diff --git a/CMakeLists.txt b/CMakeLists.txt index dd146ad193..94754a443a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ endif ( ) # CUDA is under development for now, and not deployed in production: set ( GRAPHBLAS_USE_CUDA OFF ) -# set ( GRAPHBLAS_USE_CUDA ON ) # FIXME: use this for CUDA development +# set ( GRAPHBLAS_USE_CUDA ON ) # use this for CUDA development only include ( SuiteSparsePolicy ) @@ -210,6 +210,7 @@ configure_file ( "Config/README.md.in" include_directories ( ${PROJECT_SOURCE_DIR} Source Include Config xxHash lz4 zstd zstd/zstd_subset JITpackage Demo/Include rmm_wrap # include all Source/* folders that have include/ or template/ subfolders: + Source/add Source/apply Source/assign Source/builder @@ -217,10 +218,17 @@ include_directories ( ${PROJECT_SOURCE_DIR} Source Include Config Source/callback Source/concat Source/convert + Source/cumsum + Source/emult Source/ewise + Source/extract Source/hyper + Source/ij Source/jit_kernels + Source/kronecker + Source/mask Source/math + Source/matrix Source/memory Source/monoid Source/mxm @@ -231,6 +239,7 @@ include_directories ( ${PROJECT_SOURCE_DIR} Source Include Config Source/select Source/split Source/slice + Source/sort Source/transpose Source/type Source/wait diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..b0f7717a4f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing to SuiteSparse:GraphBLAS + +To add an issue for a bug report (gasp!) or a feature request, +you can use the issue tracker on github.com, at +[`https://github.com/DrTimothyAldenDavis/GraphBLAS/issues`] +(https://github.com/DrTimothyAldenDavis/GraphBLAS/issues). + +To contribute code, you can submit a pull request. To do so, +you must first agree to the Contributor License +in the [`Contributor_License`](Contributor_License) folder. +Sign and date it the PDF, and email it to me at +DrTimothyAldenDavis@gmail.com. Pull requests will only be +included into SuiteSparse:GraphBLAS after I receive your email with +the signed PDF. + +Do not submit a pull request to the default branch. +Instead, use the dev2 branch. + diff --git a/CONTRIBUTOR-LICENSE.txt b/CONTRIBUTOR-LICENSE.txt deleted file mode 100644 index 7cd19eec69..0000000000 --- a/CONTRIBUTOR-LICENSE.txt +++ /dev/null @@ -1,177 +0,0 @@ -SuiteSparse Individual Contributor License Agreement - -Thank you for your interest in contributing to SuiteSparse ("We" or "Us"). - -This contributor agreement ("Agreement") documents the rights granted by -contributors to Us. To make this document effective, please sign it and send it -to Us by electronic submission. This is a legally binding document, so please -read it carefully before agreeing to it. The Agreement may cover more than one -software project managed by Us. - -1. Definitions - - "You" means the individual who Submits a Contribution to Us. - - "Contribution" means any work of authorship that is Submitted by You to Us - in which You own or assert ownership of the Copyright. - - "Copyright" means all rights protecting works of authorship owned or - controlled by You, including copyright, moral and neighboring rights, as - appropriate, for the full term of their existence including any extensions - by You. - - "Material" means the work of authorship which is made available by Us to - third parties. When this Agreement covers more than one software project, - the Material means the work of authorship to which the Contribution was - Submitted. After You Submit the Contribution, it may be included in the - Material. - - "Submit" means any form of electronic, verbal, or written communication - sent to Us or our representatives, including but not limited to electronic - mailing lists, source code control systems, and issue tracking systems that - are managed by, or on behalf of, Us for the purpose of discussing and - improving the Material, but excluding communication that is conspicuously - marked or otherwise designated in writing by You as "Not a Contribution." - - "Submission Date" means the date on which You Submit a Contribution to Us. - - "Effective Date" means the date You execute this Agreement or the date You - first Submit a Contribution to Us, whichever is earlier. - -2. Grant of Rights - - 2.1 Copyright License - - (a) You retain ownership of the Copyright in Your Contribution and have - the same rights to use or license the Contribution which You would have - had without entering into the Agreement. - - (b) To the maximum extent permitted by the relevant law, You grant to - Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, - irrevocable license under the Copyright covering the Contribution, with - the right to sublicense such rights through multiple tiers of - sublicensees, to reproduce, modify, display, perform and distribute the - Contribution as part of the Material; provided that this license is - conditioned upon compliance with Section 2.3. - - 2.2 Patent License - - For patent claims including, without limitation, method, process, and - apparatus claims which You own, control or have the right to grant, now - or in the future, You grant to Us a perpetual, worldwide, - non-exclusive, transferable, royalty-free, irrevocable patent license, - with the right to sublicense these rights to multiple tiers of - sublicensees, to make, have made, use, sell, offer for sale, import and - otherwise transfer the Contribution and the Contribution in combination - with the Material (and portions of such combination). This license is - granted only to the extent that the exercise of the licensed rights - infringes such patent claims; and provided that this license is - conditioned upon compliance with Section 2.3. - - 2.3 Outbound License - - Based on the grant of rights in Sections 2.1 and 2.2, if We include - Your Contribution in a Material, We may license the Contribution under - any license, including copyleft, permissive, commercial, or proprietary - licenses. - - 2.4 Moral Rights. - - If moral rights apply to the Contribution, to the maximum extent - permitted by law, You waive and agree not to assert such moral rights - against Us or our successors in interest, or any of our licensees, - either direct or indirect. - - 2.5 Our Rights. - - You acknowledge that We are not obligated to use Your Contribution as - part of the Material and may decide to include any Contribution We - consider appropriate. - - 2.6 Reservation of Rights. - - Any rights not expressly licensed under this section are expressly - reserved by You. - -3. Agreement - - You confirm that: - - (a) You have the legal authority to enter into this Agreement. - - (b) You own the Copyright and patent claims covering the Contribution which - are required to grant the rights under Section 2. - - (c) The grant of rights under Section 2 does not violate any grant of - rights which You have made to third parties, including Your employer. If - You are an employee, You have had Your employer approve this Agreement or - sign the Entity version of this document. If You are less than eighteen - years old, please have Your parents or guardian sign the Agreement. - -4. Disclaimer - - EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS - PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES - INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY - DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE - DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD - PERMITTED BY LAW. - -5. Consequential Damage Waiver - - TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE - LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, - INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING - OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY - (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. - -6. Miscellaneous - - 6.1 This Agreement will be governed by and construed in accordance with the - laws of the State of Texas excluding its conflicts of law provisions. Under - certain circumstances, the governing law in this section might be - superseded by the United Nations Convention on Contracts for the - International Sale of Goods ("UN Convention") and the parties intend to - avoid the application of the UN Convention to this Agreement and, thus, - exclude the application of the UN Convention in its entirety to this - Agreement. - - 6.2 This Agreement sets out the entire agreement between You and Us for - Your Contributions to Us and overrides all other agreements or - understandings. - - 6.3 If You or We assign the rights or obligations received through this - Agreement to a third party, as a condition of the assignment, that third - party must agree in writing to abide by all the rights and obligations in - the Agreement. - - 6.4 The failure of either party to require performance by the other party - of any provision of this Agreement in one situation shall not affect the - right of a party to require such performance at any time in the future. A - waiver of performance under a provision in one situation shall not be - considered a waiver of the performance of the provision in the future or a - waiver of the provision in its entirety. - - 6.5 If any provision of this Agreement is found void and unenforceable, - such provision will be replaced to the extent possible with a provision - that comes closest to the meaning of the original provision and which is - enforceable. The terms and conditions set forth in this Agreement shall - apply notwithstanding any failure of essential purpose of this Agreement or - any limited remedy to the maximum extent possible under law. - -Us -Timothy A. Davis, and all SuiteSparse co-authors (varies according to -the SuiteSparse package) - - -You: - - Your Name (printed): - - - Your Signature: - - - Date: - diff --git a/CUDA/GB_cuda_AxB_dot3.cpp b/CUDA/GB_cuda_AxB_dot3.cpp index df14d833cf..39e215024e 100644 --- a/CUDA/GB_cuda_AxB_dot3.cpp +++ b/CUDA/GB_cuda_AxB_dot3.cpp @@ -52,7 +52,7 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method // FIXME: pass in a stream instead, or checkout a stream CUDA_OK (cudaStreamCreate (&stream)) ; - GpuTimer kernel_timer; + GpuTimer kernel_timer; //-------------------------------------------------------------------------- // check inputs @@ -165,7 +165,7 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method GB_OK (GB_new_bix (&C, // sparse or hyper (from M), existing header ctype, cvlen, cvdim, GB_Ap_malloc, true, M_sparsity, false, M->hyper_switch, cnvec, - cnz+1, // add one to cnz for GB_cumsum of Cwork + cnz+1, // add one to cnz for cumsum of Cwork true, C_iso)) ; //-------------------------------------------------------------------------- @@ -219,7 +219,7 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method // M might be very very sparse. A(:,i) is not needed if M(:,i) is empty. // Likewise, B(:,j) is not needed if M(:,j) is empty. For now, try this - // heuristic: if M is hypersparse, then do not prefetch A->b or A->x. + // heuristic: if M is hypersparse, then do not prefetch A->b or A->x. int prefetch_b = (M_is_hyper) ? 0 : GB_PREFETCH_B ; int prefetch_x = (M_is_hyper) ? 0 : GB_PREFETCH_X ; @@ -252,6 +252,6 @@ GrB_Info GB_cuda_AxB_dot3 // C = A'*B using dot product method //-------------------------------------------------------------------------- GB_FREE_WORKSPACE ; - return GrB_SUCCESS; + return GrB_SUCCESS; } diff --git a/CUDA/GB_cuda_AxB_dot3_jit.cpp b/CUDA/GB_cuda_AxB_dot3_jit.cpp index fab1a7bdad..1d82b169d3 100644 --- a/CUDA/GB_cuda_AxB_dot3_jit.cpp +++ b/CUDA/GB_cuda_AxB_dot3_jit.cpp @@ -60,6 +60,6 @@ GrB_Info GB_cuda_AxB_dot3_jit GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, B, stream, device, number_of_sms, - &GB_callback)) ; + &GB_callback, semiring->multiply->theta)) ; } diff --git a/CUDA/GB_cuda_apply_bind1st_jit.cpp b/CUDA/GB_cuda_apply_bind1st_jit.cpp index 977a1919c6..0ad9c62dbc 100644 --- a/CUDA/GB_cuda_apply_bind1st_jit.cpp +++ b/CUDA/GB_cuda_apply_bind1st_jit.cpp @@ -28,8 +28,9 @@ GrB_Info GB_cuda_apply_bind1st_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, - GB_JIT_CUDA_KERNEL_APPLYBIND1, false, false, false, GxB_FULL, ctype, - NULL, false, false, op, false, NULL, A) ; + GB_JIT_CUDA_KERNEL_APPLYBIND1, false, + false, false, GxB_FULL, ctype, NULL, false, false, + op, false, false, NULL, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/CUDA/GB_cuda_apply_bind2nd_jit.cpp b/CUDA/GB_cuda_apply_bind2nd_jit.cpp index fa330cbaef..9f3725a9b2 100644 --- a/CUDA/GB_cuda_apply_bind2nd_jit.cpp +++ b/CUDA/GB_cuda_apply_bind2nd_jit.cpp @@ -28,8 +28,9 @@ GrB_Info GB_cuda_apply_bind2nd_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_ewise (&encoding, &suffix, - GB_JIT_CUDA_KERNEL_APPLYBIND2, false, false, false, GxB_FULL, ctype, - NULL, false, false, op, false, A, NULL) ; + GB_JIT_CUDA_KERNEL_APPLYBIND2, false, + false, false, GxB_FULL, ctype, NULL, false, false, + op, false, false, A, NULL) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/CUDA/GB_cuda_apply_unop_jit.cpp b/CUDA/GB_cuda_apply_unop_jit.cpp index 8817d8e275..afe1fb6bf6 100644 --- a/CUDA/GB_cuda_apply_unop_jit.cpp +++ b/CUDA/GB_cuda_apply_unop_jit.cpp @@ -29,7 +29,8 @@ GrB_Info GB_cuda_apply_unop_jit GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_CUDA_KERNEL_APPLYUNOP, GxB_FULL, false, ctype, op, flipij, A) ; + GB_JIT_CUDA_KERNEL_APPLYUNOP, GxB_FULL, false, ctype, op, flipij, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -48,4 +49,4 @@ GrB_Info GB_cuda_apply_unop_jit GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (Cx, A, ythunk, stream, gridsz, blocksz)) ; -} \ No newline at end of file +} diff --git a/CUDA/GB_cuda_colscale_jit.cpp b/CUDA/GB_cuda_colscale_jit.cpp index ea32ca4525..702af2cfa4 100644 --- a/CUDA/GB_cuda_colscale_jit.cpp +++ b/CUDA/GB_cuda_colscale_jit.cpp @@ -30,7 +30,7 @@ GrB_Info GB_cuda_colscale_jit uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_CUDA_KERNEL_COLSCALE, false, false, false, GB_sparsity (C), C->type, NULL, false, false, - binaryop, flipxy, A, D) ; + binaryop, false, flipxy, A, D) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/CUDA/GB_cuda_get_device_count.cu b/CUDA/GB_cuda_get_device_count.cu index 3f0d074dd4..fbb2998ae1 100644 --- a/CUDA/GB_cuda_get_device_count.cu +++ b/CUDA/GB_cuda_get_device_count.cu @@ -15,7 +15,10 @@ bool GB_cuda_get_device_count // true if OK, false if failure int *gpu_count // return # of GPUs in the system ) { + (*gpu_count) = 0 ; cudaError_t err = cudaGetDeviceCount (gpu_count) ; + printf ("GB_cuda_get_device_count: %d, cudaError_t: %d\n", + *gpu_count, err) ; return (err == cudaSuccess) ; } diff --git a/CUDA/GB_cuda_init.c b/CUDA/GB_cuda_init.c index ed920f9758..25fcc625da 100644 --- a/CUDA/GB_cuda_init.c +++ b/CUDA/GB_cuda_init.c @@ -19,13 +19,18 @@ GrB_Info GB_cuda_init (void) { // get the GPU properties - if (!GB_Global_gpu_count_set (true)) return (GrB_PANIC) ; + if (!GB_Global_gpu_count_set (true)) + { + printf ("GB_cuda_init line %d\n", __LINE__) ; + return (GrB_PANIC) ; + } int gpu_count = GB_Global_gpu_count_get ( ) ; for (int device = 0 ; device < 1 ; device++) // TODO for GPU: gpu_count { // query the GPU and then warm it up if (!GB_Global_gpu_device_properties_get (device)) { + printf ("GB_cuda_init line %d\n", __LINE__) ; return (GrB_PANIC) ; } } @@ -41,7 +46,7 @@ GrB_Info GB_cuda_init (void) // of the work. Alternatively, move GB_cuda_init here (if so, // ensure that it doesn't depend on any other initializations // below). - 256 * 1000000L, 256 * 100000000L, 1) ; + 256 * 1000000L, 1024 * 100000000L, 1) ; // FIXME: ask the GPU(s) } // warm up the GPUs @@ -49,6 +54,7 @@ GrB_Info GB_cuda_init (void) { if (!GB_cuda_warmup (device)) { + printf ("GB_cuda_init line %d\n", __LINE__) ; return (GrB_PANIC) ; } } diff --git a/CUDA/GB_cuda_reduce_to_scalar.cpp b/CUDA/GB_cuda_reduce_to_scalar.cpp index cbf7868a27..e4192fb4bd 100644 --- a/CUDA/GB_cuda_reduce_to_scalar.cpp +++ b/CUDA/GB_cuda_reduce_to_scalar.cpp @@ -76,13 +76,11 @@ GrB_Info GB_cuda_reduce_to_scalar int gridsz = (int) raw_gridsz ; // FIXME: GB_enumify_reduce is called twice: here (to get has_cheeseburger) - // and in GB_cuda_reduce_to_scalar_jit. Can we just call it once? One - // solution: The code from here to the call to GB_cuda_reduce_to_scalar_jit - // could be added to the GB_cuda_reduce_to_scalar_jit function itself. + // and in GB_cuda_reduce_to_scalar_jit. Can we just call it once? uint64_t rcode ; GB_enumify_reduce (&rcode, monoid, A) ; - bool has_cheeseburger = GB_RSHIFT (rcode, 27, 1) ; + bool has_cheeseburger = GB_RSHIFT (rcode, 16, 1) ; GBURBLE ("has_cheeseburger %d\n", has_cheeseburger) ; // determine the kind of reduction: partial (to &V), or complete diff --git a/CUDA/GB_cuda_rowscale_jit.cpp b/CUDA/GB_cuda_rowscale_jit.cpp index abb8fd9b3a..a6ecf87b74 100644 --- a/CUDA/GB_cuda_rowscale_jit.cpp +++ b/CUDA/GB_cuda_rowscale_jit.cpp @@ -30,7 +30,7 @@ GrB_Info GB_cuda_rowscale_jit uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_CUDA_KERNEL_ROWSCALE, false, false, false, GB_sparsity (C), C->type, NULL, false, false, - binaryop, flipxy, D, B) ; + binaryop, false, flipxy, D, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/CUDA/GB_cuda_select.hpp b/CUDA/GB_cuda_select.hpp index 0ab3229aff..fc55b305c4 100644 --- a/CUDA/GB_cuda_select.hpp +++ b/CUDA/GB_cuda_select.hpp @@ -28,14 +28,20 @@ GrB_Info GB_cuda_select_bitmap_jit int32_t blocksz ) ; -GrB_Info GB_cuda_select_sparse +GrB_Info GB_cuda_select_sparse_jit ( + // output: GrB_Matrix C, + // input: const bool C_iso, const GrB_IndexUnaryOp op, const bool flipij, const GrB_Matrix A, - const GB_void *ythunk + const GB_void *ythunk, + // CUDA stream and launch parameters: + cudaStream_t stream, + int32_t gridsz, + int32_t blocksz ) ; #endif diff --git a/CUDA/GB_cuda_select_bitmap.cpp b/CUDA/GB_cuda_select_bitmap.cpp index b1ab87751e..65b3ed034d 100644 --- a/CUDA/GB_cuda_select_bitmap.cpp +++ b/CUDA/GB_cuda_select_bitmap.cpp @@ -33,7 +33,9 @@ GrB_Info GB_cuda_select_bitmap { // make a copy of ythunk, since ythunk might be allocated on // the CPU stack and thus not accessible to the CUDA kernel. - ythunk_cuda = GB_MALLOC_WORK (op->ytype->size, GB_void, &ythunk_cuda_size) ; + ythunk_cuda = GB_MALLOC_WORK (op->ytype->size, GB_void, + &ythunk_cuda_size) ; + if (ythunk_cuda == NULL) { return (GrB_OUT_OF_MEMORY) ; @@ -50,7 +52,8 @@ GrB_Info GB_cuda_select_bitmap int64_t raw_gridsz = GB_ICEIL (anz, BLOCK_SIZE) ; int32_t gridsz = std::min (raw_gridsz, (int64_t) (number_of_sms * 256)) ; - // create a separate cnvals_result for CUDA since cnvals may be on the CPU stack + // create a separate cnvals_result for CUDA since cnvals may be on + // the CPU stack int64_t *cnvals_cuda ; size_t cnvals_cuda_size ; cnvals_cuda = GB_MALLOC_WORK (1, int64_t, &cnvals_cuda_size) ; diff --git a/CUDA/GB_cuda_select_branch.cpp b/CUDA/GB_cuda_select_branch.cpp index 7e72529c77..516715f42f 100644 --- a/CUDA/GB_cuda_select_branch.cpp +++ b/CUDA/GB_cuda_select_branch.cpp @@ -6,17 +6,18 @@ bool GB_cuda_select_branch const GrB_IndexUnaryOp op ) { - if (op == NULL) - { - return false ; - } + + ASSERT (A != NULL && op != NULL) ; if (A->static_header) { - // FIXME: explain this + // see Source/matrix/GB_static_header.h for details. If A has a + // static header, it cannot be done on the GPU. However, if GraphBLAS + // is compiled to use CUDA, there should be no static headers anyway, + // so this is likely dead code. Just a sanity check. return false ; } - + bool ok = (GB_cuda_type_branch (A->type)) ; if (op->xtype != NULL) diff --git a/CUDA/GB_cuda_select_sparse.cpp b/CUDA/GB_cuda_select_sparse.cpp index 70261d2bcd..2648b15b9c 100644 --- a/CUDA/GB_cuda_select_sparse.cpp +++ b/CUDA/GB_cuda_select_sparse.cpp @@ -22,6 +22,14 @@ GrB_Info GB_cuda_select_sparse const GB_void *ythunk ) { + // in progress + return (GrB_NOT_IMPLEMENTED) ; + +#if 0 + + // check inputs + ASSERT (C != NULL && !(C->static_header)) ; + ASSERT (A != NULL && !(A->static_header)) ; GB_void *ythunk_cuda = NULL ; size_t ythunk_cuda_size = 0 ; @@ -29,7 +37,9 @@ GrB_Info GB_cuda_select_sparse { // make a copy of ythunk, since ythunk might be allocated on // the CPU stack and thus not accessible to the CUDA kernel. - ythunk_cuda = GB_MALLOC_WORK (op->ytype->size, GB_void, &ythunk_cuda_size) ; + ythunk_cuda = GB_MALLOC_WORK (op->ytype->size, GB_void, + &ythunk_cuda_size) ; + if (ythunk_cuda == NULL) { return (GrB_OUT_OF_MEMORY) ; @@ -46,21 +56,17 @@ GrB_Info GB_cuda_select_sparse int64_t raw_gridsz = GB_ICEIL (anz, BLOCK_SIZE) ; int32_t gridsz = std::min (raw_gridsz, (int64_t) (number_of_sms * 256)) ; - ASSERT (!(C->static_header)) ; - GrB_Info info = GrB_NO_VALUE ; -////////////////////////////////////////////////////////////// -// FIXME: add this: -// info = GB_cuda_select_sparse_jit (C, C_iso, A, -// flipij, ythunk_cuda, op, stream, gridsz, BLOCK_SIZE) ; -// if (info == GrB_NO_VALUE) info = GrB_PANIC ; -// GB_OK (info) ; -////////////////////////////////////////////////////////////// + info = GB_cuda_select_sparse_jit (C, C_iso, A, + flipij, ythunk_cuda, op, stream, gridsz, BLOCK_SIZE) ; + if (info == GrB_NO_VALUE) info = GrB_PANIC ; + GB_OK (info) ; CUDA_OK (cudaStreamSynchronize (stream)) ; CUDA_OK (cudaStreamDestroy (stream)) ; GB_FREE_WORKSPACE ; - return info ; + return info ; +#endif } diff --git a/CUDA/GB_cuda_select_sparse_jit.cpp b/CUDA/GB_cuda_select_sparse_jit.cpp new file mode 100644 index 0000000000..c8bb3e3737 --- /dev/null +++ b/CUDA/GB_cuda_select_sparse_jit.cpp @@ -0,0 +1,56 @@ +#include "GB_cuda_select.hpp" + +extern "C" +{ + typedef GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO ((*GB_jit_dl_function)) ; +} + +GrB_Info GB_cuda_select_sparse_jit +( + // output: + GrB_Matrix C, + // input: + const bool C_iso, + const GrB_Matrix A, + const bool flipij, + const GB_void *ythunk, + const GrB_IndexUnaryOp op, + // CUDA stream and launch parameters: + cudaStream_t stream, + int32_t gridsz, + int32_t blocksz +) +{ + // in progress + return (GrB_NO_VALUE) ; + +#if 0 + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_select (&encoding, &suffix, + GB_JIT_CUDA_KERNEL_SELECT_SPARSE, C_iso, false, op, flipij, A) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_select_family, "cuda_select_sparse", + hash, &encoding, suffix, NULL, NULL, + (GB_Operator) op, A->type, NULL, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (C, A, ythunk, stream, gridsz, blocksz)) ; +#endif +} diff --git a/CUDA/TODO.txt b/CUDA/TODO.txt index cfc5ea8ae8..7c96240676 100644 --- a/CUDA/TODO.txt +++ b/CUDA/TODO.txt @@ -12,6 +12,7 @@ TODO (Mar 2024): can rmm_wrap be thread safe? set/get which GPU(s) to use handling nvcc compiler errors + handle all CUDA errors Tim: reduce calls GB_enumify_reduce twice diff --git a/CUDA/include/GB_cuda_kernel.cuh b/CUDA/include/GB_cuda_kernel.cuh index 1823a0bb6c..64b2ef6749 100644 --- a/CUDA/include/GB_cuda_kernel.cuh +++ b/CUDA/include/GB_cuda_kernel.cuh @@ -52,6 +52,7 @@ using namespace cooperative_groups ; extern "C" { + #include "include/GB_bytes.h" #include "include/GB_pun.h" #include "include/GB_partition.h" #include "include/GB_binary_search.h" @@ -65,7 +66,9 @@ extern "C" #include "include/GB_memory_macros.h" #include "include/GB_printf_kernels.h" #include "include/GB_opaque.h" + #include "include/GB_static_header.h" #include "include/GB_werk.h" + #include "include/GB_task_struct.h" #include "include/GB_callback_proto.h" #include "include/GB_saxpy3task_struct.h" #include "include/GB_callback.h" diff --git a/CUDA/template/GB_cuda_cumsum.cuh b/CUDA/template/GB_cuda_cumsum.cuh new file mode 100644 index 0000000000..6eea3da950 --- /dev/null +++ b/CUDA/template/GB_cuda_cumsum.cuh @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/template/GB_cuda_cumsum: cumlative sum of an array on the GPU(s) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_CUDA_CUMSUM +#define GB_CUDA_CUMSUM + +#include + +typedef enum GB_cuda_cumsum_type +{ + GB_CUDA_CUMSUM_EXCLUSIVE, + GB_CUDA_CUMSUM_INCLUSIVE +} GB_cuda_cumsum_type ; + +__host__ GrB_Info GB_cuda_cumsum // compute the cumulative sum of an array +( + int64_t *restrict in, // size n or n+1, input + int64_t *restrict out, // size n or n+1, output. + // to do an in-place cumsum, pass out == in + + const int64_t n, + cudaStream_t stream, + GB_cuda_cumsum_type type +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + ASSERT (in != NULL) ; + ASSERT (out != NULL) ; + ASSERT (n >= 0) ; + + void *d_temp_storage = NULL; + size_t temp_storage_bytes = 0 ; + + switch (type) + { + case GB_CUDA_CUMSUM_INCLUSIVE: + cub::DeviceScan::InclusiveSum(d_temp_storage, temp_storage_bytes, in, out, n, stream) ; + break; + default: + cub::DeviceScan::ExclusiveSum(d_temp_storage, temp_storage_bytes, in, out, n, stream) ; + } + + CUDA_OK (cudaMalloc(&d_temp_storage, temp_storage_bytes)) ; + + // Run + switch (type) + { + case GB_CUDA_CUMSUM_INCLUSIVE: + cub::DeviceScan::InclusiveSum(d_temp_storage, temp_storage_bytes, in, out, n, stream) ; + break; + default: + cub::DeviceScan::ExclusiveSum(d_temp_storage, temp_storage_bytes, in, out, n, stream) ; + } + + CUDA_OK (cudaFree(d_temp_storage)) ; + + return GrB_SUCCESS; +} +#endif diff --git a/CUDA/template/GB_cuda_ek_slice.cuh b/CUDA/template/GB_cuda_ek_slice.cuh index 396f05f7ae..688f540737 100644 --- a/CUDA/template/GB_cuda_ek_slice.cuh +++ b/CUDA/template/GB_cuda_ek_slice.cuh @@ -56,16 +56,17 @@ // FIXME: discuss grid-stride loops, the pdelta loop, and the max chunk size // here -// question: why chunks are necessary? why not just do ek_slice_setup across all entries in one go? -// answer: the slope method is only useful for a small range of entries; non-uniform entry distributions -// can distort the usefulness of the slope (will require an exhaustive linear search) -// for a large range of entries +// question: why chunks are necessary? why not just do ek_slice_setup across +// all entries in one go? answer: the slope method is only useful for a small +// range of entries; non-uniform entry distributions can distort the usefulness +// of the slope (will require an exhaustive linear search) for a large range of +// entries //------------------------------------------------------------------------------ // GB_cuda_ek_slice_setup //------------------------------------------------------------------------------ -static __device__ __inline__ int64_t GB_cuda_ek_slice_setup +static __device__ __inline__ void GB_cuda_ek_slice_setup ( // inputs, not modified: const int64_t *Ap, // array of size anvec+1 @@ -74,6 +75,8 @@ static __device__ __inline__ int64_t GB_cuda_ek_slice_setup const int64_t pfirst, // first entry in A to find k const int64_t max_pchunk, // max # of entries in A to find k // output: + int64_t *kfirst, // first vector of the slice for this chunk + int64_t *klast, // last vector of the slice for this chunk int64_t *my_chunk_size, // size of the chunk for this threadblock int64_t *anvec1, // anvec-1 float *slope // slope of vectors from kfirst to klast @@ -102,17 +105,17 @@ static __device__ __inline__ int64_t GB_cuda_ek_slice_setup // the vector that owns the entry Ai [pfirst] and Ax [pfirst]. The search // does not need to be exact, so kfirst is an estimate. - int64_t kfirst = 0 ; + (*kfirst) = 0 ; int64_t kright = anvec ; - GB_TRIM_BINARY_SEARCH (pfirst, Ap, kfirst, kright) ; + GB_TRIM_BINARY_SEARCH (pfirst, Ap, (*kfirst), kright) ; // find klast, the last vector of the slice for this chunk. klast is the // vector that owns the entry Ai [plast-1] and Ax [plast-1]. The search // does not have to be exact, so klast is an estimate. - int64_t klast = kfirst ; + (*klast) = (*kfirst) ; kright = anvec ; - GB_TRIM_BINARY_SEARCH (plast, Ap, klast, kright) ; + GB_TRIM_BINARY_SEARCH (plast, Ap, (*klast), kright) ; //-------------------------------------------------------------------------- // find slope of vectors in this chunk, and return result @@ -120,14 +123,12 @@ static __device__ __inline__ int64_t GB_cuda_ek_slice_setup // number of vectors in A for this chunk, where // Ap [kfirst:klast-1] will be searched. - int64_t nk = klast - kfirst + 1 ; + int64_t nk = (*klast) - (*kfirst) + 1 ; // slope is the estimated # of vectors in this chunk, divided by the // chunk size. (*slope) = ((float) nk) / ((float) (*my_chunk_size)) ; - (*anvec1) = anvec - 1 ; - return (kfirst) ; } //------------------------------------------------------------------------------ @@ -215,10 +216,10 @@ static __device__ __inline__ int64_t GB_cuda_ek_slice // returns my_chunk_size // determine the chunk for this threadblock and its slope //-------------------------------------------------------------------------- - int64_t my_chunk_size, anvec1 ; + int64_t my_chunk_size, anvec1, kfirst, klast ; float slope ; - int64_t kfirst = GB_cuda_ek_slice_setup (Ap, anvec, anz, pfirst, - max_pchunk, &my_chunk_size, &anvec1, &slope) ; + GB_cuda_ek_slice_setup (Ap, anvec, anz, pfirst, max_pchunk, + &kfirst, &klast, &my_chunk_size, &anvec1, &slope) ; //-------------------------------------------------------------------------- // find the kth vector that contains each entry p = pfirst:plast-1 diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh index 0239e706de..51c6ab668a 100644 --- a/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_dense_phase1.cuh @@ -46,7 +46,7 @@ __global__ void GB_cuda_AxB_dot3_dense_phase1_kernel int64_t *__restrict__ Ci = C->i ; // for zombies, or vector k - // Ci [p] for an entry C(i,j) contains either GB_FLIP(i) if C(i,j) is a + // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE(i) if C(i,j) is a // zombie, or k otherwise, where C(:,j) is the kth vector of C (j = Ch [k] // if hypersparse or j = k if standard sparse). @@ -66,10 +66,10 @@ __global__ void GB_cuda_AxB_dot3_dense_phase1_kernel // This threadblock works on Mi/Mx and Ci/Cx, in positions pfirst to // pfirst + my_chunk_size - 1. - int64_t my_chunk_size, mnvec1 ; + int64_t my_chunk_size, mnvec1, kfirst, klast ; float slope ; - int64_t kfirst = GB_cuda_ek_slice_setup (Mp, mnvec, mnz, pfirst, - chunk_size, &my_chunk_size, &mnvec1, &slope) ; + GB_cuda_ek_slice_setup (Mp, mnvec, mnz, pfirst, chunk_size, + &kfirst, &klast, &my_chunk_size, &mnvec1, &slope) ; //---------------------------------------------------------------------- // assign entries in C(i,j): either its vector k or its zombie status @@ -94,7 +94,7 @@ __global__ void GB_cuda_AxB_dot3_dense_phase1_kernel { bool mij = (bool) GB_MCAST (Mx, pM, ) ; int64_t i = Mi [pM] ; - Ci [pM] = (!mij) * (GB_FLIP (i)) + Ci [pM] = (!mij) * (GB_ZOMBIE (i)) + mij * (k) ; } #endif diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh index b305d5ffbc..cccf4eba1f 100644 --- a/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase1.cuh @@ -34,9 +34,8 @@ // GB_BUCKET_VSVS both A(:,i) and B(:,j) are very sparse. // GB_BUCKET_MERGEPATH both A(:,i) and B(:,j) are sparse, but neither are // very sparse - -// FIXME: What if all entries are in one bucket; -// can we skip the bucket creation? +// GB_BUCKET_VSSP: one of A(:,i) or B(:,j) is very sparse, and the other +// is sparse but with many entries __global__ void GB_jit_AxB_dot3_phase1_kernel ( @@ -103,7 +102,7 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel // FIXME: use (k << 2) not (k << 4) - // Ci [p] for an entry C(i,j) contains either GB_FLIP(i) if C(i,j) is a + // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE(i) if C(i,j) is a // zombie, or (k << 4) + bucket otherwise, where C(:,j) is the kth vector // of C (j = Ch [k] if hypersparse or j = k if standard sparse), and // where bucket is the bucket assignment for C(i,j). @@ -140,10 +139,10 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel // This threadblock works on Mi/Mx and Ci/Mx, in positions pfirst to // pfirst + my_chunk_size - 1. - int64_t my_chunk_size, mnvec1 ; + int64_t my_chunk_size, mnvec1, kfirst, klast ; float slope ; - int64_t kfirst = GB_cuda_ek_slice_setup (Mp, mnvec, mnz, pfirst, - chunk_size, &my_chunk_size, &mnvec1, &slope) ; + GB_cuda_ek_slice_setup (Mp, mnvec, mnz, pfirst, chunk_size, + &kfirst, &klast, &my_chunk_size, &mnvec1, &slope) ; //---------------------------------------------------------------------- // assign entries in C(i,j) to the buckets @@ -224,27 +223,77 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel // A is bitmap or full: no need to look up A(:,i) #endif { + + //------------------------------------------------------ // determine the bucket for C(i,j) + //------------------------------------------------------ + + // ainz is the # of entries in A(:,i) + // bjnz is the # of entries in B(:,j) + #if (GB_A_IS_SPARSE || GB_A_IS_HYPER) && \ (GB_B_IS_SPARSE || GB_B_IS_HYPER) - // A and B are both sparse/hyper - bool vsvs = (ainz + bjnz <= 128) ; - bucket = (GB_bucket_code) - ( ((int) ( vsvs)) * ((int) GB_BUCKET_VSVS) - + ((int) (!vsvs)) * ((int) GB_BUCKET_MERGEPATH)) ; + { + // A and B are both sparse/hyper + + // NOTE: these methods are about the same: +#if 0 + // use vsvs if both are very sparse: + int vsvs = (int) (ainz + bjnz <= 128) ; + // otherwise, use vssp if + // max(ainz,bjnz) >= 8 * min (ainz,bjnz) + int vssp = ((int) (!vsvs)) * (int) + ((ainz >= (bjnz << 3)) || (bjnz >= (ainz << 3))) ; + // otherwise, use mp + int mp = (int) (!vsvs && !vssp) ; + bucket = (GB_bucket_code) ( + ((vsvs) * (int) GB_BUCKET_VSVS) + + ((vssp) * (int) GB_BUCKET_VSSP) + + ((mp ) * (int) GB_BUCKET_MERGEPATH)) ; +#else + if (ainz + bjnz <= 128) + { + bucket = GB_BUCKET_VSVS ; + } + else + { + int64_t dmax = max (ainz, bjnz) ; + int64_t dmin = min (ainz, bjnz) ; + if (dmax >= 8 * dmin) + { + bucket = GB_BUCKET_VSSP ; + } + else + { + bucket = GB_BUCKET_MERGEPATH ; + } + } +#endif + +// // bool vsvs = (ainz < 128) || (bjnz < 128) ; +// bucket = (GB_bucket_code) +// ( ((int) ( vsvs)) * ((int) GB_BUCKET_VSVS) +// + ((int) (!vsvs)) * ((int) GB_BUCKET_MERGEPATH)) ; + + + } #elif (GB_A_IS_SPARSE || GB_A_IS_HYPER) && \ (GB_B_IS_BITMAP || GB_B_IS_FULL) - // A is sparse/hyper, B is bitmap/full - bool vsvs = (ainz <= 128) ; - bucket = (GB_bucket_code) - ( ((int) ( vsvs)) * ((int) GB_BUCKET_VSDN) - + ((int) (!vsvs)) * ((int) GB_BUCKET_SPDN)) ; + { + // A is sparse/hyper, B is bitmap/full + bool vsvs = (ainz <= 128) ; + bucket = (GB_bucket_code) + ( ((int) ( vsvs)) * ((int) GB_BUCKET_VSDN) + + ((int) (!vsvs)) * ((int) GB_BUCKET_SPDN)) ; + } #else - // A is bitmap/full, B is sparse/hyper - bool vsvs = (bjnz <= 128) ; - bucket = (GB_bucket_code) - ( ((int) ( vsvs)) * ((int) GB_BUCKET_VSDN) - + ((int) (!vsvs)) * ((int) GB_BUCKET_SPDN)) ; + { + // A is bitmap/full, B is sparse/hyper + bool vsvs = (bjnz <= 128) ; + bucket = (GB_bucket_code) + ( ((int) ( vsvs)) * ((int) GB_BUCKET_VSDN) + + ((int) (!vsvs)) * ((int) GB_BUCKET_SPDN)) ; + } #endif } } @@ -255,7 +304,7 @@ __global__ void GB_jit_AxB_dot3_phase1_kernel //------------------------------------------------------------------ // encode the bucket or zombie status in the row index of C(i,j) - Ci [pM] = (bucket == GB_BUCKET_ZOMBIE) * ( GB_FLIP(i) << 4) + Ci [pM] = (bucket == GB_BUCKET_ZOMBIE) * ( GB_ZOMBIE(i) << 4) + (bucket != GB_BUCKET_ZOMBIE) * ((k << 4) + bucket) ; // each thread counts its own bucket sizes diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh index cf4ea657da..be5056b2cc 100644 --- a/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase2end.cuh @@ -35,7 +35,7 @@ __global__ void GB_cuda_AxB_dot3_phase2end_kernel // get C information //-------------------------------------------------------------------------- - // Ci [p] for an entry C(i,j) contains either GB_FLIP(i) if C(i,j) is a + // Ci [p] for an entry C(i,j) contains either GB_ZOMBIE(i) if C(i,j) is a // zombie, or (k << 4) + bucket otherwise, where C(:,j) is the kth vector // of C (j = Ch [k] if hypersparse or j = k if standard sparse), and // where bucket is the bucket assignment for C(i,j). This phase does not @@ -117,7 +117,10 @@ __global__ void GB_cuda_AxB_dot3_phase2end_kernel //bucket_s[ibucket][ idx ] = p; bucket_idx [tid] = my_bucket [ibucket]++ ; - Ci [p] = (ibucket==0) * (Ci [p] >> 4) + (ibucket > 0) * Ci [p] ; + + // finalize the zombie bucket; no change to the rest of Ci + Ci [p] = (ibucket == GB_BUCKET_ZOMBIE) * (Ci [p] >> 4) + + (ibucket != GB_BUCKET_ZOMBIE) * (Ci [p]) ; //if(ibucket == 0) { //// bucket[my_bucket[0]++] = p; diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh index fe240b923f..8b1acebcb9 100644 --- a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_dndn.cuh @@ -36,7 +36,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_dndn_kernel GrB_Matrix C, // result matrix GrB_Matrix M, // mask matrix GrB_Matrix A, // input matrix A - GrB_Matrix B // input matrix B + GrB_Matrix B, // input matrix B + const void *theta ) { @@ -192,7 +193,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_dndn_kernel // is always true because vlen > 0 always holds for this kernel. // FIXME: if kth < 0, C(i,j) is a prezombie, and Ci [pM] already holds - // GB_FLIP (i). + // GB_ZOMBIE (i). // write result for this block to global mem if (threadIdx.x == 0) @@ -207,7 +208,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_dndn_kernel { // cij is a zombie zc++ ; - Ci [pM] = GB_FLIP (i) ; + Ci [pM] = GB_ZOMBIE (i) ; } } diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh index eeebf2e878..2a10c0c162 100644 --- a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp.cuh @@ -40,6 +40,8 @@ //------------------------------------------------------------------------------ // GB_cuda_AxB_dot3_phase3_mp_kernel //------------------------------------------------------------------------------ + +//#include __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel ( @@ -49,7 +51,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel GrB_Matrix C, GrB_Matrix M, GrB_Matrix A, - GrB_Matrix B + GrB_Matrix B, + const void *theta ) { @@ -111,9 +114,14 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel kk += gridDim.x ) { + //---------------------------------------------------------------------- + // get A(:,i) and B(:,j) + //---------------------------------------------------------------------- + int64_t pair_id = all_in_one ? kk : Bucket [kk] ; int64_t i = Mi[pair_id]; int64_t k = Ci[pair_id] >> 4; + // assert: Ci [pair_id] & 0xF == GB_BUCKET_MERGEPATH // j = k or j = Mh [k] if C and M are hypersparse int64_t j = GBH_M (Mh, k) ; @@ -128,25 +136,6 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel pA_end = Ap[i+1] ; #endif - int64_t ainz = pA_end - pA_start ; - - GB_DECLAREA (aki) ; - GB_DECLAREB (bkj) ; - GB_DECLARE_IDENTITY (cij) ; // GB_Z_TYPE cij = identity - - int cij_exists = 0 ; // FIXME: make a bool - - __shared__ int64_t Ai_s[shared_vector_size]; - int shared_steps_A = (ainz + shared_vector_size -1)/shared_vector_size; - - int64_t step_end = (shared_steps_A <= 1? ainz : shared_vector_size); - for ( int64_t i = tid; i< step_end; i+= blockDim.x) - { - Ai_s[i] = Ai[ i + pA_start]; - } - this_thread_block().sync(); - - // find B(:,j) int64_t pB_start, pB_end ; #if GB_B_IS_HYPER @@ -157,165 +146,59 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel pB_end = Bp[j+1] ; #endif - int64_t bjnz = pB_end - pB_start; // bjnz - int shared_steps_B = (bjnz + shared_vector_size -1)/shared_vector_size; - - __shared__ int64_t Bj_s[shared_vector_size]; - - step_end = (shared_steps_B <= 1 ? bjnz : shared_vector_size); - for ( int64_t i =tid; i< step_end; i+= blockDim.x) - { - Bj_s[i] = Bi[ i + pB_start]; - } - this_thread_block().sync(); - - //we want more than one intersection per thread - while ( (shared_steps_A > 0) && (shared_steps_B > 0) ) - { - int64_t awork = pA_end - pA_start; - int64_t bwork = pB_end - pB_start; - if ( shared_steps_A > 1) awork = shared_vector_size; - if ( shared_steps_B > 1) bwork = shared_vector_size; - int64_t nxy = awork + bwork; - - // ceil Divide by 32 = blockDim.x : - int work_per_thread = (nxy + blockDim.x -1)/blockDim.x; - int diag = GB_IMIN( work_per_thread*tid, nxy); - int diag_end = GB_IMIN( diag + work_per_thread, nxy); - - // bwork takes place of bjnz: - int x_min = GB_IMAX( (diag - bwork) , 0); - - //awork takes place of ainz: - int x_max = GB_IMIN( diag, awork); - - while ( x_min < x_max) - { - //binary search for correct diag break - int pivot = (x_min +x_max) >> 1; - int64_t Apiv = Ai_s[pivot] ; - int64_t Bpiv = Bj_s[diag -pivot -1] ; - - x_min = (pivot + 1)* (Apiv < Bpiv) + x_min * (1 - (Apiv < Bpiv)); - x_max = pivot * (1 - (Apiv < Bpiv)) + x_max * (Apiv < Bpiv); - - } - - int xcoord = x_min; - int ycoord = diag -x_min -1; - int64_t Atest = Ai_s[xcoord] ; - int64_t Btest = Bj_s[ycoord] ; - if ( (diag > 0) && (diag < nxy ) && (ycoord >= 0 ) && (Atest == Btest)) - { - diag--; //adjust for intersection incrementing both pointers - } - // two start points are known now - int tx_start = xcoord; // +pA_start; - int ty_start = diag -xcoord; // +pB_start; - - - x_min = GB_IMAX( (diag_end - bwork), 0); //bwork replace bjnz - x_max = GB_IMIN( diag_end, awork); //awork replace ainz - - while ( x_min < x_max) - { - int pivot = (x_min +x_max) >> 1; - int64_t Apiv = Ai_s[pivot] ; - int64_t Bpiv = Bj_s[diag_end -pivot -1] ; - - x_min = (pivot + 1)* (Apiv < Bpiv) + x_min * (1 - (Apiv < Bpiv)); - x_max = pivot * (1 - (Apiv < Bpiv)) + x_max * (Apiv < Bpiv); - } - - xcoord = x_min; - ycoord = diag_end -x_min -1; - - // two end points are known now - int tx_end = xcoord; // +pA_start; - int ty_end = diag_end - xcoord; // + pB_start; - - //merge-path dot product - int64_t pA = tx_start; // pA - int64_t pB = ty_start; // pB - - while ( pA < tx_end && pB < ty_end ) - { - int64_t Aind = Ai_s[pA] ; - int64_t Bind = Bj_s[pB] ; - #if GB_IS_PLUS_PAIR_REAL_SEMIRING && GB_Z_IGNORE_OVERFLOW - cij += (Aind == Bind) ; - #else - if (Aind == Bind) - { - // cij += aki * bkj - GB_DOT_MERGE (pA + pA_start, pB + pB_start) ; - // TODO check terminal condition, using tile.any - } - #endif - pA += (Aind <= Bind) ; - pB += (Aind >= Bind) ; - } - GB_CIJ_EXIST_POSTCHECK ; + //---------------------------------------------------------------------- + // compute cij + //---------------------------------------------------------------------- + + __shared__ int64_t Xi_s[shared_vector_size]; + __shared__ int64_t Yi_s[shared_vector_size]; - this_thread_block().sync(); + GB_DECLAREA (aki) ; + GB_DECLAREB (bkj) ; + GB_DECLARE_IDENTITY (cij) ; // GB_Z_TYPE cij = identity + int cij_exists = 0 ; - if ( (shared_steps_A >= 1) - && (shared_steps_B >= 1) - && ( Ai_s[awork-1] == Bj_s[bwork-1]) ) - { +// int64_t total_ainz = pA_start - pA_end ; +// int64_t total_bjnz = pB_start - pB_end ; - pA_start += shared_vector_size; - shared_steps_A -= 1; - if (shared_steps_A == 0) break; - pB_start += shared_vector_size; - shared_steps_B -= 1; - if (shared_steps_B == 0) break; - - step_end = ( (pA_end - pA_start) < shared_vector_size ? (pA_end - pA_start) : shared_vector_size); - for ( int64_t i = tid; i< step_end; i+= blockDim.x) - { - Ai_s[i] = Ai[ i + pA_start]; - } - this_thread_block().sync(); - - step_end = ( (pB_end - pB_start) < shared_vector_size ? (pB_end - pB_start) : shared_vector_size); - for ( int64_t i = tid; i< step_end; i+= blockDim.x) - { - Bj_s[i] = Bi[ i + pB_start]; - } - this_thread_block().sync(); - - } - else if ( (shared_steps_A >= 1) && (Ai_s[awork-1] < Bj_s[bwork-1] )) - { - pA_start += shared_vector_size; - shared_steps_A -= 1; - if (shared_steps_A == 0) break; +// if (total_ainz < total_bjnz) + { + // A(:,i) is sparser than B(:,j) + #define MP_FLIP 0 - step_end= ( (pA_end - pA_start) < shared_vector_size ? (pA_end - pA_start) : shared_vector_size); - for ( int64_t i = tid; i< step_end; i+= blockDim.x) - { - Ai_s[i] = Ai[ i + pA_start]; - } - this_thread_block().sync(); + #define pX pA + #define pX_start pA_start + #define pX_end pA_end + #define Xi Ai - } - else if ( (shared_steps_B >= 1) && (Bj_s[bwork-1] < Ai_s[awork-1]) ) - { - pB_start += shared_vector_size; - shared_steps_B -= 1; - if (shared_steps_B == 0) break; - - step_end = ( (pB_end - pB_start) < shared_vector_size ? (pB_end - pB_start) : shared_vector_size); - for ( int64_t i = tid; i< step_end; i+= blockDim.x) - { - Bj_s[i] = Bi[ i + pB_start]; - } - this_thread_block().sync(); - } - } // end while shared_steps A > 0 && shared_steps_B >0 + #define pY pB + #define pY_start pB_start + #define pY_end pB_end + #define Yi Bi - //tile.sync( ) ; + #include "GB_cuda_jit_AxB_dot3_phase3_mp_guts.cuh" + } +#if 0 + else + { + // B(:,j) is sparser than A(:,i) + // (this works but it has the same performance) + #define MP_FLIP 1 + + #define pX pB + #define pX_start pB_start + #define pX_end pB_end + #define Xi Bi + + #define pY pA + #define pY_start pA_start + #define pY_end pA_end + #define Yi Ai + + // flip the roles of A(:,i) and B(:,j) + #include "GB_cuda_jit_AxB_dot3_phase3_mp_guts.cuh" + } +#endif //---------------------------------------------------------------------- // reduce sum per-thread values to a single scalar, get OR of flag @@ -333,6 +216,11 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel } #endif +// HACK +//int64_t end_time = (int64_t) clock ( ) ; +//cij = end_time - start_time ; +//cij_exists = 1 ; + // write result for this block to global mem if (tid == 0) { @@ -346,7 +234,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_mp_kernel { // cij is a zombie zc++; - Ci [pair_id] = GB_FLIP (i) ; + Ci [pair_id] = GB_ZOMBIE (i) ; } } //__syncthreads(); diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp_guts.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp_guts.cuh new file mode 100644 index 0000000000..41a1b85ccc --- /dev/null +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_mp_guts.cuh @@ -0,0 +1,277 @@ + + //---------------------------------------------------------------------- + // trim X and Y + //---------------------------------------------------------------------- + + //try to trim tail of X + + while ( (pX_end - pX_start > shared_vector_size) + && (Yi[pY_end-1] < Xi[pX_end - shared_vector_size -1 ]) ) + { + pX_end -= shared_vector_size; + } + + //try to trim tail of Y + while ( (pY_end - pY_start > shared_vector_size) + && (Xi[pX_end-1] < Yi[pY_end - shared_vector_size -1 ]) ) + { + pY_end -= shared_vector_size; + } + + int64_t Xnz = pX_end - pX_start ; + + int shared_steps_X = (Xnz + shared_vector_size -1)/shared_vector_size; + + int64_t step_end = (shared_steps_X <= 1? Xnz : shared_vector_size); + + while( (shared_steps_X>0) && (Yi[pY_start] > Xi[pX_start+ step_end-1]) ) + { // Fast forward to skip empty intersections + pX_start += step_end; + Xnz = pX_end - pX_start ; + shared_steps_X -= 1; + step_end = (shared_steps_X <= 1? Xnz : shared_vector_size); + } + + for ( int64_t kk = tid; kk< step_end; kk+= blockDim.x) + { + Xi_s[kk] = Xi[ kk + pX_start]; + } + this_thread_block().sync(); + + int64_t Ynz = pY_end - pY_start; // Ynz + + int shared_steps_Y = (Ynz + shared_vector_size -1)/shared_vector_size; + step_end = (shared_steps_Y <= 1 ? Ynz : shared_vector_size); + + while( (shared_steps_Y>0) && (Xi[pX_start] > Yi[pY_start + step_end-1]) ) + { //Fast forward to skip + pY_start+= step_end; + Ynz = pY_end - pY_start; + shared_steps_Y -= 1; + step_end = (shared_steps_Y <= 1 ? Ynz : shared_vector_size); + } + + for ( int64_t kk =tid; kk< step_end; kk+= blockDim.x) + { + Yi_s[kk] = Yi[ kk + pY_start]; + } + this_thread_block().sync(); + + //---------------------------------------------------------------------- + // compute cij + //---------------------------------------------------------------------- + + //we want more than one intersection per thread + while ( (shared_steps_X > 0) && (shared_steps_Y > 0) ) + { + int64_t Xwork = pX_end - pX_start; + int64_t Ywork = pY_end - pY_start; + if ( shared_steps_X > 1) Xwork = shared_vector_size; + if ( shared_steps_Y > 1) Ywork = shared_vector_size; + int64_t nxy = Xwork + Ywork; + + // ceil Divide by 32 = blockDim.x : + int work_per_thread = (nxy + blockDim.x -1)/blockDim.x; + int diag = GB_IMIN( work_per_thread*tid, nxy); + int diag_end = GB_IMIN( diag + work_per_thread, nxy); + + // Ywork takes place of Ynz: + int x_min = GB_IMAX( (diag - Ywork) , 0); + + //Xwork takes place of Xnz: + int x_max = GB_IMIN( diag, Xwork); + + while ( x_min < x_max) + { + //binary search for correct diag break + int pivot = (x_min +x_max) >> 1; + int64_t Xpiv = Xi_s[pivot] ; + int64_t Ypiv = Yi_s[diag -pivot -1] ; + + x_min = (pivot + 1)* (Xpiv < Ypiv) + x_min * (1 - (Xpiv < Ypiv)); + x_max = pivot * (1 - (Xpiv < Ypiv)) + x_max * (Xpiv < Ypiv); + + } + int xcoord = x_min; + int ycoord = diag -x_min -1; + + /* + //predictor-corrector search independent on each thread + int xcoord = GB_IMAX(diag-1, 0); //predicted to be uniform distribution + while ( Xi_s[xcoord] < Yi_s[diag-xcoord-1] && (xcoord Yi_s[diag-xcoord-1] && (xcoord>x_min) ) xcoord--; + + int ycoord = diag -xcoord -1; + */ + + int64_t Xtest = Xi_s[xcoord] ; + int64_t Ytest = Yi_s[ycoord] ; + if ( (diag > 0) && (diag < nxy ) && (ycoord >= 0 ) && (Xtest == Ytest)) + { + diag--; //adjust for intersection incrementing both pointers + } + // two start points are known now + int tx_start = xcoord; // +pX_start; + int ty_start = diag -xcoord; // +pY_start; + + x_min = GB_IMAX( (diag_end - Ywork), 0); //Ywork replace Ynz + x_max = GB_IMIN( diag_end, Xwork); //Xwork replace Xnz + + while ( x_min < x_max) + { + int pivot = (x_min +x_max) >> 1; + int64_t Xpiv = Xi_s[pivot] ; + int64_t Ypiv = Yi_s[diag_end -pivot -1] ; + + x_min = (pivot + 1)* (Xpiv < Ypiv) + x_min * (1 - (Xpiv < Ypiv)); + x_max = pivot * (1 - (Xpiv < Ypiv)) + x_max * (Xpiv < Ypiv); + } + + xcoord = x_min; + ycoord = diag_end -x_min -1; + + +/* + //predictor-corrector search independent on each thread + xcoord = diag_end-1; //predicted to be uniform distribution + while ( Xi_s[xcoord] < Yi_s[diag_end-xcoord-1] && (xcoord Yi_s[diag_end-xcoord-1] && (xcoord>x_min)) xcoord--; + + ycoord = diag_end -xcoord -1; +*/ + + // two end points are known now + int tx_end = xcoord; // +pX_start; + int ty_end = diag_end - xcoord; // + pY_start; + + //merge-path dot product + int64_t pX = tx_start; // pX + int64_t pY = ty_start; // pY + + while ( pX < tx_end && pY < ty_end ) + { + int64_t Xind = Xi_s[pX] ; + int64_t Yind = Yi_s[pY] ; + #if GB_IS_PLUS_PAIR_REAL_SEMIRING && GB_Z_IGNORE_OVERFLOW + cij += (Xind == Yind) ; + #else + if (Xind == Yind) + { + // cij += aki * bkj + #if MP_FLIP + GB_DOT_MERGE (pY + pY_start, pX + pX_start) ; + #else + GB_DOT_MERGE (pX + pX_start, pY + pY_start) ; + #endif + // TODO check terminal condition, using tile.any + } + #endif + pX += (Xind <= Yind) ; + pY += (Xind >= Yind) ; + } + GB_CIJ_EXIST_POSTCHECK ; + + this_thread_block().sync(); + + if ( (shared_steps_X >= 1) + && (shared_steps_Y >= 1) + && ( Xi_s[Xwork-1] == Yi_s[Ywork-1]) ) + { + + pX_start += shared_vector_size; + shared_steps_X -= 1; + if (shared_steps_X == 0) break; + pY_start += shared_vector_size; + shared_steps_Y -= 1; + if (shared_steps_Y == 0) break; + + step_end = ( (pX_end - pX_start) < shared_vector_size ? (pX_end - pX_start) : shared_vector_size); + while( (shared_steps_X>0) && (Yi[pY_start] > Xi[pX_start + step_end-1]) ) + { //fast forward + pX_start += step_end; + shared_steps_X -= 1; + step_end = ( (pX_end - pX_start) < shared_vector_size ? (pX_end - pX_start) : shared_vector_size); + } + if (shared_steps_X == 0) break; + + for ( int64_t kk = tid; kk< step_end; kk+= blockDim.x) + { + Xi_s[kk] = Xi[ kk + pX_start]; + } + this_thread_block().sync(); + + step_end = ( (pY_end - pY_start) < shared_vector_size ? (pY_end - pY_start) : shared_vector_size); + while( (shared_steps_Y>0) && (Xi[pX_start] > Yi[pY_start + step_end-1]) ) + { //fast forward + pY_start += step_end; + shared_steps_Y -= 1; + step_end = ( (pY_end - pY_start) < shared_vector_size ? (pY_end - pY_start) : shared_vector_size); + } + if (shared_steps_Y == 0) break; + + for ( int64_t kk = tid; kk< step_end; kk+= blockDim.x) + { + Yi_s[kk] = Yi[ kk + pY_start]; + } + this_thread_block().sync(); + + } + else if ( (shared_steps_X >= 1) && (Xi_s[Xwork-1] < Yi_s[Ywork-1] )) + { + pX_start += shared_vector_size; + shared_steps_X -= 1; + if (shared_steps_X == 0) break; + + step_end= ( (pX_end - pX_start) < shared_vector_size ? (pX_end - pX_start) : shared_vector_size); + while( (shared_steps_X>0) && (Yi[pY_start] > Xi[pX_start + step_end-1]) ) + { //fast forward + pX_start += step_end; + shared_steps_X -= 1; + step_end= ( (pX_end - pX_start) < shared_vector_size ? (pX_end - pX_start) : shared_vector_size); + } + if (shared_steps_X == 0) break; + + for ( int64_t kk = tid; kk< step_end; kk+= blockDim.x) + { + Xi_s[kk] = Xi[ kk + pX_start]; + } + this_thread_block().sync(); + + } + else if ( (shared_steps_Y >= 1) && (Yi_s[Ywork-1] < Xi_s[Xwork-1]) ) + { + pY_start += shared_vector_size; + shared_steps_Y -= 1; + if (shared_steps_Y == 0) break; + + step_end = ( (pY_end - pY_start) < shared_vector_size ? (pY_end - pY_start) : shared_vector_size); + while( (shared_steps_Y>0) && (Xi[pX_start] > Yi[pY_start + step_end-1]) ) + { //fast forward + pY_start += step_end; + shared_steps_Y -= 1; + step_end = ( (pY_end - pY_start) < shared_vector_size ? (pY_end - pY_start) : shared_vector_size); + } + if (shared_steps_Y == 0) break; + + for ( int64_t kk = tid; kk< step_end; kk+= blockDim.x) + { + Yi_s[kk] = Yi[ kk + pY_start]; + } + this_thread_block().sync(); + } + } // end while shared_steps_X > 0 && shared_steps_Y >0 + + //tile.sync( ) ; + +#undef MP_FLIP + +#undef pX +#undef pX_start +#undef pX_end +#undef Xi + +#undef pY +#undef pY_start +#undef pY_end +#undef Yi + diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh index 0bc7092f6d..f50de125ec 100644 --- a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_spdn.cuh @@ -31,7 +31,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel GrB_Matrix C, // result matrix GrB_Matrix M, // mask matrix GrB_Matrix A, // input matrix A - GrB_Matrix B // input matrix B + GrB_Matrix B, // input matrix B + const void *theta ) { @@ -124,6 +125,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel int64_t pair_id = all_in_one ? kk : Bucket [kk] ; int64_t i = Mi [pair_id] ; int64_t k = Ci [pair_id] >> 4 ; + // assert: Ci [pair_id] & 0xF == GB_BUCKET_SPDN // j = k or j = Mh [k] if C and M are hypersparse int64_t j = GBH_M (Mh, k) ; @@ -280,7 +282,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_spdn_kernel { // cij is a zombie zc++ ; - Ci [pair_id] = GB_FLIP (i) ; + Ci [pair_id] = GB_ZOMBIE (i) ; } } //__syncthreads(); diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh index 1258e1894c..ae0b0bd60c 100644 --- a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsdn.cuh @@ -33,7 +33,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel GrB_Matrix C, GrB_Matrix M, GrB_Matrix A, - GrB_Matrix B + GrB_Matrix B, + const void *theta ) { @@ -119,9 +120,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel int64_t pair_id = all_in_one ? kk : Bucket[ kk ]; int64_t i = Mi [pair_id] ; - int64_t k = Ci [pair_id] >> 4; // vector of C encoded in phase1 - + // assert: Ci [pair_id] & 0xF == GB_BUCKET_VSDN // j = k or j = Mh [k] if C and M are hypersparse int64_t j = GBH_M (Mh, k) ; @@ -263,7 +263,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsdn_kernel else { my_nzombies++ ; - Ci [pair_id] = GB_FLIP (i) ; + Ci [pair_id] = GB_ZOMBIE (i) ; } // sum up the zombie count: diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vssp.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vssp.cuh new file mode 100644 index 0000000000..4f1ae7dfea --- /dev/null +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vssp.cuh @@ -0,0 +1,249 @@ +//------------------------------------------------------------------------------ +// GraphBLAS/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vssp.cuh +//------------------------------------------------------------------------------ + +// This version uses a binary-search algorithm, when the sizes nnzA and nnzB +// are far apart in size, neither is very spare nor dense, for any size of N. + +// Both the grid and block are 1D, so blockDim.x is the # threads in a +// threadblock, and the # of threadblocks is grid.x + +// int64_t start <- start of vector pairs for this kernel +// int64_t end <- end of vector pairs for this kernel +// int64_t *Bucket <- array of pair indices for all kernels +// GrB_Matrix C <- result matrix +// GrB_Matrix M <- mask matrix +// GrB_Matrix A <- input matrix A +// GrB_Matrix B <- input matrix B + +__global__ void GB_cuda_AxB_dot3_phase3_vssp_kernel +( + int64_t start, + int64_t end, + int64_t *Bucket, // do the work defined by Bucket [start:end-1] + GrB_Matrix C, + GrB_Matrix M, + GrB_Matrix A, + GrB_Matrix B, + const void *theta +) +{ + + #if !GB_A_IS_PATTERN + const GB_A_TYPE *__restrict__ Ax = (GB_A_TYPE *)A->x ; + #endif + #if !GB_B_IS_PATTERN + const GB_B_TYPE *__restrict__ Bx = (GB_B_TYPE *)B->x ; + #endif + GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *)C->x ; + int64_t *__restrict__ Ci = C->i ; + const int64_t *__restrict__ Mi = M->i ; + #if GB_M_IS_HYPER + const int64_t *__restrict__ Mh = M->h ; + #endif + + ASSERT (GB_A_IS_HYPER || GB_A_IS_SPARSE) ; + const int64_t *__restrict__ Ai = A->i ; + const int64_t *__restrict__ Ap = A->p ; + + ASSERT (GB_B_IS_HYPER || GB_B_IS_SPARSE) ; + const int64_t *__restrict__ Bi = B->i ; + const int64_t *__restrict__ Bp = B->p ; + + #if GB_A_IS_HYPER + const int64_t anvec = A->nvec ; + const int64_t *__restrict__ Ah = A->h ; + const int64_t *__restrict__ A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const int64_t *__restrict__ A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const int64_t *__restrict__ A_Yx = (int64_t *) + ((A->Y == NULL) ? NULL : A->Y->x) ; + const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; + #endif + + #if GB_B_IS_HYPER + const int64_t bnvec = B->nvec ; + const int64_t *__restrict__ Bh = B->h ; + const int64_t *__restrict__ B_Yp = (B->Y == NULL) ? NULL : B->Y->p ; + const int64_t *__restrict__ B_Yi = (B->Y == NULL) ? NULL : B->Y->i ; + const int64_t *__restrict__ B_Yx = (int64_t *) + ((B->Y == NULL) ? NULL : B->Y->x) ; + const int64_t B_hash_bits = (B->Y == NULL) ? 0 : (B->Y->vdim - 1) ; + #endif + + // zombie count (only maintained by threadIdx.x == zero) + uint64_t zc = 0 ; + + GB_M_NVALS (mnz) ; + int all_in_one = ( (end - start) == mnz ) ; + + thread_block_tile tile = tiled_partition( this_thread_block()); + + // Main loop over pairs in Bucket [start:end-1] + for (int64_t kk = start+ blockIdx.x; + kk < end ; + kk += gridDim.x) + { + + int64_t pair_id = all_in_one ? kk : Bucket[ kk ]; + + int64_t i = Mi[pair_id]; + int64_t k = Ci[pair_id] >> 4; + // assert: Ci [pair_id] & 0xF == GB_BUCKET_VSSP + + // j = k or j = Mh [k] if C and M are hypersparse + int64_t j = GBH_M (Mh, k) ; + + // find A(:,i): A is always sparse or hypersparse + int64_t pA, pA_end ; + #if GB_A_IS_HYPER + GB_hyper_hash_lookup (Ah, anvec, Ap, A_Yp, A_Yi, A_Yx, A_hash_bits, + i, &pA, &pA_end) ; + #else + pA = Ap [i] ; + pA_end = Ap [i+1] ; + #endif + + // find B(:,j): B is always sparse or hypersparse + int64_t pB, pB_end ; + #if GB_B_IS_HYPER + GB_hyper_hash_lookup (Bh, bnvec, Bp, B_Yp, B_Yi, B_Yx, B_hash_bits, + j, &pB, &pB_end) ; + #else + pB = Bp [j] ; + pB_end = Bp [j+1] ; + #endif + + GB_DECLAREA (aki) ; + GB_DECLAREB (bkj) ; + GB_DECLARE_IDENTITY (cij) ; // GB_Z_TYPE cij = identity + + bool cij_exists = false; + + int64_t nnzA = pA_end - pA; + int64_t nnzB = pB_end - pB; + + //Search for each nonzero in the smaller vector to find intersection + + if (nnzA <= nnzB) + { + //------------------------------------------------------------------ + // A(:,i) is very sparse compared to B(:,j) + //------------------------------------------------------------------ + + while (pA+ threadIdx.x< pA_end && pB< pB_end) + { + int64_t ia = Ai [pA+ threadIdx.x] ; + int64_t ib = Bi [pB] ; + /* + if (ia < ib) + { + // A(ia,i) appears before B(ib,j) + pA++ ; + } + */ + pA += ( ia < ib )*blockDim.x; + if (ib < ia) + { + // B(ib,j) appears before A(ia,i) + // discard all entries B(ib:ia-1,j) + int64_t pleft = pB + 1 ; + int64_t pright = pB_end - 1 ; + GB_TRIM_BINARY_SEARCH (ia, Bi, pleft, pright) ; + //ASSERT (pleft > pB) ; + pB = pleft ; + } + else if (ia == ib) // ia == ib == k + { + // A(k,i) and B(k,j) are the next entries to merge + GB_DOT_MERGE (pA, pB); + //GB_DOT_TERMINAL (cij) ; // break if cij == terminal + pA+= blockDim.x ; + pB++ ; + } + } + } + else + { + //------------------------------------------------------------------ + // B(:,j) is very sparse compared to A(:,i) + //------------------------------------------------------------------ + + while (pA < pA_end && pB+ threadIdx.x < pB_end) + { + int64_t ia = Ai [pA] ; + int64_t ib = Bi [pB + threadIdx.x] ; + + pB += ( ib < ia)*blockDim.x; + + if (ia < ib) + { + // A(ia,i) appears before B(ib,j) + // discard all entries A(ia:ib-1,i) + int64_t pleft = pA + 1 ; + int64_t pright = pA_end - 1 ; + GB_TRIM_BINARY_SEARCH (ib, Ai, pleft, pright) ; + //ASSERT (pleft > pA) ; + pA = pleft ; + } + /* + else if (ib < ia) + { + // B(ib,j) appears before A(ia,i) + pB++ ; + } + */ + else if (ia == ib)// ia == ib == k + { + // A(k,i) and B(k,j) are the next entries to merge + GB_DOT_MERGE (pA, pB) ; + //GB_DOT_TERMINAL (cij) ; // break if cij == terminal + pA++ ; + pB+=blockDim.x ; + } + } + + } + GB_CIJ_EXIST_POSTCHECK ; + this_thread_block().sync(); + + cij_exists = tile.any( cij_exists) ; + tile.sync ( ) ; + + #if !GB_C_ISO + if ( cij_exists) + { + cij = GB_cuda_tile_reduce_ztype (tile, cij) ; + } + #endif + + if (threadIdx.x == 0) + { + if (cij_exists) + { + Ci[pair_id] = i ; + GB_PUTC (cij, Cx, pair_id) ; + } + else + { + zc++; + //printf(" %lld, %lld is zombie %d!\n",i,j,zc); + Ci[pair_id] = GB_ZOMBIE( i ) ; + } + } + } + this_thread_block().sync(); + + //-------------------------------------------------------------------------- + // update the zombie count + //-------------------------------------------------------------------------- + + if (threadIdx.x ==0 && zc > 0) + { + // this threadblock accumulates its zombie count into the global + // zombie count + //printf("vssp warp %d zombie count = %d\n", blockIdx.x, zc); + GB_cuda_atomic_add( &(C->nzombies), zc) ; + //printf(" vssp Czombie = %lld\n",C->nzombies); + } +} + diff --git a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh index 756194c1b7..f29233d0cf 100644 --- a/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh +++ b/CUDA/template/GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh @@ -42,7 +42,8 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsvs_kernel GrB_Matrix C, GrB_Matrix M, GrB_Matrix A, - GrB_Matrix B + GrB_Matrix B, + const void *theta ) { @@ -100,6 +101,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsvs_kernel int64_t i = Mi [pair_id] ; int64_t k = Ci [pair_id]>>4 ; + // assert: Ci [pair_id] & 0xF == GB_BUCKET_VSVS // j = k or j = Mh [k] if C and M are hypersparse int64_t j = GBH_M (Mh, k) ; @@ -150,6 +152,10 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsvs_kernel GB_CIJ_EXIST_POSTCHECK ; + +// HACK +// cij_exists = false ; + if (cij_exists) { GB_PUTC (cij, Cx, pair_id) ; // Cx [pair_id] = (GB_C_TYPE) cij @@ -159,7 +165,7 @@ __global__ void GB_cuda_AxB_dot3_phase3_vsvs_kernel { // cij is a zombie my_nzombies++; - Ci [pair_id] = GB_FLIP (i) ; + Ci [pair_id] = GB_ZOMBIE (i) ; } } diff --git a/CUDA/template/GB_jit_kernel_cuda_AxB_dot3.cu b/CUDA/template/GB_jit_kernel_cuda_AxB_dot3.cu index 1355014403..1347c7c8d0 100644 --- a/CUDA/template/GB_jit_kernel_cuda_AxB_dot3.cu +++ b/CUDA/template/GB_jit_kernel_cuda_AxB_dot3.cu @@ -33,7 +33,7 @@ #define log2_chunk_size 7 #define tile_sz 32 #define log2_tile_sz 5 -#define shared_vector_size 128 +#define shared_vector_size 256 #define blocksize 32 #define threads_per_block 32 @@ -91,7 +91,7 @@ // dot3 buckets //------------------------------------------------------------------------------ -#define NBUCKETS 3 +#define NBUCKETS 4 // NBUCKETS buckets: computed by up to NBUCKETS-1 kernel launches (zombies need // no work...), each using different kernels (with different configurations @@ -103,10 +103,13 @@ typedef enum { GB_BUCKET_ZOMBIE = 0, // C(i,j) is a zombie (not a bucket) + // both A and B are sparse/hyper: GB_BUCKET_VSVS = 1, // vsvs: both A(:,i) and B(:,j) are very sparse GB_BUCKET_MERGEPATH = 2, // mp: use the merge-path method - // A is sparse/hyper and B is bitmap/full, or + GB_BUCKET_VSSP = 3, // vssp: very sparse x sparse, binary search + + // A is sparse/hyper and B is bitmap/full, // A is bitmap/full and B is sparse/hyper GB_BUCKET_VSDN = 1, // vsdn: the sparse vector is very sparse GB_BUCKET_SPDN = 2, // spdn: sparse vector has lots of entries; @@ -168,6 +171,7 @@ GB_bucket_code ; // FIXME: rename GB_dot3_bucket_code // sparse-sparse #include "GB_cuda_jit_AxB_dot3_phase3_mp.cuh" #include "GB_cuda_jit_AxB_dot3_phase3_vsvs.cuh" + #include "GB_cuda_jit_AxB_dot3_phase3_vssp.cuh" #else // sparse-dense or dense-sparse #include "GB_cuda_jit_AxB_dot3_phase3_spdn.cuh" @@ -225,6 +229,9 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) int number_of_blocks_1 = GB_IMIN (nblks_1, chunk_size * number_of_sms) ; // most methods can use these launch geometries: + // printf ("\nmnz: %ld\n", mnz) ; + // printf ("number_of_blocks_1: %d\n", number_of_blocks_1) ; + // printf ("threads_per_block: %d\n", threads_per_block) ; dim3 grid_1 (number_of_blocks_1) ; dim3 block (threads_per_block) ; @@ -281,7 +288,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) // kernel_timer.Start(); GB_cuda_AxB_dot3_phase3_dndn_kernel <> - (C, M, A, B) ; + (C, M, A, B, theta) ; } #else @@ -306,9 +313,12 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) Nanobuckets = GB_MALLOC_WORK (nanobuckets_size, int64_t, &Nb_size) ; Blockbucket = GB_MALLOC_WORK (blockbuckets_size, int64_t, &Bb_size) ; Bucketp = GB_MALLOC_WORK (NBUCKETS+1, int64_t, &Bup_size) ; - offset = GB_MALLOC_WORK (NBUCKETS, int64_t, &O_size) ; + offset = GB_MALLOC_WORK (NBUCKETS+1, int64_t, &O_size) ; Bucket = GB_MALLOC_WORK (mnz, int64_t, &Bu_size) ; + memset (offset, 0, (NBUCKETS+1) * sizeof (int64_t)) ; + memset (Bucketp, 0, (NBUCKETS+1) * sizeof (int64_t)) ; + if (Nanobuckets == NULL || Blockbucket == NULL || Bucketp == NULL || Bucket == NULL || offset == NULL) { @@ -350,6 +360,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) // kernel_timer.Start(); + // printf ("\nLaunching sparse phase1:\n") ; GB_jit_AxB_dot3_phase1_kernel <<>> (Nanobuckets, Blockbucket, C, M, A, B) ; @@ -370,6 +381,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) // kernel_timer.Start(); + // printf ("Launching sparse phase2:\n") ; GB_cuda_AxB_dot3_phase2_kernel <<>> (Blockbucket, offset, number_of_blocks_1) ; @@ -377,11 +389,13 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) int64_t s = offset [0] ; C->nzombies = s ; + printf ("\nzombies: %ld\n", offset [0]) ; bool all_in_one = false ; for (int bucket = 1 ; bucket < NBUCKETS+1 ; bucket++) { - Bucketp[bucket] = s ; + Bucketp[bucket] = s ; s += offset [bucket] ; + printf ("bucket %d: %ld\n", bucket, offset [bucket]) ; if ((Bucketp [bucket] - Bucketp [bucket-1] ) == mnz) { all_in_one = true ; @@ -398,7 +412,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) if (!all_in_one) { // kernel_timer.Start(); - + // printf ("Launching sparse phase2end:\n") ; GB_cuda_AxB_dot3_phase2end_kernel <<>> (Nanobuckets, Blockbucket, Bucketp, Bucket, offset, C, mnz) ; @@ -419,6 +433,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) int64_t end = Bucketp [bucket + 1] ; int64_t cnz_in_bucket = end - start ; int gridsz, blocksz, work_per_thread ; + // printf ("bucket %d, cnz_in_bucket %ld\n", bucket, cnz_in_bucket); if (cnz_in_bucket > 0) { @@ -447,7 +462,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) dim3 grid_3 (gridsz) ; GB_cuda_AxB_dot3_phase3_vsvs_kernel <<>> - (start, end, Bucket, C, M, A, B) ; + (start, end, Bucket, C, M, A, B, theta) ; } break ; @@ -472,11 +487,44 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) } gridsz = GB_IMIN (gridsz, 256*number_of_sms) ; dim3 grid_3 (gridsz) ; + // each thread block creates Ai_s and Bj_s; each + // are int64_t arrays of size shared_vector_size + size_t shared_bytes = 0 ; + // shared_vector_size * + // sizeof (int64_t) * 2 ; GB_cuda_AxB_dot3_phase3_mp_kernel + <<>> + (start, end, Bucket, C, M, A, B, theta) ; + } + break ; + + //------------------------------------------------------ + // vssp bucket: + //------------------------------------------------------ + + case GB_BUCKET_VSSP : + { + // FIXME: should be a function of cuda architecture + blocksz = 32 ; + work_per_thread = 256 ; + if (cnz_in_bucket > (2<<20)) + { + work_per_thread = 1024 ; + } + gridsz = GB_ICEIL (cnz_in_bucket, work_per_thread) ; + if ((gridsz < number_of_sms) && + (cnz_in_bucket > (2<<20))) + { + gridsz = number_of_sms ; + } + gridsz = GB_IMIN (gridsz, 256*number_of_sms) ; + dim3 grid_3 (gridsz) ; + GB_cuda_AxB_dot3_phase3_vssp_kernel <<>> - (start, end, Bucket, C, M, A, B) ; + (start, end, Bucket, C, M, A, B, theta) ; } break ; + } #else @@ -503,7 +551,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) dim3 grid_3 (gridsz) ; GB_cuda_AxB_dot3_phase3_vsdn_kernel <<>> - (start, end, Bucket, C, M, A, B) ; + (start, end, Bucket, C, M, A, B, theta) ; } break ; @@ -530,7 +578,7 @@ GB_JIT_CUDA_KERNEL_DOT3_PROTO (GB_jit_kernel) dim3 grid_3 (gridsz) ; GB_cuda_AxB_dot3_phase3_spdn_kernel <<>> - (start, end, Bucket, C, M, A, B) ; + (start, end, Bucket, C, M, A, B, theta) ; break ; } } diff --git a/CUDA/template/GB_jit_kernel_cuda_apply_unop.cu b/CUDA/template/GB_jit_kernel_cuda_apply_unop.cu index 7a42df06bd..fdc5e2804e 100644 --- a/CUDA/template/GB_jit_kernel_cuda_apply_unop.cu +++ b/CUDA/template/GB_jit_kernel_cuda_apply_unop.cu @@ -72,10 +72,10 @@ __global__ void GB_cuda_apply_unop_kernel pfirst < anz ; pfirst += gridDim.x << log2_chunk_size ) { - int64_t my_chunk_size, anvec_sub1 ; + int64_t my_chunk_size, anvec_sub1, kfirst, klast ; float slope ; - int64_t kfirst = GB_cuda_ek_slice_setup (Ap, anvec, anz, pfirst, - chunk_size, &my_chunk_size, &anvec_sub1, &slope) ; + GB_cuda_ek_slice_setup (Ap, anvec, anz, pfirst, chunk_size, + &kfirst, &klast, &my_chunk_size, &anvec_sub1, &slope) ; for (int64_t pdelta = threadIdx.x ; pdelta < my_chunk_size ; pdelta += blockDim.x) { @@ -118,4 +118,4 @@ GB_JIT_CUDA_KERNEL_APPLY_UNOP_PROTO (GB_jit_kernel) GB_cuda_apply_unop_kernel <<>> (Cx, ythunk, A) ; return (GrB_SUCCESS) ; -} \ No newline at end of file +} diff --git a/CUDA/template/GB_jit_kernel_cuda_colscale.cu b/CUDA/template/GB_jit_kernel_cuda_colscale.cu index fdc891edd8..da0c53e2b8 100644 --- a/CUDA/template/GB_jit_kernel_cuda_colscale.cu +++ b/CUDA/template/GB_jit_kernel_cuda_colscale.cu @@ -57,10 +57,10 @@ __global__ void GB_cuda_colscale_kernel pfirst < anz ; pfirst += gridDim.x << log2_chunk_size ) { - int64_t my_chunk_size, anvec_sub1 ; + int64_t my_chunk_size, anvec_sub1, kfirst, klast ; float slope ; - int64_t kfirst = GB_cuda_ek_slice_setup (Ap, anvec, anz, pfirst, - chunk_size, &my_chunk_size, &anvec_sub1, &slope) ; + GB_cuda_ek_slice_setup (Ap, anvec, anz, pfirst, chunk_size, + &kfirst, &klast, &my_chunk_size, &anvec_sub1, &slope) ; for (int64_t pdelta = threadIdx.x ; pdelta < my_chunk_size ; pdelta += blockDim.x) { diff --git a/CUDA/template/GB_jit_kernel_cuda_rowscale.cu b/CUDA/template/GB_jit_kernel_cuda_rowscale.cu index 8d3d9ee363..be158f7273 100644 --- a/CUDA/template/GB_jit_kernel_cuda_rowscale.cu +++ b/CUDA/template/GB_jit_kernel_cuda_rowscale.cu @@ -9,7 +9,7 @@ __global__ void GB_cuda_rowscale_kernel { const GB_A_TYPE *__restrict__ Dx = (GB_A_TYPE *) D->x ; const GB_B_TYPE *__restrict__ Bx = (GB_B_TYPE *) B->x ; - + GB_C_TYPE *__restrict__ Cx = (GB_C_TYPE *) C->x ; #define D_iso GB_A_ISO diff --git a/CUDA/template/GB_jit_kernel_cuda_select_sparse.cu b/CUDA/template/GB_jit_kernel_cuda_select_sparse.cu new file mode 100644 index 0000000000..7fc1f08d9f --- /dev/null +++ b/CUDA/template/GB_jit_kernel_cuda_select_sparse.cu @@ -0,0 +1,337 @@ +using namespace cooperative_groups ; + +#define GB_FREE_ALL \ +{ \ + GB_FREE_WORK (W) ; \ + GB_FREE_WORK (W_2) ; \ + GB_FREE_WORK (W_3) ; \ +} + +#include "GB_cuda_ek_slice.cuh" +#include "GB_cuda_cumsum.cuh" + +//------------------------------------------------------------------------------ +// GB_cuda_select_sparse_phase1: construct Keep array +//------------------------------------------------------------------------------ + +// Compute Keep array +__global__ void GB_cuda_select_sparse_phase1 +( + int64_t *Keep, + GrB_Matrix A, + void *ythunk +) +{ + const int64_t *__restrict__ Ap = A->p ; + + #if ( GB_A_IS_HYPER ) + const int64_t *__restrict__ Ah = A->h ; + #endif + + #if ( GB_DEPENDS_ON_X ) + const GB_A_TYPE *__restrict__ Ax = (GB_A_TYPE *) A->x ; + #endif + + #if ( GB_DEPENDS_ON_Y ) + const GB_Y_TYPE y = * ((GB_Y_TYPE *) thunk) ; + #endif + + GB_A_NHELD (anz) ; + + #if ( GB_DEPENDS_ON_J ) + + for (int64_t pfirst = blockIdx.x << log2_chunk_size ; + pfirst < anz ; + pfirst += gridDim.x << log2_chunk_size ) + { + int64_t my_chunk_size, anvec1, kfirst, klast ; + float slope ; + GB_cuda_ek_slice_setup (Ap, anvec, anz, pfirst, chunk_size, + &kfirst, &klast, &my_chunk_size, &anvec1, &slope) ; + + for (int64_t pdelta = threadIdx.x ; + pdelta < my_chunk_size ; + pdelta += blockDim.x) + { + int64_t pA ; + int64_t k = GB_cuda_ek_slice_entry (&pA, pdelta, pfirst, Ap, + anvec1, kfirst, slope) ; + int64_t j = GBH_A (Ah, k) ; + + #if ( GB_DEPENDS_ON_I ) + int64_t i = Ai [pA] ; + #endif + + // keep = fselect (A (i,j)), true if A(i,j) is kept, else false + GB_TEST_VALUE_OF_ENTRY (keep, pA) ; // FIXME: add Ax,i,j,y + Keep[pA] = keep; + } + } + + #else + + int tid = blockIdx.x * blockDim.x + threadIdx.x ; + int nthreads = blockDim.x * gridDim.x ; + + for (int64_t pA = tid; pA < anz; pA += nthreads) + { + #if ( GB_DEPENDS_ON_I ) + int64_t i = Ai [pA] ; + #endif + + GB_TEST_VALUE_OF_ENTRY (keep, pA) ; + Keep[pA] = keep; + } + + #endif +} + +//------------------------------------------------------------------------------ +// GB_cuda_select_sparse_phase2: +//------------------------------------------------------------------------------ + +__global__ void GB_cuda_select_sparse_phase2 +( + int64_t *Map + GrB_Matrix A, + int64_t *Ak_keep, + int64_t *Ck_delta, + int64_t *Ci, + GB_X_TYPE *Cx +) +{ + const int64_t *__restrict__ Ap = A->p ; + const int64_t *__restrict__ Ai = A->i ; + const GB_A_TYPE *__restrict__ Ax = (GB_A_TYPE *) A->x ; + + GB_A_NHELD (anz) ; + int64_t cnz = Map [anz - 1]; + + int tid = blockIdx.x * blockDim.x + threadIdx.x ; + int nthreads = blockDim.x * gridDim.x ; + + for (int64_t pfirst = blockIdx.x << log2_chunk_size ; + pfirst < anz ; + pfirst += gridDim.x << log2_chunk_size ) + { + int64_t my_chunk_size, anvec1, kfirst, klast ; + float slope ; + GB_cuda_ek_slice_setup (Ap, anvec, anz, pfirst, chunk_size, + &kfirst, &klast, &my_chunk_size, &anvec1, &slope) ; + + for (int64_t pdelta = threadIdx.x ; + pdelta < my_chunk_size ; + pdelta += blockDim.x) + { + int64_t pA = pfirst + pdelta ; + int64_t pC = Map [pA] ; // Note: pC is off-by-1 (see below). + if (Map [pA-1] < pC) + { + // This entry is kept; Keep [pA] was 1 but the contents of the + // Keep has been overwritten by the Map array using an + // inclusive cumsum. Keep [pA] (before being overwritten) is + // identical to the expression (Map [pA-1] < pC). + + // the A(i,j) is in the kA-th vector of A: + int64_t kA = GB_cuda_ek_slice_entry (&pA, pdelta, pfirst, Ap, + anvec1, kfirst, slope) ; + + // Map is offset by 1 since it was computed as an inclusive + // cumsum, so decrement pC here to get the actual position in + // Ci,Cx. + pC-- ; + Ci [pC] = Ai [pA] ; + + // Cx [pC] = Ax [pA] ; + // Q: In iso case, this just becomes + // #define GB_ISO_SELECT 1? I would expect + // Cx [0] = Ax [0] + GB_SELECT_ENTRY (pC, pA) ; + + // save the name of the vector kA that holds this entry in A, + // for the new position of this entry in C at pC. + Ak_keep [pC] = kA ; + } + } + + // Build the Delta over Ck_delta + this_thread_block().sync(); + + for (int64_t pdelta = threadIdx.x ; + pdelta < my_chunk_size ; + pdelta += blockDim.x) + { + int64_t pA = pfirst + pdelta ; + int64_t pC = Map[pA] ; + if (Map [pA-1] < pC) + { + pC-- ; + Ck_delta [pC] = (Ak_keep [pC] != Ak_keep [pC - 1]) ; + } + } + } +} + +// HERE + +__global__ void GB_cuda_select_sparse_phase3 +( + GrB_Matrix A, + int64_t cnz, + int64_t *Ak_keep, + int64_t *Ck_map, + int64_t *Cp, + int64_t *Ch +) +{ + #if ( GB_A_IS_HYPER ) + const int64_t *__restrict__ Ah = A->h; + #endif + + int tid = blockIdx.x * blockDim.x + threadIdx.x ; + int nthreads = blockDim.x * gridDim.x ; + + for (int64_t pC = tid; pC < cnz; pC += nthreads) + { + if (Ck_map[pC] != Ck_map[pC - 1]) + { + int64_t kA = Ak_keep[pC] - 1 ; + Cp[Ck_map[pC] - 1] = pC; + Ch[Ck_map[pC] - 1] = GBH_A (Ah, kA); + } + } +} + +//------------------------------------------------------------------------------ +// select sparse, host method +//------------------------------------------------------------------------------ + +extern "C" +{ + GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO (GB_jit_kernel) ; +} + +GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO (GB_jit_kernel) +{ + + //-------------------------------------------------------------------------- + // get callback functions + //-------------------------------------------------------------------------- + + #ifdef GB_JIT_RUNTIME + // get callback functions + GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; + GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; + #endif + + //-------------------------------------------------------------------------- + // check inputs and declare workspace + //-------------------------------------------------------------------------- + + int64_t *W = NULL, *W_2 = NULL, *W_3 = NULL, + *Ak_keep = NULL, *Ck_delta = NULL, + *Keep = NULL ; + size_t W_size = 0, W_2_size = 0, W_3_size = 0 ; + int64_t cnz = 0 ; + + ASSERT (GB_A_IS_HYPER || GB_A_IS_SPARSE) ; + + dim3 grid (gridsz) ; + dim3 block (blocksz) ; + + //-------------------------------------------------------------------------- + // phase 1: determine which entries of A to keep + //-------------------------------------------------------------------------- + + // Phase 1: Keep [p] = 1 if Ai,Ax [p] is kept, 0 otherwise; then cumsum + + W = GB_MALLOC_WORK (A->nvals + 1, int64_t, &W_size) ; + if (W == NULL) + { + // out of memory + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + + // shift by one, to define Keep [-1] as 0 + W [0] = 0; // placeholder for easier end-condition + Keep = W + 1 ; // Keep has size A->nvals and starts at W [1] + + GB_cuda_select_sparse_phase1 <<>> + (Keep, A, ythunk) ; + + CUDA_OK (cudaStreamSynchronize (stream)) ; + + //-------------------------------------------------------------------------- + // phase1b: Map = cumsum (Keep) + //-------------------------------------------------------------------------- + + // in-place cumsum, overwriting Keep with its cumsum, then becomes Map + CUDA_OK (GB_cuda_cumsum (Keep, Keep, A->nvals, stream, + GB_CUDA_CUMSUM_INCLUSIVE)) ; + CUDA_OK (cudaStreamSynchronize (stream)) ; + + int64_t *Map = Keep ; // Keep has been replaced with Map + cnz = Map [A->nvals - 1] ; // total # of entries kept, for C + + // Q: need to allocate space for Cx, Ci? + // If cnz = 0, just need to do Cp [0] = 0, then done? + + // allocate workspace + W_2 = GB_MALLOC_WORK (cnz + 1, int64_t, &W_2_size) ; + W_3 = GB_MALLOC_WORK (cnz + 1, int64_t, &W_3_size) ; + if (W_2 == NULL || W_3 == NULL) + { + // out of memory + GB_FREE_ALL ; + return (GrB_OUT_OF_MEMORY) ; + } + + // shift by one: to define Ck_delta [-1] as 0 + W_2 [0] = 0 ; + Ck_delta = W_2 + 1 ; + + // shift by one: to define Ak_keep [-1] as -1 + W_3 [0] = -1 ; + Ak_keep = W_3 + 1 ; + + + //-------------------------------------------------------------------------- + // phase 2: + //-------------------------------------------------------------------------- + + // Phase 2: Build Ci, Cx, Ak_keep, and Ck_delta + GB_cuda_select_sparse_phase2 <<>> + (Map, A, Ak_keep, Ck_delta, Ci, Cx) ; + + CUDA_OK (cudaStreamSynchronize (stream)) ; + + // Cumsum over Ck_delta array to get Ck_map + // Can reuse `Keep` to avoid a malloc + //-------------------------------------------------------------------------- + // phase2b: Ck_map = cumsum (Ck_delta) + //-------------------------------------------------------------------------- + + CUDA_OK (GB_cuda_cumsum (Keep, Ck_delta, cnz, stream, + GB_CUDA_CUMSUM_INCLUSIVE)) ; + CUDA_OK (cudaStreamSynchronize (stream)) ; + + int64_t *Ck_map = Keep; + int64_t cnk = Ck_map [cnz - 1] ; + + // Q: Need to allocate space for Cp, Ch? + + //-------------------------------------------------------------------------- + // Phase 3: Build Cp and Ch + //-------------------------------------------------------------------------- + GB_cuda_select_sparse_phase3 <<>> + (A, cnz, Ak_keep, Ck_map, Cp, Ch) ; + CUDA_OK (cudaStreamSynchronize (stream)) ; + + // log the end of the last vector of C + Cp [Ck_map [cnz - 1]] = cnz; + + GB_FREE_ALL ; + return (GrB_SUCCESS) ; +} + diff --git a/CUDA/unused/GB_cuda_cumsum.cu b/CUDA/unused/GB_cuda_cumsum.cu deleted file mode 100644 index 8ed9726afa..0000000000 --- a/CUDA/unused/GB_cuda_cumsum.cu +++ /dev/null @@ -1,69 +0,0 @@ -//------------------------------------------------------------------------------ -// GraphBLAS/CUDA/GB_cuda_cumsum: cumlative sum of an array on the GPU(s) -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// Compute the cumulative sum of an array count[0:n], of size n+1 -// in pseudo-MATLAB notation: - -// k = sum (count [0:n-1] != 0) ; - -// count = cumsum ([0 count[0:n-1]]) ; - -// That is, count [j] on input is overwritten with the value of -// sum (count [0..j-1]). count [n] is implicitly zero on input. -// On output, count [n] is the total sum. - -#include "GB_cuda.hpp" -// #include -#include - -GrB_Info GB_cuda_cumsum // compute the cumulative sum of an array -( - int64_t *restrict count, // size n+1, input/output - const int64_t n -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - ASSERT (count != NULL) ; - ASSERT (n >= 0) ; - - //-------------------------------------------------------------------------- - // count = cumsum ([0 count[0:n-1]]) ; - //-------------------------------------------------------------------------- - - void *d_temp_storage = NULL; - size_t temp_storage_bytes; - cub::DeviceScan::ExclusiveSum(d_temp_storage, temp_storage_bytes, count, - count, (int) n) ; - size_t size ; - d_temp_storage = GB_malloc_memory( temp_storage_bytes, 1, &size); - if ( d_temp_storage == NULL){ - return GrB_OUT_OF_MEMORY; - } - - // Run - CubDebugExit(cub::DeviceScan::ExclusiveSum(d_temp_storage, temp_storage_bytes, count, count, n)); - - // Check for correctness (and display results, if specified) - #if 0 - #ifdef GB_DEBUG - int compare = CompareDeviceResults(h_reference, count, num_items, true, g_verbose); - ASSERT( compare == 0); - #endif - #endif - - // Cleanup - GB_free_memory (&d_temp_storage, size) ; - - return GrB_SUCCESS; -} - diff --git a/Config/GraphBLAS.h.in b/Config/GraphBLAS.h.in index 1c1374a9e8..00f1ebb297 100644 --- a/Config/GraphBLAS.h.in +++ b/Config/GraphBLAS.h.in @@ -30,13 +30,6 @@ // with the name GxB_* are user-accessible in SuiteSparse:GraphBLAS but cannot // be guaranteed to appear in all GraphBLAS implementations. -// 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 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 @@ -177,10 +170,10 @@ // // One of the above options is required. To use the JIT, these two // options must also be added at run time via - // GrB_set (GrB_Global, GxB_JIT_C_COMPILER_FLAGS, "...") - // where "..." would be all the flags required to compile a JIT kernel, - // including "-O3 -fopenmp" and so on, as well as one of the above two - // options. + // GrB_set (GrB_Global, GxB_JIT_C_COMPILER_FLAGS, "[flags]") + // where "[flags]" would be all the flags required to compile a JIT + // kernel, including "-O3 -fopenmp" and so on, as well as one of the + // above two options. #else // Let the cmake configuration script determine the complex type // that is available: @@ -257,13 +250,13 @@ // can use tests like this: // // #if GxB_SPEC_VERSION >= GxB_VERSION (2,0,3) -// ... use features in GraphBLAS specification 2.0.3 ... +// use features in GraphBLAS specification 2.0.3 // #else -// ... only use features in early specifications +// only use features in early specifications // #endif // // #if GxB_IMPLEMENTATION > GxB_VERSION (1,4,0) -// ... use features from version 1.4.0 of a GraphBLAS package +// use features from version 1.4.0 of a GraphBLAS package // #endif // X_GRAPHBLAS: names this particular implementation: @@ -319,11 +312,11 @@ // The 'spec' string describes the GraphBLAS spec: #define GxB_SPEC_ABOUT \ -"GraphBLAS C API, by Benjamin Brock, Aydin Buluc, Raye Kimmerer,\n" \ +"GraphBLAS C API, by Benjamin Brock, Aydin Buluc, Raye Kimmerer,\n" \ "Jim Kitchen, Manoj 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" +"Michel Pelletier, Erik Welch, and Carl Yang. 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" //============================================================================== // GrB_Index: the GraphBLAS integer @@ -338,11 +331,6 @@ typedef uint64_t GrB_Index ; // matrix or vector dimension is GrB_INDEX_MAX+1, or 2^60 in SuiteSparse:GrB. #define GrB_INDEX_MAX ((GrB_Index) (1ULL << 60) - 1) -// GxB_INDEX_MAX is historical; use GrB_INDEX_MAX+1 instead. It differs by one -// from GrB_INDEX_MAX, since it defined the largest valid matrix or vector -// dimension. -#define GxB_INDEX_MAX ((GrB_Index) (1ULL << 60)) - //============================================================================== // GraphBLAS error and informational codes //============================================================================== @@ -382,7 +370,8 @@ typedef enum GrB_INSUFFICIENT_SPACE = -103, // output array not large enough GrB_INVALID_OBJECT = -104, // object is corrupted GrB_INDEX_OUT_OF_BOUNDS = -105, // row or col index out of bounds - GrB_EMPTY_OBJECT = -106 // an object does not contain a value + GrB_EMPTY_OBJECT = -106, // an object does not contain a value + GxB_JIT_ERROR = -1001, // JIT compiler/loader error } GrB_Info ; @@ -507,7 +496,7 @@ typedef enum GxB_AxB_METHOD = 7090, // descriptor for selecting C=A*B algorithm GxB_SORT = 7091, // control sort in GrB_mxm GxB_COMPRESSION = 7092, // select compression for serialize - GxB_IMPORT = 7093, // secure vs fast import + GxB_IMPORT = 7093, // secure vs fast GxB_pack } GrB_Desc_Field ; @@ -515,7 +504,7 @@ typedef enum { // for all GrB_Descriptor fields: GrB_DEFAULT = 0, // default behavior of the method - GxB_DEFAULT = 0, // historical; use GrB_DEFAULT instead + GxB_DEFAULT = 0, // Historical; use GrB_DEFAULT instead // for GrB_OUTP only: GrB_REPLACE = 1, // clear the output before assigning new values to it @@ -687,22 +676,6 @@ GB_GLOBAL GrB_UnaryOp // GxB_LNOT_BOOL; it just has a different name. GrB_LNOT ; -// GxB_ABS is now in the v1.3 spec, the following names are historical: -GB_GLOBAL GrB_UnaryOp - - // z = abs(x) - GxB_ABS_BOOL, - GxB_ABS_INT8, - GxB_ABS_INT16, - GxB_ABS_INT32, - GxB_ABS_INT64, - GxB_ABS_UINT8, - GxB_ABS_UINT16, - GxB_ABS_UINT32, - GxB_ABS_UINT64, - GxB_ABS_FP32, - GxB_ABS_FP64 ; - //------------------------------------------------------------------------------ // Unary operators for floating-point types only //------------------------------------------------------------------------------ @@ -1220,15 +1193,26 @@ GB_GLOBAL GrB_BinaryOp GxB_IGNORE_DUP ; typedef void (*GxB_binary_function) (void *, const void *, const void *) ; //============================================================================== -// GxB_SelectOp: select operators (DEPRECATED: do not use) +// GxB_IndexBinaryOp: index binary operators //============================================================================== -// 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, GxB_EQ_THUNK, GxB_GT_THUNK, GxB_GE_THUNK, GxB_LT_THUNK, - GxB_LE_THUNK ; +// GxB_IndexBinaryOp: a function z=f(x,ia,jb, y,ib,jb, theta). The function f +// must have the signature: + +// void f (void *z, const void *x, GrB_Index ix, GrB_Index jx, +// const void *y, GrB_Index iy, GrB_Index jy, +// const void *theta) ; + +// The pointers are void * but they are always of pointers to objects of type +// ztype, xtype, ytype, and theta_type, respectively. +// for examples. + +typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp ; + +typedef void (*GxB_index_binary_function) (void *, + const void *, GrB_Index, GrB_Index, + const void *, GrB_Index, GrB_Index, + const void *) ; //============================================================================== // GrB_IndexUnaryOp: a unary operator that depends on the row/col indices @@ -1353,8 +1337,7 @@ typedef struct GB_Semiring_opaque *GrB_Semiring ; // GrB_Scalar: a GraphBLAS scalar //============================================================================== -typedef struct GB_Scalar_opaque *GxB_Scalar ; // historical: use GrB_Scalar -typedef struct GB_Scalar_opaque *GrB_Scalar ; // use this instead +typedef struct GB_Scalar_opaque *GrB_Scalar ; //============================================================================== // GrB_Vector: a GraphBLAS vector @@ -1390,22 +1373,22 @@ typedef enum // for global options or matrix options GxB_HYPER_HASH = 7048, // hyper_hash control (global int64 value, // or bool per matrix) GxB_BITMAP_SWITCH = 7001, // switch to bitmap (double value) - GxB_FORMAT = 7002, // historical; use GrB_STORAGE_ORIENTATION_HINT + GxB_FORMAT = 7002, // Historical; use GrB_STORAGE_ORIENTATION_HINT //------------------------------------------------------------ // GrB_get for GrB_GLOBAL: //------------------------------------------------------------ - 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_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, // historical; use GrB_API_VER_* + 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 *) @@ -1449,7 +1432,7 @@ typedef enum // for global options or matrix options //------------------------------------------------------------ GxB_SPARSITY_STATUS = 7034, // hyper, sparse, bitmap or full (1,2,4,8) - GxB_IS_HYPER = 7035, // historical; use GxB_SPARSITY_STATUS + GxB_IS_HYPER = 7035, // Historical; use GxB_SPARSITY_STATUS //------------------------------------------------------------ // GrB_get/GrB_set for GrB_Matrix: @@ -1470,21 +1453,6 @@ typedef enum } GxB_JIT_Control ; -// GxB_FORMAT is historical, but it can be by row or by column: -typedef enum -{ - GxB_BY_ROW = 0, // CSR: compressed sparse row format - GxB_BY_COL = 1, // CSC: compressed sparse column format - GxB_NO_FORMAT = -1 // format not defined -} -GxB_Format_Value ; - -// The default format is by row. These constants are defined as GB_GLOBAL -// const, so that if SuiteSparse:GraphBLAS is recompiled with a different -// default format, and the application is relinked but not recompiled, it will -// acquire the new default values. -GB_GLOBAL const GxB_Format_Value GxB_FORMAT_DEFAULT ; - // the default hyper_switch parameter GB_GLOBAL const double GxB_HYPER_DEFAULT ; @@ -1637,7 +1605,8 @@ typedef enum // SuiteSparse extensions: //-------------------------------------------------------------------------- - // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, and GrB_IndexUnaryOp: + // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, + // and GxB_IndexBinaryOp GxB_JIT_C_NAME = 7041, // C type or function name GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition @@ -1649,6 +1618,13 @@ typedef enum // GrB_Semiring only: GxB_SEMIRING_MONOID = 7046, // semiring monoid GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op + + // GrB_BinaryOp and GxB_IndexBinaryOp: + GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops + GxB_THETA_TYPE_STRING = 7051, + + // GrB_BinaryOp or GrB_Semiring: + GxB_THETA = 7052, // to get the value of theta } GrB_Field ; @@ -1728,18 +1704,6 @@ GB_GLOBAL GrB_Monoid // 10 MIN monoids: (not for complex types) //-------------------------------------------------------------------------- - // GxB_MIN monoids, historical, use GrB_MIN_MONOID_* instead: - GxB_MIN_INT8_MONOID, // identity: INT8_MAX terminal: INT8_MIN - GxB_MIN_INT16_MONOID, // identity: INT16_MAX terminal: INT16_MIN - GxB_MIN_INT32_MONOID, // identity: INT32_MAX terminal: INT32_MIN - GxB_MIN_INT64_MONOID, // identity: INT64_MAX terminal: INT32_MIN - GxB_MIN_UINT8_MONOID, // identity: UINT8_MAX terminal: 0 - GxB_MIN_UINT16_MONOID, // identity: UINT16_MAX terminal: 0 - GxB_MIN_UINT32_MONOID, // identity: UINT32_MAX terminal: 0 - GxB_MIN_UINT64_MONOID, // identity: UINT64_MAX terminal: 0 - GxB_MIN_FP32_MONOID, // identity: INFINITY terminal: -INFINITY - GxB_MIN_FP64_MONOID, // identity: INFINITY terminal: -INFINITY - // preferred names from the v1.3 spec: GrB_MIN_MONOID_INT8, // identity: INT8_MAX terminal: INT8_MIN GrB_MIN_MONOID_INT16, // identity: INT16_MAX terminal: INT16_MIN @@ -1756,18 +1720,6 @@ GB_GLOBAL GrB_Monoid // 10 MAX monoids: //-------------------------------------------------------------------------- - // GxB_MAX monoids, historical, use GrB_MAX_MONOID_* instead: - GxB_MAX_INT8_MONOID, // identity: INT8_MIN terminal: INT8_MAX - GxB_MAX_INT16_MONOID, // identity: INT16_MIN terminal: INT16_MAX - GxB_MAX_INT32_MONOID, // identity: INT32_MIN terminal: INT32_MAX - GxB_MAX_INT64_MONOID, // identity: INT64_MIN terminal: INT64_MAX - GxB_MAX_UINT8_MONOID, // identity: 0 terminal: UINT8_MAX - GxB_MAX_UINT16_MONOID, // identity: 0 terminal: UINT16_MAX - GxB_MAX_UINT32_MONOID, // identity: 0 terminal: UINT32_MAX - GxB_MAX_UINT64_MONOID, // identity: 0 terminal: UINT64_MAX - GxB_MAX_FP32_MONOID, // identity: -INFINITY terminal: INFINITY - GxB_MAX_FP64_MONOID, // identity: -INFINITY terminal: INFINITY - // preferred names from the v1.3 spec: GrB_MAX_MONOID_INT8, // identity: INT8_MIN terminal: INT8_MAX GrB_MAX_MONOID_INT16, // identity: INT16_MIN terminal: INT16_MAX @@ -1784,18 +1736,6 @@ GB_GLOBAL GrB_Monoid // 12 PLUS monoids: //-------------------------------------------------------------------------- - // GxB_PLUS monoids, historical, use GrB_PLUS_MONOID_* instead: - GxB_PLUS_INT8_MONOID, // identity: 0 - GxB_PLUS_INT16_MONOID, // identity: 0 - GxB_PLUS_INT32_MONOID, // identity: 0 - GxB_PLUS_INT64_MONOID, // identity: 0 - GxB_PLUS_UINT8_MONOID, // identity: 0 - GxB_PLUS_UINT16_MONOID, // identity: 0 - GxB_PLUS_UINT32_MONOID, // identity: 0 - GxB_PLUS_UINT64_MONOID, // identity: 0 - GxB_PLUS_FP32_MONOID, // identity: 0 - GxB_PLUS_FP64_MONOID, // identity: 0 - // preferred names from the v1.3 spec: GrB_PLUS_MONOID_INT8, // identity: 0 GrB_PLUS_MONOID_INT16, // identity: 0 @@ -1816,18 +1756,6 @@ GB_GLOBAL GrB_Monoid // 12 TIMES monoids: identity value is 1, int* and uint* are terminal //-------------------------------------------------------------------------- - // GxB_TIMES monoids, historical, use GrB_TIMES_MONOID_* instead: - GxB_TIMES_INT8_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_INT16_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_INT32_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_INT64_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_UINT8_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_UINT16_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_UINT32_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_UINT64_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_FP32_MONOID, // identity: 1 - GxB_TIMES_FP64_MONOID, // identity: 1 - // preferred names from the v1.3 spec: GrB_TIMES_MONOID_INT8, // identity: 1 terminal: 0 GrB_TIMES_MONOID_INT16, // identity: 1 terminal: 0 @@ -1866,13 +1794,6 @@ GB_GLOBAL GrB_Monoid // 4 Boolean monoids: (see also the GxB_ANY_BOOL_MONOID above) //-------------------------------------------------------------------------- - // GxB_* boolean monoids, historical, use GrB_* instead: - GxB_LOR_BOOL_MONOID, // identity: false terminal: true - GxB_LAND_BOOL_MONOID, // identity: true terminal: false - GxB_LXOR_BOOL_MONOID, // identity: false - GxB_LXNOR_BOOL_MONOID, // identity: true - GxB_EQ_BOOL_MONOID, // (another name for GrB_LXNOR_MONOID_BOOL) - // preferred names from the v1.3 spec: GrB_LOR_MONOID_BOOL, // identity: false terminal: true GrB_LAND_MONOID_BOOL, // identity: true terminal: false @@ -1981,7 +1902,7 @@ GB_GLOBAL GrB_Monoid // with ANY as the multiply operator, but they are not predefined below. // Likewise, additional built-in operators can be used as multiplicative -// operators for floating-point semirings (POW, ATAN2, HYPOT, ...) and many +// operators for floating-point semirings (POW, ATAN2, HYPOT, etc) and many // more semirings can be constructed from bitwise monoids and many integer // binary (non-bitwise) multiplicative operators, but these are not // pre-defined. @@ -1999,6 +1920,8 @@ GB_GLOBAL GrB_Monoid // identical, as are FIRSTJ1 and SECONDI1. These semirings still appear as // predefined, for convenience. +// 124 of the GxB_* semirings are now superceded by GrB_* semirings. + GB_GLOBAL GrB_Semiring //------------------------------------------------------------------------------ @@ -2006,28 +1929,28 @@ GB_GLOBAL GrB_Semiring //------------------------------------------------------------------------------ // semirings with multiply op: z = FIRST (x,y), all types x,y,z the same: - GxB_MIN_FIRST_INT8 , GxB_MAX_FIRST_INT8 , GxB_PLUS_FIRST_INT8 , GxB_TIMES_FIRST_INT8 , GxB_ANY_FIRST_INT8 , - GxB_MIN_FIRST_INT16 , GxB_MAX_FIRST_INT16 , GxB_PLUS_FIRST_INT16 , GxB_TIMES_FIRST_INT16 , GxB_ANY_FIRST_INT16 , - GxB_MIN_FIRST_INT32 , GxB_MAX_FIRST_INT32 , GxB_PLUS_FIRST_INT32 , GxB_TIMES_FIRST_INT32 , GxB_ANY_FIRST_INT32 , - GxB_MIN_FIRST_INT64 , GxB_MAX_FIRST_INT64 , GxB_PLUS_FIRST_INT64 , GxB_TIMES_FIRST_INT64 , GxB_ANY_FIRST_INT64 , - GxB_MIN_FIRST_UINT8 , GxB_MAX_FIRST_UINT8 , GxB_PLUS_FIRST_UINT8 , GxB_TIMES_FIRST_UINT8 , GxB_ANY_FIRST_UINT8 , - GxB_MIN_FIRST_UINT16 , GxB_MAX_FIRST_UINT16 , GxB_PLUS_FIRST_UINT16 , GxB_TIMES_FIRST_UINT16 , GxB_ANY_FIRST_UINT16 , - GxB_MIN_FIRST_UINT32 , GxB_MAX_FIRST_UINT32 , GxB_PLUS_FIRST_UINT32 , GxB_TIMES_FIRST_UINT32 , GxB_ANY_FIRST_UINT32 , - GxB_MIN_FIRST_UINT64 , GxB_MAX_FIRST_UINT64 , GxB_PLUS_FIRST_UINT64 , GxB_TIMES_FIRST_UINT64 , GxB_ANY_FIRST_UINT64 , - GxB_MIN_FIRST_FP32 , GxB_MAX_FIRST_FP32 , GxB_PLUS_FIRST_FP32 , GxB_TIMES_FIRST_FP32 , GxB_ANY_FIRST_FP32 , - GxB_MIN_FIRST_FP64 , GxB_MAX_FIRST_FP64 , GxB_PLUS_FIRST_FP64 , GxB_TIMES_FIRST_FP64 , GxB_ANY_FIRST_FP64 , + GxB_PLUS_FIRST_INT8 , GxB_TIMES_FIRST_INT8 , GxB_ANY_FIRST_INT8 , + GxB_MAX_FIRST_INT16 , GxB_PLUS_FIRST_INT16 , GxB_TIMES_FIRST_INT16 , GxB_ANY_FIRST_INT16 , + GxB_MAX_FIRST_INT32 , GxB_PLUS_FIRST_INT32 , GxB_TIMES_FIRST_INT32 , GxB_ANY_FIRST_INT32 , + GxB_MAX_FIRST_INT64 , GxB_PLUS_FIRST_INT64 , GxB_TIMES_FIRST_INT64 , GxB_ANY_FIRST_INT64 , + GxB_MAX_FIRST_UINT8 , GxB_PLUS_FIRST_UINT8 , GxB_TIMES_FIRST_UINT8 , GxB_ANY_FIRST_UINT8 , + GxB_MAX_FIRST_UINT16 , GxB_PLUS_FIRST_UINT16 , GxB_TIMES_FIRST_UINT16 , GxB_ANY_FIRST_UINT16 , + GxB_MAX_FIRST_UINT32 , GxB_PLUS_FIRST_UINT32 , GxB_TIMES_FIRST_UINT32 , GxB_ANY_FIRST_UINT32 , + GxB_MAX_FIRST_UINT64 , GxB_PLUS_FIRST_UINT64 , GxB_TIMES_FIRST_UINT64 , GxB_ANY_FIRST_UINT64 , + GxB_MAX_FIRST_FP32 , GxB_PLUS_FIRST_FP32 , GxB_TIMES_FIRST_FP32 , GxB_ANY_FIRST_FP32 , + GxB_MAX_FIRST_FP64 , GxB_PLUS_FIRST_FP64 , GxB_TIMES_FIRST_FP64 , GxB_ANY_FIRST_FP64 , // semirings with multiply op: z = SECOND (x,y), all types x,y,z the same: - GxB_MIN_SECOND_INT8 , GxB_MAX_SECOND_INT8 , GxB_PLUS_SECOND_INT8 , GxB_TIMES_SECOND_INT8 , GxB_ANY_SECOND_INT8 , - GxB_MIN_SECOND_INT16 , GxB_MAX_SECOND_INT16 , GxB_PLUS_SECOND_INT16 , GxB_TIMES_SECOND_INT16 , GxB_ANY_SECOND_INT16 , - GxB_MIN_SECOND_INT32 , GxB_MAX_SECOND_INT32 , GxB_PLUS_SECOND_INT32 , GxB_TIMES_SECOND_INT32 , GxB_ANY_SECOND_INT32 , - GxB_MIN_SECOND_INT64 , GxB_MAX_SECOND_INT64 , GxB_PLUS_SECOND_INT64 , GxB_TIMES_SECOND_INT64 , GxB_ANY_SECOND_INT64 , - GxB_MIN_SECOND_UINT8 , GxB_MAX_SECOND_UINT8 , GxB_PLUS_SECOND_UINT8 , GxB_TIMES_SECOND_UINT8 , GxB_ANY_SECOND_UINT8 , - GxB_MIN_SECOND_UINT16 , GxB_MAX_SECOND_UINT16 , GxB_PLUS_SECOND_UINT16 , GxB_TIMES_SECOND_UINT16, GxB_ANY_SECOND_UINT16 , - GxB_MIN_SECOND_UINT32 , GxB_MAX_SECOND_UINT32 , GxB_PLUS_SECOND_UINT32 , GxB_TIMES_SECOND_UINT32, GxB_ANY_SECOND_UINT32 , - GxB_MIN_SECOND_UINT64 , GxB_MAX_SECOND_UINT64 , GxB_PLUS_SECOND_UINT64 , GxB_TIMES_SECOND_UINT64, GxB_ANY_SECOND_UINT64 , - GxB_MIN_SECOND_FP32 , GxB_MAX_SECOND_FP32 , GxB_PLUS_SECOND_FP32 , GxB_TIMES_SECOND_FP32 , GxB_ANY_SECOND_FP32 , - GxB_MIN_SECOND_FP64 , GxB_MAX_SECOND_FP64 , GxB_PLUS_SECOND_FP64 , GxB_TIMES_SECOND_FP64 , GxB_ANY_SECOND_FP64 , + GxB_PLUS_SECOND_INT8 , GxB_TIMES_SECOND_INT8 , GxB_ANY_SECOND_INT8 , + GxB_PLUS_SECOND_INT16 , GxB_TIMES_SECOND_INT16 , GxB_ANY_SECOND_INT16 , + GxB_PLUS_SECOND_INT32 , GxB_TIMES_SECOND_INT32 , GxB_ANY_SECOND_INT32 , + GxB_PLUS_SECOND_INT64 , GxB_TIMES_SECOND_INT64 , GxB_ANY_SECOND_INT64 , + GxB_PLUS_SECOND_UINT8 , GxB_TIMES_SECOND_UINT8 , GxB_ANY_SECOND_UINT8 , + GxB_PLUS_SECOND_UINT16 , GxB_TIMES_SECOND_UINT16, GxB_ANY_SECOND_UINT16 , + GxB_PLUS_SECOND_UINT32 , GxB_TIMES_SECOND_UINT32, GxB_ANY_SECOND_UINT32 , + GxB_PLUS_SECOND_UINT64 , GxB_TIMES_SECOND_UINT64, GxB_ANY_SECOND_UINT64 , + GxB_PLUS_SECOND_FP32 , GxB_TIMES_SECOND_FP32 , GxB_ANY_SECOND_FP32 , + GxB_PLUS_SECOND_FP64 , GxB_TIMES_SECOND_FP64 , GxB_ANY_SECOND_FP64 , // semirings with multiply op: z = PAIR (x,y), all types x,y,z the same: // (note that min_pair, max_pair, times_pair are all identical to any_pair, and are marked below) @@ -2043,40 +1966,40 @@ GB_GLOBAL GrB_Semiring GxB_MIN_PAIR_FP64 /**/, GxB_MAX_PAIR_FP64 /**/, GxB_PLUS_PAIR_FP64 , GxB_TIMES_PAIR_FP64 /**/, GxB_ANY_PAIR_FP64 , // semirings with multiply op: z = MIN (x,y), all types x,y,z the same: - GxB_MIN_MIN_INT8 , GxB_MAX_MIN_INT8 , GxB_PLUS_MIN_INT8 , GxB_TIMES_MIN_INT8 , GxB_ANY_MIN_INT8 , - GxB_MIN_MIN_INT16 , GxB_MAX_MIN_INT16 , GxB_PLUS_MIN_INT16 , GxB_TIMES_MIN_INT16 , GxB_ANY_MIN_INT16 , - GxB_MIN_MIN_INT32 , GxB_MAX_MIN_INT32 , GxB_PLUS_MIN_INT32 , GxB_TIMES_MIN_INT32 , GxB_ANY_MIN_INT32 , - GxB_MIN_MIN_INT64 , GxB_MAX_MIN_INT64 , GxB_PLUS_MIN_INT64 , GxB_TIMES_MIN_INT64 , GxB_ANY_MIN_INT64 , - GxB_MIN_MIN_UINT8 , GxB_MAX_MIN_UINT8 , GxB_PLUS_MIN_UINT8 , GxB_TIMES_MIN_UINT8 , GxB_ANY_MIN_UINT8 , - GxB_MIN_MIN_UINT16 , GxB_MAX_MIN_UINT16 , GxB_PLUS_MIN_UINT16 , GxB_TIMES_MIN_UINT16 , GxB_ANY_MIN_UINT16 , - GxB_MIN_MIN_UINT32 , GxB_MAX_MIN_UINT32 , GxB_PLUS_MIN_UINT32 , GxB_TIMES_MIN_UINT32 , GxB_ANY_MIN_UINT32 , - GxB_MIN_MIN_UINT64 , GxB_MAX_MIN_UINT64 , GxB_PLUS_MIN_UINT64 , GxB_TIMES_MIN_UINT64 , GxB_ANY_MIN_UINT64 , - GxB_MIN_MIN_FP32 , GxB_MAX_MIN_FP32 , GxB_PLUS_MIN_FP32 , GxB_TIMES_MIN_FP32 , GxB_ANY_MIN_FP32 , - GxB_MIN_MIN_FP64 , GxB_MAX_MIN_FP64 , GxB_PLUS_MIN_FP64 , GxB_TIMES_MIN_FP64 , GxB_ANY_MIN_FP64 , + GxB_MIN_MIN_INT8 , GxB_TIMES_MIN_INT8 , GxB_ANY_MIN_INT8 , + GxB_MIN_MIN_INT16 , GxB_TIMES_MIN_INT16 , GxB_ANY_MIN_INT16 , + GxB_MIN_MIN_INT32 , GxB_TIMES_MIN_INT32 , GxB_ANY_MIN_INT32 , + GxB_MIN_MIN_INT64 , GxB_TIMES_MIN_INT64 , GxB_ANY_MIN_INT64 , + GxB_MIN_MIN_UINT8 , GxB_TIMES_MIN_UINT8 , GxB_ANY_MIN_UINT8 , + GxB_MIN_MIN_UINT16 , GxB_TIMES_MIN_UINT16 , GxB_ANY_MIN_UINT16 , + GxB_MIN_MIN_UINT32 , GxB_TIMES_MIN_UINT32 , GxB_ANY_MIN_UINT32 , + GxB_MIN_MIN_UINT64 , GxB_TIMES_MIN_UINT64 , GxB_ANY_MIN_UINT64 , + GxB_MIN_MIN_FP32 , GxB_TIMES_MIN_FP32 , GxB_ANY_MIN_FP32 , + GxB_MIN_MIN_FP64 , GxB_TIMES_MIN_FP64 , GxB_ANY_MIN_FP64 , // semirings with multiply op: z = MAX (x,y), all types x,y,z the same: - GxB_MIN_MAX_INT8 , GxB_MAX_MAX_INT8 , GxB_PLUS_MAX_INT8 , GxB_TIMES_MAX_INT8 , GxB_ANY_MAX_INT8 , - GxB_MIN_MAX_INT16 , GxB_MAX_MAX_INT16 , GxB_PLUS_MAX_INT16 , GxB_TIMES_MAX_INT16 , GxB_ANY_MAX_INT16 , - GxB_MIN_MAX_INT32 , GxB_MAX_MAX_INT32 , GxB_PLUS_MAX_INT32 , GxB_TIMES_MAX_INT32 , GxB_ANY_MAX_INT32 , - GxB_MIN_MAX_INT64 , GxB_MAX_MAX_INT64 , GxB_PLUS_MAX_INT64 , GxB_TIMES_MAX_INT64 , GxB_ANY_MAX_INT64 , - GxB_MIN_MAX_UINT8 , GxB_MAX_MAX_UINT8 , GxB_PLUS_MAX_UINT8 , GxB_TIMES_MAX_UINT8 , GxB_ANY_MAX_UINT8 , - GxB_MIN_MAX_UINT16 , GxB_MAX_MAX_UINT16 , GxB_PLUS_MAX_UINT16 , GxB_TIMES_MAX_UINT16 , GxB_ANY_MAX_UINT16 , - GxB_MIN_MAX_UINT32 , GxB_MAX_MAX_UINT32 , GxB_PLUS_MAX_UINT32 , GxB_TIMES_MAX_UINT32 , GxB_ANY_MAX_UINT32 , - GxB_MIN_MAX_UINT64 , GxB_MAX_MAX_UINT64 , GxB_PLUS_MAX_UINT64 , GxB_TIMES_MAX_UINT64 , GxB_ANY_MAX_UINT64 , - GxB_MIN_MAX_FP32 , GxB_MAX_MAX_FP32 , GxB_PLUS_MAX_FP32 , GxB_TIMES_MAX_FP32 , GxB_ANY_MAX_FP32 , - GxB_MIN_MAX_FP64 , GxB_MAX_MAX_FP64 , GxB_PLUS_MAX_FP64 , GxB_TIMES_MAX_FP64 , GxB_ANY_MAX_FP64 , + GxB_MAX_MAX_INT8 , GxB_PLUS_MAX_INT8 , GxB_TIMES_MAX_INT8 , GxB_ANY_MAX_INT8 , + GxB_MAX_MAX_INT16 , GxB_PLUS_MAX_INT16 , GxB_TIMES_MAX_INT16 , GxB_ANY_MAX_INT16 , + GxB_MAX_MAX_INT32 , GxB_PLUS_MAX_INT32 , GxB_TIMES_MAX_INT32 , GxB_ANY_MAX_INT32 , + GxB_MAX_MAX_INT64 , GxB_PLUS_MAX_INT64 , GxB_TIMES_MAX_INT64 , GxB_ANY_MAX_INT64 , + GxB_MAX_MAX_UINT8 , GxB_PLUS_MAX_UINT8 , GxB_TIMES_MAX_UINT8 , GxB_ANY_MAX_UINT8 , + GxB_MAX_MAX_UINT16 , GxB_PLUS_MAX_UINT16 , GxB_TIMES_MAX_UINT16 , GxB_ANY_MAX_UINT16 , + GxB_MAX_MAX_UINT32 , GxB_PLUS_MAX_UINT32 , GxB_TIMES_MAX_UINT32 , GxB_ANY_MAX_UINT32 , + GxB_MAX_MAX_UINT64 , GxB_PLUS_MAX_UINT64 , GxB_TIMES_MAX_UINT64 , GxB_ANY_MAX_UINT64 , + GxB_MAX_MAX_FP32 , GxB_PLUS_MAX_FP32 , GxB_TIMES_MAX_FP32 , GxB_ANY_MAX_FP32 , + GxB_MAX_MAX_FP64 , GxB_PLUS_MAX_FP64 , GxB_TIMES_MAX_FP64 , GxB_ANY_MAX_FP64 , // semirings with multiply op: z = PLUS (x,y), all types x,y,z the same: - GxB_MIN_PLUS_INT8 , GxB_MAX_PLUS_INT8 , GxB_PLUS_PLUS_INT8 , GxB_TIMES_PLUS_INT8 , GxB_ANY_PLUS_INT8 , - GxB_MIN_PLUS_INT16 , GxB_MAX_PLUS_INT16 , GxB_PLUS_PLUS_INT16 , GxB_TIMES_PLUS_INT16 , GxB_ANY_PLUS_INT16 , - GxB_MIN_PLUS_INT32 , GxB_MAX_PLUS_INT32 , GxB_PLUS_PLUS_INT32 , GxB_TIMES_PLUS_INT32 , GxB_ANY_PLUS_INT32 , - GxB_MIN_PLUS_INT64 , GxB_MAX_PLUS_INT64 , GxB_PLUS_PLUS_INT64 , GxB_TIMES_PLUS_INT64 , GxB_ANY_PLUS_INT64 , - GxB_MIN_PLUS_UINT8 , GxB_MAX_PLUS_UINT8 , GxB_PLUS_PLUS_UINT8 , GxB_TIMES_PLUS_UINT8 , GxB_ANY_PLUS_UINT8 , - GxB_MIN_PLUS_UINT16 , GxB_MAX_PLUS_UINT16 , GxB_PLUS_PLUS_UINT16 , GxB_TIMES_PLUS_UINT16 , GxB_ANY_PLUS_UINT16 , - GxB_MIN_PLUS_UINT32 , GxB_MAX_PLUS_UINT32 , GxB_PLUS_PLUS_UINT32 , GxB_TIMES_PLUS_UINT32 , GxB_ANY_PLUS_UINT32 , - GxB_MIN_PLUS_UINT64 , GxB_MAX_PLUS_UINT64 , GxB_PLUS_PLUS_UINT64 , GxB_TIMES_PLUS_UINT64 , GxB_ANY_PLUS_UINT64 , - GxB_MIN_PLUS_FP32 , GxB_MAX_PLUS_FP32 , GxB_PLUS_PLUS_FP32 , GxB_TIMES_PLUS_FP32 , GxB_ANY_PLUS_FP32 , - GxB_MIN_PLUS_FP64 , GxB_MAX_PLUS_FP64 , GxB_PLUS_PLUS_FP64 , GxB_TIMES_PLUS_FP64 , GxB_ANY_PLUS_FP64 , + GxB_PLUS_PLUS_INT8 , GxB_TIMES_PLUS_INT8 , GxB_ANY_PLUS_INT8 , + GxB_PLUS_PLUS_INT16 , GxB_TIMES_PLUS_INT16 , GxB_ANY_PLUS_INT16 , + GxB_PLUS_PLUS_INT32 , GxB_TIMES_PLUS_INT32 , GxB_ANY_PLUS_INT32 , + GxB_PLUS_PLUS_INT64 , GxB_TIMES_PLUS_INT64 , GxB_ANY_PLUS_INT64 , + GxB_PLUS_PLUS_UINT8 , GxB_TIMES_PLUS_UINT8 , GxB_ANY_PLUS_UINT8 , + GxB_PLUS_PLUS_UINT16 , GxB_TIMES_PLUS_UINT16 , GxB_ANY_PLUS_UINT16 , + GxB_PLUS_PLUS_UINT32 , GxB_TIMES_PLUS_UINT32 , GxB_ANY_PLUS_UINT32 , + GxB_PLUS_PLUS_UINT64 , GxB_TIMES_PLUS_UINT64 , GxB_ANY_PLUS_UINT64 , + GxB_PLUS_PLUS_FP32 , GxB_TIMES_PLUS_FP32 , GxB_ANY_PLUS_FP32 , + GxB_PLUS_PLUS_FP64 , GxB_TIMES_PLUS_FP64 , GxB_ANY_PLUS_FP64 , // semirings with multiply op: z = MINUS (x,y), all types x,y,z the same: GxB_MIN_MINUS_INT8 , GxB_MAX_MINUS_INT8 , GxB_PLUS_MINUS_INT8 , GxB_TIMES_MINUS_INT8 , GxB_ANY_MINUS_INT8 , @@ -2091,16 +2014,16 @@ GB_GLOBAL GrB_Semiring GxB_MIN_MINUS_FP64 , GxB_MAX_MINUS_FP64 , GxB_PLUS_MINUS_FP64 , GxB_TIMES_MINUS_FP64 , GxB_ANY_MINUS_FP64 , // semirings with multiply op: z = TIMES (x,y), all types x,y,z the same: - GxB_MIN_TIMES_INT8 , GxB_MAX_TIMES_INT8 , GxB_PLUS_TIMES_INT8 , GxB_TIMES_TIMES_INT8 , GxB_ANY_TIMES_INT8 , - GxB_MIN_TIMES_INT16 , GxB_MAX_TIMES_INT16 , GxB_PLUS_TIMES_INT16 , GxB_TIMES_TIMES_INT16 , GxB_ANY_TIMES_INT16 , - GxB_MIN_TIMES_INT32 , GxB_MAX_TIMES_INT32 , GxB_PLUS_TIMES_INT32 , GxB_TIMES_TIMES_INT32 , GxB_ANY_TIMES_INT32 , - GxB_MIN_TIMES_INT64 , GxB_MAX_TIMES_INT64 , GxB_PLUS_TIMES_INT64 , GxB_TIMES_TIMES_INT64 , GxB_ANY_TIMES_INT64 , - GxB_MIN_TIMES_UINT8 , GxB_MAX_TIMES_UINT8 , GxB_PLUS_TIMES_UINT8 , GxB_TIMES_TIMES_UINT8 , GxB_ANY_TIMES_UINT8 , - GxB_MIN_TIMES_UINT16 , GxB_MAX_TIMES_UINT16 , GxB_PLUS_TIMES_UINT16 , GxB_TIMES_TIMES_UINT16 , GxB_ANY_TIMES_UINT16 , - GxB_MIN_TIMES_UINT32 , GxB_MAX_TIMES_UINT32 , GxB_PLUS_TIMES_UINT32 , GxB_TIMES_TIMES_UINT32 , GxB_ANY_TIMES_UINT32 , - GxB_MIN_TIMES_UINT64 , GxB_MAX_TIMES_UINT64 , GxB_PLUS_TIMES_UINT64 , GxB_TIMES_TIMES_UINT64 , GxB_ANY_TIMES_UINT64 , - GxB_MIN_TIMES_FP32 , GxB_MAX_TIMES_FP32 , GxB_PLUS_TIMES_FP32 , GxB_TIMES_TIMES_FP32 , GxB_ANY_TIMES_FP32 , - GxB_MIN_TIMES_FP64 , GxB_MAX_TIMES_FP64 , GxB_PLUS_TIMES_FP64 , GxB_TIMES_TIMES_FP64 , GxB_ANY_TIMES_FP64 , + GxB_TIMES_TIMES_INT8 , GxB_ANY_TIMES_INT8 , + GxB_TIMES_TIMES_INT16 , GxB_ANY_TIMES_INT16 , + GxB_TIMES_TIMES_INT32 , GxB_ANY_TIMES_INT32 , + GxB_TIMES_TIMES_INT64 , GxB_ANY_TIMES_INT64 , + GxB_TIMES_TIMES_UINT8 , GxB_ANY_TIMES_UINT8 , + GxB_TIMES_TIMES_UINT16 , GxB_ANY_TIMES_UINT16 , + GxB_TIMES_TIMES_UINT32 , GxB_ANY_TIMES_UINT32 , + GxB_TIMES_TIMES_UINT64 , GxB_ANY_TIMES_UINT64 , + GxB_TIMES_TIMES_FP32 , GxB_ANY_TIMES_FP32 , + GxB_TIMES_TIMES_FP64 , GxB_ANY_TIMES_FP64 , // semirings with multiply op: z = DIV (x,y), all types x,y,z the same: GxB_MIN_DIV_INT8 , GxB_MAX_DIV_INT8 , GxB_PLUS_DIV_INT8 , GxB_TIMES_DIV_INT8 , GxB_ANY_DIV_INT8 , @@ -2339,8 +2262,8 @@ GB_GLOBAL GrB_Semiring GxB_LOR_FIRST_BOOL , GxB_LAND_FIRST_BOOL , GxB_LXOR_FIRST_BOOL , GxB_EQ_FIRST_BOOL , GxB_ANY_FIRST_BOOL , GxB_LOR_SECOND_BOOL , GxB_LAND_SECOND_BOOL , GxB_LXOR_SECOND_BOOL , GxB_EQ_SECOND_BOOL , GxB_ANY_SECOND_BOOL , GxB_LOR_PAIR_BOOL/**/ , GxB_LAND_PAIR_BOOL/**/ , GxB_LXOR_PAIR_BOOL , GxB_EQ_PAIR_BOOL/**/ , GxB_ANY_PAIR_BOOL , - GxB_LOR_LOR_BOOL , GxB_LAND_LOR_BOOL , GxB_LXOR_LOR_BOOL , GxB_EQ_LOR_BOOL , GxB_ANY_LOR_BOOL , - GxB_LOR_LAND_BOOL , GxB_LAND_LAND_BOOL , GxB_LXOR_LAND_BOOL , GxB_EQ_LAND_BOOL , GxB_ANY_LAND_BOOL , + GxB_LOR_LOR_BOOL , GxB_LXOR_LOR_BOOL , GxB_ANY_LOR_BOOL , + GxB_LAND_LAND_BOOL , GxB_EQ_LAND_BOOL , GxB_ANY_LAND_BOOL , GxB_LOR_LXOR_BOOL , GxB_LAND_LXOR_BOOL , GxB_LXOR_LXOR_BOOL , GxB_EQ_LXOR_BOOL , GxB_ANY_LXOR_BOOL , GxB_LOR_EQ_BOOL , GxB_LAND_EQ_BOOL , GxB_LXOR_EQ_BOOL , GxB_EQ_EQ_BOOL , GxB_ANY_EQ_BOOL , GxB_LOR_GT_BOOL , GxB_LAND_GT_BOOL , GxB_LXOR_GT_BOOL , GxB_EQ_GT_BOOL , GxB_ANY_GT_BOOL , @@ -2473,12 +2396,6 @@ GB_GLOBAL GrB_Semiring // GrB_* semirings //------------------------------------------------------------------------------ -// The v1.3 C API for GraphBLAS adds the following 124 predefined semirings, -// with GrB_* names. They are identical to 124 GxB_* semirings defined above, -// with the same name, except that GrB_LXNOR_LOR_SEMIRING_BOOL is identical to -// GxB_EQ_LOR_BOOL (since GrB_EQ_BOOL == GrB_LXNOR). The old names are listed -// below alongside each new name; the new GrB_* names are preferred. - // 12 kinds of GrB_* semirings are available for all 10 real non-boolean types: // PLUS_TIMES, PLUS_MIN, @@ -2489,9 +2406,6 @@ GB_GLOBAL GrB_Semiring // LOR_LAND, LAND_LOR, LXOR_LAND, LXNOR_LOR. -// GxB_* semirings corresponding to the equivalent GrB_* semiring are -// historical. - GB_GLOBAL GrB_Semiring //-------------------------------------------------------------------------- @@ -2499,165 +2413,165 @@ GB_GLOBAL GrB_Semiring //-------------------------------------------------------------------------- // PLUS_TIMES semirings for all 10 real, non-boolean types: - GrB_PLUS_TIMES_SEMIRING_INT8, // GxB_PLUS_TIMES_INT8 - GrB_PLUS_TIMES_SEMIRING_INT16, // GxB_PLUS_TIMES_INT16 - GrB_PLUS_TIMES_SEMIRING_INT32, // GxB_PLUS_TIMES_INT32 - GrB_PLUS_TIMES_SEMIRING_INT64, // GxB_PLUS_TIMES_INT64 - GrB_PLUS_TIMES_SEMIRING_UINT8, // GxB_PLUS_TIMES_UINT8 - GrB_PLUS_TIMES_SEMIRING_UINT16, // GxB_PLUS_TIMES_UINT16 - GrB_PLUS_TIMES_SEMIRING_UINT32, // GxB_PLUS_TIMES_UINT32 - GrB_PLUS_TIMES_SEMIRING_UINT64, // GxB_PLUS_TIMES_UINT64 - GrB_PLUS_TIMES_SEMIRING_FP32, // GxB_PLUS_TIMES_FP32 - GrB_PLUS_TIMES_SEMIRING_FP64, // GxB_PLUS_TIMES_FP64 + GrB_PLUS_TIMES_SEMIRING_INT8, + GrB_PLUS_TIMES_SEMIRING_INT16, + GrB_PLUS_TIMES_SEMIRING_INT32, + GrB_PLUS_TIMES_SEMIRING_INT64, + GrB_PLUS_TIMES_SEMIRING_UINT8, + GrB_PLUS_TIMES_SEMIRING_UINT16, + GrB_PLUS_TIMES_SEMIRING_UINT32, + GrB_PLUS_TIMES_SEMIRING_UINT64, + GrB_PLUS_TIMES_SEMIRING_FP32, + GrB_PLUS_TIMES_SEMIRING_FP64, // PLUS_MIN semirings for all 10 real, non-boolean types: - GrB_PLUS_MIN_SEMIRING_INT8, // GxB_PLUS_MIN_INT8 - GrB_PLUS_MIN_SEMIRING_INT16, // GxB_PLUS_MIN_INT16 - GrB_PLUS_MIN_SEMIRING_INT32, // GxB_PLUS_MIN_INT32 - GrB_PLUS_MIN_SEMIRING_INT64, // GxB_PLUS_MIN_INT64 - GrB_PLUS_MIN_SEMIRING_UINT8, // GxB_PLUS_MIN_UINT8 - GrB_PLUS_MIN_SEMIRING_UINT16, // GxB_PLUS_MIN_UINT16 - GrB_PLUS_MIN_SEMIRING_UINT32, // GxB_PLUS_MIN_UINT32 - GrB_PLUS_MIN_SEMIRING_UINT64, // GxB_PLUS_MIN_UINT64 - GrB_PLUS_MIN_SEMIRING_FP32, // GxB_PLUS_MIN_FP32 - GrB_PLUS_MIN_SEMIRING_FP64, // GxB_PLUS_MIN_FP64 + GrB_PLUS_MIN_SEMIRING_INT8, + GrB_PLUS_MIN_SEMIRING_INT16, + GrB_PLUS_MIN_SEMIRING_INT32, + GrB_PLUS_MIN_SEMIRING_INT64, + GrB_PLUS_MIN_SEMIRING_UINT8, + GrB_PLUS_MIN_SEMIRING_UINT16, + GrB_PLUS_MIN_SEMIRING_UINT32, + GrB_PLUS_MIN_SEMIRING_UINT64, + GrB_PLUS_MIN_SEMIRING_FP32, + GrB_PLUS_MIN_SEMIRING_FP64, //-------------------------------------------------------------------------- // 50 semirings with MIN monoids //-------------------------------------------------------------------------- // MIN_PLUS semirings for all 10 real, non-boolean types: - GrB_MIN_PLUS_SEMIRING_INT8, // GxB_MIN_PLUS_INT8 - GrB_MIN_PLUS_SEMIRING_INT16, // GxB_MIN_PLUS_INT16 - GrB_MIN_PLUS_SEMIRING_INT32, // GxB_MIN_PLUS_INT32 - GrB_MIN_PLUS_SEMIRING_INT64, // GxB_MIN_PLUS_INT64 - GrB_MIN_PLUS_SEMIRING_UINT8, // GxB_MIN_PLUS_UINT8 - GrB_MIN_PLUS_SEMIRING_UINT16, // GxB_MIN_PLUS_UINT16 - GrB_MIN_PLUS_SEMIRING_UINT32, // GxB_MIN_PLUS_UINT32 - GrB_MIN_PLUS_SEMIRING_UINT64, // GxB_MIN_PLUS_UINT64 - GrB_MIN_PLUS_SEMIRING_FP32, // GxB_MIN_PLUS_FP32 - GrB_MIN_PLUS_SEMIRING_FP64, // GxB_MIN_PLUS_FP64 + GrB_MIN_PLUS_SEMIRING_INT8, + GrB_MIN_PLUS_SEMIRING_INT16, + GrB_MIN_PLUS_SEMIRING_INT32, + GrB_MIN_PLUS_SEMIRING_INT64, + GrB_MIN_PLUS_SEMIRING_UINT8, + GrB_MIN_PLUS_SEMIRING_UINT16, + GrB_MIN_PLUS_SEMIRING_UINT32, + GrB_MIN_PLUS_SEMIRING_UINT64, + GrB_MIN_PLUS_SEMIRING_FP32, + GrB_MIN_PLUS_SEMIRING_FP64, // MIN_TIMES semirings for all 10 real, non-boolean types: - GrB_MIN_TIMES_SEMIRING_INT8, // GxB_MIN_TIMES_INT8 - GrB_MIN_TIMES_SEMIRING_INT16, // GxB_MIN_TIMES_INT16 - GrB_MIN_TIMES_SEMIRING_INT32, // GxB_MIN_TIMES_INT32 - GrB_MIN_TIMES_SEMIRING_INT64, // GxB_MIN_TIMES_INT64 - GrB_MIN_TIMES_SEMIRING_UINT8, // GxB_MIN_TIMES_UINT8 - GrB_MIN_TIMES_SEMIRING_UINT16, // GxB_MIN_TIMES_UINT16 - GrB_MIN_TIMES_SEMIRING_UINT32, // GxB_MIN_TIMES_UINT32 - GrB_MIN_TIMES_SEMIRING_UINT64, // GxB_MIN_TIMES_UINT64 - GrB_MIN_TIMES_SEMIRING_FP32, // GxB_MIN_TIMES_FP32 - GrB_MIN_TIMES_SEMIRING_FP64, // GxB_MIN_TIMES_FP64 + GrB_MIN_TIMES_SEMIRING_INT8, + GrB_MIN_TIMES_SEMIRING_INT16, + GrB_MIN_TIMES_SEMIRING_INT32, + GrB_MIN_TIMES_SEMIRING_INT64, + GrB_MIN_TIMES_SEMIRING_UINT8, + GrB_MIN_TIMES_SEMIRING_UINT16, + GrB_MIN_TIMES_SEMIRING_UINT32, + GrB_MIN_TIMES_SEMIRING_UINT64, + GrB_MIN_TIMES_SEMIRING_FP32, + GrB_MIN_TIMES_SEMIRING_FP64, // MIN_FIRST semirings for all 10 real, non-boolean types: - GrB_MIN_FIRST_SEMIRING_INT8, // GxB_MIN_FIRST_INT8 - GrB_MIN_FIRST_SEMIRING_INT16, // GxB_MIN_FIRST_INT16 - GrB_MIN_FIRST_SEMIRING_INT32, // GxB_MIN_FIRST_INT32 - GrB_MIN_FIRST_SEMIRING_INT64, // GxB_MIN_FIRST_INT64 - GrB_MIN_FIRST_SEMIRING_UINT8, // GxB_MIN_FIRST_UINT8 - GrB_MIN_FIRST_SEMIRING_UINT16, // GxB_MIN_FIRST_UINT16 - GrB_MIN_FIRST_SEMIRING_UINT32, // GxB_MIN_FIRST_UINT32 - GrB_MIN_FIRST_SEMIRING_UINT64, // GxB_MIN_FIRST_UINT64 - GrB_MIN_FIRST_SEMIRING_FP32, // GxB_MIN_FIRST_FP32 - GrB_MIN_FIRST_SEMIRING_FP64, // GxB_MIN_FIRST_FP64 + GrB_MIN_FIRST_SEMIRING_INT8, + GrB_MIN_FIRST_SEMIRING_INT16, + GrB_MIN_FIRST_SEMIRING_INT32, + GrB_MIN_FIRST_SEMIRING_INT64, + GrB_MIN_FIRST_SEMIRING_UINT8, + GrB_MIN_FIRST_SEMIRING_UINT16, + GrB_MIN_FIRST_SEMIRING_UINT32, + GrB_MIN_FIRST_SEMIRING_UINT64, + GrB_MIN_FIRST_SEMIRING_FP32, + GrB_MIN_FIRST_SEMIRING_FP64, // MIN_SECOND semirings for all 10 real, non-boolean types: - GrB_MIN_SECOND_SEMIRING_INT8, // GxB_MIN_SECOND_INT8 - GrB_MIN_SECOND_SEMIRING_INT16, // GxB_MIN_SECOND_INT16 - GrB_MIN_SECOND_SEMIRING_INT32, // GxB_MIN_SECOND_INT32 - GrB_MIN_SECOND_SEMIRING_INT64, // GxB_MIN_SECOND_INT64 - GrB_MIN_SECOND_SEMIRING_UINT8, // GxB_MIN_SECOND_UINT8 - GrB_MIN_SECOND_SEMIRING_UINT16, // GxB_MIN_SECOND_UINT16 - GrB_MIN_SECOND_SEMIRING_UINT32, // GxB_MIN_SECOND_UINT32 - GrB_MIN_SECOND_SEMIRING_UINT64, // GxB_MIN_SECOND_UINT64 - GrB_MIN_SECOND_SEMIRING_FP32, // GxB_MIN_SECOND_FP32 - GrB_MIN_SECOND_SEMIRING_FP64, // GxB_MIN_SECOND_FP64 + GrB_MIN_SECOND_SEMIRING_INT8, + GrB_MIN_SECOND_SEMIRING_INT16, + GrB_MIN_SECOND_SEMIRING_INT32, + GrB_MIN_SECOND_SEMIRING_INT64, + GrB_MIN_SECOND_SEMIRING_UINT8, + GrB_MIN_SECOND_SEMIRING_UINT16, + GrB_MIN_SECOND_SEMIRING_UINT32, + GrB_MIN_SECOND_SEMIRING_UINT64, + GrB_MIN_SECOND_SEMIRING_FP32, + GrB_MIN_SECOND_SEMIRING_FP64, // MIN_MAX semirings for all 10 real, non-boolean types: - GrB_MIN_MAX_SEMIRING_INT8, // GxB_MIN_MAX_INT8 - GrB_MIN_MAX_SEMIRING_INT16, // GxB_MIN_MAX_INT16 - GrB_MIN_MAX_SEMIRING_INT32, // GxB_MIN_MAX_INT32 - GrB_MIN_MAX_SEMIRING_INT64, // GxB_MIN_MAX_INT64 - GrB_MIN_MAX_SEMIRING_UINT8, // GxB_MIN_MAX_UINT8 - GrB_MIN_MAX_SEMIRING_UINT16, // GxB_MIN_MAX_UINT16 - GrB_MIN_MAX_SEMIRING_UINT32, // GxB_MIN_MAX_UINT32 - GrB_MIN_MAX_SEMIRING_UINT64, // GxB_MIN_MAX_UINT64 - GrB_MIN_MAX_SEMIRING_FP32, // GxB_MIN_MAX_FP32 - GrB_MIN_MAX_SEMIRING_FP64, // GxB_MIN_MAX_FP64 + GrB_MIN_MAX_SEMIRING_INT8, + GrB_MIN_MAX_SEMIRING_INT16, + GrB_MIN_MAX_SEMIRING_INT32, + GrB_MIN_MAX_SEMIRING_INT64, + GrB_MIN_MAX_SEMIRING_UINT8, + GrB_MIN_MAX_SEMIRING_UINT16, + GrB_MIN_MAX_SEMIRING_UINT32, + GrB_MIN_MAX_SEMIRING_UINT64, + GrB_MIN_MAX_SEMIRING_FP32, + GrB_MIN_MAX_SEMIRING_FP64, //-------------------------------------------------------------------------- // 50 semirings with MAX monoids //-------------------------------------------------------------------------- // MAX_PLUS semirings for all 10 real, non-boolean types - GrB_MAX_PLUS_SEMIRING_INT8, // GxB_MAX_PLUS_INT8 - GrB_MAX_PLUS_SEMIRING_INT16, // GxB_MAX_PLUS_INT16 - GrB_MAX_PLUS_SEMIRING_INT32, // GxB_MAX_PLUS_INT32 - GrB_MAX_PLUS_SEMIRING_INT64, // GxB_MAX_PLUS_INT64 - GrB_MAX_PLUS_SEMIRING_UINT8, // GxB_MAX_PLUS_UINT8 - GrB_MAX_PLUS_SEMIRING_UINT16, // GxB_MAX_PLUS_UINT16 - GrB_MAX_PLUS_SEMIRING_UINT32, // GxB_MAX_PLUS_UINT32 - GrB_MAX_PLUS_SEMIRING_UINT64, // GxB_MAX_PLUS_UINT64 - GrB_MAX_PLUS_SEMIRING_FP32, // GxB_MAX_PLUS_FP32 - GrB_MAX_PLUS_SEMIRING_FP64, // GxB_MAX_PLUS_FP64 + GrB_MAX_PLUS_SEMIRING_INT8, + GrB_MAX_PLUS_SEMIRING_INT16, + GrB_MAX_PLUS_SEMIRING_INT32, + GrB_MAX_PLUS_SEMIRING_INT64, + GrB_MAX_PLUS_SEMIRING_UINT8, + GrB_MAX_PLUS_SEMIRING_UINT16, + GrB_MAX_PLUS_SEMIRING_UINT32, + GrB_MAX_PLUS_SEMIRING_UINT64, + GrB_MAX_PLUS_SEMIRING_FP32, + GrB_MAX_PLUS_SEMIRING_FP64, // MAX_TIMES semirings for all 10 real, non-boolean types: - GrB_MAX_TIMES_SEMIRING_INT8, // GxB_MAX_TIMES_INT8 - GrB_MAX_TIMES_SEMIRING_INT16, // GxB_MAX_TIMES_INT16 - GrB_MAX_TIMES_SEMIRING_INT32, // GxB_MAX_TIMES_INT32 - GrB_MAX_TIMES_SEMIRING_INT64, // GxB_MAX_TIMES_INT64 - GrB_MAX_TIMES_SEMIRING_UINT8, // GxB_MAX_TIMES_UINT8 - GrB_MAX_TIMES_SEMIRING_UINT16, // GxB_MAX_TIMES_UINT16 - GrB_MAX_TIMES_SEMIRING_UINT32, // GxB_MAX_TIMES_UINT32 - GrB_MAX_TIMES_SEMIRING_UINT64, // GxB_MAX_TIMES_UINT64 - GrB_MAX_TIMES_SEMIRING_FP32, // GxB_MAX_TIMES_FP32 - GrB_MAX_TIMES_SEMIRING_FP64, // GxB_MAX_TIMES_FP64 + GrB_MAX_TIMES_SEMIRING_INT8, + GrB_MAX_TIMES_SEMIRING_INT16, + GrB_MAX_TIMES_SEMIRING_INT32, + GrB_MAX_TIMES_SEMIRING_INT64, + GrB_MAX_TIMES_SEMIRING_UINT8, + GrB_MAX_TIMES_SEMIRING_UINT16, + GrB_MAX_TIMES_SEMIRING_UINT32, + GrB_MAX_TIMES_SEMIRING_UINT64, + GrB_MAX_TIMES_SEMIRING_FP32, + GrB_MAX_TIMES_SEMIRING_FP64, // MAX_FIRST semirings for all 10 real, non-boolean types: - GrB_MAX_FIRST_SEMIRING_INT8, // GxB_MAX_FIRST_INT8 - GrB_MAX_FIRST_SEMIRING_INT16, // GxB_MAX_FIRST_INT16 - GrB_MAX_FIRST_SEMIRING_INT32, // GxB_MAX_FIRST_INT32 - GrB_MAX_FIRST_SEMIRING_INT64, // GxB_MAX_FIRST_INT64 - GrB_MAX_FIRST_SEMIRING_UINT8, // GxB_MAX_FIRST_UINT8 - GrB_MAX_FIRST_SEMIRING_UINT16, // GxB_MAX_FIRST_UINT16 - GrB_MAX_FIRST_SEMIRING_UINT32, // GxB_MAX_FIRST_UINT32 - GrB_MAX_FIRST_SEMIRING_UINT64, // GxB_MAX_FIRST_UINT64 - GrB_MAX_FIRST_SEMIRING_FP32, // GxB_MAX_FIRST_FP32 - GrB_MAX_FIRST_SEMIRING_FP64, // GxB_MAX_FIRST_FP64 + GrB_MAX_FIRST_SEMIRING_INT8, + GrB_MAX_FIRST_SEMIRING_INT16, + GrB_MAX_FIRST_SEMIRING_INT32, + GrB_MAX_FIRST_SEMIRING_INT64, + GrB_MAX_FIRST_SEMIRING_UINT8, + GrB_MAX_FIRST_SEMIRING_UINT16, + GrB_MAX_FIRST_SEMIRING_UINT32, + GrB_MAX_FIRST_SEMIRING_UINT64, + GrB_MAX_FIRST_SEMIRING_FP32, + GrB_MAX_FIRST_SEMIRING_FP64, // MAX_SECOND semirings for all 10 real, non-boolean types: - GrB_MAX_SECOND_SEMIRING_INT8, // GxB_MAX_SECOND_INT8 - GrB_MAX_SECOND_SEMIRING_INT16, // GxB_MAX_SECOND_INT16 - GrB_MAX_SECOND_SEMIRING_INT32, // GxB_MAX_SECOND_INT32 - GrB_MAX_SECOND_SEMIRING_INT64, // GxB_MAX_SECOND_INT64 - GrB_MAX_SECOND_SEMIRING_UINT8, // GxB_MAX_SECOND_UINT8 - GrB_MAX_SECOND_SEMIRING_UINT16, // GxB_MAX_SECOND_UINT16 - GrB_MAX_SECOND_SEMIRING_UINT32, // GxB_MAX_SECOND_UINT32 - GrB_MAX_SECOND_SEMIRING_UINT64, // GxB_MAX_SECOND_UINT64 - GrB_MAX_SECOND_SEMIRING_FP32, // GxB_MAX_SECOND_FP32 - GrB_MAX_SECOND_SEMIRING_FP64, // GxB_MAX_SECOND_FP64 + GrB_MAX_SECOND_SEMIRING_INT8, + GrB_MAX_SECOND_SEMIRING_INT16, + GrB_MAX_SECOND_SEMIRING_INT32, + GrB_MAX_SECOND_SEMIRING_INT64, + GrB_MAX_SECOND_SEMIRING_UINT8, + GrB_MAX_SECOND_SEMIRING_UINT16, + GrB_MAX_SECOND_SEMIRING_UINT32, + GrB_MAX_SECOND_SEMIRING_UINT64, + GrB_MAX_SECOND_SEMIRING_FP32, + GrB_MAX_SECOND_SEMIRING_FP64, // MAX_MIN semirings for all 10 real, non-boolean types: - GrB_MAX_MIN_SEMIRING_INT8, // GxB_MAX_MIN_INT8 - GrB_MAX_MIN_SEMIRING_INT16, // GxB_MAX_MIN_INT16 - GrB_MAX_MIN_SEMIRING_INT32, // GxB_MAX_MIN_INT32 - GrB_MAX_MIN_SEMIRING_INT64, // GxB_MAX_MIN_INT64 - GrB_MAX_MIN_SEMIRING_UINT8, // GxB_MAX_MIN_UINT8 - GrB_MAX_MIN_SEMIRING_UINT16, // GxB_MAX_MIN_UINT16 - GrB_MAX_MIN_SEMIRING_UINT32, // GxB_MAX_MIN_UINT32 - GrB_MAX_MIN_SEMIRING_UINT64, // GxB_MAX_MIN_UINT64 - GrB_MAX_MIN_SEMIRING_FP32, // GxB_MAX_MIN_FP32 - GrB_MAX_MIN_SEMIRING_FP64, // GxB_MAX_MIN_FP64 + GrB_MAX_MIN_SEMIRING_INT8, + GrB_MAX_MIN_SEMIRING_INT16, + GrB_MAX_MIN_SEMIRING_INT32, + GrB_MAX_MIN_SEMIRING_INT64, + GrB_MAX_MIN_SEMIRING_UINT8, + GrB_MAX_MIN_SEMIRING_UINT16, + GrB_MAX_MIN_SEMIRING_UINT32, + GrB_MAX_MIN_SEMIRING_UINT64, + GrB_MAX_MIN_SEMIRING_FP32, + GrB_MAX_MIN_SEMIRING_FP64, //-------------------------------------------------------------------------- // 4 boolean semirings: //-------------------------------------------------------------------------- - GrB_LOR_LAND_SEMIRING_BOOL, // GxB_LOR_LAND_BOOL - GrB_LAND_LOR_SEMIRING_BOOL, // GxB_LAND_LOR_BOOL - GrB_LXOR_LAND_SEMIRING_BOOL, // GxB_LXOR_LAND_BOOL - GrB_LXNOR_LOR_SEMIRING_BOOL ; // GxB_EQ_LOR_BOOL (note EQ == LXNOR) + GrB_LOR_LAND_SEMIRING_BOOL, + GrB_LAND_LOR_SEMIRING_BOOL, + GrB_LXOR_LAND_SEMIRING_BOOL, + GrB_LXNOR_LOR_SEMIRING_BOOL ; //============================================================================== // GxB_fprint and GxB_print: print the contents of a GraphBLAS object @@ -2675,7 +2589,7 @@ typedef enum GxB_Print_Level ; //============================================================================== -// GrB import/export +// GrB_import/GrB_export //============================================================================== // The GrB C API specification supports 3 formats: @@ -2687,6 +2601,20 @@ typedef enum } GrB_Format ; +typedef enum +{ + GxB_BY_ROW = 0, // matrix is held by row + GxB_BY_COL = 1, // matrix is held by column + GxB_NO_FORMAT = -1 // row/column storage is not defined +} +GxB_Format_Value ; + +// The default format is by row. These constants are defined as GB_GLOBAL +// const, so that if SuiteSparse:GraphBLAS is recompiled with a different +// default format, and the application is relinked but not recompiled, it will +// acquire the new default values. +GB_GLOBAL const GxB_Format_Value GxB_FORMAT_DEFAULT ; + //============================================================================== // serialize/deserialize compression levels //============================================================================== @@ -2736,22 +2664,6 @@ GrB_Info GxB_init // start up GraphBLAS and also define malloc, etc GrB_Info GrB_finalize (void) ; // finish GraphBLAS -//============================================================================== -// GrB_getVersion: GraphBLAS 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 - unsigned int *subversion // returns GRB_SUBVERSION -) ; - //============================================================================== // GrB_Descriptor: the GraphBLAS descriptor //============================================================================== @@ -2761,16 +2673,6 @@ GrB_Info GrB_Descriptor_new // create a new descriptor GrB_Descriptor *descriptor // handle of descriptor to create ) ; -// 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 ( GrB_Descriptor *descriptor // handle of descriptor to free @@ -2873,10 +2775,6 @@ GrB_Info GxB_Type_new // create a new named GraphBLAS type const char *type_defn // typedef for the type (no max length) ) ; -// 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. @@ -2915,12 +2813,6 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator const char *unop_defn // definition of the user function ) ; -// 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 ( GrB_UnaryOp *unaryop // handle of unary operator to free @@ -2952,26 +2844,40 @@ GrB_Info GxB_BinaryOp_new const char *binop_defn // definition of the user function ) ; -// 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 ( GrB_BinaryOp *binaryop // handle of binary operator to free ) ; //============================================================================== -// GxB_SelectOp: select operators (DEPRECATED: do not use) +// GxB_IndexBinaryOp: index binary operators //============================================================================== -// historical; use GrB_select and GrB_IndexUnaryOp instead: -GrB_Info GxB_SelectOp_xtype (GrB_Type *xtype, GxB_SelectOp selectop) ; -GrB_Info GxB_SelectOp_ttype (GrB_Type *ttype, GxB_SelectOp selectop) ; +// GxB_IndexBinaryOp_new creates a new user-defined index binary op +GrB_Info GxB_IndexBinaryOp_new +( + GxB_IndexBinaryOp *op, // handle for the new index binary operator + GxB_index_binary_function function, // pointer to the index binary function + GrB_Type ztype, // type of output z + GrB_Type xtype, // type of input x + GrB_Type ytype, // type of input y + GrB_Type theta_type, // type of input theta + const char *idxbinop_name, // name of the user function + const char *idxbinop_defn // definition of the user function +) ; + +GrB_Info GxB_IndexBinaryOp_free // free a user-created index binary operator +( + GxB_IndexBinaryOp *op // handle of index binary operator to free +) ; + +// GxB_BinaryOp_new_IndexOp: create a new binary op from an index binary op +GrB_Info GxB_BinaryOp_new_IndexOp +( + GrB_BinaryOp *binop, // handle of binary op to create + GxB_IndexBinaryOp idxbinop, // based on this index binary op + GrB_Scalar theta // theta value to bind to the new binary op +) ; //============================================================================== // GrB_IndexUnaryOp: a unary operator that depends on the row/col indices @@ -2999,11 +2905,6 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp const char *idxop_defn // definition of the user function ) ; -// 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 ( GrB_IndexUnaryOp *op // handle of IndexUnary to free @@ -3013,6 +2914,9 @@ GrB_Info GrB_IndexUnaryOp_free // free a user-created IndexUnaryOp // GrB_Monoid //============================================================================== +// The GrB_BinaryOp must be associative and commutative (but this cannot be +// checked). It cannot be based on a GxB_IndexBinaryOp. + GrB_Info GrB_Monoid_new_BOOL // create a new boolean monoid ( GrB_Monoid *monoid, // handle of monoid to create @@ -3271,11 +3175,6 @@ GrB_Info GxB_Monoid_terminal_new // create a monoid (monoid, op, identity, terminal) #endif -// 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 ( GrB_Monoid *monoid // handle of monoid to free @@ -3285,6 +3184,9 @@ GrB_Info GrB_Monoid_free // free a user-created monoid // GrB_Semiring //============================================================================== +// The multiply op can be any GrB_BinaryOp, including those based on a +// GxB_IndexBinaryOp. + GrB_Info GrB_Semiring_new // create a semiring ( GrB_Semiring *semiring, // handle of semiring to create @@ -3292,10 +3194,6 @@ GrB_Info GrB_Semiring_new // create a semiring GrB_BinaryOp multiply // multiply operator of the semiring ) ; -// 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 ( GrB_Semiring *semiring // handle of semiring to free @@ -3331,10 +3229,6 @@ GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar 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 ( size_t *size, // # of bytes used by the scalar s @@ -3346,13 +3240,6 @@ GrB_Info GrB_Scalar_free // free a GrB_Scalar GrB_Scalar *s // handle of GrB_Scalar to free ) ; -// historical names identical to GrB_Scalar_methods above: -GrB_Info GxB_Scalar_new (GrB_Scalar *s, GrB_Type type) ; -GrB_Info GxB_Scalar_dup (GrB_Scalar *s, const GrB_Scalar t) ; -GrB_Info GxB_Scalar_clear (GrB_Scalar s) ; -GrB_Info GxB_Scalar_nvals (GrB_Index *nvals, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_free (GrB_Scalar *s) ; - //------------------------------------------------------------------------------ // GrB_Scalar_setElement //------------------------------------------------------------------------------ @@ -3444,20 +3331,6 @@ GrB_Info GrB_Scalar_setElement_UDT // s = x void *x // user scalar to assign to s ) ; -// historical names identical to GrB_Scalar_methods above: -GrB_Info GxB_Scalar_setElement_BOOL (GrB_Scalar s, bool x) ; -GrB_Info GxB_Scalar_setElement_INT8 (GrB_Scalar s, int8_t x) ; -GrB_Info GxB_Scalar_setElement_INT16 (GrB_Scalar s, int16_t x) ; -GrB_Info GxB_Scalar_setElement_INT32 (GrB_Scalar s, int32_t x) ; -GrB_Info GxB_Scalar_setElement_INT64 (GrB_Scalar s, int64_t x) ; -GrB_Info GxB_Scalar_setElement_UINT8 (GrB_Scalar s, uint8_t x) ; -GrB_Info GxB_Scalar_setElement_UINT16 (GrB_Scalar s, uint16_t x) ; -GrB_Info GxB_Scalar_setElement_UINT32 (GrB_Scalar s, uint32_t x) ; -GrB_Info GxB_Scalar_setElement_UINT64 (GrB_Scalar s, uint64_t x) ; -GrB_Info GxB_Scalar_setElement_FP32 (GrB_Scalar s, float x) ; -GrB_Info GxB_Scalar_setElement_FP64 (GrB_Scalar s, double x) ; -GrB_Info GxB_Scalar_setElement_UDT (GrB_Scalar s, void *x) ; - // Type-generic version: x can be any supported C type or void * for a // user-defined type. @@ -3477,9 +3350,6 @@ GrB_Info GrB_Scalar_setElement // s = x GB_CASES (GrB, Scalar_setElement) \ ) \ (s, x) - -// historical; use GrB_Scalar_setElement instead: -#define GxB_Scalar_setElement(s,x) GrB_Scalar_setElement (s, x) #endif //------------------------------------------------------------------------------ @@ -3573,20 +3443,6 @@ GrB_Info GrB_Scalar_extractElement_UDT // x = s const GrB_Scalar s // GrB_Scalar to extract an entry from ) ; -// historical names identical to GrB_Scalar_methods above: -GrB_Info GxB_Scalar_extractElement_BOOL (bool *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_INT8 (int8_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_INT16 (int16_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_INT32 (int32_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_INT64 (int64_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UINT8 (uint8_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UINT16 (uint16_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UINT32 (uint32_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UINT64 (uint64_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_FP32 (float *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_FP64 (double *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UDT (void *x, const GrB_Scalar s) ; - // Type-generic version: x can be a pointer to any supported C type or void * // for a user-defined type. @@ -3608,9 +3464,6 @@ GrB_Info GrB_Scalar_extractElement // x = s GB_PCASES (GrB, Scalar_extractElement) \ ) \ (x, s) - -// historical; use GrB_Scalar_extractElement instead: -#define GxB_Scalar_extractElement(x,s) GrB_Scalar_extractElement (x, s) #endif //============================================================================== @@ -3651,10 +3504,6 @@ GrB_Info GrB_Vector_nvals // get the number of entries in a vector 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 ( size_t *size, // # of bytes used by the vector v @@ -3679,6 +3528,8 @@ GrB_Info GrB_Vector_free // free a vector // GrB_Vector_build: w = sparse (I,1,X), but using any // associative operator to assemble duplicate entries. +// The dup operator cannot be based on a GxB_IndexBinaryOp. + GrB_Info GrB_Vector_build_BOOL // build a vector from (I,X) tuples ( GrB_Vector w, // vector to build @@ -4133,8 +3984,8 @@ GrB_Info GrB_Vector_removeElement // GrB_Vector_extractTuples //------------------------------------------------------------------------------ -// Extracts all tuples from a vector, like [I,~,X] = find (v). If -// any parameter I and/or X is NULL, then that component is not extracted. For +// Extracts all tuples from a vector, like [I,~,X] = find (v). If any +// parameter I and/or X is NULL, then that component is not extracted. For // example, to extract just the row indices, pass I as non-NULL, and X as NULL. // This is like [I,~,~] = find (v). @@ -4317,10 +4168,6 @@ GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix 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 ( size_t *size, // # of bytes used by the matrix A @@ -4344,6 +4191,7 @@ GrB_Info GrB_Matrix_free // free a matrix // GrB_Matrix_build: C = sparse (I,J,X), but using any // associative operator to assemble duplicate entries. +// The dup operator cannot be based on a GxB_IndexBinaryOp. GrB_Info GrB_Matrix_build_BOOL // build a matrix from (I,J,X) tuples ( @@ -5148,71 +4996,6 @@ GrB_Info GxB_Context_disengage // disengage a Context GxB_Context Context // Context to disengage ) ; -//============================================================================== -// GxB_set and GxB_get: historical; use GrB_set and GrB_get instead -//============================================================================== - -// 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,...) \ - _Generic \ - ( \ - (arg1), \ - default: GxB_Global_Option_set , \ - GxB_Option_Field : GxB_Global_Option_set , \ - GrB_Vector : GxB_Vector_Option_set , \ - GrB_Matrix : GxB_Matrix_Option_set , \ - GrB_Descriptor : GxB_Desc_set , \ - GxB_Context : GxB_Context_set \ - ) \ - (arg1, __VA_ARGS__) - -#define GxB_get(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - default: GxB_Global_Option_get , \ - GxB_Option_Field : GxB_Global_Option_get , \ - GrB_Vector : GxB_Vector_Option_get , \ - GrB_Matrix : GxB_Matrix_Option_get , \ - GrB_Descriptor : GxB_Desc_get , \ - GxB_Context : GxB_Context_get \ - ) \ - (arg1, __VA_ARGS__) -#endif - //============================================================================== // GrB_set and GrB_get //============================================================================== @@ -5239,11 +5022,16 @@ 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 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) ; @@ -5263,6 +5051,17 @@ GrB_Info GrB_BinaryOp_get_INT32 (GrB_BinaryOp, int32_t * , GrB_Field) ; GrB_Info GrB_BinaryOp_get_SIZE (GrB_BinaryOp, size_t * , GrB_Field) ; GrB_Info GrB_BinaryOp_get_VOID (GrB_BinaryOp, void * , GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_Scalar (GxB_IndexBinaryOp, GrB_Scalar, + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_String (GxB_IndexBinaryOp, char * , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_INT32 (GxB_IndexBinaryOp, int32_t * , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_SIZE (GxB_IndexBinaryOp, size_t * , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_VOID (GxB_IndexBinaryOp, void * , + GrB_Field) ; + GrB_Info GrB_Monoid_get_Scalar (GrB_Monoid, GrB_Scalar, GrB_Field) ; GrB_Info GrB_Monoid_get_String (GrB_Monoid, char * , GrB_Field) ; GrB_Info GrB_Monoid_get_INT32 (GrB_Monoid, int32_t * , GrB_Field) ; @@ -5365,6 +5164,16 @@ GrB_Info GxB_Context_get_VOID (GxB_Context, void * , GrB_Field) ; size_t * : GrB_BinaryOp_get_SIZE , \ void * : GrB_BinaryOp_get_VOID \ ) , \ + GxB_IndexBinaryOp : \ + _Generic \ + ( \ + (value), \ + GrB_Scalar : GxB_IndexBinaryOp_get_Scalar , \ + char * : GxB_IndexBinaryOp_get_String , \ + int32_t * : GxB_IndexBinaryOp_get_INT32 , \ + size_t * : GxB_IndexBinaryOp_get_SIZE , \ + void * : GxB_IndexBinaryOp_get_VOID \ + ) , \ GrB_Monoid : \ _Generic \ ( \ @@ -5476,13 +5285,22 @@ 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) ; + size_t) ; GrB_Info GrB_BinaryOp_set_Scalar (GrB_BinaryOp, GrB_Scalar, GrB_Field) ; GrB_Info GrB_BinaryOp_set_String (GrB_BinaryOp, char * , GrB_Field) ; GrB_Info GrB_BinaryOp_set_INT32 (GrB_BinaryOp, int32_t , GrB_Field) ; GrB_Info GrB_BinaryOp_set_VOID (GrB_BinaryOp, void * , GrB_Field, size_t) ; +GrB_Info GxB_IndexBinaryOp_set_Scalar (GxB_IndexBinaryOp, GrB_Scalar, + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_set_String (GxB_IndexBinaryOp, char * , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_set_INT32 (GxB_IndexBinaryOp, int32_t , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_set_VOID (GxB_IndexBinaryOp, void * , + GrB_Field, size_t) ; + GrB_Info GrB_Monoid_set_Scalar (GrB_Monoid, GrB_Scalar, GrB_Field) ; GrB_Info GrB_Monoid_set_String (GrB_Monoid, char * , GrB_Field) ; GrB_Info GrB_Monoid_set_INT32 (GrB_Monoid, int32_t , GrB_Field) ; @@ -5574,6 +5392,15 @@ GrB_Info GxB_Context_set_VOID (GxB_Context, void * , GrB_Field, size_t) ; int32_t : GrB_BinaryOp_set_INT32 , \ void * : GrB_BinaryOp_set_VOID \ ) , \ + GxB_IndexBinaryOp : \ + _Generic \ + ( \ + (value), \ + GrB_Scalar : GxB_IndexBinaryOp_set_Scalar , \ + char * : GxB_IndexBinaryOp_set_String , \ + int32_t : GxB_IndexBinaryOp_set_INT32 , \ + void * : GxB_IndexBinaryOp_set_VOID \ + ) , \ GrB_Monoid : \ _Generic \ ( \ @@ -5644,6 +5471,7 @@ GrB_Info GxB_Context_set_VOID (GxB_Context, void * , GrB_Field, size_t) ; GrB_UnaryOp *: GrB_UnaryOp_free , \ GrB_BinaryOp *: GrB_BinaryOp_free , \ GrB_IndexUnaryOp *: GrB_IndexUnaryOp_free , \ + GxB_IndexBinaryOp*: GxB_IndexBinaryOp_free, \ GrB_Monoid *: GrB_Monoid_free , \ GrB_Semiring *: GrB_Semiring_free , \ GrB_Scalar *: GrB_Scalar_free , \ @@ -5666,6 +5494,7 @@ GrB_Info GrB_Type_wait (GrB_Type type , GrB_WaitMode waitmode); GrB_Info GrB_UnaryOp_wait (GrB_UnaryOp op , GrB_WaitMode waitmode); GrB_Info GrB_BinaryOp_wait (GrB_BinaryOp op , GrB_WaitMode waitmode); GrB_Info GrB_IndexUnaryOp_wait (GrB_IndexUnaryOp op , GrB_WaitMode waitmode); +GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp op , GrB_WaitMode waitmode); GrB_Info GrB_Monoid_wait (GrB_Monoid monoid , GrB_WaitMode waitmode); GrB_Info GrB_Semiring_wait (GrB_Semiring semiring, GrB_WaitMode waitmode); GrB_Info GrB_Descriptor_wait (GrB_Descriptor desc , GrB_WaitMode waitmode); @@ -5684,6 +5513,7 @@ GrB_Info GxB_Context_wait (GxB_Context Context , GrB_WaitMode waitmode); GrB_UnaryOp : GrB_UnaryOp_wait , \ GrB_BinaryOp : GrB_BinaryOp_wait , \ GrB_IndexUnaryOp : GrB_IndexUnaryOp_wait , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_wait, \ GrB_Monoid : GrB_Monoid_wait , \ GrB_Semiring : GrB_Semiring_wait , \ GrB_Scalar : GrB_Scalar_wait , \ @@ -5695,9 +5525,6 @@ GrB_Info GxB_Context_wait (GxB_Context Context , GrB_WaitMode waitmode); (object, waitmode) #endif -// NOTE: GxB_Scalar_wait is historical; use GrB_Scalar_wait instead -GrB_Info GxB_Scalar_wait (GrB_Scalar *s) ; - //============================================================================== // GrB_error: error handling //============================================================================== @@ -5710,16 +5537,18 @@ GrB_Info GxB_Scalar_wait (GrB_Scalar *s) ; GrB_Info GrB_Type_error (const char **error, const GrB_Type type) ; GrB_Info GrB_UnaryOp_error (const char **error, const GrB_UnaryOp op) ; GrB_Info GrB_BinaryOp_error (const char **error, const GrB_BinaryOp op) ; -GrB_Info GrB_IndexUnaryOp_error (const char **error, const GrB_IndexUnaryOp op) ; +GrB_Info GrB_IndexUnaryOp_error (const char **error, + const GrB_IndexUnaryOp op) ; +GrB_Info GxB_IndexBinaryOp_error(const char **error, + const GxB_IndexBinaryOp op); GrB_Info GrB_Monoid_error (const char **error, const GrB_Monoid monoid) ; -GrB_Info GrB_Semiring_error (const char **error, const GrB_Semiring semiring) ; +GrB_Info GrB_Semiring_error (const char **error, const GrB_Semiring + semiring) ; GrB_Info GrB_Scalar_error (const char **error, const GrB_Scalar s) ; GrB_Info GrB_Vector_error (const char **error, const GrB_Vector v) ; GrB_Info GrB_Matrix_error (const char **error, const GrB_Matrix A) ; GrB_Info GrB_Descriptor_error (const char **error, const GrB_Descriptor d) ; -// GxB_Scalar_error is historical: use GrB_Scalar_error instead -GrB_Info GxB_Scalar_error (const char **error, const GrB_Scalar s) ; -GrB_Info GxB_Context_error (const char **error, const GxB_Context Context); +GrB_Info GxB_Context_error (const char **error, const GxB_Context c) ; // GrB_error (error,object) polymorphic function: #if GxB_STDC_VERSION >= 201112L @@ -5731,6 +5560,7 @@ GrB_Info GxB_Context_error (const char **error, const GxB_Context Context); GrB_UnaryOp : GrB_UnaryOp_error , \ GrB_BinaryOp : GrB_BinaryOp_error , \ GrB_IndexUnaryOp : GrB_IndexUnaryOp_error , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_error, \ GrB_Monoid : GrB_Monoid_error , \ GrB_Semiring : GrB_Semiring_error , \ GrB_Scalar : GrB_Scalar_error , \ @@ -5746,6 +5576,8 @@ GrB_Info GxB_Context_error (const char **error, const GxB_Context Context); // GrB_mxm, vxm, mxv: matrix multiplication over a semiring //============================================================================== +// No accum operator in any method can be based on a GxB_IndexBinaryOp. + GrB_Info GrB_mxm // C = accum (C, A*B) ( GrB_Matrix C, // input/output matrix for results @@ -5787,6 +5619,8 @@ GrB_Info GrB_mxv // w = accum (w, A*u) // product, and where pairs of elements in two matrices (or vectors) are // pairwise "multiplied" with C(i,j) = mult (A(i,j),B(i,j)). +// The mult operator can be based on a GxB_IndexBinaryOp. + GrB_Info GrB_Vector_eWiseMult_Semiring // w = accum (w, u.*v) ( GrB_Vector w, // input/output vector for results @@ -7146,18 +6980,6 @@ GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar // w = accum (w, op(x,u)) const GrB_Descriptor desc // descriptor for w and mask ) ; -// historical: identical to GrB_Vector_apply_BinaryOp1st_Scalar -GrB_Info GxB_Vector_apply_BinaryOp1st // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Scalar x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL // w = accum (w, op(x,u)) ( GrB_Vector w, // input/output vector for results @@ -7330,18 +7152,6 @@ GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar // w = accum (w, op(u,y)) const GrB_Descriptor desc // descriptor for w and mask ) ; -// historical: identical to GrB_Vector_apply_BinaryOp2nd_Scalar -GrB_Info GxB_Vector_apply_BinaryOp2nd // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL // w = accum (w, op(u,y)) ( GrB_Vector w, // input/output vector for results @@ -7685,18 +7495,6 @@ GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar // C=accum(C,op(x,A)) const GrB_Descriptor desc // descriptor for C, mask, and A ) ; -// historical: identical to GrB_Matrix_apply_BinaryOp1st_Scalar -GrB_Info GxB_Matrix_apply_BinaryOp1st // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Scalar x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL // C=accum(C,op(x,A)) ( GrB_Matrix C, // input/output matrix for results @@ -7869,18 +7667,6 @@ GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar // C=accum(C,op(A,y)) const GrB_Descriptor desc // descriptor for C, mask, and A ) ; -// historical: identical to GrB_Matrix_apply_BinaryOp2nd_Scalar -GrB_Info GxB_Matrix_apply_BinaryOp2nd // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL // C=accum(C,op(A,y)) ( GrB_Matrix C, // input/output matrix for results @@ -8646,22 +8432,6 @@ GrB_Info GrB_Matrix_select_UDT // C=accum(C,op(A)) (C, Mask, accum, op, x, y, d) #endif -//============================================================================== -// GxB_select: matrix and vector selection (DEPRECATED: use GrB_select instead) -//============================================================================== - -GrB_Info GxB_Vector_select (GrB_Vector w, const GrB_Vector mask, - const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, - const GrB_Scalar Thunk, const GrB_Descriptor desc) ; -GrB_Info GxB_Matrix_select (GrB_Matrix C, const GrB_Matrix Mask, - const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, - const GrB_Scalar Thunk, const GrB_Descriptor desc) ; -#if GxB_STDC_VERSION >= 201112L -#define GxB_select(C,Mask,accum,op,A,Thunk,desc) _Generic \ -((C), GrB_Vector:GxB_Vector_select , GrB_Matrix:GxB_Matrix_select ) \ -(C, Mask, accum, op, A, Thunk, desc) -#endif - //============================================================================== // GrB_reduce: matrix and vector reduction //============================================================================== @@ -9066,18 +8836,6 @@ GrB_Info GrB_transpose // C = accum (C, A') // GrB_kronecker: Kronecker product //============================================================================== -// GxB_kron is historical; use GrB_kronecker instead -GrB_Info GxB_kron // C = accum(C,kron(A,B)) (historical) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) ( GrB_Matrix C, // input/output matrix for results @@ -9143,25 +8901,9 @@ GrB_Info GrB_Vector_resize // change the size of a vector GrB_Index nrows_new // new number of rows in vector ) ; -// GxB_*_resize are identical to the GrB_*resize methods above -GrB_Info GxB_Matrix_resize // change the size of a matrix (historical) -( - GrB_Matrix C, // matrix to modify - GrB_Index nrows_new, // new number of rows in matrix - GrB_Index ncols_new // new number of columns in matrix -) ; - -GrB_Info GxB_Vector_resize // change the size of a vector (historical) -( - GrB_Vector w, // vector to modify - GrB_Index nrows_new // new number of rows in vector -) ; - // GxB_resize is a generic function for resizing a matrix or vector: - // GrB_Vector_resize (u,nrows_new) // GrB_Matrix_resize (A,nrows_new,ncols_new) - #if GxB_STDC_VERSION >= 201112L #define GxB_resize(arg1,...) \ _Generic \ @@ -9250,8 +8992,13 @@ GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp FILE *f // file for output ) ; -GrB_Info GxB_SelectOp_fprint (GxB_SelectOp op, const char *name, - GxB_Print_Level pr, FILE *f) ; +GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp +( + GxB_IndexBinaryOp op, // object to print and check + const char *name, // name of the object + GxB_Print_Level pr, // print level + FILE *f // file for output +) ; GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid ( @@ -9318,7 +9065,7 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context GrB_UnaryOp : GxB_UnaryOp_fprint , \ GrB_BinaryOp : GxB_BinaryOp_fprint , \ GrB_IndexUnaryOp : GxB_IndexUnaryOp_fprint , \ - GxB_SelectOp : GxB_SelectOp_fprint , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_fprint, \ GrB_Monoid : GxB_Monoid_fprint , \ GrB_Semiring : GxB_Semiring_fprint , \ GrB_Scalar : GxB_Scalar_fprint , \ @@ -9333,61 +9080,58 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context #endif //============================================================================== -// Matrix and vector import/export/pack/unpack -//============================================================================== - -// The import/export/pack/unpack functions allow the user application to create -// a GrB_Matrix or GrB_Vector object, and to extract its contents, faster and -// with less memory overhead than the GrB_*_build and GrB_*_extractTuples -// functions. - -// The semantics of import/export/pack/unpack are the same as the "move -// constructor" in C++. On import, the user provides a set of arrays that have -// been previously allocated via the ANSI C malloc function. The arrays define -// the content of the matrix or vector. Unlike GrB_*_build, the GraphBLAS -// library then takes ownership of the user's input arrays and may either (a) -// incorporate them into its internal data structure for the new GrB_Matrix or -// GrB_Vector, potentially creating the GrB_Matrix or GrB_Vector in constant -// time with no memory copying performed, or (b) if the library does not -// support the import format directly, then it may convert the input to its -// internal format, and then free the user's input arrays. GraphBLAS may also -// choose to use a mix of the two strategies. In either case, the input arrays -// are no longer "owned" by the user application. If A is a GrB_Matrix created -// by an import/pack, the user input arrays are freed no later than GrB_free -// (&A), and may be freed earlier, at the discretion of the GraphBLAS library. -// The data structure of the GrB_Matrix and GrB_Vector remain opaque. - -// The export/unpack of a GrB_Matrix or GrB_Vector is symmetric with the import -// operation. The export is destructive, where the GrB_Matrix or GrB_Vector no -// longer exists when the export completes. The GrB_Matrix or GrB_Vector -// exists after an unpack operation, just with no entries. In both export and -// unpack, the user is returned several arrays that contain the matrix or -// vector in the requested format. Ownership of these arrays is given to the -// user application, which is then responsible for freeing them via the ANSI C -// free function. If the output format is supported by the GraphBLAS library, -// then these arrays may be returned to the user application in O(1) time and -// with no memory copying performed. Otherwise, the GraphBLAS library will -// create the output arrays for the user (via the ANSI C malloc function), fill -// them with the GrB_Matrix or GrB_Vector data, and then return the newly -// allocated arrays to the user. - -// Eight different formats are provided for import/export. For each format, -// the Ax array has a C-type corresponding to one of the 13 built-in -// types in GraphBLAS (bool, int*_t, uint*_t, float, double, float complex, or -// double complex), or a user-defined type. - -// On import/pack, the required user arrays Ah, Ap, Ab, Ai, Aj, and/or Ax must -// be non-NULL pointers to memory space allocated by the ANSI C malloc (or -// calloc, or realloc), unless nzmax is zero (in which case the Ab, Ai, Aj, Ax, -// vb, vi, and vx arrays may all be NULL). For the import, A (or GrB_Vector v) -// is undefined on input, just like GrB_*_new, the GrB_Matrix. If the import -// is successful, the GrB_Matrix A or GrB_Vector v is created, and the pointers -// to the user input arrays have been set to NULL. These user arrays have -// either been incorporated directly into the GrB_Matrix A or GrB_Vector v, in -// which case the user input arrays will eventually be freed by GrB_free (&A), -// or their contents have been copied and the arrays freed. This decision is -// made by the GraphBLAS library itself, and the user application has no -// control over this decision. +// GxB_pack/GxB_unpack: Matrix and vector pack/unpack +//============================================================================== + +// The pack/unpack functions allow the user application to create a GrB_Matrix +// or GrB_Vector object, and to extract its contents, faster and with less +// memory overhead than the GrB_*_build and GrB_*_extractTuples functions. + +// The semantics of pack/unpack are the same as the "move constructor" in C++. +// On pack, the user provides a set of arrays that have been previously +// allocated via the ANSI C malloc function. The arrays define the content of +// the matrix or vector. Unlike GrB_*_build, the GraphBLAS library then takes +// ownership of the user's input arrays and may either (a) incorporate them +// into its internal data structure for the new GrB_Matrix or GrB_Vector, +// potentially creating the GrB_Matrix or GrB_Vector in constant time with no +// memory copying performed, or (b) if the library does not support the format +// directly, then it may convert the input to its internal format, and then +// free the user's input arrays. GraphBLAS may also choose to use a mix of the +// two strategies. In either case, the input arrays are no longer "owned" by +// the user application. If A is a GrB_Matrix created by a pack, the user +// input arrays are freed no later than GrB_free (&A), and may be freed +// earlier, at the discretion of the GraphBLAS library. The data structure of +// the GrB_Matrix and GrB_Vector remain opaque. + +// The unpack of a GrB_Matrix or GrB_Vector is symmetric with the pack +// operation. The GrB_Matrix or GrB_Vector exists after an unpack operation, +// just with no entries. For unpack, the user is returned several arrays that +// contain the matrix or vector in the requested format. Ownership of these +// arrays is given to the user application, which is then responsible for +// freeing them via the ANSI C free function. If the output format is +// supported by the GraphBLAS library, then these arrays may be returned to the +// user application in O(1) time and with no memory copying performed. +// Otherwise, the GraphBLAS library will create the output arrays for the user +// (via the ANSI C malloc function), fill them with the GrB_Matrix or +// GrB_Vector data, and then return the newly allocated arrays to the user. + +// Eight different formats are provided for pack/unpack. For each format, the +// Ax array has a C-type corresponding to one of the 13 built-in types +// in GraphBLAS (bool, int*_t, uint*_t, float, double, float complex, or double +// complex), or a user-defined type. + +// On pack, the required user arrays Ah, Ap, Ab, Ai, Aj, and/or Ax must be +// non-NULL pointers to memory space allocated by the ANSI C malloc (or calloc, +// or realloc), unless nzmax is zero (in which case the Ab, Ai, Aj, Ax, vb, vi, +// and vx arrays may all be NULL). For the pack, A (or GrB_Vector v) is +// undefined on input, just like GrB_*_new, the GrB_Matrix. If the pack is +// successful, the GrB_Matrix A or GrB_Vector v is created, and the pointers to +// the user input arrays have been set to NULL. These user arrays have either +// been incorporated directly into the GrB_Matrix A or GrB_Vector v, in which +// case the user input arrays will eventually be freed by GrB_free (&A), or +// their contents have been copied and the arrays freed. This decision is made +// by the GraphBLAS library itself, and the user application has no control +// over this decision. // If any of the arrays Ab, Aj, Ai, Ax, vb, vi, or vx have zero size (with // nzmax of zero), they are allowed to be be NULL pointers on input. @@ -9400,52 +9144,25 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context // No error checking is performed on the content of the user input arrays. If // the user input arrays do not conform to the precise specifications above, // results are undefined. No typecasting of the values of the matrix or vector -// entries is performed on import or export. +// entries is performed on pack/unpack // SuiteSparse:GraphBLAS supports all eight formats natively (CSR, CSC, // HyperCSR, and HyperCSC, BitmapR, BitmapC, FullR, FullC). For vectors, only -// CSC, BitmapC, and FullC formats are used. On import, the all eight formats -// take O(1) time and memory to import. On export, if the GrB_Matrix or -// GrB_Vector is already in this particular format, then the export takes O(1) +// CSC, BitmapC, and FullC formats are used. On pack, the all eight formats +// take O(1) time and memory to pack. On unpack, if the GrB_Matrix or +// GrB_Vector is already in this particular format, then the unpack takes O(1) // time and no memory copying is performed. -// If the import is not successful, the GxB_Matrix_import_* functions return A -// as NULL, GxB_Vector_import returns v as NULL, and the user input arrays are -// neither modified nor freed. They are still owned by the user application. - // If the input data is untrusted, use the following descriptor setting for -// GxB_Matrix_import* and GxB_Matrix_pack*. The import/pack will be slower, -// but secure. GrB_Matrix_import uses the slow, secure method, since it has -// no descriptor input. +// GxB_Matrix_pack*. The pack will be slower, but secure. GrB_Matrix_import +// uses the slow, secure method, since it has no descriptor input. // // GxB_set (desc, GxB_IMPORT, GxB_SECURE_IMPORT) ; -// As of v5.2.0, GxB_*import* and GxB_*export* are declared historical. Use -// GxB_*pack* and GxB_*unpack* instead. The GxB import/export will be kept -// but only documented here, not in the User Guide. - //------------------------------------------------------------------------------ // GxB_Matrix_pack_CSR: pack a CSR matrix //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_CSR // historical: use GxB_Matrix_pack_CSR -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers", Ap_size >= (nrows+1)* sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A) * sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9467,7 +9184,7 @@ GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix // GrB_Index Ap [nrows+1], Aj [nvals] ; Ax [nvals] ; // // The column indices of entries in the ith row of the matrix are held - // in Aj [Ap [i] ... Ap[i+1]], and the corresponding values are held + // in Aj [Ap [i] to Ap[i+1]-1], and the corresponding values are held // in the same positions in Ax. Column indices must be in the range 0 // to ncols-1. If jumbled is false, the column indices must appear in // sorted order within each row. No duplicate column indices may @@ -9481,24 +9198,6 @@ GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix // GxB_Matrix_pack_CSC: pack a CSC matrix //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_CSC // historical: use GxB_Matrix_pack_CSC -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - GrB_Index **Ap, // col "pointers", Ap_size >= (ncols+1)*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9520,7 +9219,7 @@ GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix // GrB_Index Ap [ncols+1], Ai [nvals] ; Ax [nvals] ; // // The row indices of entries in the jth column of the matrix are held - // in Ai [Ap [j] ... Ap[j+1]], and the corresponding values are held + // in Ai [Ap [j] to Ap[j+1]-1], and the corresponding values are held // in the same positions in Ax. Row indices must be in the range 0 to // nrows-1. If jumbled is false, the row indices must appear in // sorted order within each column. No duplicate row indices may @@ -9534,27 +9233,6 @@ GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix // GxB_Matrix_pack_HyperCSR: pack a hypersparse CSR matrix //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_HyperCSR // historical: use GxB_Matrix_pack_HyperCSR -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers", Ap_size >= (nvec+1)*sizeof(int64_t) - GrB_Index **Ah, // row indices, Ah_size >= nvec*sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of rows that appear in Ah - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9587,7 +9265,7 @@ GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix // the matrix. It // must appear in sorted order, and no duplicates may appear. If i = // Ah [k] is the kth row, then the column indices of the ith - // row appear in Aj [Ap [k] ... Ap [k+1]], and the corresponding + // row appear in Aj [Ap [k] to Ap [k+1]-1], and the corresponding // values appear in the same locations in Ax. Column indices must be // in the range 0 to ncols-1, and must appear in sorted order within // each row. No duplicate column indices may appear in any row. nvec @@ -9600,27 +9278,6 @@ GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix // GxB_Matrix_pack_HyperCSC: pack a hypersparse CSC matrix //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_HyperCSC // historical: use GxB_Matrix_pack_HyperCSC -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - GrB_Index **Ap, // col "pointers", Ap_size >= (nvec+1)*sizeof(int64_t) - GrB_Index **Ah, // column indices, Ah_size >= nvec*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A)*(type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of columns that appear in Ah - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9653,7 +9310,7 @@ GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix // The Ah array is a list of the column indices of non-empty columns. // It must appear in sorted order, and no duplicates may appear. If j // = Ah [k] is the kth non-empty column, then the row indices of the - // jth column appear in Ai [Ap [k] ... Ap [k+1]], and the + // jth column appear in Ai [Ap [k] to Ap [k+1]-1], and the // corresponding values appear in the same locations in Ax. Row // indices must be in the range 0 to nrows-1, and must appear in // sorted order within each column. No duplicate row indices may @@ -9667,22 +9324,6 @@ GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix // GxB_Matrix_pack_BitmapR: pack a bitmap matrix, held by row //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_BitmapR // historical: use GxB_Matrix_pack_BitmapR -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9710,22 +9351,6 @@ GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row // GxB_Matrix_pack_BitmapC: pack a bitmap matrix, held by column //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_BitmapC // historical: use GxB_Matrix_pack_BitmapC -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9753,19 +9378,6 @@ GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column // GxB_Matrix_pack_FullR: pack a full matrix, held by row //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_FullR // historical: use GxB_Matrix_pack_FullR -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9787,19 +9399,6 @@ GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row // GxB_Matrix_pack_FullC: pack a full matrix, held by column //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_FullC // historical: use GxB_Matrix_pack_FullC -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9818,25 +9417,9 @@ GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column // Ax [i+j*nrows]. All entries in A are present. //------------------------------------------------------------------------------ -// GxB_Vector_pack_CSC: import/pack a vector in CSC format +// GxB_Vector_pack_CSC: pack a vector in CSC format //------------------------------------------------------------------------------ -GrB_Info GxB_Vector_import_CSC // historical: use GxB_Vector_pack_CSC -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n, // vector length - GrB_Index **vi, // indices, vi_size >= nvals(v) * sizeof(int64_t) - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vi_size, // size of vi in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in vector - bool jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format ( GrB_Vector v, // vector to create (type and length unchanged) @@ -9859,21 +9442,6 @@ GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format // GxB_Vector_pack_Bitmap: pack a vector in bitmap format //------------------------------------------------------------------------------ -GrB_Info GxB_Vector_import_Bitmap // historical: GxB_Vector_pack_Bitmap -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n, // vector length - int8_t **vb, // bitmap, vb_size >= n - void **vx, // values, vx_size >= n * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vb_size, // size of vb in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector ( GrB_Vector v, // vector to create (type and length unchanged) @@ -9894,18 +9462,6 @@ GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector // GxB_Vector_pack_Full: pack a vector in full format //------------------------------------------------------------------------------ -GrB_Info GxB_Vector_import_Full // historical: use GxB_Vector_pack_Full -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n, // vector length - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_pack_Full // pack a full vector ( GrB_Vector v, // vector to create (type and length unchanged) @@ -9920,58 +9476,35 @@ GrB_Info GxB_Vector_pack_Full // pack a full vector // matrix in FullC format. //------------------------------------------------------------------------------ -// GxB* export/unpack +// GxB unpack //------------------------------------------------------------------------------ -// The GxB_*_export/unpack functions are symmetric with the GxB_*_import/pack -// functions. The export/unpack functions force completion of any pending -// operations, prior to the export, except if the only pending operation is to -// unjumble the matrix. +// The GxB_*_unpack functions are symmetric with the GxB_*_pack functions. The +// unpack functions force completion of any pending operations, prior to the +// unpack, except if the only pending operation is to unjumble the matrix. // // If there are no entries in the matrix or vector, then the index arrays (Ai, // Aj, or vi) and value arrays (Ax or vx) are returned as NULL. This is not an // error condition. // -// A GrB_Matrix may be exported/unpacked in any one of four different formats. -// On successful export, the input GrB_Matrix A is freed, and the output arrays -// Ah, Ap, Ai, Aj, and/or Ax are returned to the user application as arrays -// allocated by the ANSI C malloc function. The four formats are the same as -// the import formats for GxB_Matrix_import/pack. +// A GrB_Matrix may be unpacked in any one of four different formats. // -// If jumbled is NULL on input, this indicates to GxB_*export/unpack* that the -// exported/unpacked matrix cannot be returned in a jumbled format. In this -// case, if the matrix is jumbled, it is sorted before exporting it to the -// caller. +// If jumbled is NULL on input, this indicates to GxB_*unpack* that the +// unpacked matrix cannot be returned in a jumbled format. In this case, if +// the matrix is jumbled, it is sorted before unpacking it to the caller. // -// If iso is NULL on input, this indicates to the export/unpack methods that -// the exported/unpacked matrix cannot be returned in a iso format, with an Ax -// array with just one entry. In this case, if the matrix is iso, it is -// expanded before exporting/unpacking it to the caller. +// If iso is NULL on input, this indicates to the unpack methods that the +// unpacked matrix cannot be returned in a iso format, with an Ax array with +// just one entry. In this case, if the matrix is iso, it is expanded before +// unpacking it to the caller. // -// For the export/unpack*Full* methods, all entries in the matrix or must be -// present. That is, GrB_*_nvals must report nvals equal to nrows*ncols or a -// matrix. If this condition does not hold, the matrix/vector is not exported, -// and GrB_INVALID_VALUE is returned. +// For the unpack*Full* methods, all entries in the matrix or must be present. +// That is, GrB_*_nvals must report nvals equal to nrows*ncols or a matrix. If +// this condition does not hold, the matrix/vector is not unpack, and +// GrB_INVALID_VALUE is returned. // -// If the export/unpack is not successful, the export/unpack functions do not -// modify matrix or vector and the user arrays are returned as NULL. - -GrB_Info GxB_Matrix_export_CSR // historical: use GxB_Matrix_unpack_CSR -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers" - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; +// If the unpack is not successful, the unpack functions do not modify matrix +// or vector and the user arrays are returned as NULL. GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix ( @@ -9987,23 +9520,6 @@ GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_CSC // historical: use GxB_Matrix_unpack_CSC -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - GrB_Index **Ap, // column "pointers" - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10018,26 +9534,6 @@ GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_HyperCSR //historical: use GxB_Matrix_unpack_HyperCSR -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers" - GrB_Index **Ah, // row indices - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of rows that appear in Ah - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10055,26 +9551,6 @@ GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_HyperCSC //historical: use GxB_Matrix_unpack_HyperCSC -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - GrB_Index **Ap, // column "pointers" - GrB_Index **Ah, // column indices - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of columns that appear in Ah - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10092,21 +9568,6 @@ GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_BitmapR // historical: use GxB_Matrix_unpack_BitmapR -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10119,21 +9580,6 @@ GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_BitmapC // historical: use GxB_Matrix_unpack_BitmapC -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10146,18 +9592,6 @@ GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_FullR // historical: use GxB_Matrix_unpack_FullR -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10167,18 +9601,6 @@ GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_FullC // historical: use GxB_Matrix_unpack_FullC -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10188,21 +9610,6 @@ GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_export_CSC // historical: use GxB_Vector_unpack_CSC -( - GrB_Vector *v, // handle of vector to export and free - GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector - GrB_Index **vi, // indices - void **vx, // values - GrB_Index *vi_size, // size of vi in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in vector - bool *jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector ( GrB_Vector v, // vector to unpack (type and length unchanged) @@ -10216,20 +9623,6 @@ GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_export_Bitmap // historical: use GxB_Vector_unpack_Bitmap -( - GrB_Vector *v, // handle of vector to export and free - GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector - int8_t **vb, // bitmap - void **vx, // values - GrB_Index *vb_size, // size of vb in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector ( GrB_Vector v, // vector to unpack (type and length unchanged) @@ -10242,17 +9635,6 @@ GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_export_Full // historical: use GxB_Vector_unpack_Full -( - GrB_Vector *v, // handle of vector to export and free - GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector - void **vx, // values - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_unpack_Full // unpack a full vector ( GrB_Vector v, // vector to unpack (type and length unchanged) @@ -10272,7 +9654,7 @@ GrB_Info GxB_Vector_unpack_Full // unpack a full vector // GxB_unpack_HyperHash unpacks the hyper_hash from the hypersparse matrix A. // Normally, this method is called immediately before calling one of the four -// methods GxB_Matrix_(export/unpack)_Hyper(CSR/CSC). For example, to unpack +// methods GxB_Matrix_unpack_Hyper(CSR/CSC). For example, to unpack // then pack a hypersparse CSC matrix: // GrB_Matrix Y = NULL ; @@ -10284,14 +9666,12 @@ GrB_Info GxB_Vector_unpack_Full // unpack a full vector // &iso, &nvec, &jumbled, descriptor) ; // // // use the unpacked contents of A here, but do not change Ah or nvec. -// ... // // // to pack the data back into A: -// GxB_Matrix_pack_HyperCSC (A, ...) ; // pack most of A, except A->Y +// GxB_Matrix_pack_HyperCSC (A, etc) ; // pack most of A, except A->Y // GxB_pack_HyperHash (A, &Y, desc) ; // then pack A->Y -// The same process is used with GxB_Matrix_unpack_HyperCSR, -// an the GxB_Matrix_export_Hyper* and GxB_Matrix_import_Hyper* methods. +// The same process is used with GxB_Matrix_unpack_HyperCSR. // If A is not hypersparse on input to GxB_unpack_HyperHash, or if A is // hypersparse but does yet not have a hyper_hash, then Y is returned as NULL. @@ -10318,7 +9698,7 @@ GrB_Info GxB_unpack_HyperHash // move A->Y into Y // GxB_pack_HyperHash assigns the input Y matrix as the A->Y hyper_hash of the // hypersparse matrix A. Normally, this method is called immediately after -// calling one of the four methods GxB_Matrix_(import/pack)_Hyper(CSR/CSC). +// calling one of the four methods GxB_Matrix_pack_Hyper(CSR/CSC). // If A is not hypersparse on input to GxB_pack_HyperHash, or if A already has // a hyper_hash matrix, or if Y is NULL on input, then nothing happens and Y is @@ -10342,8 +9722,8 @@ GrB_Info GxB_unpack_HyperHash // move A->Y into Y // Results are undefined if the input Y was not created by GxB_unpack_HyperHash // (see the example above) or if the Ah contents or nvec of the matrix A are -// modified after they were exported/unpacked by -// GxB_Matrix_(export/unpack)_Hyper(CSR/CSC). +// modified after they were unpacked by +// GxB_Matrix_unpack_Hyper(CSR/CSC). GrB_Info GxB_pack_HyperHash // move Y into A->Y ( @@ -10353,7 +9733,7 @@ GrB_Info GxB_pack_HyperHash // move Y into A->Y ) ; //============================================================================== -// GrB import/export +// GrB_import/GrB_export //============================================================================== // The GrB_Matrix_import method copies from user-provided arrays into an @@ -11001,9 +10381,6 @@ GrB_Info GxB_Vector_deserialize // deserialize blob into a GrB_Vector const GrB_Descriptor desc // to control # of threads used ) ; -// 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 //============================================================================== @@ -11111,7 +10488,7 @@ outer loop), and one entry at a time within the row (in the inner loop): GxB_Iterator_new (&iterator) ; // attach it to the matrix A, known to be type GrB_FP64 GrB_Info info = GxB_rowIterator_attach (iterator, A, NULL) ; - if (info < 0) { handle the failure ... } + if (info < 0) { handle the failure } // seek to A(0,:) info = GxB_rowIterator_seekRow (iterator, 0) ; while (info != GxB_EXHAUSTED) @@ -11145,7 +10522,7 @@ parallel iteration using 4 threads (work may be imbalanced however): GxB_Iterator iterator ; GxB_Iterator_new (&iterator) ; GrB_Info info = GxB_rowIterator_attach (iterator, A, NULL) ; - if (info < 0) { handle the failure ... } + if (info < 0) { handle the failure } // seek to A(row1,:) info = GxB_rowIterator_seekRow (iterator, row1) ; while (info != GxB_EXHAUSTED) @@ -11181,9 +10558,9 @@ parallel iteration using 4 threads (work may be imbalanced however): // The contents of an iterator must not be directly accessed by the user // application. Only the functions and macros provided here may access -// "iterator->..." contents. The iterator is defined here only so that macros +// "iterator->" contents. The iterator is defined here only so that macros // can be used to speed up the use of the iterator methods. User applications -// must not use "iterator->..." directly. +// must not use "iterator->" directly. struct GB_Iterator_opaque { @@ -11666,7 +11043,7 @@ GrB_Index GxB_colIterator_getRowIndex (GxB_Iterator iterator) ; GxB_Iterator_new (&iterator) ; // attach it to the matrix A, known to be type GrB_FP64 GrB_Info info = GxB_Matrix_Iterator_attach (iterator, A, NULL) ; - if (info < 0) { handle the failure ... } + if (info < 0) { handle the failure } // seek to the first entry info = GxB_Matrix_Iterator_seek (iterator, 0) ; while (info != GxB_EXHAUSTED) @@ -11797,7 +11174,7 @@ single thread iteration of a whole vector, one entry at at time GxB_Iterator_new (&iterator) ; // attach it to the vector v, known to be type GrB_FP64 GrB_Info info = GxB_Vector_Iterator_attach (iterator, v, NULL) ; - if (info < 0) { handle the failure ... } + if (info < 0) { handle the failure } // seek to the first entry info = GxB_Vector_Iterator_seek (iterator, 0) ; while (info != GxB_EXHAUSTED) @@ -12059,9 +11436,375 @@ void GxB_Iterator_get_UDT (GxB_Iterator iterator, (iterator)->type_size) \ ) +//============================================================================== +//=== Historical methods ======================================================= +//============================================================================== + +// 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 in +// working order for historical backward compatibility; it might no longer be +// mentioned in the user guide. Historical functions and symbols listed below +// would only be removed in the rare case that they cause a serious conflict +// with future methods. Replacements for these historical objects and +// functions are listed below. If tagged "as-is" then only the name is +// changed. Otherwise, refer to the older SuiteSparse:GraphBLAS user guides on +// the usage of these historical methods, and upgrade to the newer methods +// present in this version of GraphBLAS. + +// GrB_getVersion: use GrB_get instead +GrB_Info GrB_getVersion (unsigned int *, unsigned int *) ; + +// GxB_INDEX_MAX: use GrB_INDEX_MAX+1 instead +#define GxB_INDEX_MAX ((GrB_Index) (1ULL << 60)) + +// GxB_ABS_*: use GrB_ABS_* instead (as-is) +GB_GLOBAL GrB_UnaryOp + GxB_ABS_BOOL, GxB_ABS_INT8, GxB_ABS_INT16, GxB_ABS_INT32, GxB_ABS_INT64, + GxB_ABS_UINT8, GxB_ABS_UINT16, GxB_ABS_UINT32, GxB_ABS_UINT64, GxB_ABS_FP32, + GxB_ABS_FP64 ; + +// GxB_SelectOp: use 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, GxB_EQ_THUNK, GxB_GT_THUNK, GxB_GE_THUNK, GxB_LT_THUNK, + GxB_LE_THUNK ; +GrB_Info GxB_SelectOp_xtype (GrB_Type *, GxB_SelectOp) ; +GrB_Info GxB_SelectOp_ttype (GrB_Type *, GxB_SelectOp) ; +GrB_Info GxB_SelectOp_fprint (GxB_SelectOp op, const char *name, + GxB_Print_Level pr, FILE *f) ; + +// GxB_Scalar: use GrB_Scalar instead (as-is) +typedef struct GB_Scalar_opaque *GxB_Scalar ; + +// GxB_* monoids: GrB_* monoids instead (as-is) +GB_GLOBAL GrB_Monoid + GxB_MIN_INT8_MONOID, GxB_MIN_INT16_MONOID, GxB_MIN_INT32_MONOID, + GxB_MIN_INT64_MONOID, GxB_MIN_UINT8_MONOID, GxB_MIN_UINT16_MONOID, + GxB_MIN_UINT32_MONOID, GxB_MIN_UINT64_MONOID, GxB_MIN_FP32_MONOID, + GxB_MIN_FP64_MONOID, GxB_MAX_INT8_MONOID, GxB_MAX_INT16_MONOID, + GxB_MAX_INT32_MONOID, GxB_MAX_INT64_MONOID, GxB_MAX_UINT8_MONOID, + GxB_MAX_UINT16_MONOID, GxB_MAX_UINT32_MONOID, GxB_MAX_UINT64_MONOID, + GxB_MAX_FP32_MONOID, GxB_MAX_FP64_MONOID, GxB_PLUS_INT8_MONOID, + GxB_PLUS_INT16_MONOID, GxB_PLUS_INT32_MONOID, GxB_PLUS_INT64_MONOID, + GxB_PLUS_UINT8_MONOID, GxB_PLUS_UINT16_MONOID, GxB_PLUS_UINT32_MONOID, + GxB_PLUS_UINT64_MONOID, GxB_PLUS_FP32_MONOID, GxB_PLUS_FP64_MONOID, + GxB_TIMES_INT8_MONOID, GxB_TIMES_INT16_MONOID, GxB_TIMES_INT32_MONOID, + GxB_TIMES_INT64_MONOID, GxB_TIMES_UINT8_MONOID, GxB_TIMES_UINT16_MONOID, + GxB_TIMES_UINT32_MONOID, GxB_TIMES_UINT64_MONOID, GxB_TIMES_FP32_MONOID, + GxB_TIMES_FP64_MONOID, GxB_LOR_BOOL_MONOID, GxB_LAND_BOOL_MONOID, + GxB_LXOR_BOOL_MONOID, GxB_LXNOR_BOOL_MONOID, GxB_EQ_BOOL_MONOID ; + +// GxB_* semirings: use the GrB_* semirings instead (as-is) +GB_GLOBAL GrB_Semiring + + GxB_PLUS_TIMES_INT8, GxB_PLUS_MIN_INT8, GxB_MIN_PLUS_INT8, + GxB_PLUS_TIMES_INT16, GxB_PLUS_MIN_INT16, GxB_MIN_PLUS_INT16, + GxB_PLUS_TIMES_INT32, GxB_PLUS_MIN_INT32, GxB_MIN_PLUS_INT32, + GxB_PLUS_TIMES_INT64, GxB_PLUS_MIN_INT64, GxB_MIN_PLUS_INT64, + GxB_PLUS_TIMES_UINT8, GxB_PLUS_MIN_UINT8, GxB_MIN_PLUS_UINT8, + GxB_PLUS_TIMES_UINT16, GxB_PLUS_MIN_UINT16, GxB_MIN_PLUS_UINT16, + GxB_PLUS_TIMES_UINT32, GxB_PLUS_MIN_UINT32, GxB_MIN_PLUS_UINT32, + GxB_PLUS_TIMES_UINT64, GxB_PLUS_MIN_UINT64, GxB_MIN_PLUS_UINT64, + GxB_PLUS_TIMES_FP32, GxB_PLUS_MIN_FP32, GxB_MIN_PLUS_FP32, + GxB_PLUS_TIMES_FP64, GxB_PLUS_MIN_FP64, GxB_MIN_PLUS_FP64, + + GxB_MIN_TIMES_INT8, GxB_MIN_FIRST_INT8, GxB_MIN_SECOND_INT8, + GxB_MIN_TIMES_INT16, GxB_MIN_FIRST_INT16, GxB_MIN_SECOND_INT16, + GxB_MIN_TIMES_INT32, GxB_MIN_FIRST_INT32, GxB_MIN_SECOND_INT32, + GxB_MIN_TIMES_INT64, GxB_MIN_FIRST_INT64, GxB_MIN_SECOND_INT64, + GxB_MIN_TIMES_UINT8, GxB_MIN_FIRST_UINT8, GxB_MIN_SECOND_UINT8, + GxB_MIN_TIMES_UINT16, GxB_MIN_FIRST_UINT16, GxB_MIN_SECOND_UINT16, + GxB_MIN_TIMES_UINT32, GxB_MIN_FIRST_UINT32, GxB_MIN_SECOND_UINT32, + GxB_MIN_TIMES_UINT64, GxB_MIN_FIRST_UINT64, GxB_MIN_SECOND_UINT64, + GxB_MIN_TIMES_FP32, GxB_MIN_FIRST_FP32, GxB_MIN_SECOND_FP32, + GxB_MIN_TIMES_FP64, GxB_MIN_FIRST_FP64, GxB_MIN_SECOND_FP64, + + GxB_MIN_MAX_INT8, GxB_MAX_PLUS_INT8, GxB_MAX_TIMES_INT8, + GxB_MIN_MAX_INT16, GxB_MAX_PLUS_INT16, GxB_MAX_TIMES_INT16, + GxB_MIN_MAX_INT32, GxB_MAX_PLUS_INT32, GxB_MAX_TIMES_INT32, + GxB_MIN_MAX_INT64, GxB_MAX_PLUS_INT64, GxB_MAX_TIMES_INT64, + GxB_MIN_MAX_UINT8, GxB_MAX_PLUS_UINT8, GxB_MAX_TIMES_UINT8, + GxB_MIN_MAX_UINT16, GxB_MAX_PLUS_UINT16, GxB_MAX_TIMES_UINT16, + GxB_MIN_MAX_UINT32, GxB_MAX_PLUS_UINT32, GxB_MAX_TIMES_UINT32, + GxB_MIN_MAX_UINT64, GxB_MAX_PLUS_UINT64, GxB_MAX_TIMES_UINT64, + GxB_MIN_MAX_FP32, GxB_MAX_PLUS_FP32, GxB_MAX_TIMES_FP32, + GxB_MIN_MAX_FP64, GxB_MAX_PLUS_FP64, GxB_MAX_TIMES_FP64, + + GxB_MAX_FIRST_INT8, GxB_MAX_SECOND_INT8, GxB_MAX_MIN_INT8, + GxB_MAX_FIRST_INT16, GxB_MAX_SECOND_INT16, GxB_MAX_MIN_INT16, + GxB_MAX_FIRST_INT32, GxB_MAX_SECOND_INT32, GxB_MAX_MIN_INT32, + GxB_MAX_FIRST_INT64, GxB_MAX_SECOND_INT64, GxB_MAX_MIN_INT64, + GxB_MAX_FIRST_UINT8, GxB_MAX_SECOND_UINT8, GxB_MAX_MIN_UINT8, + GxB_MAX_FIRST_UINT16, GxB_MAX_SECOND_UINT16, GxB_MAX_MIN_UINT16, + GxB_MAX_FIRST_UINT32, GxB_MAX_SECOND_UINT32, GxB_MAX_MIN_UINT32, + GxB_MAX_FIRST_UINT64, GxB_MAX_SECOND_UINT64, GxB_MAX_MIN_UINT64, + GxB_MAX_FIRST_FP32, GxB_MAX_SECOND_FP32, GxB_MAX_MIN_FP32, + GxB_MAX_FIRST_FP64, GxB_MAX_SECOND_FP64, GxB_MAX_MIN_FP64, + + GxB_LOR_LAND_BOOL, GxB_LAND_LOR_BOOL, GxB_LXOR_LAND_BOOL, + GxB_EQ_LOR_BOOL ; // use GrB_LXNOR_LOR_SEMIRING_BOOL instead (as-is) + +// GxB_Desc*get/set and GrB_Descriptor_set: use GrB_get/set instead. +GrB_Info GrB_Descriptor_set (GrB_Descriptor, GrB_Desc_Field, GrB_Desc_Value) ; +GrB_Info GxB_Descriptor_get (GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field) ; +GrB_Info GxB_Desc_set (GrB_Descriptor, GrB_Desc_Field, ...) ; +GrB_Info GxB_Desc_set_INT32 (GrB_Descriptor, GrB_Desc_Field, int32_t) ; +GrB_Info GxB_Desc_set_FP64 (GrB_Descriptor, GrB_Desc_Field, double) ; +GrB_Info GxB_Desc_get (GrB_Descriptor, GrB_Desc_Field, ...) ; +GrB_Info GxB_Desc_get_INT32 (GrB_Descriptor, GrB_Desc_Field, int32_t *) ; +GrB_Info GxB_Desc_get_FP64 (GrB_Descriptor, GrB_Desc_Field, double *) ; + +// GxB_Type_* queries: use GrB_get instead +GrB_Info GxB_Type_name (char *, const GrB_Type) ; +GrB_Info GxB_Type_size (size_t *, const GrB_Type) ; + +// GxB_UnaryOp_* queries: use GrB_get_instead +GrB_Info GxB_UnaryOp_ztype (GrB_Type *, GrB_UnaryOp) ; +GrB_Info GxB_UnaryOp_ztype_name (char *, const GrB_UnaryOp) ; +GrB_Info GxB_UnaryOp_xtype (GrB_Type *, GrB_UnaryOp) ; +GrB_Info GxB_UnaryOp_xtype_name (char *, const GrB_UnaryOp) ; + +// GxB_BinaryOp_* queries: use GrB_get_instead +GrB_Info GxB_BinaryOp_ztype (GrB_Type *, GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_ztype_name (char *, const GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_xtype (GrB_Type *, GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_xtype_name (char *, const GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_ytype (GrB_Type *, GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_ytype_name (char *, const GrB_BinaryOp) ; + +// GxB_IndexUnaryOp_* queries: use GrB_get instead +GrB_Info GxB_IndexUnaryOp_ztype_name (char *, const GrB_IndexUnaryOp) ; +GrB_Info GxB_IndexUnaryOp_xtype_name (char *, const GrB_IndexUnaryOp) ; +GrB_Info GxB_IndexUnaryOp_ytype_name (char *, const GrB_IndexUnaryOp) ; + +// GxB_Monoid_* queries: use GrB_get instead +GrB_Info GxB_Monoid_operator (GrB_BinaryOp *, GrB_Monoid) ; +GrB_Info GxB_Monoid_identity (void *, GrB_Monoid) ; +GrB_Info GxB_Monoid_terminal (bool *, void *, GrB_Monoid) ; + +// GxB_Semiring_* queries: use GrB_get instead +GrB_Info GxB_Semiring_add (GrB_Monoid *, GrB_Semiring) ; +GrB_Info GxB_Semiring_multiply (GrB_BinaryOp *, GrB_Semiring) ; + +// GxB_Scalar_* queries: use GrB_get instead +GrB_Info GxB_Scalar_type (GrB_Type *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_type_name (char *, const GrB_Scalar) ; + +// GxB_Scalar_* methods: use GrB_Scalar_* instead (as-is) +GrB_Info GxB_Scalar_new (GrB_Scalar *, GrB_Type) ; +GrB_Info GxB_Scalar_dup (GrB_Scalar *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_clear (GrB_Scalar ) ; +GrB_Info GxB_Scalar_nvals (GrB_Index *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_free (GrB_Scalar *) ; +GrB_Info GxB_Scalar_setElement_BOOL (GrB_Scalar, bool) ; +GrB_Info GxB_Scalar_setElement_INT8 (GrB_Scalar, int8_t) ; +GrB_Info GxB_Scalar_setElement_INT16 (GrB_Scalar, int16_t) ; +GrB_Info GxB_Scalar_setElement_INT32 (GrB_Scalar, int32_t) ; +GrB_Info GxB_Scalar_setElement_INT64 (GrB_Scalar, int64_t) ; +GrB_Info GxB_Scalar_setElement_UINT8 (GrB_Scalar, uint8_t) ; +GrB_Info GxB_Scalar_setElement_UINT16 (GrB_Scalar, uint16_t) ; +GrB_Info GxB_Scalar_setElement_UINT32 (GrB_Scalar, uint32_t) ; +GrB_Info GxB_Scalar_setElement_UINT64 (GrB_Scalar, uint64_t) ; +GrB_Info GxB_Scalar_setElement_FP32 (GrB_Scalar, float) ; +GrB_Info GxB_Scalar_setElement_FP64 (GrB_Scalar, double) ; +GrB_Info GxB_Scalar_setElement_UDT (GrB_Scalar, void *) ; +GrB_Info GxB_Scalar_extractElement_BOOL (bool *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_INT8 (int8_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_INT16 (int16_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_INT32 (int32_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_INT64 (int64_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UINT8 (uint8_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UINT16 (uint16_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UINT32 (uint32_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UINT64 (uint64_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_FP32 (float *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_FP64 (double *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UDT (void *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_wait (GrB_Scalar *) ; +GrB_Info GxB_Scalar_error (const char **, const GrB_Scalar) ; +#if GxB_STDC_VERSION >= 201112L +#define GxB_Scalar_setElement(s,x) GrB_Scalar_setElement (s, x) +#define GxB_Scalar_extractElement(x,s) GrB_Scalar_extractElement (x, s) +#endif + +// GxB_Vector_* queries: use GrB_get instead +GrB_Info GxB_Vector_type (GrB_Type *, const GrB_Vector) ; +GrB_Info GxB_Vector_type_name (char *, const GrB_Vector) ; + +// GxB_Matrix_* queries: use GrB_get instead +GrB_Info GxB_Matrix_type (GrB_Type *, const GrB_Matrix) ; +GrB_Info GxB_Matrix_type_name (char *, const GrB_Matrix) ; + +// GxB_*_Option_set/get: use GrB_get/set instead +GrB_Info GxB_Matrix_Option_set (GrB_Matrix, GxB_Option_Field, ...) ; +GrB_Info GxB_Matrix_Option_set_INT32 (GrB_Matrix, GxB_Option_Field, int32_t) ; +GrB_Info GxB_Matrix_Option_set_FP64 (GrB_Matrix, GxB_Option_Field, double) ; +GrB_Info GxB_Matrix_Option_get (GrB_Matrix, GxB_Option_Field, ...) ; +GrB_Info GxB_Matrix_Option_get_INT32 (GrB_Matrix, GxB_Option_Field, int32_t *) ; +GrB_Info GxB_Matrix_Option_get_FP64 (GrB_Matrix, GxB_Option_Field, double *) ; +GrB_Info GxB_Vector_Option_set (GrB_Vector, GxB_Option_Field, ...) ; +GrB_Info GxB_Vector_Option_set_INT32 (GrB_Vector, GxB_Option_Field, int32_t) ; +GrB_Info GxB_Vector_Option_set_FP64 (GrB_Vector, GxB_Option_Field, double) ; +GrB_Info GxB_Vector_Option_get (GrB_Vector, GxB_Option_Field, ...) ; +GrB_Info GxB_Vector_Option_get_INT32 (GrB_Vector, GxB_Option_Field, int32_t *) ; +GrB_Info GxB_Vector_Option_get_FP64 (GrB_Vector, GxB_Option_Field, double *) ; +GrB_Info GxB_Global_Option_set (GxB_Option_Field, ...) ; +GrB_Info GxB_Global_Option_set_INT32 (GxB_Option_Field, int32_t) ; +GrB_Info GxB_Global_Option_set_FP64 (GxB_Option_Field, double) ; +GrB_Info GxB_Global_Option_set_FP64_ARRAY (GxB_Option_Field, double *) ; +GrB_Info GxB_Global_Option_set_INT64_ARRAY (GxB_Option_Field, int64_t *) ; +GrB_Info GxB_Global_Option_set_CHAR (GxB_Option_Field, const char *) ; +GrB_Info GxB_Global_Option_set_FUNCTION (GxB_Option_Field, void *) ; +GrB_Info GxB_Global_Option_get (GxB_Option_Field, ...) ; +GrB_Info GxB_Global_Option_get_INT32 (GxB_Option_Field, int32_t *) ; +GrB_Info GxB_Global_Option_get_FP64 (GxB_Option_Field, double *) ; +GrB_Info GxB_Global_Option_get_INT64 (GxB_Option_Field, int64_t *) ; +GrB_Info GxB_Global_Option_get_CHAR (GxB_Option_Field, const char **) ; +GrB_Info GxB_Global_Option_get_FUNCTION (GxB_Option_Field, void **) ; +GrB_Info GxB_Context_set_INT32 (GxB_Context, GxB_Context_Field, int32_t) ; +GrB_Info GxB_Context_set_FP64 (GxB_Context, GxB_Context_Field, double) ; +GrB_Info GxB_Context_set (GxB_Context, GxB_Context_Field, ...) ; +GrB_Info GxB_Context_get_INT32 (GxB_Context, GxB_Context_Field, int32_t *) ; +GrB_Info GxB_Context_get_FP64 (GxB_Context, GxB_Context_Field, double *) ; +GrB_Info GxB_Context_get (GxB_Context, GxB_Context_Field, ...) ; + +// GxB_get/set: use GrB_get/set instead +#if GxB_STDC_VERSION >= 201112L +#define GxB_set(arg1,...) \ + _Generic \ + ( \ + (arg1), \ + default: GxB_Global_Option_set , \ + GxB_Option_Field : GxB_Global_Option_set , \ + GrB_Vector : GxB_Vector_Option_set , \ + GrB_Matrix : GxB_Matrix_Option_set , \ + GrB_Descriptor : GxB_Desc_set , \ + GxB_Context : GxB_Context_set \ + ) \ + (arg1, __VA_ARGS__) +#define GxB_get(arg1,...) \ + _Generic \ + ( \ + (arg1), \ + default: GxB_Global_Option_get , \ + GxB_Option_Field : GxB_Global_Option_get , \ + GrB_Vector : GxB_Vector_Option_get , \ + GrB_Matrix : GxB_Matrix_Option_get , \ + GrB_Descriptor : GxB_Desc_get , \ + GxB_Context : GxB_Context_get \ + ) \ + (arg1, __VA_ARGS__) +#endif + +// GxB_*_apply_BinaryOp*: GrB_*_apply_BinaryOp*_Scalar instead (as-is) +GrB_Info GxB_Vector_apply_BinaryOp1st (GrB_Vector, const GrB_Vector, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Vector, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_apply_BinaryOp2nd (GrB_Vector, const GrB_Vector, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Vector, const GrB_Scalar, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_apply_BinaryOp1st (GrB_Matrix, const GrB_Matrix, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Matrix, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_apply_BinaryOp2nd (GrB_Matrix, const GrB_Matrix, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Scalar, + const GrB_Descriptor) ; + +// GxB_kron: use GrB_Matrix_kronecker_BinaryOp instead (as-is) +GrB_Info GxB_kron (GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, + const GrB_BinaryOp, const GrB_Matrix, const GrB_Matrix, + const GrB_Descriptor) ; + +// GxB_*_resize: use GrB_*_resize instead (as-is) +GrB_Info GxB_Matrix_resize (GrB_Matrix, GrB_Index, GrB_Index) ; +GrB_Info GxB_Vector_resize (GrB_Vector, GrB_Index) ; + +// GxB_*_import/export_[FORMAT]: use GxB_*_pack/unpack_[FORMAT] instead +GrB_Info GxB_Matrix_import_CSR (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, + GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, + bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_BitmapR (GrB_Matrix *, GrB_Type, GrB_Index, + GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_CSC (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, + GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, + bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_HyperCSR (GrB_Matrix *, GrB_Type, GrB_Index, + GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, + GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_HyperCSC (GrB_Matrix *, GrB_Type, GrB_Index, + GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, + GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_BitmapC (GrB_Matrix *, GrB_Type, GrB_Index, + GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_FullR (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, + void **, GrB_Index, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_FullC (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, + void **, GrB_Index, bool, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_CSC (GrB_Vector *, GrB_Type, GrB_Index, GrB_Index **, + void **, GrB_Index, GrB_Index, bool, GrB_Index, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_Bitmap (GrB_Vector *, GrB_Type, GrB_Index, int8_t **, + void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_Full (GrB_Vector *, GrB_Type, GrB_Index, void **, + GrB_Index, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_CSR (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, + GrB_Index *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_CSC (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, + GrB_Index *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_HyperCSR (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, + GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, + bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_HyperCSC (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, + GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_BitmapR (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, + GrB_Index *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_BitmapC (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, + GrB_Index *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_FullR (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_FullC (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_CSC (GrB_Vector *, GrB_Type *, GrB_Index *, + GrB_Index **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, + bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_Bitmap (GrB_Vector *, GrB_Type *, GrB_Index *, + int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_Full (GrB_Vector *, GrB_Type *, GrB_Index *, + void **, GrB_Index *, bool *, const GrB_Descriptor) ; + +// GxB_select: use GrB_select instead +GrB_Info GxB_Vector_select (GrB_Vector w, const GrB_Vector mask, + const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, + const GrB_Scalar Thunk, const GrB_Descriptor desc) ; +GrB_Info GxB_Matrix_select (GrB_Matrix C, const GrB_Matrix Mask, + const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, + const GrB_Scalar Thunk, const GrB_Descriptor desc) ; +#if GxB_STDC_VERSION >= 201112L +#define GxB_select(C,Mask,accum,op,A,Thunk,desc) _Generic ((C), \ + GrB_Vector : GxB_Vector_select , \ + GrB_Matrix : GxB_Matrix_select ) (C, Mask, accum, op, A, Thunk, desc) +#endif + +// GxB_deserialize_* queries: use GrB_get instead +GrB_Info GxB_deserialize_type_name (char *, const void *, GrB_Index) ; + #endif // GB_CUDA_FOLDER #if defined ( __cplusplus ) } #endif + #endif diff --git a/Contributor_License/SuiteSparse Individual Contributor License Agreement (20241011).pdf b/Contributor_License/SuiteSparse Individual Contributor License Agreement (20241011).pdf new file mode 100644 index 0000000000..56ab97585d Binary files /dev/null and b/Contributor_License/SuiteSparse Individual Contributor License Agreement (20241011).pdf differ diff --git a/Demo/Program/gauss_demo.c b/Demo/Program/gauss_demo.c index 24a47625f7..c4567ea650 100644 --- a/Demo/Program/gauss_demo.c +++ b/Demo/Program/gauss_demo.c @@ -211,6 +211,7 @@ int main (void) // MINGW it is treated as always false). Only Linux and Mac can change // this setting. TRY (GxB_Global_Option_set (GxB_JIT_USE_CMAKE, true)) ; +// TRY (GxB_Global_Option_set (GxB_JIT_ERROR_FALLBACK, false)) ; printf ("Gauss demo. Note that all transposes are array transposes,\n" "not matrix (conjugate) transposes.\n\n") ; diff --git a/Demo/Program/grow_demo.c b/Demo/Program/grow_demo.c index 0fcdbd2fa8..9d017b0a1a 100644 --- a/Demo/Program/grow_demo.c +++ b/Demo/Program/grow_demo.c @@ -122,9 +122,9 @@ int main (int argc, char **argv) OK (GrB_Matrix_new (&C, atype, anrows, ancols)) ; OK (GrB_Vector_new (&w, atype, ancols)) ; // OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE)) ; - OK (GrB_Matrix_set_INT32 (C, (int32_t) false, GxB_HYPER_HASH)) ; - OK (GrB_Matrix_set_INT32 (C, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; - OK (GrB_Vector_set_INT32 (w, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (C, (int32_t) false, (GrB_Field) GxB_HYPER_HASH)) ; + OK (GrB_Matrix_set_INT32 (C, GxB_HYPERSPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Vector_set_INT32 (w, GxB_SPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; // printf ("\n\nC empty:\n") ; // OK (GxB_print (C, 1)) ; @@ -154,7 +154,7 @@ int main (int argc, char **argv) // OK (GxB_print (C, 1)) ; } - OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, (GrB_Field) GxB_BURBLE)) ; // OK (GxB_print (C, 1)) ; tt [0] = WALLCLOCK - tt [0] ; @@ -174,7 +174,7 @@ int main (int argc, char **argv) // OK (GrB_Global_set_INT32 (GrB_GLOBAL, true, GxB_BURBLE)) ; GrB_Matrix_free (&C) ; OK (GrB_Matrix_new (&C, atype, anrows, ancols)) ; - OK (GrB_Matrix_set_INT32 (C, GxB_HYPERSPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (C, GxB_HYPERSPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; t2 [0] = WALLCLOCK ; int64_t i1 = 0 ; @@ -193,7 +193,7 @@ int main (int argc, char **argv) // W = A (i1:i2,:) t = WALLCLOCK ; OK (GrB_Matrix_new (&W, atype, irows, ancols)) ; - OK (GrB_Matrix_set_INT32 (W, GxB_SPARSE, GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_set_INT32 (W, GxB_SPARSE, (GrB_Field) GxB_SPARSITY_CONTROL)) ; GrB_Index Icolon [3] ; Icolon [GxB_BEGIN] = i1 ; Icolon [GxB_INC ] = 1 ; @@ -222,7 +222,7 @@ int main (int argc, char **argv) i1 += irows ; } - OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, GxB_BURBLE)) ; + OK (GrB_Global_set_INT32 (GrB_GLOBAL, false, (GrB_Field) GxB_BURBLE)) ; t2 [0] = WALLCLOCK - t2 [0] ; printf ("\nmany rows at a time:\n") ; @@ -242,13 +242,13 @@ int main (int argc, char **argv) for (int trial = 1 ; trial <= 2 ; trial++) { int32_t threads ; - GrB_Global_get_INT32 (GrB_GLOBAL, &threads, GxB_GLOBAL_NTHREADS) ; + GrB_Global_get_INT32 (GrB_GLOBAL, &threads, (GrB_Field) GxB_GLOBAL_NTHREADS) ; GrB_Matrix_free (&T) ; t = WALLCLOCK ; OK (GrB_Matrix_dup (&T, A)) ; t = (WALLCLOCK - t) ; printf ("dup: %g (%d threads)\n", t, threads) ; - GrB_Global_set_INT32 (GrB_GLOBAL, (int) 1, GxB_GLOBAL_NTHREADS) ; + GrB_Global_set_INT32 (GrB_GLOBAL, (int) 1, (GrB_Field) GxB_GLOBAL_NTHREADS) ; } printf ("grow_demo: all tests passed\n") ; diff --git a/Doc/CONTRIBUTOR-LICENSE.txt b/Doc/CONTRIBUTOR-LICENSE.txt deleted file mode 100644 index 142bf61ecc..0000000000 --- a/Doc/CONTRIBUTOR-LICENSE.txt +++ /dev/null @@ -1,182 +0,0 @@ -SuiteSparse:GraphBLAS Individual Contributor License Agreement - -Thank you for your interest in contributing to SuiteSparse:GraphBLAS - -This contributor agreement ("Agreement") documents the rights granted by -contributors to the SuiteSparse:GraphBLAS authors ("We" and "Us"). To make this -document effective, please sign it and send it to Us by electronic submission. -This is a legally binding document, so please read it carefully before agreeing -to it. This Agreement is specific to SuiteSparse:GraphBLAS and does not -cover any other software project managed by Us. - -1. Definitions - - "You" means the individual who Submits a Contribution to Us. - - "Contribution" means any work of authorship that is Submitted by You to Us - in which You own or assert ownership of the Copyright. - - "Copyright" means all rights protecting works of authorship owned or - controlled by You, including copyright, moral and neighboring rights, as - appropriate, for the full term of their existence including any extensions - by You. - - "Material" means the work of authorship which is made available by Us to - third parties. When this Agreement covers more than one software project, - the Material means the work of authorship to which the Contribution was - Submitted. After You Submit the Contribution, it may be included in the - Material. - - "Submit" means any form of electronic, verbal, or written communication - sent to Us or our representatives, including but not limited to electronic - mailing lists, source code control systems, and issue tracking systems that - are managed by, or on behalf of, Us for the purpose of discussing and - improving the Material, but excluding communication that is conspicuously - marked or otherwise designated in writing by You as "Not a Contribution." - - "Submission Date" means the date on which You Submit a Contribution to Us. - - "Effective Date" means the date You execute this Agreement or the date You - first Submit a Contribution to Us, whichever is earlier. - -2. Grant of Rights - - 2.1 Copyright License - - (a) You retain ownership of the Copyright in Your Contribution and have - the same rights to use or license the Contribution which You would have - had without entering into the Agreement. - - (b) To the maximum extent permitted by the relevant law, You grant to - Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, - irrevocable license under the Copyright covering the Contribution, with - the right to sublicense such rights through multiple tiers of - sublicensees, to reproduce, modify, display, perform and distribute the - Contribution as part of the Material; provided that this license is - conditioned upon compliance with Section 2.3. - - 2.2 Patent License - - For patent claims including, without limitation, method, process, and - apparatus claims which You own, control or have the right to grant, now - or in the future, You grant to Us a perpetual, worldwide, - non-exclusive, transferable, royalty-free, irrevocable patent license, - with the right to sublicense these rights to multiple tiers of - sublicensees, to make, have made, use, sell, offer for sale, import and - otherwise transfer the Contribution and the Contribution in combination - with the Material (and portions of such combination). This license is - granted only to the extent that the exercise of the licensed rights - infringes such patent claims; and provided that this license is - conditioned upon compliance with Section 2.3. - - 2.3 Outbound License - - Based on the grant of rights in Sections 2.1 and 2.2, if We include - Your Contribution in a Material, We may license the Contribution under - any kind of permissive, commercial, or proprietary licenses, but - excluding any kind of copyleft license. Neither the Contribution, nor - SuiteSparse:GraphBLAS itself, will be licensed under a copyleft license - (including but not limited to GNU GPL, GNU LGPL, GNU AGPL, or - CC-BY_SA). Note that this restriction of copyleft licensing applies to - just SuiteSparse:GraphBLAS, not to any other packages in SuiteSparse, - many of which are already licensed under the GNU GPL or GNU LGPL. - - 2.4 Moral Rights. - - If moral rights apply to the Contribution, to the maximum extent - permitted by law, You waive and agree not to assert such moral rights - against Us or our successors in interest, or any of our licensees, - either direct or indirect. - - 2.5 Our Rights. - - You acknowledge that We are not obligated to use Your Contribution as - part of the Material and may decide to include any Contribution We - consider appropriate. - - 2.6 Reservation of Rights. - - Any rights not expressly licensed under this section are expressly - reserved by You. - -3. Agreement - - You confirm that: - - (a) You have the legal authority to enter into this Agreement. - - (b) You own the Copyright and patent claims covering the Contribution which - are required to grant the rights under Section 2. - - (c) The grant of rights under Section 2 does not violate any grant of - rights which You have made to third parties, including Your employer. If - You are an employee, You have had Your employer approve this Agreement or - sign the Entity version of this document. If You are less than eighteen - years old, please have Your parents or guardian sign the Agreement. - -4. Disclaimer - - EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS - PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES - INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY - DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE - DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD - PERMITTED BY LAW. - -5. Consequential Damage Waiver - - TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE - LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, - INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING - OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY - (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. - -6. Miscellaneous - - 6.1 This Agreement will be governed by and construed in accordance with the - laws of the State of Texas excluding its conflicts of law provisions. Under - certain circumstances, the governing law in this section might be - superseded by the United Nations Convention on Contracts for the - International Sale of Goods ("UN Convention") and the parties intend to - avoid the application of the UN Convention to this Agreement and, thus, - exclude the application of the UN Convention in its entirety to this - Agreement. - - 6.2 This Agreement sets out the entire agreement between You and Us for - Your Contributions to Us and overrides all other agreements or - understandings. - - 6.3 If You or We assign the rights or obligations received through this - Agreement to a third party, as a condition of the assignment, that third - party must agree in writing to abide by all the rights and obligations in - the Agreement. - - 6.4 The failure of either party to require performance by the other party - of any provision of this Agreement in one situation shall not affect the - right of a party to require such performance at any time in the future. A - waiver of performance under a provision in one situation shall not be - considered a waiver of the performance of the provision in the future or a - waiver of the provision in its entirety. - - 6.5 If any provision of this Agreement is found void and unenforceable, - such provision will be replaced to the extent possible with a provision - that comes closest to the meaning of the original provision and which is - enforceable. The terms and conditions set forth in this Agreement shall - apply notwithstanding any failure of essential purpose of this Agreement or - any limited remedy to the maximum extent possible under law. - -Us -Timothy A. Davis, GraphBLAS author - - -You: - - Your Name (printed): - - - Your Signature: - - - Date: - diff --git a/Doc/ChangeLog b/Doc/ChangeLog index a3bcae2af7..dfb007f987 100644 --- a/Doc/ChangeLog +++ b/Doc/ChangeLog @@ -1,3 +1,29 @@ +Nov 18, 2024: version 9.4.2 + + * clarified User Guide: regarding when the hyper-hash is built + * JIT: reduced JIT kernel encodings + * also: includes the updates from 9.4.0.beta and 9.4.1.beta listed below + +Nov 15, 2024: version 9.4.1 (only released as BETA) + + * new JIT kernels added: for GrB_assign, GrB_extract, GxB_sort, + GrB_kronecker, stand-alone mask phase, and utilities (convert to/from + sparse/bitmap, unjumble). All kernels formerly tagged "JIT: needed" + are now finished. + * removed Factory kernels for: types int8 and uint8, and semirings: + max_min, max_plus, max_times, min_max, min_times, plus_min, plus_max, + non-Boolean land/lor/lxor/lxnor, and integer times_first/second, + to reduce size of compiled library. JIT kernels will be used instead + for these types and semirings. + * GxB_IndexBinaryOp: finalized and named as GxB_*. + +Oct 15, 2024: version 9.4.0 (only released as BETA) + + * new operator and associated methods: added the draft G*B_IndexBinaryOp + * JIT error-handling behavior changed: if a compiler error occurs in the + JIT, GxB_JIT_ERROR is now returned. Previously, GraphBLAS would fall + back to a generic method if such an error occurred. + Aug 12, 2024: version 9.3.1 * (56) bug fix: wrong type for fgetc return value in JITpackage; leads diff --git a/Doc/FUTURE.txt b/Doc/FUTURE.txt index 90712b3a2b..b80b0c4e64 100644 --- a/Doc/FUTURE.txt +++ b/Doc/FUTURE.txt @@ -1,7 +1,5 @@ FUTURE plans for GraphBLAS: - GrB_IndexBinaryOp : very important for many graph algorithms - JIT package: don't just check 1st line of GraphBLAS.h when deciding to unpack the src in user cache folder. Use a crc test. @@ -41,7 +39,7 @@ FUTURE plans for GraphBLAS: 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" + GrB_set (op, GxB_DEFN, "string") also for all ops candidates for kernel fusion: @@ -55,10 +53,86 @@ FUTURE plans for GraphBLAS: * check if vectorization of GrB_mxm is effective when using clang * see how HNSW vector search could be implemented in GraphBLAS - for CUDA JIT: - - https://developer.nvidia.com/blog/cuda-12-0-compiler-support-for-runtime-lto-using-nvjitlink-library/ - Developer webpage talking about ways to do nvJit with link time - optimization using CUDA 12.0 Shows precompiled path and JIT path to - generate kernels +integer sizes: + use 32-bit or 64-bit integers in A->i, A->h, and perhaps A->p. + >>> requires generic pack/unpack method for O(1) move constructors. + could use new build methods (int32 indices), or GrB_Vectors for I and J. + does not require new extracTuples method (simply typecast the copy). + could use new GrB_*import/export methods, with int32 indices, or just + typecast on copy. + +first step: + A->i and A->h have the same size (both 32, or both 64), + determined by max(nrows,ncols) <= 2^30. A->p always 64-bit. + In the GrB_Matrix, A->i and A->h become void *, not int64_t *. + This gives 2 types of matrices. + + Ai = A->i ; + Ah = A->h ; + Ai [p] = i + Ah [k] = j + i = Ai [p] ; + j = Ah [k] ; + + replaced with + + GBI_GET_PTR (A) ; // new macro + GBH_GET_PTR (A) ; // new macro + GBI_SET (Ai, p, k) // new macro + GBH_SET (Ah, k, j) // new macro + i = GHI_A (Ai, pA, avlen) ; // no change to use of macro + j = GHH_A (Ah, pA, avlen) ; // no change to use of macro + + where + + #define GPI_GET_PTR(A) \ + A ## i32 = (A->is_32) ? (int32_t *) A->i : NULL ; + A ## i64 = (A->is_32) ? NULL : (int64_t *) A->i ; + + #define GPH_GET_PTR(A) \ + A ## h32 = (A->is_32) ? (int32_t *) A->h : NULL ; + A ## h64 = (A->is_32) ? NULL : (int64_t *) A->h ; + + #define GBI_SET (Ai, p, i) \ + if (Ai ## 32 == NULL) + { + Ai ## 64 [p] = (i) ; + } + else + { + Ai ## 32 [p] = (i) ; + } + + #define GBH_SET (Ah, k, j) \ + if (Ah ## 32 == NULL) + { + Ah ## 64 [k] = (j) ; + } + else + { + Ah ## 32 [k] = (j) ; + } + +// handles the case where Ai is 32 bit, 64 bit, or NULL for full matrix: +#define GBI (Ai, p, vlen) + (Ai ## 32 == NULL) ? ((Ai ## 64 == NULL) ? ((p) % vlen) : Ai ## 64 [p]) + : (Ai ## 32 [p]) ; + +// use the same for GBH + +All JIT kernels can be specialized to the int types of its matrices. +FactoryKernels and generic kernels cannot; they would need to use the above +macros. Or, current single-integer codes with no specializations would use: + + if (all matrices are 32 bit) + use all 32 bit Ai and Ah for all matrices + else if all 64 + use all 64 bit Ai and Ah for all matrices + else + use generic macros as above + +The code inside each of the 3 cases above would be templatized methods. + +memcpy (Ai, Ci, ...) would be replaced with a function that did all 4 +variants: both 32, 32 to 64, 64 to 32, and both 64. diff --git a/Doc/GrB_get_set.tex b/Doc/GrB_get_set.tex index 2c339aa93d..9563fff7e7 100644 --- a/Doc/GrB_get_set.tex +++ b/Doc/GrB_get_set.tex @@ -209,7 +209,8 @@ \subsection{Enum types for get/set: {\sf GrB\_Field}, {\sf GrB\_Orientation}, // GrB_Type (readable only): GrB_SIZE = 110, // size of the type - // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, and GrB_IndexUnaryOp: + // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, + // and GxB_IndexBinaryOp GxB_JIT_C_NAME = 7041, // C type or function name GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition @@ -221,6 +222,13 @@ \subsection{Enum types for get/set: {\sf GrB\_Field}, {\sf GrB\_Orientation}, // GrB_Semiring only: GxB_SEMIRING_MONOID = 7046, // semiring monoid GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op + + // GrB_BinaryOp and GxB_IndexBinaryOp: + GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops + GxB_THETA_TYPE_STRING = 7051, + + // GrB_BinaryOp or GrB_Semiring: + GxB_THETA = 7052, // to get the value of theta } GrB_Field ; @@ -372,7 +380,8 @@ \subsection{Global Options ({\sf GrB\_Global})} 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} \\ +\verb'GxB_JIT_USE_CMAKE' & R/W & \verb'int32_t'& " \\ +% \verb'GxB_JIT_ERROR_FALLBACK' & R/W & \verb'int32_t'& " \\ \hline \verb'GxB_HYPER_SWITCH' & R/W & \verb'double' & global hypersparsity control. \newline See Section~\ref{hypersparse}. \\ @@ -794,9 +803,11 @@ \subsection{{\sf GrB\_BinaryOp} Options} \verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\ \verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ \verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ +\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code, if any \\ \verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ \verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ \verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ +\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type, if any \\ \hline \verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (binop) name of the operator. For built-in operators, this returns the GraphBLAS @@ -810,6 +821,11 @@ \subsection{{\sf GrB\_BinaryOp} Options} \verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & definition for a user-defined operator, as a C function; built-in operators return an empty string. It can be set at most once. \\ +\verb'GxB_THETA' & R & \verb'GrB_Scalar' & + value of \verb'Theta', if any. + The type of the \verb'GrB_Scalar' + must match the \verb'Theta' type of the underlying + index-binary operator exactly. \\ \hline \end{tabular} } @@ -824,6 +840,68 @@ \subsection{{\sf GrB\_BinaryOp} Options} without a name, but it cannot use the JIT, even if the operator is given a name later on after the operator is created. +The \verb'*THETA*' options can only be used in the binary operator was +created by \verb'GxB_BinaryOp_new_IndexOp'. + +%------------------------------------------------------------------------------- +\newpage +\subsection{{\sf GxB\_IndexBinaryOp} Options} +\label{get_set_idxbinop} +%------------------------------------------------------------------------------- + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_get (GxB_IndexBinaryOp op, GrB_Scalar value, GrB_Field f) ; +GrB_Info GrB_get (GxB_IndexBinaryOp op, char * value, GrB_Field f) ; +GrB_Info GrB_get (GxB_IndexBinaryOp op, int32_t * value, GrB_Field f) ; +GrB_Info GrB_get (GxB_IndexBinaryOp op, size_t * value, GrB_Field f) ; + +GrB_Info GrB_set (GxB_IndexBinaryOp op, char * value, GrB_Field f) ; +\end{verbatim} +}\end{mdframed} + +\noindent +{\small +\begin{tabular}{|l|l|l|p{2.8in}|} +\hline +\verb'GrB_Field' & R/W & C type & description \\ +\hline +\verb'GrB_INP0_TYPE_CODE' & R & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\ +\verb'GrB_INP1_TYPE_CODE' & R & \verb'int32_t'& 2nd input type code \\ +\verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code \\ +\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code \\ +\verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type \\ +\verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type \\ +\verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type \\ +\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type \\ +\hline +\verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (binop) + name of the operator. + For user-defined operators, the name can be any string of any length. It + is not used by the JIT. It can be set at most once. \\ +\verb'GxB_JIT_C_NAME' & R/W1 & \verb'char *' & + This must be a valid name of a C function to enable its use in the JIT. + The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including + the \verb'nul' terminating byte. It can be set at most once. \\ +\verb'GxB_JIT_C_DEFINITION' & R/W1 & \verb'char *' & + definition for a user-defined operator, as a C function; built-in operators + return an empty string. It can be set at most once. \\ +\hline +\end{tabular} +} + +There are no built-in index-binary operators, but if there are in the future, +they will not be be modified by \verb'GrB_set'. User-defined operators can be +used without setting their name or definition, but they can be used in JIT +kernels only when both the JIT C name and the definition are set. + +To use the JIT, all semirings that access this index-binary operator must +be defined after the user-defined operator has been given both a name and a +definition. GraphBLAS can use a semiring that uses a binary operator +without a name, but it cannot use the JIT, even if the operator is given a name +later on after the operator is created. + %------------------------------------------------------------------------------- \newpage \subsection{{\sf GrB\_Monoid} Options} @@ -949,6 +1027,7 @@ \subsection{{\sf GrB\_Semiring} Options} \verb'GrB_OUTP_TYPE_CODE' & R & \verb'int32_t'& output type code of the multiplicative operator, and the monoid type. \\ +\verb'GxB_THETA_TYPE_CODE' & R & \verb'int32_t'& $\Theta$ type code, if any \\ \verb'GrB_INP0_TYPE_STRING' & R & \verb'char *' & name of the 1st input type of the multiplicative operator \\ \verb'GrB_INP1_TYPE_STRING' & R & \verb'char *' & name of the 2nd input type @@ -956,12 +1035,18 @@ \subsection{{\sf GrB\_Semiring} Options} \verb'GrB_OUTP_TYPE_STRING' & R & \verb'char *' & name of the output type of the multiplicative operator, and the monoid type. \\ +\verb'GxB_THETA_TYPE_STRING' & R & \verb'char *' & name of the $\Theta$ type, if any \\ \hline \verb'GrB_NAME' & R/W1 & \verb'char *' & % GrB_ALREADY_SET (semiring) name of the semiring. For built-in semirings, this returns the GraphBLAS name (\verb'"GrB_LOR_LAND_SEMIRING_BOOL"' for \verb'GrB_LOR_LAND_SEMIRING_BOOL', for example). For user-defined semirings, the name can be any string of any length. It is not used by the JIT. It can be set at most once. \\ +\verb'GxB_THETA' & R & \verb'GrB_Scalar' & + value of \verb'Theta', if any. + The type of the \verb'GrB_Scalar' + must match the \verb'Theta' type of the underlying + index-binary operator exactly. \\ \hline \end{tabular} } @@ -1011,6 +1096,9 @@ \subsection{{\sf GrB\_Semiring} Options} The binary op and monoid returned are aliases, not new objects. +The \verb'*THETA*' options can only be used in the multiplicative binary +operator of the semiring was created by \verb'GxB_BinaryOp_new_IndexOp'. + %------------------------------------------------------------------------------- \newpage \subsection{{\sf GrB\_Matrix} Options} diff --git a/Doc/GraphBLAS_UserGuide.bib b/Doc/GraphBLAS_UserGuide.bib index 404ad3958d..3d0d44a542 100644 --- a/Doc/GraphBLAS_UserGuide.bib +++ b/Doc/GraphBLAS_UserGuide.bib @@ -78,6 +78,7 @@ @techreport{spec author={Bulu\c{c}, A. and Mattson, T. and McMillan, S. and Moreira, J. and Yang, C.}, title={The {GraphBLAS} {C} {API} Specification}, year={2017}, + institution={GraphBLAS.org}, note={\href{http://graphblas.org/}{http://graphblas.org/}}, } @@ -85,6 +86,7 @@ @techreport{spec2 author={Brock, B. and Bulu\c{c}, A. and Mattson, T. and McMillan, S. and Moreira, J.}, title={The {GraphBLAS} {C} {API} Specification (v2.0)}, year={2021}, + institution={GraphBLAS.org}, note={\href{http://graphblas.org/}{http://graphblas.org/}}, } @@ -92,6 +94,7 @@ @techreport{Kepner2017 author={Kepner, J.}, title={{GraphBLAS} Mathematics}, year={2017}, + institution={MIT}, note={ \href{http://www.mit.edu/~kepner/GraphBLAS/GraphBLAS-Math-release.pdf}{http://www.mit.edu/$\sim$kepner/GraphBLAS/GraphBLAS-Math-release.pdf} } @@ -211,6 +214,14 @@ @inproceedings{Davis18b publisher={IEEE}, } +@inproceedings{idxbinop, + author={Mattson, T. G. and Bezbaruah, M. and Maier, M. and McMillan, S. and Peletier, M. and Welch, E. and Davis, T. A.}, + title={Indexed Binary operations in the GraphBLAS}, + year={2024}, + booktitle={IEEE HPEC'24}, + publisher={IEEE}, +} + @inproceedings{DavisAznavehKolodziej19, author={Davis, T. A. and Aznaveh, M. and Kolodziej, S.}, title={Write Quick, Run Fast: Sparse Deep Neural Network in 20 Minutes of diff --git a/Doc/GraphBLAS_UserGuide.pdf b/Doc/GraphBLAS_UserGuide.pdf index e7f89b8387..727796b53c 100644 Binary files a/Doc/GraphBLAS_UserGuide.pdf and b/Doc/GraphBLAS_UserGuide.pdf differ diff --git a/Doc/GraphBLAS_UserGuide.tex b/Doc/GraphBLAS_UserGuide.tex index fa915948b6..756087ee01 100644 --- a/Doc/GraphBLAS_UserGuide.tex +++ b/Doc/GraphBLAS_UserGuide.tex @@ -6,7 +6,7 @@ \usepackage[colorlinks,linkcolor=Blue,citecolor=Blue,urlcolor=Blue]{hyperref} \usepackage{amssymb} \usepackage{amsmath} -\usepackage{framed} +% \usepackage{framed} \usepackage{mdframed} % \usepackage{geometry} % \usepackage{pdflscape} @@ -1306,6 +1306,7 @@ \subsection{{\sf GrB\_Info:} status code returned by GraphBLAS} %=============== \verb'GrB_INVALID_OBJECT' & -104 & object is corrupted \\ \verb'GrB_INDEX_OUT_OF_BOUNDS' & -105 & a row or column index is out of bounds \\ \verb'GrB_EMPTY_OBJECT' & -106 & a input scalar has no entry \\ +\verb'GxB_JIT_ERROR' &-1001 & JIT compiler error \\ \hline \end{tabular} \vspace{0.2in} @@ -1419,6 +1420,7 @@ \section{GraphBLAS Objects and their Methods} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \verb'GrB_UnaryOp' & a unary operator $z=f(x)$, where $z$ and $x$ are scalars\\ \verb'GrB_BinaryOp' & a binary operator $z=f(x,y)$, where $z$, $x$, and $y$ are scalars\\ \verb'GrB_IndexUnaryOp' & an index-unary operator \\ +\verb'GxB_IndexBinaryOp' & an index-binary operator \\ \verb'GrB_Monoid' & an associative and commutative binary operator \\ & and its identity value \\ \verb'GrB_Semiring' & a monoid that defines the ``plus'' and a binary operator\\ @@ -1848,7 +1850,7 @@ \subsection{GraphBLAS unary operators: {\sf GrB\_UnaryOp}, $z=f(x)$} %========== \vspace{0.2in} \begin{tabular}{|llll|} \hline -\multicolumn{4}{|c|}{Positional unary operators for any type (including user-defined)} \\ +\multicolumn{4}{|c|}{Index-based unary operators for any type (including user-defined)} \\ \hline GraphBLAS name & types (domains) & $z=f(a_{ij})$ & description \\ \hline @@ -1940,15 +1942,16 @@ \subsection{GraphBLAS unary operators: {\sf GrB\_UnaryOp}, $z=f(x)$} %========== } \vspace{0.2in} -A positional unary operator return the row or column index of an entry. For a +Built-in index-based unary operators return the row or column index of an entry. For a matrix $z=f(a_{ij})$ returns $z = i$ or $z = j$, or +1 for 1-based indices. The latter is useful in the MATLAB/Octave interface, where row and column indices are 1-based. When applied to a vector, $j$ is always zero, and $i$ is the index in -the vector. Positional unary operators come in two types: \verb'INT32' and +the vector. These built-in unary operators come in two types: \verb'INT32' and \verb'INT64', which is the type of the output, $z$. The functions are agnostic to the type of their inputs; they only depend on the position of the entries, not their values. -User-defined positional operators cannot be defined by \verb'GrB_UnaryOp_new'. +User-defined index-based operators cannot be defined by \verb'GrB_UnaryOp_new'; +use \verb'GrB_IndexUnaryOp_new' instead; see Section~\ref{idxunop}. \verb'GxB_FREXPX' and \verb'GxB_FREXPE' return the mantissa and exponent, respectively, from the C11 \verb'frexp' function. The exponent is @@ -2385,22 +2388,29 @@ \subsection{GraphBLAS binary operators: {\sf GrB\_BinaryOp}, $z=f(x,y)$} %====== $2^{31}-1$ and (-1)/0 is $-2^{31}$. Refer to Section~\ref{type} for a list of integer ranges. -Eight positional operators are predefined. They differ when used in a semiring -and when used in \verb'GrB_eWise*' and \verb'GrB_apply'. Positional operators +%=============================================================================== +\subsubsection{GraphBLAS binary operators based on index binary operators} +%=============================================================================== + +Eight binary operators based on underlying index binary operators are +predefined. They differ when used in a semiring and when used in +\verb'GrB_eWise*' and \verb'GrB_apply'. These index-based binary operators cannot be used in \verb'GrB_build', nor can they be used as the \verb'accum' operator for any operation. -The positional binary operators do not depend on the type or numerical value of -their inputs, just their position in a matrix or vector. For a vector, $j$ is -always 0, and $i$ is the index into the vector. There are two types $N$ +The index-based binary operators do not depend on the type or numerical value +of their inputs, just their position in a matrix or vector. For a vector, $j$ +is always 0, and $i$ is the index into the vector. There are two types $N$ available: \verb'INT32' and \verb'INT64', which is the type of the output $z$. -User-defined positional operators cannot be defined by \verb'GrB_BinaryOp_new'. +User-defined index-based operators are not defined by \verb'GrB_BinaryOp_new', +but by \verb'GxB_BinaryOp_new_IndexOp' instead. See Section~\ref{idxbinaryop} +for details. \vspace{0.2in} {\footnotesize \begin{tabular}{|llll|} \hline -\multicolumn{4}{|c|}{Positional binary operators for any type (including user-defined)} \\ +\multicolumn{4}{|c|}{Index-based binary operators for any type (including user-defined)} \\ \multicolumn{4}{|c|}{when used as a multiplicative operator in a semiring} \\ \hline GraphBLAS name & types (domains) & $z=f(a_{ik},b_{kj})$ & description \\ @@ -2421,7 +2431,7 @@ \subsection{GraphBLAS binary operators: {\sf GrB\_BinaryOp}, $z=f(x,y)$} %====== {\footnotesize \begin{tabular}{|llll|} \hline -\multicolumn{4}{|c|}{Positional binary operators for any type (including user-defined)} \\ +\multicolumn{4}{|c|}{Index-based binary operators for any type (including user-defined)} \\ \multicolumn{4}{|c|}{when used in all other methods} \\ \hline GraphBLAS name & types (domains) & $z=f(a_{ij},b_{ij})$ & description \\ @@ -2906,7 +2916,7 @@ \subsubsection{{\sf GrB\_IndexUnaryOp\_wait:} wait for an index-unary operator} \end{verbatim} }\end{mdframed} -After creating a user-defined select operator, a GraphBLAS library may choose +After creating a user-defined index-unary operator, a GraphBLAS library may choose to exploit non-blocking mode to delay its creation. Currently, SuiteSparse:GraphBLAS currently does nothing except to ensure that the \verb'op' is valid. @@ -2940,6 +2950,285 @@ \subsubsection{{\sf GrB\_IndexUnaryOp\_free:} free a user-defined index-unary op input. It does nothing at all if passed a built-in index-unary operator. +\newpage +%=============================================================================== +\subsection{GraphBLAS index-binary operators: {\sf GxB\_IndexBinaryOp}} +%=============================================================================== +\label{idxbinaryop} + +An index-binary operator is a scalar function of the following form: +\[ +z=f(x,i_x,j_x,y,i_y,j_y,\Theta), +\] +where the value $x$ appears at row $i_x$ and column $j_x$ in its matrix, +and the value $y$ appears at row $i_y$ and column $j_y$ in its matrix. +The value $\Theta$ is a scalar that is the same for all uses of the operator. +See our IEEE HPEC'24 paper for more details (\cite{idxbinop}). + +When used in an element-wise method for $\bf C = A \oplus B$ and related +methods (\verb'GrB_eWiseAdd', \verb'GxB_eWiseUnion', \verb'GrB_eWiseMult', or +\verb'GrB_Kronecker'), the operator is used for a pair of entries $a_{ij}$ and +$b_{ij}$, as +\[ +z=f(a_{ij},i,j,b_{ij},i,j,\Theta). +\] +When used as the multiplicative operator in a semiring, to compute +$\bf C = A \oplus.\otimes B$, the operator is used as +\[ +z=f(a_{ik},i,k,b_{kj},k,j,\Theta) +\] +to compute an entry to be summed by the monoid of the semiring. + +No GraphBLAS operations directly use the \verb'GxB_IndexBinaryOp'. Instead, +the operator is coupled with a scalar \verb'Theta' value to create a new +index-based binary operator, which is simply a special case of a +\verb'GrB_BinaryOp'. The resulting \verb'GrB_BinaryOp' can then be passed to +element-wise methods and as the multiplicative operator of a new semiring. + +The signature of the index-binary function \verb'f' is as follows: + +{\footnotesize +\begin{verbatim} +void f +( + void *z, // output value z, of type ztype + const void *x, // input value x of type xtype; value of v(ix) or A(ix,jx) + GrB_Index ix, // row index of v(ix) or A(ix,jx) + GrB_Index jx, // column index of A(ix,jx), or zero for v(ix) + const void *y, // input value y of type ytype; value of w(iy) or B(iy,jy) + GrB_Index iy, // row index of w(iy) or B(iy,jy) + GrB_Index jy, // column index of B(iy,jy), or zero for w(iy) + const void *theta // input scalar theta of type theta_type +) ; \end{verbatim}} + +The following binary operators (\verb'GrB_BinaryOp' objects) are pre-defined, +where $N$ can be \verb'INT32' or \verb'INT64'. These operators do not use +\verb'theta'. Instead, the offset of 1 in \verb'GxB_FIRSTI1' is fixed into +the operator itself. + +\vspace{0.2in} +{\footnotesize +\begin{tabular}{|llll|} +\hline +\multicolumn{4}{|c|}{Built-in index-based binary operators for any type} \\ +\hline +GraphBLAS name & types (domains) & $z=f(x,y)$ & description \\ +\hline +\verb'GxB_FIRSTI_'$N$ & $ \rightarrow N$ & $z = i_x$ & row index of $x$ (0-based) \\ +\verb'GxB_FIRSTI1_'$N$ & $ \rightarrow N$ & $z = i_x+1$ & row index of $x$ (1-based) \\ +\verb'GxB_FIRSTJ_'$N$ & $ \rightarrow N$ & $z = j_x$ & column index of $x$ (0-based) \\ +\verb'GxB_FIRSTJ1_'$N$ & $ \rightarrow N$ & $z = j_x+1$ & column index of $x$ (1-based) \\ +\verb'GxB_SECONDI_'$N$ & $ \rightarrow N$ & $z = i_y$ & row index of $y$ (0-based) \\ +\verb'GxB_SECONDI1_'$N$ & $ \rightarrow N$ & $z = i_y+1$ & row index of $y$ (1-based) \\ +\verb'GxB_SECONDJ_'$N$ & $ \rightarrow N$ & $z = j_y$ & column index of $y$ (0-based) \\ +\verb'GxB_SECONDJ1_'$N$ & $ \rightarrow N$ & $z = j_y+1$ & column index of $y$ (1-based) \\ +\hline +\end{tabular} +} + +\vspace{0.2in} +The following methods operate on the \verb'GxB_IndexBinaryOp' object: + +\vspace{0.1in} +\noindent +{\footnotesize +\begin{tabular}{lll} +\hline +GraphBLAS function & purpose & Section \\ +\hline +\verb'GxB_IndexBinaryOp_new' & create a named user-defined index-binary operator & \ref{idxbinop_new_named} \\ +\verb'GxB_IndexBinaryOp_wait' & wait for a user-defined index-binary operator & \ref{idxbinop_wait} \\ +\verb'GrB_get' & get properties of an operator & \ref{get_set_idxbinop} \\ +\verb'GrB_set' & set the operator name/definition & \ref{get_set_idxbinop} \\ +\verb'GxB_IndexBinaryOp_free' & free a user-defined index-binary operator & \ref{idxbinop_free} \\ +\verb'GxB_BinaryOp_new_IndexOp' & create a new index-based \verb'GrB_BinaryOp' & \ref{binop_new_idxop} \\ +\hline +\end{tabular} +} +\vspace{0.1in} + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_IndexBinaryOp\_new:} create a user-defined index-binary operator} +%------------------------------------------------------------------------------- +\label{idxbinop_new_named} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_IndexBinaryOp_new +( + GxB_IndexBinaryOp *op, // handle for the new index binary operator + GxB_index_binary_function function, // pointer to the index binary function + GrB_Type ztype, // type of output z + GrB_Type xtype, // type of input x + GrB_Type ytype, // type of input y + GrB_Type theta_type, // type of input theta + const char *idxbinop_name, // name of the user function + const char *idxbinop_defn // definition of the user function +) ; +\end{verbatim} }\end{mdframed} + +Creates a named \verb'GxB_IndexBinaryOp'. Only the first 127 characters of +\verb'idxbinop_name' are used. The \verb'ixdbinop_defn' is a string containing +the entire function itself. + +The two strings \verb'idxbinop_name' and \verb'idxbinop_defn' are optional, but +are required to enable the JIT compilation of kernels that use this operator. +For example, the following operator can be used to compute the argmax of a +matrix with a single call to \verb'GrB_mxv'. It returns a vector \verb'c' +where \verb'c(i) = (k,v)', where the largest value in the $i$th row of \verb'A' +has value \verb'v' and appears in column \verb'k'. If multiple values in the +$i$th row have the same largest value, the one with the smallest column index +is returned. + +{\footnotesize +\begin{verbatim} + typedef struct { int64_t k ; double v ; } tuple_fp64 ; + #define FP64_K "typedef struct { int64_t k ; double v ; } tuple_fp64 ;" + void make_fp64 (tuple_fp64 *z, + const double *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx ; + z->v = (*x) ; + } + void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + #define MAX_FP64 (a string containing the max_fp64 function above) + + // create the types and operators: + GrB_Scalar Theta ; // unused, but cannot be NULL + GrB_Scalar_new (&Theta, GrB_BOOL) ; + GrB_Scalar_setElement_BOOL (Theta, 0) ; + GxB_IndexBinaryOp Iop ; + GrB_BinaryOp Bop, MonOp ; + GrB_Type Tuple ; + GxB_Type_new (&Tuple, sizeof (tuple_fp64), "tuple_fp64", FP64_K) ; + GxB_IndexBinaryOp_new (&Iop, make_fp64, Tuple, GrB_FP64, GrB_BOOL, GrB_BOOL, + "make_fp64", MAKE_FP64)) ; + GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta) ; + tuple_fp64 id ; + memset (&id, 0, sizeof (tuple_fp64)) ; + id.k = INT64_MAX ; + id.v = (double) (-INFINITY) ; + GxB_BinaryOp_new (&MonOp, max_fp64, Tuple, Tuple, Tuple, "max_fp64", MAX_FP64) ; + GrB_Monoid MonOp ; + GrB_Semiring Semiring ; + GrB_Monoid_new_UDT (&Monoid, MonOp, &id) ; + GrB_Semiring_new (&Semiring, Monoid, Bop) ; + + // compute the argmax of each row of a GrB_FP64 matrix A: + // y = zeros (ncols,1) ; + GrB_Vector y ; + GrB_Matrix_new (&y, GrB_BOOL, ncols, 1)) ; + GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, GrB_ALL, ncols, GrB_ALL, 1, NULL)) ; + // c = A*y using the argmax semiring + GrB_Vector_new (&c, Tuple, nrows, 1)) ; + GrB_mxv (c, NULL, NULL, Semiring, A, y, NULL) ; \end{verbatim}} + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_IndexBinaryOp\_wait:} wait for an index-binary operator} +%------------------------------------------------------------------------------- +\label{idxbinop_wait} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_IndexBinaryOp_wait +( + GxB_IndexBinaryOp op, + GrB_WaitMode waitmode +) ; +\end{verbatim} +}\end{mdframed} + +After creating a user-defined index-binary operator, a GraphBLAS library may choose +to exploit non-blocking mode to delay its creation. Currently, +SuiteSparse:GraphBLAS currently does nothing except to ensure that the +\verb'op' is valid. + +% \newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_IndexBinaryOp\_free:} free a user-defined index-binary operator} +%------------------------------------------------------------------------------- +\label{idxbinop_free} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GrB_free // free a user-created index-binary operator +( + GxB_IndexBinaryOp *op // handle of IndexBinaryOp to free +) ; +\end{verbatim} +}\end{mdframed} + +\verb'GxB_IndexBinaryOp_free' frees a user-defined index-binary operator. Either usage: + + {\small + \begin{verbatim} + GxB_IndexBinaryOp_free (&op) ; + GrB_free (&op) ; \end{verbatim}} + +\noindent +frees the \verb'op' and sets \verb'op' to \verb'NULL'. It safely +does nothing if passed a \verb'NULL' handle, or if \verb'op == NULL' on +input. No built-in index-binary operators exist, but if they did, +the method does nothing at all if passed a built-in index-binary operator. + +\newpage +%------------------------------------------------------------------------------- +\subsubsection{{\sf GxB\_BinaryOp\_new\_IndexOp:} create a index-based binary operator} +%------------------------------------------------------------------------------- +\label{binop_new_idxop} + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_BinaryOp_new_IndexOp +( + GrB_BinaryOp *binop, // handle of binary op to create + GxB_IndexBinaryOp idxbinop, // based on this index binary op + GrB_Scalar theta // theta value to bind to the new binary op +) ; +\end{verbatim} +}\end{mdframed} + +The \verb'GxB_IndexBinaryOp' cannot be directly used in any GraphBLAS operation +such as \verb'GrB_mxm'. Instead, it must be used to create a new index-based +\verb'GrB_BinaryOp'. The resulting binary operator can then be used to as the +multiplicative operator in a new user-defined semiring, or as the primary +binary operator of the element-wise operations (\verb'eWiseAdd', +\verb'eWiseUnion', \verb'eWiseMult', or \verb'kronecker'). + +The resulting binary operator cannot be used as the \verb'accum' operator in +any GraphBLAS operation. It also cannot be used in other places where a binary +operator appears, including \verb'GrB_*_build', \verb'GrB_apply', +\verb'GrB_reduce' and \verb'GrB_*_sort'. + +The \verb'GxB_BinaryOp_new_IndexOp' method creates this index-based binary +operator. It takes two input parameters: an index-binary operator, and a +scalar \verb'Theta'. The value of \verb'Theta' is copied into this new binary +operator, and the value cannot be changed. To change \verb'Theta', the binary +operator must be freed, and any semiring that would like to use the new value +of \verb'Theta' must also be recreated. + +An example of its use is given in Section~\ref{idxbinop_new_named}. + \newpage %=============================================================================== \subsection{GraphBLAS monoids: {\sf GrB\_Monoid}} %============================= @@ -3097,6 +3386,9 @@ \subsubsection{{\sf GrB\_Monoid\_new:} create a monoid} If \verb'op' is a built-in operator with a known identity value, then the \verb'identity' parameter is ignored, and its known identity value is used instead. +% +The \verb'op' cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Monoid\_wait:} wait for a monoid} @@ -3186,6 +3478,9 @@ \subsubsection{{\sf GxB\_Monoid\_terminal\_new:} create a monoid with terminal} that computes the same thing as \verb'GrB_MIN_FP32', and then create a monoid based on this user-defined operator with a terminal value of zero and an identity of \verb'+INFINITY'. +% +The \verb'op' cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. % \newpage %------------------------------------------------------------------------------- @@ -3354,19 +3649,22 @@ \subsubsection{{\sf GrB\_Semiring\_new:} create a semiring} \item 4 unsigned integer types \end{itemize} -\item 80 positional semirings, $X \times X \rightarrow N$ where $N$ is +\item 80 index-based semirings, $X \times X \rightarrow N$ where $N$ is \verb'INT32' or \verb'INT64': \vspace{-0.05in} \begin{itemize} \item 5 monoids (\verb'MIN', \verb'MAX', \verb'PLUS', \verb'TIMES', \verb'ANY') - \item 8 positional operators + \item 8 index-based operators (\verb'FIRSTI', \verb'FIRSTI1', \verb'FIRSTJ', \verb'FIRSTJ1', \verb'SECONDI', \verb'SECONDI1', \verb'SECONDJ', \verb'SECONDJ1') \item 2 integer types (\verb'INT32', \verb'INT64') \end{itemize} \end{itemize} +% +The \verb'multiply' operator can be any a binary operator, including one +created by \verb'GxB_BinaryOp_new_IndexOp'. %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Semiring\_wait:} wait for a semiring} @@ -3931,6 +4229,9 @@ \subsubsection{{\sf GrB\_Vector\_build:} build a vector from a set of tu If \verb'dup' is the special binary operator \verb'GxB_IGNORE_DUP', then any duplicates are ignored. If duplicates appear, the last one in the list of tuples is taken and the prior ones ignored. This is not an error. +% +The \verb'dup' operator cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. \begin{alert} {\bf SPEC:} Results are defined even if \verb'dup' is non-associative and/or @@ -4596,6 +4897,9 @@ \subsubsection{{\sf GrB\_Matrix\_build:} build a matrix from a set of tuples} do. In particular, the MATLAB \verb'sparse' function only provides one option for assembling duplicates (summation), and it can only build double, double complex, and logical sparse matrices. +% +The \verb'dup' operator cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. % \newpage %------------------------------------------------------------------------------- @@ -4626,7 +4930,7 @@ \subsubsection{{\sf GxB\_Matrix\_build\_Scalar:} build a matrix from a set of tu entries in the sparsity pattern of \verb'C' are identical, and equal to the input scalar value. -\newpage +% \newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Matrix\_setElement:} add an entry to a matrix} %------------------------------------------------------------------------------- @@ -6606,13 +6910,15 @@ \subsubsection{{\sf GxB\_unpack\_HyperHash:} unpack the hypersparse hash} The same process is used with \verb'GxB_Matrix_unpack_HyperCSR'. If \verb'A' is not hypersparse on input to \verb'GxB_unpack_HyperHash', or if -\verb'A' is hypersparse but does yet not have a hyper-hash, then \verb'Y' is -returned as \verb'NULL'. This is not an error condition, and -\verb'GrB_SUCCESS' is returned. The hyper-hash of a hypersparse matrix -\verb'A' is a matrix that provides quick access to the inverse of \verb'Ah'. -It is not always needed and may not be present. It is left as pending work to -be computed when needed. To ensure that the hyper-hash is constructed for a -hypersparse matrix \verb'A', use \verb'GrB_Matrix_wait (A, GrB_MATERIALIZE)' +\verb'A' is hypersparse but does yet not have a hyper-hash and or does not need +one, then \verb'Y' is returned as \verb'NULL'. This is not an error condition, +and \verb'GrB_SUCCESS' is returned. + +The hyper-hash of a hypersparse matrix \verb'A' is a matrix that provides quick +access to the inverse of \verb'Ah'. It is not always needed and may not be +present. It is left as pending work to be computed when needed. To ensure +that the hyper-hash is constructed for a hypersparse matrix \verb'A' (if it +needs one), use \verb'GrB_Matrix_wait (A, GrB_MATERIALIZE)' If \verb'Y' is moved from \verb'A' and returned as non-\verb'NULL' to the caller, then it is the responsibility of the user application to free it, or to @@ -6621,7 +6927,13 @@ \subsubsection{{\sf GxB\_unpack\_HyperHash:} unpack the hypersparse hash} If this method is called to remove the hyper-hash \verb'Y' from the hypersparse matrix \verb'A', and then \verb'GrB_Matrix_wait (A, GrB_MATERIALZE)' is called, -a new hyper-hash matrix is constructed for \verb'A'. +a new hyper-hash matrix is constructed for \verb'A' (if it needs one). + +Not all hypersparse matrices need the hyper-hash. The hyper-hash is built +only if the matrix has more than 1024 non-empty rows (if held by row) or +columns (if held by column). This threshold of 1024 can be revised with +\verb'GrB_set' as a global setting, \verb'GxB_HYPER_HASH' +(See Section \ref{get_set_global}). \newpage %------------------------------------------------------------------------------- @@ -7223,6 +7535,9 @@ \subsubsection{{\sf GxB\_Vector\_sort:} sort a vector} \verb'GxB_Vector_sort' is identical to sorting the single column of an \verb'n'-by-1 matrix. Refer to Section \ref{matrix_sort} for details. +% +The \verb'op' cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. %------------------------------------------------------------------------------- \subsubsection{{\sf GxB\_Matrix\_sort:} sort the rows/columns of a matrix} @@ -7279,6 +7594,9 @@ \subsubsection{{\sf GxB\_Matrix\_sort:} sort the rows/columns of a matrix} The outputs \verb'C' and \verb'P' are both optional; either one (but not both) may be \verb'NULL', in which case that particular output matrix is not computed. +% +The \verb'op' cannot be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. \newpage %=============================================================================== @@ -8173,6 +8491,7 @@ \subsection{Using the JIT} \verb'GxB_JIT_C_PREFACE' & \verb'char *' & C code as preface to JIT kernels \\ \verb'GxB_JIT_C_CONTROL' & see below & CPU JIT control \\ \verb'GxB_JIT_USE_CMAKE' & see below & CPU JIT control \\ +%\verb'GxB_JIT_ERROR_FALLBACK'& \verb'int32_t' & how to handle JIT compiler errors \\ \verb'GxB_JIT_ERROR_LOG' & \verb'char *' & error log file \\ \verb'GxB_JIT_CACHE_PATH' & \verb'char *' & folder with compiled kernels \\ \hline @@ -8241,14 +8560,25 @@ \subsubsection{\sf GxB\_JIT\_C\_CONTROL} \verb'GxB_JIT_RUN' instead. This is not an error condition. The resulting setting can be queried via \verb'GrB_get', if desired. -The JIT control setting can be also changed by GraphBLAS itself, based on +If your copy of GraphBLAS has many PreJIT kernels compiled into it, or uses +many run-time JIT kernels, turning of the JIT with \verb'GxB_JIT_OFF' can be +costly. This setting clears the entire JIT hash table. Renabling the JIT and +using it will require the JIT table to be repopulated, including a check of +each PreJIT kernel the first time they are used. If you wish to temporarily +disable the JIT, consider switching the JIT control to \verb'GxB_JIT_PAUSE' and +then back to \verb'GxB_JIT_RUN' to reenable the JIT. + +%---------------------------------------- +\subsubsection{JIT error handling} +%---------------------------------------- + +The JIT control setting can be changed by GraphBLAS itself, based on following error conditions. These changes affect all kernels, not just the kernel causing the error. If any of these cases occur, the call to GraphBLAS -will often return still return \verb'GrB_SUCCESS' because it can use its -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'GrB_get' to read the \verb'GxB_JIT_C_CONTROL' state. +returns \verb'GxB_JIT_ERROR', unless GraphBLAS runs out of memory, in which +case it returns \verb'GrB_OUT_OF_MEMORY' instead. If the JIT is disabled +through any of these errors, it can be detected by \verb'GrB_get' to read the +\verb'GxB_JIT_C_CONTROL' state. \begin{itemize} @@ -8285,6 +8615,12 @@ \subsubsection{\sf GxB\_JIT\_C\_CONTROL} \end{itemize} +As a result of this automatic change in the JIT control setting, after the +first JIT error is returned, subsequent calls to GraphBLAS will likely succeed. +GraphBLAS will use a generic kernel instead. To re-enable the JIT for +subsequent calls to GraphBLAS, the user application must reset the +\verb'GxB_JIT_C_CONTROL' back to \verb'GxB_JIT_ON'. + In many use cases of GraphBLAS (such as LAGraph), a function will create a type or operator, use it, and then free it just before returning. It would be far to costly to clear the loaded kernel and reload it each time the LAGraph @@ -8410,7 +8746,7 @@ \subsubsection{\sf GxB\_JIT\_CACHE\_PATH} exists, and initializes the cache path with that value instead of using the default. -{\bf Restrictions:} the cache path is santized for security reasons. No spaces +{\bf Restrictions:} the cache path is sanitized for security reasons. No spaces are permitted. Backslashes are converted into forward slashes. It can contain only charactors in the following list: @@ -8620,15 +8956,6 @@ \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 @@ -8642,7 +8969,8 @@ \subsubsection{Heuristics for controlling the 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. +problems. The possible downside of this approach is that the same JIT kernels +might be needed later for larger problems. \subsubsection{CUDA / SYCL / OpenCL kernels} The CUDA JIT will enable NVIDIA GPUs to be exploited. There are simply too @@ -9217,6 +9545,9 @@ \subsubsection{{\sf GrB\_Vector\_eWiseMult:} element-wise vector multiply} additive operator of the monoid is used as the \verb'multiply' binary operator. If given a semiring (\verb'GrB_Semiring'), the multiply operator of the semiring is used as the \verb'multiply' binary operator. +% +The \verb'multiply' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. The next and final step is ${\bf w \langle m \rangle = w \odot t}$, as described in Section~\ref{accummask}, except that all the terms are column @@ -9261,6 +9592,9 @@ \subsubsection{{\sf GrB\_Matrix\_eWiseMult:} element-wise matrix multiply} additive operator of the monoid is used as the \verb'multiply' binary operator. If given a semiring (\verb'GrB_Semiring'), the multiply operator of the semiring is used as the \verb'multiply' binary operator. +% +The \verb'multiply' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. \vspace{0.05in} The operation can be expressed in MATLAB notation as: @@ -9384,6 +9718,9 @@ \subsubsection{{\sf GrB\_Vector\_eWiseAdd:} element-wise vector addition} additive operator of the monoid is used as the \verb'add' binary operator. If given a semiring (\verb'GrB_Semiring'), the additive operator of the monoid of the semiring is used as the \verb'add' binary operator. +% +The \verb'add' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. The final step is ${\bf w \langle m \rangle = w \odot t}$, as described in Section~\ref{accummask}, except that all the terms are column vectors instead @@ -9424,6 +9761,9 @@ \subsubsection{{\sf GrB\_Matrix\_eWiseAdd:} element-wise matrix addition} additive operator of the monoid is used as the \verb'add' binary operator. If given a semiring (\verb'GrB_Semiring'), the additive operator of the monoid of the semiring is used as the \verb'add' binary operator. +% +The \verb'add' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. \vspace{0.05in} The operation can be expressed in MATLAB notation as: @@ -9529,6 +9869,9 @@ \subsubsection{{\sf GxB\_Vector\_eWiseUnion:} element-wise vector addition} Likewise, if \verb'v(i)' is present but \verb'u(i)' is not, then \verb't(i)=alpha+v(i)', where \verb'+' denotes the binary operator, \verb'add'. +% +The \verb'add' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. \newpage %------------------------------------------------------------------------------- @@ -9563,6 +9906,9 @@ \subsubsection{{\sf GxB\_Matrix\_eWiseUnion:} element-wise matrix addition} Likewise, if \verb'B(i,j)' is present but \verb'A(i,j)' is not, then \verb'T(i,j)=alpha+B(i,j)', where \verb'+' denotes the binary operator, \verb'add'. +% +The \verb'add' operator may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. \newpage %=============================================================================== @@ -10947,7 +11293,7 @@ \subsection{{\sf GrB\_apply:} apply a unary, binary, or index-unary operator} when describing each variation. When discussing features that apply to all versions, the simple name \verb'GrB_apply' is used. -\newpage +% \newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Vector\_apply:} apply a unary operator to a vector} %------------------------------------------------------------------------------- @@ -10976,7 +11322,7 @@ \subsubsection{{\sf GrB\_Vector\_apply:} apply a unary operator to a vector} \langle m \rangle = w \odot t}$, as described in Section~\ref{accummask}, except that all the terms are column vectors instead of matrices. -\newpage +% \newpage %------------------------------------------------------------------------------- \subsubsection{{\sf GrB\_Matrix\_apply:} apply a unary operator to a matrix} %------------------------------------------------------------------------------- @@ -11028,7 +11374,7 @@ \subsubsection{{\sf GrB\_Matrix\_apply:} apply a unary operator to a matrix} both built-in and user-defined types. However, it is only available for matrices, not vectors. -\newpage +% \newpage %=============================================================================== \subsubsection{{\sf GrB\_Vector\_apply\_BinaryOp1st:} apply a binary operator to a vector; 1st scalar binding} %=============================================================================== @@ -11056,6 +11402,13 @@ \subsubsection{{\sf GrB\_Vector\_apply\_BinaryOp1st:} apply a binary operator to type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. It is otherwise identical to \verb'GrB_Vector_apply'. +The \verb'op' can be any binary operator except that it cannot be a +user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. +For backward compatibility with prior versions of SuiteSparse:GraphBLAS, +built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be +used, however. The equivalent index-unary operators are used in their place. + +\newpage %=============================================================================== \subsubsection{{\sf GrB\_Vector\_apply\_BinaryOp2nd:} apply a binary operator to a vector; 2nd scalar binding} %=============================================================================== @@ -11083,7 +11436,13 @@ \subsubsection{{\sf GrB\_Vector\_apply\_BinaryOp2nd:} apply a binary operator to type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. It is otherwise identical to \verb'GrB_Vector_apply'. -\newpage +The \verb'op' can be any binary operator except that it cannot be a +user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. +For backward compatibility with prior versions of SuiteSparse:GraphBLAS, +built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be +used, however. The equivalent index-unary operators are used in their place. + +% \newpage %=============================================================================== \subsubsection{{\sf GrB\_Vector\_apply\_IndexOp:} apply an index-unary operator to a vector} %=============================================================================== @@ -11110,6 +11469,7 @@ \subsubsection{{\sf GrB\_Vector\_apply\_IndexOp:} apply an index-unary operator type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. It is otherwise identical to \verb'GrB_Vector_apply'. +% \newpage %=============================================================================== \subsubsection{{\sf GrB\_Matrix\_apply\_BinaryOp1st:} apply a binary operator to a matrix; 1st scalar binding} %=============================================================================== @@ -11137,7 +11497,13 @@ \subsubsection{{\sf GrB\_Matrix\_apply\_BinaryOp1st:} apply a binary operator to type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. It is otherwise identical to \verb'GrB_Matrix_apply'. -\newpage +The \verb'op' can be any binary operator except that it cannot be a +user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. +For backward compatibility with prior versions of SuiteSparse:GraphBLAS, +built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be +used, however. The equivalent index-unary operators are used in their place. + +% \newpage %=============================================================================== \subsubsection{{\sf GrB\_Matrix\_apply\_BinaryOp2nd:} apply a binary operator to a matrix; 2nd scalar binding} %=============================================================================== @@ -11165,6 +11531,12 @@ \subsubsection{{\sf GrB\_Matrix\_apply\_BinaryOp2nd:} apply a binary operator to type, a \verb'void *' for user-defined types, or a \verb'GrB_Scalar'. It is otherwise identical to \verb'GrB_Matrix_apply'. +The \verb'op' can be any binary operator except that it cannot be a +user-defined \verb'GrB_BinaryOp' created by \verb'GxB_BinaryOp_new_IndexOp'. +For backward compatibility with prior versions of SuiteSparse:GraphBLAS, +built-in index-based binary operators such as \verb'GxB_FIRSTI_INT32' may be +used, however. The equivalent index-unary operators are used in their place. + %=============================================================================== \subsubsection{{\sf GrB\_Matrix\_apply\_IndexOp:} apply an index-unary operator to a matrix} %=============================================================================== @@ -11298,7 +11670,7 @@ \subsubsection{{\sf GrB\_Matrix\_select:} apply a select operator to a matrix} For floating-point values, comparisons with \verb'NaN' always return false. The \verb'GrB_VALUE*' operators should not be used with a scalar \verb'y' that is -equal to \verb'NaN'. For this case, create a user-defined select operator that +equal to \verb'NaN'. For this case, create a user-defined index-unary operator that performs the test with the ANSI C \verb'isnan' function instead. \vspace{0.2in} @@ -11575,6 +11947,9 @@ \subsection{{\sf GrB\_kronecker:} Kronecker product} %========================== The operator \verb'op' may be a \verb'GrB_BinaryOp', a \verb'GrB_Monoid', or a \verb'GrB_Semiring'. In the latter case, the multiplicative operator of the semiring is used. +% +The \verb'op' may be a binary operator +created by \verb'GxB_BinaryOp_new_IndexOp'. \newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -11598,6 +11973,7 @@ \section{Printing GraphBLAS objects} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \verb'GxB_UnaryOp_fprint' & print and check a \verb'GrB_UnaryOp' \\ \verb'GxB_BinaryOp_fprint' & print and check a \verb'GrB_BinaryOp' \\ \verb'GxB_IndexUnaryOp_fprint' & print and check a \verb'GrB_IndexUnaryOp' \\ +\verb'GxB_IndexBinaryOp_fprint'& print and check a \verb'GxB_IndexBinaryOp' \\ \verb'GxB_Monoid_fprint' & print and check a \verb'GrB_Monoid' \\ \verb'GxB_Semiring_fprint' & print and check a \verb'GrB_Semiring' \\ \verb'GxB_Descriptor_fprint' & print and check a \verb'GrB_Descriptor' \\ @@ -11686,7 +12062,7 @@ \section{Printing GraphBLAS objects} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% use \verb'GrB_set (GrB_GLOBAL, true, GxB_PRINT_1BASED)'. Printing is done as zero-based by default. -\newpage +% \newpage %=============================================================================== \subsection{{\sf GxB\_fprint:} Print a GraphBLAS object to a file} %============ %=============================================================================== @@ -11811,6 +12187,22 @@ \subsection{{\sf GxB\_IndexUnaryOp\_fprint:} Print a {\sf GrB\_IndexUnaryOp}} the \verb'GrB_TRIL' index-unary operator to the file \verb'f'. \newpage +%=============================================================================== +\subsection{{\sf GxB\_IndexBinaryOp\_fprint:} Print a {\sf GxB\_IndexBinaryOp}} +%=============================================================================== + +\begin{mdframed}[userdefinedwidth=6in] +{\footnotesize +\begin{verbatim} +GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp +( + GxB_IndexBinaryOp op, // object to print and check + const char *name, // name of the object + GxB_Print_Level pr, // print level + FILE *f // file for output +) ; +\end{verbatim} } \end{mdframed} + %=============================================================================== \subsection{{\sf GxB\_Monoid\_fprint:} Print a {\sf GrB\_Monoid}} %=============================================================================== @@ -11854,6 +12246,7 @@ \subsection{{\sf GxB\_Semiring\_fprint:} Print a {\sf GrB\_Semiring}} \verb'GxB_COMPLETE, f)' prints the predefined \verb'GxB_PLUS_TIMES_FP64' semiring to the file \verb'f'. +\newpage %=============================================================================== \subsection{{\sf GxB\_Descriptor\_fprint:} Print a {\sf GrB\_Descriptor}} %=============================================================================== @@ -11914,6 +12307,7 @@ \subsection{{\sf GxB\_Matrix\_fprint:} Print a {\sf GrB\_Matrix}} prints about 30 entries from the matrix \verb'A' to the file \verb'f'. +\newpage %=============================================================================== \subsection{{\sf GxB\_Vector\_fprint:} Print a {\sf GrB\_Vector}} %=============================================================================== @@ -11933,7 +12327,6 @@ \subsection{{\sf GxB\_Vector\_fprint:} Print a {\sf GrB\_Vector}} For example, \verb'GxB_Vector_fprint (v, "my vector", GxB_SHORT, f)' prints about 30 entries from the vector \verb'v' to the file \verb'f'. -\newpage %=============================================================================== \subsection{{\sf GxB\_Scalar\_fprint:} Print a {\sf GrB\_Scalar}} %=============================================================================== @@ -12585,7 +12978,6 @@ \subsection{Example: column iterator for a matrix} double aij = GxB_Iterator_get_FP64 (iterator) ; // move to the next entry in A(:,j) info = GxB_colIterator_nextRow (iterator) ; - OK (info) ; } // move to the next column, A(:,j+1), or a subsequent one if j+1 is implicit info = GxB_colIterator_nextCol (iterator) ; @@ -12804,58 +13196,6 @@ \subsection{Using iso matrices and vectors in a graph algorithm} semiring, but any other binary operator can be used instead when using \verb'GrB_mxv'. -Below is a method for computing the argmax of each row of a square matrix -\verb'A' of dimension \verb'n' and type \verb'GrB_FP64'. The vector \verb'x' -contains the maximum value in each row, and the vector \verb'p' contains the -zero-based column index of the maximum value in each row. If there are -duplicate maximum values in each row, any one of them is selected arbitrarily -using the \verb'ANY' monoid. To select the minimum column index of the -duplicate maximum values, use the \verb'GxB_MIN_SECONDI_INT64' semiring instead -(this will be slightly slower than the \verb'ANY' monoid if there are many -duplicates). - -To compute the argmax of each column, use the \verb'GrB_DESC_T0' descriptor -in \verb'GrB_mxv', and compute \verb'G=A*D' instead of \verb'G=D*A' with -\verb'GrB_mxm'. See the \verb'GrB.argmin' and \verb'GrB.argmax' functions -in the MATLAB/Octave interface for details. - -% corresponds to GrB.argmax with dim = 2 - -{\footnotesize -\begin{verbatim} - GrB_Vector_new (&x, GrB_FP64, n) ; - GrB_Vector_new (&y, GrB_FP64, n) ; - GrB_Vector_new (&p, GrB_INT64, n) ; - // y (:) = 1, an iso full vector - GrB_assign (y, NULL, NULL, 1, GrB_ALL, n, NULL) ; - // x = max (A) where x(i) = max (A (i,:)) - GrB_mxv (x, NULL, NULL, GrB_MAX_FIRST_SEMIRING_FP64, A, y, NULL) ; - // D = diag (x) - GrB_Matrix_diag (&D, x, 0) ; - // G = D*A using the ANY_EQ semiring - GrB_Matrix_new (&G, GrB_BOOL, n, n) ; - GrB_mxm (G, NULL, NULL, GxB_ANY_EQ_FP64, D, A, NULL) ; - // drop explicit zeros from G - GrB_select (G, NULL, NULL, GrB_VALUENE_BOOL, G, 0, NULL) ; - // find the position of any max entry in each row: p = G*y, - // so that p(i) = j if x(i) = A(i,j) = max (A (i,:)) - GrB_mxv (p, NULL, NULL, GxB_ANY_SECONDI_INT64, G, y, NULL) ; \end{verbatim}} - -No part of the above code takes $\Omega(n)$ time or memory. The data type of -the iso full vector \verb'y' can be anything, and its iso value can be -anything. It is operated on by the \verb'FIRST' operator in the first -\verb'GrB_mxv', and the \verb'SECONDI' positional operator in the second -\verb'GrB_mxv', and both operators are oblivious to the content and even the -type of \verb'y'. The semirings simply note that \verb'y' is a full vector and -compute their result according, by accessing the matrices only (\verb'A' and -\verb'G', respectively). - -For floating-point values, \verb'NaN' values are ignored, and treated as if -they were not present in the input matrix, unless all entries in a given row -are equal to \verb'NaN'. In that case, if all entries in \verb'A(i,:)' are -equal to \verb'NaN', then \verb'x(i)' is \verb'NaN' and the entry \verb'p(i)' -is not present. - %------------------------------------------------------------------------------- \subsection{Iso matrices from matrix multiplication} %------------------------------------------------------------------------------- @@ -12871,7 +13211,7 @@ \subsection{Iso matrices from matrix multiplication} where the first rule that fits defines the property and value of \verb'C'. \begin{itemize} - \item If the semiring includes a positional multiplicative operator + \item If the semiring includes a index-based multiplicative operator (\verb'GxB_FIRSTI', \verb'GrB_SECONDI', and related operators), then \verb'C' is never iso. @@ -12923,7 +13263,7 @@ \subsection{Iso matrices from eWiseMult and kronecker} applied with \verb'eWiseMult'. These rules also apply to \verb'GrB_kronecker'. \begin{itemize} - \item If the operator is positional (\verb'GxB_FIRSTI' and related) then + \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then \verb'C' is not iso. \item If the op is \verb'PAIR' (same as \verb'ONEB'), @@ -12955,7 +13295,7 @@ \subsection{Iso matrices from eWiseAdd} the rules for \verb'eWiseMult' in Section~\ref{iso_emult} are used instead. - \item If the operator is positional (\verb'GxB_FIRSTI' and related) then + \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then \verb'C' is not iso. \item If $a$ and $b$ differ (when typecasted to the type of \verb'C'), @@ -12980,7 +13320,7 @@ \subsection{Iso matrices from eWiseUnion} the rules for \verb'eWiseMult' in Section~\ref{iso_emult} are used instead. - \item If the operator is positional (\verb'GxB_FIRSTI' and related) then + \item If the operator is index-based (\verb'GxB_FIRSTI' and related) then \verb'C' is not iso. \item If the op is \verb'PAIR' (same as \verb'ONEB'), @@ -13024,7 +13364,7 @@ \subsection{Iso matrices from apply} operator with \verb's' a scalar. \begin{itemize} - \item If the operator is positional (\verb'GxB_POSITION*', + \item If the operator is index-based (\verb'GxB_POSITION*', \verb'GxB_FIRSTI', and related) then \verb'C' is not iso. \item If the operator is \verb'ONE' or \verb'PAIR' (same as \verb'ONEB'), @@ -13139,7 +13479,7 @@ \subsubsection{Assignment with no accumulator operator} \subsubsection{Assignment with an accumulator operator} If an accumulator operator is present, the following rules are used. -Positional operators (\verb'GxB_FIRSTI' and related) cannot be used as +Index-based operators (\verb'GxB_FIRSTI' and related) cannot be used as accumulator operators, so these rules do not consider that case. \begin{itemize} @@ -14492,6 +14832,43 @@ \section{Release Notes} \begin{itemize} +\item Nov 20, 2024: version 9.4.2 + + \begin{itemize} + \item clarified User Guide: regarding when the hyper-hash is built + \item JIT: reduced JIT kernel encodings + \item (also includes the updates from 9.4.0.beta and 9.4.1.beta listed below). + \end{itemize} + +\item Nov 15, 2024: version 9.4.1 (only released as BETA) + + \begin{itemize} + \item More JIT kernels: all JIT kernels for \verb'GrB_assign', + \verb'GxB_subassign', \verb'GrB_extract', \verb'GxB_sort' + \verb'GrB_kronecker', the stand-alone mask phase (an internal method that + computes $\bf C \langle M \rangle = Z$), and utilities have been created. + All kernels formerly tagged in the code as \verb'JIT: needed' are now + finished. + \item + removed Factory kernels for: types int8 and uint8, and semirings: + max\_min, max\_plus, max\_times, min\_max, min\_times, plus\_min, + plus\_max, + non-Boolean land/lor/lxor/lxnor, and integer times\_first/second, + to reduce size of compiled library. + JIT kernels will be used instead for these types and semirings. + \item \verb'GxB_IndexBinaryOp': finalized and named as \verb'GxB_*'. + \end{itemize} + +\item Oct 15, 2024: version 9.4.0 (only released as BETA) + + \begin{itemize} + \item new operator and associated methods: + added the draft \verb'G*B_IndexBinaryOp'. + \item JIT error-handling behavior changed: if a compiler error occurs in + the JIT, \verb'GxB_JIT_ERROR' is now returned. Previously, GraphBLAS + would fall back to a generic method if such an error occurred. + \end{itemize} + \item Aug 12, 2024: version 9.3.1 \begin{itemize} @@ -15248,7 +15625,7 @@ \section{Release Notes} \item \verb'GrB_*_extractTuples': may return indices out of order \item removed internal features: GBI iterator, slice and hyperslice matrices \item bitmap/full matrices and vectors added - \item positional operators and semirings: + \item index-based operators and semirings: \verb'GxB_FIRSTI_INT32' and related ops \item jumbled matrices: sort left pending, like zombies and pending tuples \item \verb'GxB_get/set': added \verb'GxB_SPARSITY_*' diff --git a/Doc/GraphBLAS_version.tex b/Doc/GraphBLAS_version.tex index 43025c5439..501f0b14f4 100644 --- a/Doc/GraphBLAS_version.tex +++ b/Doc/GraphBLAS_version.tex @@ -1,5 +1,5 @@ % version of SuiteSparse:GraphBLAS \date{VERSION -9.3.1, -Aug 12, 2024} +9.4.2, +Nov 18, 2024} diff --git a/Doc/IndexBinaryOps_IEEE_HPEC24.pdf b/Doc/IndexBinaryOps_IEEE_HPEC24.pdf new file mode 100644 index 0000000000..9575947e2e Binary files /dev/null and b/Doc/IndexBinaryOps_IEEE_HPEC24.pdf differ diff --git a/Doc/README_Doc.txt b/Doc/README_Doc.txt index 05ea770afb..7180ba7a87 100644 --- a/Doc/README_Doc.txt +++ b/Doc/README_Doc.txt @@ -6,7 +6,7 @@ This folder contains the following files: CONTRIBUTOR-LICENSE.txt how to contribute to GraphBLAS ChangeLog changes in GraphBLAS - GraphBLAS_API_C_2.0.0.pdf v2.0 C API (see https://graphblas.org) + GraphBLAS_API_C_v2.1.0.pdf v2.1.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 @@ -77,3 +77,8 @@ The_GraphBLAS_in_Julia_and_Python_the_PageRank_and_Triangle_Centralities.pdf Performance Extreme Computing Conference (HPEC), Waltham, MA, USA, 2021, pp. 1-7, doi: 10.1109/HPEC49654.2021.9622789. +IndexBinaryOps_IEEE_HPEC24.pdf + + T. G. Mattson, M. Bezbaruah, M. Maier, S. McMillan, M. Peletier, E. Welch, + and T. A. Davis, Indexed Binary operations in the GraphBLAS, IEEE HPEC'24. + diff --git a/Doc/md-frame-0.mdf b/Doc/md-frame-0.mdf new file mode 100644 index 0000000000..1c79a61cf6 --- /dev/null +++ b/Doc/md-frame-0.mdf @@ -0,0 +1,861 @@ + +%% Style file for mdframed for package option `framemethod=default` +%% +%% This package may be distributed under the terms of the LaTeX Project +%% Public License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +\def\mdframedOpackagename{md-frame-0} +\ProvidesFile{md-frame-0.mdf}% + [\mdfmaindate\ % + \mdversion: \mdframedOpackagename] +\def\mdf@background@default{\color{\mdf@backgroundcolor}} +\def\mdf@frametitlebackground@default{\color{\mdf@frametitlebackgroundcolor}} +\def\mdf@shadow@default{\color{\mdf@shadowcolor}} +\def\mdf@innerlinecolor@default{\color{\mdf@innerlinecolor}} +\def\mdf@middlelinecolor@default{\color{\mdf@middlelinecolor}} +\def\mdf@outerlinecolor@default{\color{\mdf@outerlinecolor}} +\def\mdf@frametitlerulecolor@default{\color{\mdf@frametitlerulecolor}} +\let\mdf@linecolor@default\mdf@middlelinecolor@default +\def\mdf@@frametitlerule{% + \ifbool{mdf@frametitlerule}{% + \vbox{\hsize\mdfframetitleboxwidth% + \par\unskip\vskip\mdf@frametitlebelowskip@length% + \rlap{\noindent\hspace*{-\mdf@innerleftmargin@length}% + \mdf@frametitlerulecolor@default% + \rule{\dimexpr\mdfframetitleboxwidth% + +\mdf@innerleftmargin@length + +\mdf@innerrightmargin@length\relax + }{\mdf@frametitlerulewidth@length}% + }\hrule \@height\z@ \@width\hsize}% + }{% + \vbox{\hsize\mdfframetitleboxwidth% + \par\unskip\vskip\mdf@frametitlebelowskip@length% + \rlap{\noindent\hspace*{-\mdf@innerleftmargin@length}% + \mdf@frametitlerulecolor@default% + \rule{\dimexpr\mdfframetitleboxwidth% + +\mdf@innerleftmargin@length + +\mdf@innerrightmargin@length\relax + }{\z@}% + }\hrule \@height\z@ \@width\hsize}% + }% + \iftoggle{mdf@notfirstframetitle}% + {% + \par\unskip\vskip\mdf@splittopskip@length% + }% + {% + \par\unskip\vskip\mdf@innertopmargin@length% + }% +}% + +\def\mdf@drawsubtitleaboveline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitleabovelinecolor}% + \rule{\mdf@templength}{\mdf@subtitleabovelinewidth@length}% + }% +} +\def\mdf@drawsubtitlebelowline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitlebelowlinecolor}% + \rule{\mdf@templength}{\mdf@subtitlebelowlinewidth@length}% + }% +} +\def\mdf@drawsubtitlebackground{% + \rlap{\smash{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitlebackgroundcolor}% + \rule[-\mdfsubtitleheight]{\mdf@templength}{\mdfsubtitleheight}% + }}% +} +\def\mdf@frame@background@single{% + \ifbool{mdf@shadow}% + {% + \rlap% + {% + \smash% + {% + \mdf@shadow@default% + \rule[\dimexpr + -\mdfboundingboxdepth + -\mdf@shadowsize@length + \ifbool{mdf@bottomline}{-\mdf@middlelinewidth@length}{} + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + +\mdf@shadowsize@length + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\dimexpr + \mdfboundingboxtotalheight + +\mdf@shadowsize@length + \ifbool{mdf@bottomline}{+\mdf@middlelinewidth@length}{} + \relax}% + }% + }% + }{}% + \rlap% + {% + \mdf@background@default% + \rule[-\mdfboundingboxdepth]% + {\mdfboundingboxtotalwidth}% + {\mdfboundingboxtotalheight}% + }% +}% +\def\mdf@frame@frametitlebackground@single{% + \rlap% + {% + \mdf@frametitlebackground@default% + \rule[\dimexpr + -\mdfboundingboxdepth + +\mdfboundingboxtotalheight + -\mdfframetitleboxtotalheight + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdfframetitleboxtotalheight}% + }% +}% +\def\mdf@frame@topline@single{% + \rlap% + {% + \mdf@linecolor@default% + \ifbool{mdf@topline}% + {% + \rule[\dimexpr + \mdfboundingboxheight + -\mdfboundingboxdepth% + +\mdf@innerbottommargin@length + +\mdf@innertopmargin@length + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdf@middlelinewidth@length}% + }{}% + }% +}% +\def\mdf@frame@bottomline@single{% + \rlap% + {% + \ifbool{mdf@leftline}% + {% + \hspace*{-\mdf@middlelinewidth@length}% + }{}% + \mdf@linecolor@default% + \ifbool{mdf@bottomline}% + {% + \rule[\dimexpr + -\mdfboundingboxdepth + -\mdf@middlelinewidth@length + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}% + \relax}% + {\mdf@middlelinewidth@length}% + }{}% + }% +}% +\def\mdf@frame@leftline@single{% + \llap% + {% + \mdf@linecolor@default% + \rule[-\mdfboundingboxdepth]% + {\mdf@middlelinewidth@length}% + {\dimexpr + \mdfboundingboxtotalheight% + \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{}% + \relax}% + }% +}% +\def\mdf@frame@rightline@single{% + \rlap% + {% + \mdf@linecolor@default% + \hspace*{\mdfboundingboxwidth}% + \hspace*{\mdf@innerrightmargin@length}% + \rule[\dimexpr + -\mdfboundingboxdepth% + \relax]% + {\mdf@middlelinewidth@length}% + {\dimexpr + \mdfboundingboxtotalheight% + \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{}% + \relax}% + }% +}% +\def\mdf@putbox@single{% + \ifvoid\mdf@splitbox@one\relax + \else% + \mdf@makebox@out% + {% + \mdf@makeboxalign@left% + \setlength{\mdfboundingboxwidth}% + {\wd\mdf@splitbox@one}% + \setlength{\mdfboundingboxtotalwidth}% + {\dimexpr + \mdfboundingboxwidth + +\mdf@innerleftmargin@length% + +\mdf@innerrightmargin@length + \relax}% + \setlength{\mdfboundingboxheight}% + {\dimexpr + \ht\mdf@splitbox@one + +\dp\mdf@splitbox@one + \relax}% + \setlength{\mdfboundingboxdepth}% + {\dimexpr + \dp\mdf@splitbox@one + +\mdf@innerbottommargin@length + \relax}% + \setlength{\mdfboundingboxtotalheight}% + {\dimexpr + \mdfboundingboxheight + +\mdf@innertopmargin@length% + +\mdf@innerbottommargin@length + \relax}% + \setlength{\mdftotallinewidth}% + {\dimexpr + \mdf@innerlinewidth@length + +\mdf@middlelinewidth@length% + +\mdf@outerlinewidth@length + \relax}% + \noindent% + \setlength{\@tempdima}% + {\dimexpr + \mdfboundingboxtotalwidth% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{} + \relax}% + \mdf@makebox@in[\@tempdima]% + {% + \null% + \ifbool{mdf@leftline}% + {% + \hspace*{\mdftotallinewidth}% + \mdf@frame@leftline@single% + }{}% + \mdf@frame@topline@single% + \mdf@frame@background@single% + \mdf@frame@bottomline@single% + \ifdefempty{\mdf@frametitle}{}{\mdf@frame@frametitlebackground@single}% + \hspace*{\mdf@innerleftmargin@length}% + \ifbool{mdf@rightline}% + {% + \mdf@frame@rightline@single% + }{}% + {\box\mdf@splitbox@one}% + }% + \mdf@extra% + \mdf@singleextra + \mdf@makeboxalign@right% + }% + \fi% +} +\def\mdf@frame@background@first{% + \ifbool{mdf@shadow}% + {% + \rlap% + {% + \smash% + {% + \mdf@shadow@default% + \rule[\dimexpr + -\mdfboundingboxdepth + -\mdf@shadowsize@length + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + +\mdf@shadowsize@length + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\dimexpr + \mdfboundingboxtotalheight + +\mdf@shadowsize@length + \relax}% + }% + }% + }{}% + \rlap% + {% + \mdf@background@default% + \rule[-\mdfboundingboxdepth]% + {\mdfboundingboxtotalwidth}% + {\mdfboundingboxtotalheight}% + }% +}% +\def\mdf@frame@frametitlebackground@first{% + \ifbool{mdf@repeatframetitle}% + {%repeating title = true + \rlap% + {% + \mdf@frametitlebackground@default% + \rule[\dimexpr + -\mdfboundingboxdepth + +\mdfboundingboxtotalheight + -\mdfframetitleboxtotalheight + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdfframetitleboxtotalheight}% + }% + }% + {%repeating title = false -- maybe splitted + \ifdimless{\mdfframetitleboxtotalheight}{\mdfboundingboxtotalheight}% + {% + \rlap% + {% + \mdf@frametitlebackground@default% + \rule[\dimexpr + -\mdfboundingboxdepth + +\mdfboundingboxtotalheight + -\mdfframetitleboxtotalheight + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdfframetitleboxtotalheight}% + }% + \global\mdfframetitleboxtotalheight=-\p@\relax% + }% + {% + \mdf@PackageWarning{You got a page break inside the title\MessageBreak + Current this isn't well supported}% + \rlap% + {% + \mdf@frametitlebackground@default% + \rule[-\mdfboundingboxdepth]% + {\mdfboundingboxtotalwidth}% + {\mdfboundingboxtotalheight}% + }% + \global\mdfframetitleboxtotalheight=% + \dimexpr% + \mdfframetitleboxtotalheight + -\mdfboundingboxheight + +\mdf@frametitlebelowskip@length + +.5\baselineskip-1pt + \relax% + }% + }% +}% +\def\mdf@frame@leftline@first{% + \llap% + {% + \mdf@linecolor@default% + \rule[-\mdfboundingboxdepth]% + {\mdf@middlelinewidth@length}% + {\dimexpr + \mdfboundingboxtotalheight% + \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{} + \relax}% + }% +}% +\def\mdf@frame@topline@first{% + \rlap% + {% + \mdf@linecolor@default% + \rule[\dimexpr + \mdfboundingboxheight + -\mdfboundingboxdepth + +\mdf@splitbottomskip@length + +\mdf@innertopmargin@length + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdf@middlelinewidth@length}% + }% +} +\def\mdf@frame@rightline@first{% + \rlap% + {% + \mdf@linecolor@default% + \hspace*{\mdfboundingboxwidth}% + \hspace*{\mdf@innerrightmargin@length}% + \rule[-\mdfboundingboxdepth]% + {\mdf@middlelinewidth@length}% + {\dimexpr + \mdfboundingboxtotalheight% + \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{} + \relax}% + }% +}% +\def\mdf@frame@bottomline@first{% + \rlap% + {% + \ifbool{mdf@leftline}% + {% + \hspace*{-\mdf@middlelinewidth@length}% + }{}% + \mdf@linecolor@default% + \ifbool{mdf@bottomline}% + {% + \rule[\dimexpr + -\mdfboundingboxdepth + -\mdf@middlelinewidth@length + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\mdf@middlelinewidth@length}% + }{}% + }% +}% +\def\mdf@putbox@first{% + \ifvoid\mdf@splitbox@two\relax + \else% + \mdf@makebox@out[\linewidth]% + {% + \mdf@makeboxalign@left% + \setlength{\mdfboundingboxwidth} + {\wd\mdf@splitbox@two}% + \setlength{\mdfboundingboxtotalwidth}% + {\dimexpr + \mdfboundingboxwidth + +\mdf@innerleftmargin@length% + +\mdf@innerrightmargin@length + \relax}% + \setlength{\mdfboundingboxheight} + {\dimexpr + \ht\mdf@splitbox@two + +\dp\mdf@splitbox@two + \relax}% + \setlength{\mdfboundingboxdepth}% + {\dimexpr + \dp\mdf@splitbox@two + +\mdf@splitbottomskip@length + \relax}% + \setlength{\mdfboundingboxtotalheight}% + {\dimexpr + \mdfboundingboxheight + +\mdf@innertopmargin@length% + +\mdf@splitbottomskip@length + \relax}% + \setlength{\@tempdima}% + {\dimexpr + \mdfboundingboxtotalwidth% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}% + \relax}% + \mdf@makebox@in[\@tempdima]% + {% + \null% + \ifbool{mdf@leftline}% + {% + \hspace*{\mdf@middlelinewidth@length}% + \mdf@frame@leftline@first% + }{}% + \ifbool{mdf@everyline}% + {% + \mdf@frame@bottomline@first% + }{}% + \ifbool{mdf@topline}% + {% + \mdf@frame@topline@first% + }{}% + \mdf@frame@background@first% + \ifdefempty{\mdf@frametitle}{}{\mdf@frame@frametitlebackground@first}% + \hspace*{\mdf@innerleftmargin@length}% + \ifbool{mdf@rightline}% + {% + \mdf@frame@rightline@first% + }{}% + {\box\mdf@splitbox@two}% + }% + \mdf@extra% + \mdf@firstextra% + \mdf@makeboxalign@right% + }% + \fi% +} +\def\mdf@frame@background@second{% + \ifbool{mdf@shadow}% + {% + \rlap% + {% + \smash% + {% + \mdf@shadow@default% + \rule[\dimexpr + -\mdfboundingboxdepth + -\mdf@shadowsize@length + \ifbool{mdf@bottomline}{-\mdf@middlelinewidth@length}{} + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + +\mdf@shadowsize@length + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\dimexpr + \mdfboundingboxtotalheight + +\mdf@shadowsize@length + \relax}% + }% + }% + }{}% + \rlap% + {% + \mdf@background@default% + \rule[-\mdfboundingboxdepth]% + {\mdfboundingboxtotalwidth}% + {\mdfboundingboxtotalheight}% + }% +}% +\def\mdf@frame@frametitlebackground@second{% + \ifbool{mdf@repeatframetitle}% + {%repeating title = true + \rlap% + {% + \mdf@frametitlebackground@default% + \rule[\dimexpr + -\mdfboundingboxdepth + +\mdfboundingboxtotalheight + -\mdfframetitleboxtotalheight + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdfframetitleboxtotalheight}% + }% + }% + {%repeating title = false -- maybe splitted + \ifdimless{\mdfframetitleboxtotalheight}{\z@}% + {}% + {% + \rlap% + {% + \mdf@frametitlebackground@default% + \rule[\dimexpr + -\mdfboundingboxdepth + +\mdfboundingboxtotalheight + -\mdfframetitleboxtotalheight + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdfframetitleboxtotalheight}% + }% + }% + }% +}% +\def\mdf@frame@leftline@second{% + \llap% + {% + \mdf@linecolor@default% + \rule[-\mdfboundingboxdepth]% + {\mdf@middlelinewidth@length}% + {\dimexpr\mdfboundingboxtotalheight}% + }% +}% +\def\mdf@frame@bottomline@second{% + \rlap% + {% + \ifbool{mdf@leftline}% + {% + \hspace*{-\mdf@middlelinewidth@length}% + }{}% + \mdf@linecolor@default% + \rule[\dimexpr + -\mdfboundingboxdepth + -\mdf@middlelinewidth@length + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{} + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\mdf@middlelinewidth@length}% + }% +}% +\def\mdf@frame@rightline@second{% + \rlap% + {% + \mdf@linecolor@default\hspace*{\mdfboundingboxwidth}% + \hspace*{\mdf@innerrightmargin@length}% + \rule[-\mdfboundingboxdepth]% + {\mdf@middlelinewidth@length}% + {\mdfboundingboxtotalheight}% + }% +}% +\def\mdf@frame@topline@second{% + \rlap% + {% + \ifbool{mdf@leftline}% + {% + \hspace*{-\mdf@middlelinewidth@length}% + }{}% + \mdf@linecolor@default% + \ifbool{mdf@topline}% + {% + \rule[\dimexpr + \mdfboundingboxheight + -\mdfboundingboxdepth% + +\mdf@innerbottommargin@length + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\mdf@middlelinewidth@length}% + }{}% + }% +}% + +\def\mdf@putbox@second{% + \ifvoid\mdf@splitbox@one\relax% + \else + \mdf@makebox@out% + {% + \mdf@makeboxalign@left% + \setlength{\mdfboundingboxwidth}% + {\wd\mdf@splitbox@one}% + \setlength{\mdfboundingboxtotalwidth}% + {\dimexpr + \mdfboundingboxwidth + +\mdf@innerleftmargin@length% + +\mdf@innerrightmargin@length + \relax}% + \setlength{\mdfboundingboxheight}% + {\dimexpr + \ht\mdf@splitbox@one + +\dp\mdf@splitbox@one + \relax}% + \setlength{\mdfboundingboxdepth}% + {\dimexpr + \dp\mdf@splitbox@one + +\mdf@innerbottommargin@length + \relax}% + \setlength{\mdfboundingboxtotalheight}% + {\dimexpr + \mdfboundingboxheight + +\mdf@innerbottommargin@length + \relax}% + \setlength{\@tempdima}% + {\dimexpr + \mdfboundingboxtotalwidth% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}% + \relax}% + \mdf@makebox@in[\@tempdima]% + {% + \null% + \ifbool{mdf@leftline}% + {% + \hspace*{\mdf@middlelinewidth@length}% + \mdf@frame@leftline@second% + }{}% + \ifbool{mdf@everyline}% + {% + \mdf@frame@topline@second + }{}% + \mdf@frame@background@second% + \ifbool{mdf@bottomline}% + {% + \mdf@frame@bottomline@second% + }{}% + \ifdefempty{\mdf@frametitle}{}{\mdf@frame@frametitlebackground@second}% + \hspace*{\mdf@innerleftmargin@length}% + \ifbool{mdf@rightline}% + {% + \mdf@frame@rightline@second% + }{}% + {\box\mdf@splitbox@one}% + }% + \mdf@extra% + \mdf@secondextra% + \mdf@makeboxalign@right% + }% + \fi% +}% +\def\mdf@frame@leftline@middle{% + \llap% + {% + \mdf@linecolor@default% + \rule[-\mdfboundingboxdepth]% + {\mdf@middlelinewidth@length}% + {\mdfboundingboxtotalheight}% + }% +}% +\def\mdf@frame@background@middle{% + \ifbool{mdf@shadow}% + {% + \rlap% + {% + \smash% + {% + \mdf@shadow@default% + \rule[\dimexpr + -\mdfboundingboxdepth + -\mdf@shadowsize@length + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + +\mdf@shadowsize@length + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\mdfboundingboxtotalheight}% + }% + }% + }{}% + \rlap% + {% + \mdf@background@default% + \rule[-\mdfboundingboxdepth]% + {\mdfboundingboxtotalwidth}% + {\mdfboundingboxtotalheight}% + }% +}% +\def\mdf@frame@frametitlebackground@middle{% + \ifbool{mdf@repeatframetitle}% + {%repeating title = true + \rlap% + {% + \mdf@frametitlebackground@default% + \rule[\dimexpr + -\mdfboundingboxdepth + +\mdfboundingboxtotalheight + -\mdfframetitleboxtotalheight + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdfframetitleboxtotalheight}% + }% + }% + {%repeating title = false -- maybe splitted + \ifdimless{\mdfframetitleboxtotalheight}{\z@}% + {}% + {% + \rlap% + {% + \mdf@frametitlebackground@default% + \rule[\dimexpr + -\mdfboundingboxdepth + +\mdfboundingboxtotalheight + -\mdfframetitleboxtotalheight + \relax]% + {\mdfboundingboxtotalwidth}% + {\mdfframetitleboxtotalheight}% + }% + \global\mdfframetitleboxtotalheight=-\p@\relax% + }% + }% +}% +\def\mdf@frame@rightline@middle{% + \rlap% + {% + \mdf@linecolor@default% + \hspace*{\mdfboundingboxwidth}% + \hspace*{\mdf@innerrightmargin@length}% + \rule[-\mdfboundingboxdepth]% + {\mdf@middlelinewidth@length}% + {\mdfboundingboxtotalheight}% + }% +}% +\def\mdf@frame@topline@middle{% + \rlap% + {% + \ifbool{mdf@leftline}% + {% + \hspace*{-\mdf@middlelinewidth@length}% + }{}% + \mdf@linecolor@default% + \ifbool{mdf@topline}% + {% + \rule[\dimexpr + \mdfboundingboxtotalheight + -\mdfboundingboxdepth + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\mdf@middlelinewidth@length}% + }{}% + }% +}% +\def\mdf@frame@bottomline@middle{% + \rlap% + {% + \ifbool{mdf@leftline}% + {% + \hspace*{-\mdf@middlelinewidth@length}% + }{}% + \mdf@linecolor@default% + \ifbool{mdf@bottomline}% + {% + \rule[\dimexpr + -\mdfboundingboxdepth + -\mdf@middlelinewidth@length + \relax]% + {\dimexpr + \mdfboundingboxtotalwidth + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{} + \relax}% + {\mdf@middlelinewidth@length}% + }{}% + }% +}% + +\def\mdf@putbox@middle{% + \ifvoid\mdf@splitbox@two\relax% + \else + \mdf@makebox@out% + {% + \mdf@makeboxalign@left% + \setlength{\mdfboundingboxwidth} + {\wd\mdf@splitbox@two}% + \setlength{\mdfboundingboxtotalwidth}% + {\dimexpr + \mdfboundingboxwidth + +\mdf@innerleftmargin@length% + +\mdf@innerrightmargin@length + \relax}% + \setlength{\mdfboundingboxheight} + {\dimexpr + \ht\mdf@splitbox@two + +\dp\mdf@splitbox@two + \relax}% + \setlength{\mdfboundingboxdepth}% + {\dimexpr + \dp\mdf@splitbox@two + +\mdf@splitbottomskip@length + \relax}% + \setlength{\mdfboundingboxtotalheight}% + {\dimexpr + \mdfboundingboxheight + +\mdf@splitbottomskip@length + \relax}% + \setlength{\@tempdima} + {\dimexpr + \mdfboundingboxtotalwidth% + \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}% + \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}% + \relax}% + \mdf@makebox@in[\@tempdima]% + {% + \null% + \ifbool{mdf@leftline}% + {% + \hspace*{\mdf@middlelinewidth@length}% + \mdf@frame@leftline@middle% + }{}% + \mdf@frame@background@middle% + \ifbool{mdf@everyline}% + {% + \mdf@frame@topline@middle + }{}% + \ifdefempty{\mdf@frametitle}{} + {\mdf@frame@frametitlebackground@middle}% + \ifbool{mdf@everyline}% + {% + \mdf@frame@bottomline@middle% + }{}% + \hspace*{\mdf@innerleftmargin@length}% + \ifbool{mdf@rightline}% + {% + \mdf@frame@rightline@middle% + }{}% + {\box\mdf@splitbox@two}% + }% + \mdf@extra% + \mdf@middleextra% + \mdf@makeboxalign@right% + }% + \fi% +} + \endinput diff --git a/Doc/mdframed.sty b/Doc/mdframed.sty new file mode 100644 index 0000000000..27765d7882 --- /dev/null +++ b/Doc/mdframed.sty @@ -0,0 +1,1475 @@ +%% +%% This is file `mdframed.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mdframed.dtx (with options: `package') +%% ---------------------------------------------------------------- +%% Working with the command fbox or fcolorbox, one has to +%% handle page breaks by hand. The present package defines the +%% environment mdframed which automatically deals with page breaks. +%% +%% Author's name: Marco Daniel and Elke Schubert (!new) +%% License type: lppl +%% +%% ================================================== +%% ========Is based on the idea of framed.sty======== +%% ================================================== +%% ===== Currently the package has a beta-Status ==== +%% ================================================== +%% WITH THANKS TO (alphabetically): +%% ROLF NIEPRASCHK +%% HEIKO OBERDIEK +%% HERBERT VOSS +%% +%% Copyright (c) 2010-2013 Marco Daniel +%% +%% This package may be distributed under the terms of the LaTeX Project +%% Public License, as described in lppl.txt in the base LaTeX distribution. +%% Either version 1.0 or, at your option, any later version. +%% +%% +%% ================================================= +%% Erstellung eines Rahmens, der am Seitenende keine +%% horizontale Linie einfuegt +%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +%% _______________ +%% | page 1 | +%% | Text | +%% | __Text__ | +%% | | Text | | +%% P A G E B R E A K +%% | | Text | | +%% | |_Text_| | +%% | Text | +%% |____page 2___| +%% +%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +%% ================================================== +%% + +\def\mdversion{1.9b} +\def\mdframedpackagename{mdframed} +\def\mdfmaindate{2013/07/01} +\def\mdfrevision{ 212}% Done by github: git rev-list HEAD | wc -l +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mdframed}% + [\mdfmaindate\space \mdversion: \mdframedpackagename] +\newcommand*\mdf@PackageError[1]{\PackageError{\mdframedpackagename}{#1}} +\newcommand*\mdf@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}} +\newcommand*\mdf@PackageInfo[1]{\PackageInfo{\mdframedpackagename}{#1}} +\newcommand*\mdf@LoadFile@IfExist[1]{% + \IfFileExists{#1.sty}{% + \RequirePackage{#1}% + }{% + \mdf@PackageWarning{The file #1 does not exist\MessageBreak + but needed by \mdframedpackagename\MessageBreak + see documentation fo further information + }% + }% +} +\RequirePackage{kvoptions} +\RequirePackage{xparse} +\RequirePackage{etoolbox}[2011/01/03] +\RequirePackage{zref-abspage} +\RequirePackage{needspace} +\RequirePackage{color} +\SetupKeyvalOptions{family=mdf,prefix=mdf@} +\def\mdf@definestyle@defaultoptions{}% +\newlength{\mdf@templength} +\def\mdf@iflength#1{% + \afterassignment\mdf@iflength@check% + \mdf@templength=#1\mdf@defaultunit\relax\relax + \expandafter\endgroup\next +} +\def\mdf@iflength@check#1{% + \begingroup + \ifx\relax#1\@empty + \def\next{\@secondoftwo} + \else + \def\next{\@firstoftwo} + \expandafter\mdf@iflength@cleanup + \fi +} +\def\mdf@iflength@cleanup#1\relax{} +\DeclareListParser*{\mdf@dolist}{,} +\def\mdf@do@lengthoption#1{% + \mdf@lengthoption@doubledo#1\@nil% +} +\def\mdf@lengthoption@doubledo#1==#2\@nil{% + \mdf@option@length{#1}{#2}% + \mdf@define@key@length{#1}% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% +} + +\newrobustcmd*{\mdf@option@length}[2]{% + \expandafter\newlength\csname mdf@#1@length\endcsname% + \expandafter\setlength\csname mdf@#1@length\endcsname{#2}% + } + +\newrobustcmd*{\mdf@define@key@length}[1]{% + \define@key{mdf}{#1}{% + \def\@tempa{##1} + \mdf@iflength{\@tempa}% + {\csxdef{mdfl@#1}{\the\mdf@templength}}% + {\csxdef{mdfl@#1}{\the\mdf@templength}}% + \setlength{\csname mdf@#1@length\endcsname}{\csname mdfl@#1\endcsname}% + }% +} + +\def\mdf@do@stringoption#1{% + \mdf@stringoption@doubledo#1\@nil% +} +\def\mdf@stringoption@doubledo#1==#2\@nil{% + \expandafter\gdef\csname mdf@#1\endcsname{#2}% + \define@key{mdf}{#1}{% + \csdef{mdf@#1}{##1}% + }% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% +} +\def\mdf@do@booloption#1{% + \mdf@booloption@doubledo#1\@nil% +} +\def\mdf@booloption@doubledo#1==#2\@nil{% + \newbool{mdf@#1}\setbool{mdf@#1}{#2}% + \define@key{mdf}{#1}[#2]{% + \setbool{mdf@#1}{##1}% + }% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% +} +\newcounter{mdf@globalstyle@cnt} +\defcounter{mdf@globalstyle@cnt}{-99} + +\define@key{mdf}{style}{% + \mdf@PackageWarning{package option style is depreciated^^J + at this point and will be ignored^^J + use framemethod instead\MessageBreak}% +} + +\providecommand*\mdf@framemethod{} +\def\mdf@framemethod@i{}% +\def\mdf@framemethod@ii{}% +\def\mdf@framemethod@iii{}% +\define@key{mdf}{framemethod}[default]{% + \lowercase{\def\mdf@tempa{#1}}%lowercase not expandable + \forcsvlist{\listadd\mdf@framemethod@i}{default,tex,latex,none,0} + \forcsvlist{\listadd\mdf@framemethod@ii}{pgf,tikz,1} + \forcsvlist{\listadd\mdf@framemethod@iii}{pstricks,ps,2,postscript} + \xifinlist{\mdf@tempa}{\mdf@framemethod@i}% + {\def\mdf@@framemethod{default}\defcounter{mdf@globalstyle@cnt}{0}}% + {\xifinlist{\mdf@tempa}{\mdf@framemethod@ii}% + {\def\mdf@@framemethod{tikz}% + \defcounter{mdf@globalstyle@cnt}{1}\mdf@LoadFile@IfExist{tikz}}% + {\xifinlist{\mdf@tempa}{\mdf@framemethod@iii}% + {\def\mdf@@framemethod{pstricks}% + \defcounter{mdf@globalstyle@cnt}{2}\mdf@LoadFile@IfExist{pst-node}}% + {\mdf@LoadFile@IfExist{#1}}% + }% + }% + \ifcase\value{mdf@globalstyle@cnt}\relax% + \input{md-frame-0.mdf}% + \or\input{md-frame-1.mdf}% + \or\input{md-frame-2.mdf}% + \or\input{md-frame-3.mdf}% + \else% + \IfFileExists{md-frame-\value{mdf@globalstyle@cnt}.mdf}% + {\input{md-frame-\value{mdf@globalstyle@cnt}.mdf}}% + {% + \input{md-frame-0.mdf}% + \mdf@PackageWarning{The style number \value{mdf@globalstyle@cnt} + does not exist^^J + mdframed ues instead style=0 \mdframedpackagename}% + }% + \fi% +} +\DeclareVoidOption{tikz}{\setkeys{mdf}{framemethod=tikz}} +\DeclareVoidOption{TikZ}{\setkeys{mdf}{framemethod=tikz}} +\DeclareVoidOption{ps}{\setkeys{mdf}{framemethod=pstricks}} +\DeclareVoidOption{pstricks}{\setkeys{mdf}{framemethod=pstricks}} +\DeclareVoidOption{PSTricks}{\setkeys{mdf}{framemethod=pstricks}} + +\mdf@dolist{\mdf@do@lengthoption}{% + {skipabove==\topsep},% + {skipbelow==\topsep},% + {leftmargin==\z@},% + {rightmargin==\z@},% + {innerleftmargin==10pt},% + {innerrightmargin==10pt},% + {innertopmargin==0.4\baselineskip},% + {innerbottommargin==0.4\baselineskip},% + {splittopskip==10pt},% + {splitbottomskip==10pt},% + {outermargin==\z@},% + {innermargin==\z@},% + {linewidth==0.4pt},% + {innerlinewidth==\z@},% + {middlelinewidth==\expandafter\mdf@linewidth@length},% + {outerlinewidth==\z@},% + {roundcorner==\z@},% + {footenotedistance==\medskipamount}, + {userdefinedwidth==\linewidth}, + {needspace==\z@}, + {frametitleaboveskip==5pt}, + {frametitlebelowskip==5pt}, + {frametitlerulewidth==.2pt}, + {frametitleleftmargin==10pt},% + {frametitlerightmargin==10pt},% + {shadowsize==8pt},% + {extratopheight==\z@},% + {subtitleabovelinewidth==.8pt},% + {subtitlebelowlinewidth==.6pt},% + {subtitleaboveskip==\baselineskip},% + {subtitlebelowskip==1.2\baselineskip},% + {subtitleinneraboveskip==.5\baselineskip},% + {subtitleinnerbelowskip==.5\baselineskip},% + {subsubtitleabovelinewidth==.8pt},% + {subsubtitlebelowlinewidth==.6pt},% + {subsubtitleaboveskip==\baselineskip},% + {subsubtitlebelowskip==1.2\baselineskip},% + {subsubtitleinneraboveskip==.5\baselineskip},% + {subsubtitleinnerbelowskip==.5\baselineskip},% +} +\mdf@dolist{\mdf@do@stringoption}{% + {frametitle=={}},% + {firstframetitle=={}},% + {framefoot=={}},% + {lastframefoot=={}},% + {defaultunit==pt},% + {linecolor==black},% + {backgroundcolor==white},% + {fontcolor==black},% + {frametitlefontcolor==black},% + {innerlinecolor==\mdf@linecolor},% + {outerlinecolor==\mdf@linecolor},% + {middlelinecolor==\mdf@linecolor},% + {psroundlinecolor==\mdf@backgroundcolor},% + {frametitlerulecolor==\mdf@linecolor}, + {frametitlebackgroundcolor==\mdf@backgroundcolor},% + {shadowcolor==black!50},% + {settings=={}},% + {frametitlesettings=={}},% + {font=={}},% + {frametitlefont==\normalfont\bfseries},% + {printheight==none},% + {alignment=={}},% + {frametitlealignment=={}},% + {theoremseparator=={:}},% + {theoremcountersep=={.}},% + {theoremtitlefont=={}},% + {theoremspace=={\space}},% + {extra=={}},% + {singleextra=={}},% + {firstextra=={}},% + {middleextra=={}},% + {secondextra=={}},% + {beforesingleframe=={}},% + {aftersingleframe=={}},% + {beforebreak=={}},% + {afterbreak=={}},% + {beforelastframe=={}},% + {afterlastframe=={}},% + {startcode=={}},% + {startinnercode=={}},% + {endinnercode=={}},% + {endcode=={}},% + {subtitlefont==\normalfont\bfseries},% + {subsubtitlefont==\normalfont},% + {subtitlebackgroundcolor==white},% + {subsubtitlebackgroundcolor==white},% + {subtitleabovelinecolor==black},% + {subtitlebelowlinecolor==black},% + {subsubtitleabovelinecolor==black},% + {subsubtitlebelowlinecolor==black},% +} +\mdf@dolist{\mdf@do@booloption}{% + {ntheorem==false},% + {topline==true},% + {leftline==true},% + {bottomline==true},% + {rightline==true},% + {frametitletopline==true},% + {frametitleleftline==true},% + {frametitlebottomline==true},% + {frametitlerightline==true},% + {frametitlerule==false},% + {footnoteinside==true},% + {usetwoside==true},% + {repeatframetitle==false},%Noch nicht richtig implementiert + {shadow==false},% + {everyline==false},% + {ignorelastdescenders==false},% + {subtitleaboveline==false}, + {subtitlebelowline==false}, + {subsubtitleaboveline==false}, + {subsubtitlebelowline==false}, + {draft==false}, + {suppressfirstparskip==true}, +} +%%special boolflag hidealllines: +\newbool{mdf@hidealllines}% +\define@key{mdf}{hidealllines}[false]{% +\setbool{mdf@hidealllines}{#1}% + \ifbool{mdf@hidealllines}{% + \kvsetkeys{mdf}{leftline=false,topline=false,% + rightline=false,bottomline=false}% + }{% + \kvsetkeys{mdf}{leftline=true,topline=true,% + rightline=true,bottomline=true}% + }% +} +\appto\mdf@definestyle@defaultoptions{hidealllines=false,}% +%%special boolflag nobreak: +\DeclareBoolOption[true]{nobreak} +\boolfalse{mdf@nobreak}% +\appto\mdf@definestyle@defaultoptions{nobreak=false,} +\def\mdf@do@alignoption#1{% + \mdf@alignoption@tripledo#1\@nil% +} +\def\mdf@alignoption@tripledo#1==#2==#3\@nil{% + \csdef{mdf@align@#1@left}{\null\hspace*{#2}}% + \csdef{mdf@align@#1@right}{\hspace*{#3}\null}% +} +\mdf@dolist{\mdf@do@alignoption}{% + {left==\mdf@leftmargin@length==\z@},% + {center==\fill==\fill},% + {right==\fill==\mdf@rightmargin@length},% + {outer==\fill==\mdf@rightmargin@length},%not supported yet + {outer==\mdf@leftmargin@length==\fill},%not supported yet +} +\newcommand*\mdf@align{}% +\newcommand*\mdf@makeboxalign@left{\null\hspace*{\mdf@leftmargin@length}}% +\newcommand*\mdf@makeboxalign@right{}% +\define@key{mdf}{align}[left]{% + \ifcsundef{mdf@align@#1@left}{% + \mdf@PackageWarning{Unknown alignment #1\MessageBreak}% + \letcs\mdf@makeboxalign@left{mdf@align@left@left}% + \letcs\mdf@makeboxalign@right{mdf@align@left@right}% + }{% + \def\mdf@makeboxalign@left{\csuse{mdf@align@#1@left}}% + \def\mdf@makeboxalign@right{\csuse{mdf@align@#1@right}}% + }% +} +\def\mdf@tikzset@local{\tikzset{tikzsetting/.style={}}} +\define@key{mdf}{tikzsetting}{% + \def\mdf@tikzset@local{\tikzset{tikzsetting/.style={#1}}}% +} +\define@key{mdf}{apptotikzsetting}{% + \appto\mdf@tikzset@local{#1}% +} +\def\mdf@psset@local{} +\define@key{mdf}{pstrickssetting}{% + \def\mdf@psset@local{#1} +} +\def\mdfpstricks@appendsettings{} +\define@key{mdf}{pstricksappsetting}{% + \def\mdfpstricks@appendsettings{#1}% +} +\def\mdf@xcolor{} +\define@key{mdf}{xcolor}[]{% + \def\@tempa{#1}% + \@ifpackageloaded{xcolor}{% + \let\mdf@xcolor\@empty %ignoriere die Eingabe der Optionen + \def\@tempa{}% + }{}% + \ifx\relax\@tempa\relax\else + \PassOptionsToPackage{\mdf@xcolor}{xcolor}% + \RequirePackage{xcolor}% + \fi% +}% +\DeclareDefaultOption{% + \mdf@PackageError{Unknown Option '\CurrentOption' for mdframed}} +\ProcessKeyvalOptions*\relax +\ifnum\c@mdf@globalstyle@cnt<0 + \kvsetkeys{mdf}{framemethod=default,} +\fi +\newrobustcmd*{\mdfsetup}{\kvsetkeys{mdf}} +\define@key{mdf}{style}{% + \ifcsundef{mdf@definestyle@#1}{% + \mdf@PackageWarning{Unknown definedstyle #1^^J + You have to define a style ^^J + via \string\mdfdefinedstyle\MessageBreak + }% + }% + {\expandafter\expandafter\expandafter\mdfsetup\expandafter% + \expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}% +}% +\DeclareVoidOption{default}{% + \expandafter\expandafter\expandafter\mdfsetup\expandafter% + \expandafter\expandafter{\csname mdf@definestyle@defaultoptions\endcsname}% +}% + +\ifnum\c@mdf@globalstyle@cnt>0 + \define@key{mdf}{linewidth}{% + \def\@tempa{#1} + \mdf@iflength{\@tempa}% + {\csxdef{mdfl@linewidth}{\the\mdf@templength}}% + {\csxdef{mdfl@linewidth}{\the\mdf@templength}}% + \setlength{\csname mdf@middlelinewidth@length\endcsname}% + {\csname mdfl@linewidth\endcsname}% + }% +\fi + +\let\mdf@PackageNoInfo\@gobble +\newrobustcmd*\mdf@ifstrequal@expand{% +\expandafter\ifstrequal\expandafter{\mdf@printheight}% +} +\newrobustcmd*\mdf@print@space{% + %case "none" + \mdf@ifstrequal@expand{none}{\def\mdf@tempa{NoInfo}}{% + %case "info" + \mdf@ifstrequal@expand{info}{\def\mdf@tempa{Info}}{% + %case "warning" + \mdf@ifstrequal@expand{warning}{\def\mdf@tempa{Warning}}{% + %case "unknown" + \mdf@PackageWarning{Unknown key for printheight=\mdf@printheight^^J + use none, info or warning}% + \def\mdf@tempa{none}% + }% + }% + }% +\def\mdf@PackageInfoSpace{\csname mdf@Package\mdf@tempa\endcsname}% +} +\newsavebox\mdf@frametitlebox +\newsavebox\mdf@footnotebox +\newsavebox\mdf@splitbox@one +\newsavebox\mdf@splitbox@two +\newsavebox\mdf@splitbox@save + +\newlength\mdfsplitboxwidth +\newlength\mdfsplitboxtotalwidth +\newlength\mdfsplitboxheight +\newlength\mdfsplitboxdepth +\newlength\mdfsplitboxtotalheight +\newlength\mdfframetitleboxwidth +\newlength\mdfframetitleboxtotalwidth +\newlength\mdfframetitleboxheight +\newlength\mdfframetitleboxdepth +\newlength\mdfframetitleboxtotalheight +\newlength\mdffootnoteboxwidth +\newlength\mdffootnoteboxtotalwidth +\newlength\mdffootnoteboxheight +\newlength\mdffootnoteboxdepth +\newlength\mdffootnoteboxtotalheight +\newlength\mdftotallinewidth +\newlength\mdfboundingboxwidth +\newlength\mdfboundingboxtotalwidth +\newlength\mdfboundingboxheight +\newlength\mdfboundingboxdepth +\newlength\mdfboundingboxtotalheight +\newlength\mdf@freevspace@length +\newlength\mdf@horizontalwidthofbox@length +\newlength\mdf@verticalmarginwhole@length +\newlength\mdf@horizontalspaceofbox +\newlength\mdfsubtitleheight +\newlength\mdfsubsubtitleheight + +\newbool{mdfsingleframe}\boolfalse{mdfsingleframe} +\newbool{mdffirstframe}\boolfalse{mdffirstframe} +\newbool{mdfmiddleframe}\boolfalse{mdfmiddleframe} +\newbool{mdflastframe}\boolfalse{mdflastframe} + +\newtoggle{mdf@notfirstframetitle}\togglefalse{mdf@notfirstframetitle}% +\newtoggle{mdflastframe}\togglefalse{mdflastframe} + +\newcounter{mdfcountframes}\setcounter{mdfcountframes}{0} +\newrobustcmd\mdfcreateextratikz{} + +\def\mdf@lrbox#1{% + \mdf@patchamsthm%patch amsthm + \setbox#1\vbox\bgroup% + \color@begingroup% + \mdf@horizontalmargin@equation% + \columnwidth=\hsize% + \textwidth=\hsize% + \let\if@nobreak\iffalse% + \let\if@noskipsec\iffalse% + \let\par\@@par% + \let\-\@dischyph% + \let\'\@acci\let\`\@accii\let\=\@acciii% + \parindent\z@ \parskip\z@skip% + \linewidth\hsize% + \@totalleftmargin\z@% + \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip% + \parfillskip\@flushglue \lineskip\normallineskip% + \baselineskip\normalbaselineskip% +%% \sloppy% + \let\\\@normalcr% + \mdf@par@local%New feature to restore parskip/parindent local in save box + \ifbool{mdf@suppressfirstparskip}{\vspace*{-\parskip}}{}% + \@afterindentfalse% + %\@afterheading% +} +\def\endmdf@lrbox{\color@endgroup\egroup} +\newrobustcmd*\mdf@ignorevbadness{% + \edef\mdf@currentvbadness{\the\vbadness}% + \vbadness=\@M% + \afterassignment\mdf@restorevbadness} + +\newrobustcmd*\mdf@restorevbadness{\vbadness=\mdf@currentvbadness\relax} +\let\mdf@patchamsthm\relax +\AtBeginDocument{% +\@ifpackageloaded{amsthm}% + {% + \newrobustcmd\mdf@patchamsthm{% + \let\mdf@deferred@thm@head\deferred@thm@head% + \pretocmd{\deferred@thm@head}{\@inlabelfalse}% + {\mdf@PackageInfo{mdframed detected package amsthm ^^J + changed the theorem header of amsthm\MessageBreak}% + }{% + \mdf@PackageError{mdframed detected package amsthm ^^J + changed the theorem header of amsthm + failed\MessageBreak}% + }% + }% + }{}% +} +\def\mdf@trivlist#1{% + \edef\mdf@temp{% + \topsep=\the\topsep\relax% + \partopsep=\the\partopsep\relax% + \parsep=\the\parsep\relax% + }% + \setlength{\topsep}{#1}% + \topskip\z@% + \partopsep\z@% + \parsep\z@% + \@nmbrlistfalse% + \@trivlist% + \labelwidth\z@% + \leftmargin\z@% + \itemindent\z@% + \let\@itemlabel\@empty% + \def\makelabel##1{##1}% + \item\relax\mdf@temp\relax% +} +\let\endmdf@trivlist\endtrivlist +\patchcmd\endmdf@trivlist\@endparenv\mdf@endparenv{% + \wlog{^^J****** mdframed patching \string\endmdf@trivlist}% + \wlog{^^J****** -- success******^^J}% + }{% + \wlog{^^J****** mdframed patching \string\endmdf@trivlist}% + \wlog{^^J****** -- failed******^^J}% +} +\def\mdf@endparenv{% + \addpenalty\@endparpenalty\addvspace\mdf@skipbelow@length\@endpetrue} +\newrobustcmd*\mdf@makebox@out[2][\linewidth]{% + \noindent\hb@xt@\z@{% + \noindent\makebox[\dimexpr #1\relax][l]{#2}% + \hss}% +}% +\newrobustcmd*\mdf@makebox@in[2][\mdf@userdefinedwidth@length]{% + \noindent\makebox[\dimexpr #1\relax][l]{#2}% +} +\newrobustcmd*\mdfdefinestyle[2]{% + \csdef{mdf@definestyle@#1}{#2}% +} +\newrobustcmd*\mdfapptodefinestyle[2]{% + \ifcsundef{mdf@definestyle@#1}% + {\mdf@PackageWarning{Unknown style #1}}% + {\csappto{mdf@definestyle@#1}{,#2}}% +} +\newrobustcmd*{\mdflength}[1]{\csuse{mdf@#1@length}} + +\newrobustcmd*{\surroundwithmdframed}[2][]{% + \BeforeBeginEnvironment{#2}{\begin{mdframed}[#1]}% + \AfterEndEnvironment{#2}{\end{mdframed}}% +} +\newrobustcmd*\newmdenv[2][]{% + \newenvironment{#2}{% + \mdfsetup{#1}% + \begin{mdframed}% + }{% + \end{mdframed}% + }% +} +\newrobustcmd*\renewmdenv[2][]{% + \expandafter\let\csname #2\endcsname\relax% + \expandafter\let\csname end#2\endcsname\relax% + \newmdenv[#1]{#2}% +}% +\DeclareDocumentCommand\newmdtheoremenv{O{} m o m o }{% + \ifboolexpr{ test {\IfNoValueTF {#3}} and test {\IfNoValueTF {#5}} }% + {\newtheorem{#2}{#4}}{% + \IfValueTF{#3}{\newtheorem{#2}[#3]{#4}}{}% + \IfValueTF{#5}{\newtheorem{#2}{#4}[#5]}{}% + }% + \BeforeBeginEnvironment{#2}{% + \begin{mdframed}[#1]}% + \AfterEndEnvironment{#2}{% + \end{mdframed}}% +} +\newrobustcmd*\mdf@thm@caption[2]{} +\AtBeginDocument{% + \@ifpackageloaded{ntheorem}% + {\renewrobustcmd*\mdf@thm@caption{\thm@thmcaption}}{}% + } +\newrobustcmd*\mdf@checkntheorem{% + \ifbool{mdf@ntheorem}% + {\ifundef{\theorempreskipamount}% + {\mdf@PackageWarning{You have not loaded ntheorem yet}}% + {\setlength{\theorempreskipamount}{\z@}% + \setlength{\theorempostskipamount}{\z@}% + }% + }{}% +} +\DeclareDocumentCommand{\mdtheorem}{ O{} m o m o }% + {\ifcsdef{#2}% + {\mdf@PackageWarning{Environment #2 already exits\MessageBreak}}% + {% + \IfNoValueTF {#3}% + {%#3 not given -- number relationship + \IfNoValueTF {#5}% + {%#3+#5 not given + \@definecounter{#2}% + \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}% + \newenvironment{#2}[1][]{% + \refstepcounter{#2}% + \ifstrempty{##1}% + {\let\@temptitle\relax}% + {% + \def\@temptitle{\mdf@theoremseparator% + \mdf@theoremspace% + \mdf@theoremtitlefont% + ##1}% + \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% + }% + \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% + \@temptitle}]}% + {\end{mdframed}}% + \newenvironment{#2*}[1][]{% + \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}% + \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% + {\end{mdframed}}% + }% + {%#5 given -- reset counter + \@definecounter{#2}\@newctr{#2}[#5]% + \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}% + \expandafter\xdef\csname the#2\endcsname{% + \expandafter\noexpand\csname the#5\endcsname \@thmcountersep% + \@thmcounter{#2}}% + \newenvironment{#2}[1][]{% + \refstepcounter{#2}% + \ifstrempty{##1}% + {\let\@temptitle\relax}% + {% + \def\@temptitle{\mdf@theoremseparator% + \mdf@theoremspace% + \mdf@theoremtitlefont% + ##1}% + \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% + } + \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% + \@temptitle}]}% + {\end{mdframed}}% + \newenvironment{#2*}[1][]{% + \ifstrempty{##1}% + {\let\@temptitle\relax}% + {% + \def\@temptitle{\mdf@theoremseparator% + \mdf@theoremspace% + \mdf@theoremtitlefont% + ##1}% + \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% + }% + \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% + {\end{mdframed}}% + }% + }% + {%#3 given -- number relationship + \global\@namedef{the#2}{\@nameuse{the#3}}% + \newenvironment{#2}[1][]{% + \refstepcounter{#3}% + \ifstrempty{##1}% + {\let\@temptitle\relax}% + {% + \def\@temptitle{\mdf@theoremseparator% + \mdf@theoremspace% + \mdf@theoremtitlefont% + ##1}% + \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% + } + \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% + \@temptitle}]}% + {\end{mdframed}}% + \newenvironment{#2*}[1][]{% + \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}% + \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% + {\end{mdframed}}% + }% + }% + } + +\newrobustcmd\mdfframedtitleenv[1]{% + \mdf@lrbox{\mdf@frametitlebox}% + \begingroup + %%\parindent\z@\parskip\z@% + \@afterheading + \mdf@frametitlealignment% + \leavevmode\color{\mdf@frametitlefontcolor}% + \normalfont\mdf@frametitlefont{#1}% + \mdf@@ignorelastdescenders% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%% + \endgroup + \endmdf@lrbox\relax% + \mdf@ignorevbadness% + \setbox\mdf@frametitlebox=\vbox{\unvbox\mdf@frametitlebox}% + \mdfframetitleboxwidth=\wd\mdf@frametitlebox\relax% + \mdfframetitleboxheight=\ht\mdf@frametitlebox\relax% + \mdfframetitleboxdepth=\dp\mdf@frametitlebox\relax% + \mdfframetitleboxtotalheight=\dimexpr + \ht\mdf@frametitlebox + +\dp\mdf@frametitlebox% + +\mdf@frametitleaboveskip@length + +\mdf@frametitlebelowskip@length + \relax% + \setbox\mdf@frametitlebox=%prevent frametitle to expand glue + \vbox to \dimexpr\mdfframetitleboxheight+\mdfframetitleboxdepth\relax% + {\unvbox\mdf@frametitlebox}% +} + +\newrobustcmd\mdf@@frametitle@use{% + \mdf@ignorevbadness% + \setbox\mdf@splitbox@one=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% + \offinterlineskip\relax% + \unvcopy\mdf@frametitlebox\relax% + \mdf@@frametitlerule\relax% + \unvbox\mdf@splitbox@one\relax% + }% + \mdf@ignorevbadness% + \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}% + \mdfsetup{innertopmargin=\mdf@frametitleaboveskip@length}% +} +\newrobustcmd*\mdf@footnoterule{% + \kern0\p@% + \hrule \@width 1in \kern 2.6\p@} + +\newrobustcmd*\mdf@footnoteoutput{% + \ifvoid\@mpfootins\else% + \nobreak% + \vskip\mdf@footenotedistance@length% + \normalcolor% + \mdf@footnoterule% + \unvbox\@mpfootins% + \fi% +} + +\newrobustcmd*\mdf@footnoteinput{% + \def\@mpfn{mpfootnote}% + \def\thempfn{\thempfootnote}% + \c@mpfootnote\z@% + \let\@footnotetext\@mpfootnotetext% +} +\newrobustcmd*\mdf@styledefinition{%AVOID!!!Needed for framemethod=default + \ifnumequal{\value{mdf@globalstyle@cnt}}{0}% + {\deflength{\mdf@innerlinewidth@length}{\z@}% + \deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}% + \deflength{\mdf@outerlinewidth@length}{\z@}% + \let\mdf@innerlinecolor\mdf@linecolor% + \let\mdf@middlelinecolor\mdf@linecolor% + \let\mdf@outerlinecolor\mdf@linecolor% + }{}% +} +\let\mdf@reserved@a\@empty +\newrobustcmd*\detected@mdf@put@frame{% + \ifmdf@nobreak%Option nobreak=true? + \def\mdf@reserved@a{\mdf@put@frame@standalone}% + \else% + \def\mdf@reserved@a{\mdf@put@frame}% + \ifx\@captype\@undefined% + \def\mdf@reserved@a{\mdf@put@frame}% + \else% + \mdf@PackageInfo{mdframed inside float ^^J + mdframed uses option nobreak \mdframedpackagename}% + \def\mdf@reserved@a{\mdf@put@frame@standalone}% + \fi% + \if@minipage% + \mdf@PackageInfo{mdframed inside minipage ^^J + mdframed uses option nobreak \mdframedpackagename}% + \def\mdf@reserved@a{\mdf@put@frame@standalone}% + \fi% + \ifinner% + \mdf@PackageInfo{mdframed inside a box ^^J + mdframed uses option nobreak \mdframedpackagename}% + \def\mdf@reserved@a{\mdf@put@frame@standalone}% + \fi% + \fi% +\mdf@reserved@a% +} +\newcount\mdf@envdepth \mdf@envdepth=0 +\@definecounter{mdf@env@i} +\@definecounter{mdf@env@ii} +\newrobustcmd*\mdf@preenvsetting{% + \needspace{\mdf@needspace@length} + \mdf@twoside@checklength% + \edef\mdf@par@local{% + \parskip=\the\parskip\relax% + \parindent=\the\parindent\relax}% + \parskip\z@% + \parindent\z@% + \let\width\z@% + \let\height\z@% + \mdf@checkntheorem% + \ifbool{mdf@draft}{% + \ifdimgreater{\overfullrule}{0pt}{}{\setlength\overfullrule{5pt}}}{}% + %% Nested environments and provide an extra counter. + \ifnum\mdf@envdepth >\tw@\@toodeep\else% + \advance\mdf@envdepth\@ne + \edef\mdf@depthctr{mdf@env@\romannumeral\the\mdf@envdepth}% + \fi + \mdf@styledefinition% + \mdf@footnoteinput% + \color{\mdf@fontcolor}% + \mdf@font% +} +\newrobustcmd*\mdf@@ignorelastdescenders{% + \ifbool{mdf@ignorelastdescenders}% + {% + \par\strut\par% + \unskip\unskip\setbox0=\lastbox + \vspace*{\dimexpr\ht\strutbox-\baselineskip\relax}% + }{}% +} +\newenvironment{mdframed}[1][]{% + \color@begingroup% + \mdfsetup{userdefinedwidth=\linewidth,#1}% + \mdf@startcode% + \mdf@preenvsetting% + \ifdefempty{\mdf@firstframetitle}{}% + {\let\mdf@frametitlesave\mdf@frametitle% + \let\mdf@frametitle\mdf@firstframetitle% + }% + \ifvmode\nointerlineskip\fi% + \mdf@trivlist{\mdf@skipabove@length}%% + \mdf@settings% + \mdf@lrbox{\mdf@splitbox@one}% + \mdf@startinnercode% + }% + {% + \mdf@@ignorelastdescenders% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%% + \ifmdf@footnoteinside% + \def\mdf@reserveda{% + \mdf@footnoteoutput% + \mdf@endinnercode% + \endmdf@lrbox% + \ifdefempty{\mdf@frametitle}{}% + {\mdfframedtitleenv{\mdf@frametitle}\mdf@@frametitle@use}% + \detected@mdf@put@frame}% + \else% + \def\mdf@reserveda{% + \mdf@endinnercode% + \endmdf@lrbox% + \ifdefempty{\mdf@frametitle}{}% + {\mdfframedtitleenv{\mdf@frametitle}\mdf@@frametitle@use}% + \detected@mdf@put@frame% + \mdf@footnoteoutput% + }% + \fi% + \mdf@reserveda% + \aftergroup\endmdf@trivlist% + \color@endgroup% + \mdf@endcode% +} + +\newtoggle{md:checktwoside} +\settoggle{md:checktwoside}{false} +\newrobustcmd*\mdf@twoside@checklength{% + \if@twoside% + \ifbool{mdf@usetwoside}% + {\mdf@PackageInfo{mdframed works in twoside mode}% + \settoggle{md:checktwoside}{true}% + \setlength\mdf@rightmargin@length{\mdf@outermargin@length}% + \setlength\mdf@leftmargin@length{\mdf@innermargin@length}% + }% + {\mdf@PackageInfo{mdframed inside twoside mode but\MessageBreak + works with oneside mode}% + \settoggle{md:checktwoside}{false}% + }% + \fi% +} + +\newcounter{mdf@zref@counter}%keine doppelten laebes +\zref@newprop*{mdf@pagevalue}[0]{\number\value{page}} +\zref@addprop{\ZREF@mainlist}{mdf@pagevalue} +\newrobustcmd*\mdf@zref@label{% + \stepcounter{mdf@zref@counter}% + \zref@label{mdf@pagelabel-\number\value{mdf@zref@counter}}% +} +\newrobustcmd*\if@mdf@pageodd{% + \zref@refused{mdf@pagelabel-\the\value{mdf@zref@counter}}% + \ifodd\zref@extract{mdf@pagelabel-\the\value{mdf@zref@counter}}% + {mdf@pagevalue}% + \setlength\mdf@rightmargin@length{\mdf@outermargin@length}% + \setlength\mdf@leftmargin@length{\mdf@innermargin@length}% + \else + \setlength\mdf@rightmargin@length{\mdf@innermargin@length}% + \setlength\mdf@leftmargin@length{\mdf@outermargin@length}% + \fi% +} +\newrobustcmd*\mdf@@setzref{% + \iftoggle{md:checktwoside}{\mdf@zref@label\if@mdf@pageodd}{}% +} +\newrobustcmd*\mdf@freepagevspace{% + \bgroup\@nobreakfalse\addpenalty\z@\egroup%added 29.5.12 + \penalty\@M\relax\vskip 2\baselineskip\relax% + \penalty9999\relax\vskip -2\baselineskip\relax% + \penalty9999% + \ifdimequal{\pagegoal}{\maxdimen}% + {\mdf@freevspace@length\vsize}% + {\mdf@freevspace@length=\pagegoal\relax% + \advance\mdf@freevspace@length by -\pagetotal\relax% + \addtolength\mdf@freevspace@length{\dimexpr-\parskip\relax}\relax% + }% +} +\newrobustcmd*\mdf@advancelength@sub[2]{% + \advance #1 by -\csname mdf@#2@length\endcsname\relax% +} +\newrobustcmd*\mdf@advancelength@add[2]{% + \advance #1 by \csname mdf@#2@length\endcsname\relax% +} +\newrobustcmd*\mdf@horizontalmargin@equation{% + \setlength{\mdf@horizontalspaceofbox}{\mdf@userdefinedwidth@length}% + \mdf@dolist{\mdf@advancelength@sub{\mdf@horizontalspaceofbox}}{% + leftmargin,outerlinewidth,middlelinewidth,% + innerlinewidth,innerleftmargin,innerrightmargin,% + innerlinewidth,middlelinewidth,outerlinewidth,% + rightmargin}% + \notbool{mdf@leftline}% + {% + \mdf@dolist{\mdf@advancelength@add{\mdf@horizontalspaceofbox}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% + \notbool{mdf@rightline}% + {% + \mdf@dolist{\mdf@advancelength@add{\mdf@horizontalspaceofbox}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% + \hsize=\mdf@horizontalspaceofbox% +} +\newrobustcmd*\mdf@keeplines@single{% + \notbool{mdf@topline}% + {% + \mdf@dolist{\mdf@advancelength@sub{\mdf@verticalmarginwhole@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% + \notbool{mdf@bottomline}% + {% + \mdf@dolist{\mdf@advancelength@sub{\mdf@verticalmarginwhole@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% +} +\protected@edef\mdf@reset{\boxmaxdepth\the\boxmaxdepth% + \splittopskip\the\splittopskip}% +\newrobustcmd*\mdf@put@frame@standalone{\relax% + \ifvoid\mdf@splitbox@one\relax% + \mdf@PackageWarning{The environment is empty\MessageBreak}% + \else% + %Hier berechnung Box-Inhalt+Rahmen oben und unten + \setlength{\mdf@verticalmarginwhole@length}% + {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% + \mdf@dolist{\mdf@advancelength@add{\mdf@verticalmarginwhole@length}}{% + outerlinewidth,middlelinewidth,innerlinewidth,% + innertopmargin,innerbottommargin,innerlinewidth,% + middlelinewidth,outerlinewidth,extratopheight}% + \mdf@keeplines@single% + \begingroup% + \mdf@@setzref% + \booltrue{mdfsingleframe}% + \mdf@beforesingleframe% + \mdf@putbox@single% + \mdf@aftersingleframe% + \endgroup%Output no break + \fi% +} +\def\mdf@put@frame{\relax% +\ifvoid\mdf@splitbox@one\relax + \mdf@PackageWarning{The environment is empty\MessageBreak}% + \let\mdf@reserved@a\relax% +\else + \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}% + \mdf@print@space% + \mdf@freepagevspace%gives \mdf@freevspace@length + \mdf@PackageInfoSpace{\the\mdf@freevspace@length before the + beginning of \MessageBreak + the environment ending on input line \MessageBreak}% + \ifdimless{\mdf@freevspace@length}{2\baselineskip}% + {% + \mdf@PackageInfo{Not enough space on this page}% + \vfill\eject% + \def\mdf@reserved@a{\mdf@put@frame}% + }{% + %Hier berechnung Box-Inhalt+Rahmen oben und unten + \setlength{\mdf@verticalmarginwhole@length}% + {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% + \mdf@dolist{\mdf@advancelength@add{\mdf@verticalmarginwhole@length}}% + {% + outerlinewidth,middlelinewidth,innerlinewidth,% + innertopmargin,innerbottommargin,% + innerlinewidth,middlelinewidth,outerlinewidth,extratopheight}% + \mdf@keeplines@single% + \ifdimless{\mdf@verticalmarginwhole@length}{\mdf@freevspace@length}% + {%enough space / no break + \begingroup% + \mdf@@setzref% + \booltrue{mdfsingleframe}% + \mdf@beforesingleframe% + \mdf@putbox@single% + \mdf@aftersingleframe% + \endgroup%Output no break + \let\mdf@reserved@a\relax% + }% + {% + \def\mdf@reserved@a{\mdf@put@frame@i}%need to split + }% + }% +\fi% +\mdf@reserved@a% +} +\def\mdf@put@frame@i{%Box must be splitted + \mdf@freepagevspace%gives \mdf@freevspace@length + \dimen@=\the\mdf@freevspace@length\relax% + \dimen@i=\mdf@innertopmargin@length\relax% + \mdf@dolist{\mdf@advancelength@add{\dimen@i}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + \advance\dimen@i by 2\baselineskip\relax% + \ifdimless{\dimen@}{\dimen@i}% + {\hrule \@height\z@ \@width\hsize% + \vfill\eject%no room for two lines + \def\mdf@reserved@a{\mdf@put@frame}% + }% + {%enough space for first part + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}{%calculate with \dimen@ + outerlinewidth,middlelinewidth,innerlinewidth,%width of top rule + innertopmargin,splitbottomskip}%width of length + \ifboolexpr{ bool {mdf@everyline} and bool {mdf@bottomline} }% + {%need space for bottomline + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% + \ifbool{mdf@topline}{}%%no top line + {% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }% + \advance\dimen@.8\pageshrink% + \ifdimless{\ht\mdf@splitbox@one+\dp\mdf@splitbox@one}{\dimen@}% + {\mdf@PackageWarning{You got a bad break\MessageBreak + because the last box will be empty\MessageBreak + you have to change it manually\MessageBreak + by changing the text, the space\MessageBreak + or something else}% + \advance\dimen@ by -1.8\baselineskip\relax%needed???????????????????? + }{}% + \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}%save original + \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% + \mdf@ignorevbadness% + \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@\relax% + \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}% + \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}% + \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}{\dimen@}% + {%splitted wrong + \mdf@PackageInfo{Box was splittet wrong^^J + starting loop to iterate + the splitting point\MessageBreak}% + \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% + \dimen@i=\dimen@\relax% + \@tempcnta=\z@\relax% + \loop + \ifdim\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax>\dimen@ + \advance\dimen@i by -\p@\relax% + \advance\@tempcnta by \@ne\relax% +%% \wlog{***mdframed \string\@tempcnta=\the\@tempcnta***} +%% \wlog{***mdframed \string\dimen@i=\the\dimen@i***} + \mdf@ignorevbadness% + \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% + \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% + \mdf@ignorevbadness% + \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@i\relax% + \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}% + \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}% + \ifnum\@tempcnta>100 + \let\iterate\relax% + \mdf@PackageWarning{correct box splittet fails^^J + It seems you are using a non splittable + contents\MessageBreak}% + \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% + \setbox\mdf@splitbox@two=\vbox{}% + \def\mdf@reserved@a{\mdf@put@frame}% + \fi + \repeat% + }{}% + \ifvoid\mdf@splitbox@one\relax% + \mdf@PackageWarning{You got a bad break because the splittet box + is empty^^J + You have to change the page settings^^J + like enlargethispage or something else^^J + the package increases do + \enlargethispage{\baselineskip}\MessageBreak}% + \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save} + \enlargethispage{\baselineskip}% + \def\mdf@reserved@a{\mdf@put@frame}% + \fi% + % Test if first splitted frame doesn't have the original with. + % occurs with math + \ifdim\wd\mdf@splitbox@two=\wd\mdf@splitbox@one\relax + \else% + \mdf@PackageInfo{You first box width is to small^^J + mdframed fixed it\MessageBreak}% + \setbox\mdf@splitbox@two=\vbox% + {% + \hrule \@height\z@ \@width\mdfboundingboxwidth\relax% + \unvcopy\mdf@splitbox@two% + }% + \fi% + \ifvoid\mdf@splitbox@two\relax% + {% + \hrule \@height\f@size pt \@width\z@% + \hrule \@height\z@ \@width\hsize}% + \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% + \def\mdf@reserved@a{\mdf@put@frame% + }% + \else% + \ifdimequal{\ht\mdf@splitbox@two}{0pt}% + {% + \hrule \@height\z@ \@width\hsize% + \vfill\eject% + \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% + \def\mdf@reserved@a{\mdf@put@frame}% + }% + {% + \begingroup% + \mdf@@setzref% + \mdf@beforebreak% + \booltrue{mdffirstframe}% + \mdf@putbox@first% + \mdf@afterbreak% + \endgroup% + \hrule \@height\z@ \@width\hsize% + \vfill\eject% + \def\mdf@reserved@a{\mdf@put@frame@ii}% + }% + \fi% + }% +\mdf@reserved@a% +} +\def\mdf@put@frame@ii{% + \setlength{\mdf@freevspace@length}{\vsize}% + \ifbool{mdf@repeatframetitle}% + {%repeating title -- more robust using hooks. + \toggletrue{mdf@notfirstframetitle}% + \splitmaxdepth\z@ \splittopskip\z@% + \setbox\mdf@splitbox@one=\vbox{\break\unvbox\mdf@splitbox@one}% + \mdf@ignorevbadness% + \setbox0=\vsplit\mdf@splitbox@one to \z@\relax% + \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}% + \setbox\mdf@splitbox@one\vbox% + {% + \parskip\z@\relax% + \parindent\z@\relax% + \vskip\mdf@frametitleaboveskip@length% + \unvcopy\mdf@frametitlebox\relax% + \mdf@@frametitlerule\relax% + \unvbox\mdf@splitbox@one\relax% + }% + \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}% + }{}% + \setlength{\dimen@}{\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}% + \ifboolexpr { bool {mdf@everyline} and bool {mdf@topline} }% + {% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% + \notbool{mdf@bottomline}%remove bottom if neccessary + {% + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% + \ifdimgreater{\dimen@}{\mdf@freevspace@length}% + {%have a middle box + \advance\mdf@freevspace@length by -\mdf@splitbottomskip@length\relax% + \ifbool{mdf@everyline}%regard top and bottom if everyline is used + {% + \ifbool{mdf@topline}% + {% + \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% + \ifbool{mdf@bottomline}% + {% + \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% + }{}% + \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}% + \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% + \mdf@ignorevbadness% + \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \mdf@freevspace@length% + \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}% + \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}% + \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}% + {\mdf@freevspace@length}% + {%splitted wrong + \mdf@PackageInfo{Box was splittet wrong^^J + starting loop to iterate + the splitting point\MessageBreak}% + \dimen@i=\mdf@freevspace@length%\relax + \@tempcnta=\z@\relax + \loop + \ifdim\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax>% + \mdf@freevspace@length\relax + \advance\dimen@i by -\p@\relax% + \advance\@tempcnta by \@ne\relax% + \ifnum\@tempcnta>100 + \let\iterate\relax% + \mdf@PackageWarning{correct box splittet fails^^J + It seems you are using a non splittable + contents\MessageBreak}% + \fi + \mdf@ignorevbadness% + \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% + \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% + \mdf@ignorevbadness% + \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@i\relax% + \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}% + \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}% + \repeat% + }{}% + \ifvoid\mdf@splitbox@one\relax% + \mdf@PackageWarning{You got a bad break because the splittet box is + empty^^J + You have to change the page settings^^J + like enlargethispage or something else^^J + the package increases do + \enlargethispage{\baselineskip}\MessageBreak}% + \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% + \enlargethispage{\baselineskip}% + \def\mdf@reserved@a{\mdf@put@frame@ii}% + \else + \setbox\mdf@splitbox@two=\vbox% + {% + \hrule \@height\z@ \@width\mdfboundingboxwidth\relax% + \unvcopy\mdf@splitbox@two% + }% + \begingroup% + \mdf@@setzref% + \booltrue{mdfmiddleframe}% + \mdf@beforebreak% + \mdf@putbox@middle% + \mdf@afterbreak% + \endgroup% + \hrule \@height\z@ \@width\hsize% + \vfill\eject% + \def\mdf@reserved@a{\mdf@put@frame@ii}% + \fi + }%End middle box case + {%start last box case + \ifvoid\mdf@splitbox@one + \mdf@PackageWarning{You got a bad break\MessageBreak + because the last split box is empty\MessageBreak + You have to change the settings}%% + \setbox\mdf@splitbox@one=\vbox% + {% + \unvbox\mdf@splitbox@one% + \hrule \@height\z@ \@width\mdfboundingboxwidth + }% + \fi% + \ifdimless{\ht\mdf@splitbox@one}{1sp}% + {% + \mdf@PackageWarning{You got a bad break\MessageBreak + because the last split box is empty\MessageBreak + You have to change the settings}% + + \let\mdf@reserved@a\relax% + \setbox\mdf@splitbox@one=\vbox% + {% + \unvbox\mdf@splitbox@one% + \hrule \@height\z@ \@width\mdfboundingboxwidth + }% + }{}% + \begingroup% + \toggletrue{mdflastframe}% + \mdf@beforebreak% + \begingroup% + \mdf@@setzref% + \booltrue{mdflastframe}% + \mdf@beforelastframe% + \mdf@putbox@second% + \mdf@afterlastframe% + \endgroup% + \hrule \@height\z@ \@width\hsize% + \mdf@afterbreak% + \endgroup% + \let\mdf@reserved@a\relax% + }% + \mdf@reserved@a% +} + +\newrobustcmd\mdfsubtitle[2][]% +{% + \begingroup + \penalty-9995%set a breakpoint before the subtitle + \parindent\z@\relax% + \parskip\z@\relax% + \mdfsetup{#1}%only for subtitle options + \par\addvspace{\mdf@subtitleaboveskip@length}% + \setbox\z@=\vbox{% + \mdf@frametitlealignment% + \mdf@subtitlefont{#2}% + \mdf@@ignorelastdescenders% + \relax}% + \setbox\z@=\vbox{\unvbox\z@}% + \setbox\z@=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% + \offinterlineskip\relax% + \vbox to \mdf@subtitleinneraboveskip@length{}% + \unvbox\z@\relax% + \vbox to \mdf@subtitleinnerbelowskip@length{}% + }%\z@ contains the subtitle+required length + \setlength{\mdfsubtitleheight}{\dimexpr\ht\z@+\dp\z@\relax} + \setbox\z@=\vbox to \mdfsubtitleheight {\unvbox\z@}% + % \dimen@ is now the complete width + \mdf@templength=\linewidth\relax% + \mdf@dolist{\mdf@advancelength@add{\mdf@templength}}% + {innerleftmargin,innerrightmargin}% + \offinterlineskip\relax% + \ifbool{mdf@subtitleaboveline}{\mdf@drawsubtitleaboveline\par}{}% + \mdf@drawsubtitlebackground% + \box\z@% + \ifbool{mdf@subtitlebelowline}{\mdf@drawsubtitlebelowline}{}% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% + \penalty 9995% + \addvspace{\mdf@subtitlebelowskip@length}% + \endgroup% + \@afterheading% +} + +\newrobustcmd\mdfsubsubtitle[2][]% +{% + \begingroup + \penalty-9995%set a breakpoint before the subtitle + \parindent\z@\relax% + \parskip\z@\relax% + \mdfsetup{#1}%only for subtitle options + \par\addvspace{\mdf@subsubtitleaboveskip@length}% + \setbox\z@=\vbox{% + \mdf@frametitlealignment% + \mdf@subsubtitlefont{#2}% + \mdf@@ignorelastdescenders% + \relax}% + \setbox\z@=\vbox{\unvbox\z@}% + \setbox\z@=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% + \offinterlineskip\relax% + \vbox to \mdf@subsubtitleinneraboveskip@length{}% + \unvbox\z@\relax% + \vbox to \mdf@subsubtitleinnerbelowskip@length{}% + }%\z@ contains the subtitle+required length + \setlength{\mdfsubsubtitleheight}{\dimexpr\ht\z@+\dp\z@\relax} + \setbox\z@=\vbox to \mdfsubsubtitleheight {\unvbox\z@}% + % \dimen@ is now the complete width + \mdf@templength=\linewidth\relax% + \mdf@dolist{\mdf@advancelength@add{\mdf@templength}}% + {innerleftmargin,innerrightmargin}% + \offinterlineskip\relax% + \ifbool{mdf@subsubtitleaboveline}{\mdf@drawsubtitleaboveline\par}{}% + \mdf@drawsubtitlebackground% + \box\z@% + \ifbool{mdf@subsubtitlebelowline}{\mdf@drawsubtitlebelowline}{}% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% + \penalty 9995% + \addvspace{\mdf@subsubtitlebelowskip@length}% + \endgroup% + \@afterheading% +} +%%%% _____t_____ +%%%% | | +%%%% | | +%%%% | | +%%%% l| |r +%%%% | | +%%%% | | +%%%% |___________| +%%%% b +\newrobustcmd*\mdf@test@ltrb{% + \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline}) + and (bool {mdf@leftline}) and (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@ltr{% + \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline}) + and (bool {mdf@leftline}) and (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@ltb{% + \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline}) + and (bool {mdf@leftline}) and not (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@trb{% + \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline}) + and not (bool {mdf@leftline}) and (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@lrb{% + \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline}) + and (bool {mdf@leftline}) and (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@lb{% + \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline}) + and (bool {mdf@leftline}) and not (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@rb{% + \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline}) + and not (bool {mdf@leftline}) and (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@tr{% + \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline}) + and not (bool {mdf@leftline}) and (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@lt{% + \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline}) + and (bool {mdf@leftline}) and not (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@lr{% + \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline}) + and (bool {mdf@leftline}) and (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@tb{% + \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline}) + and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@l{% + \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline}) + and (bool {mdf@leftline}) and not (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@r{% + \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline}) + and not (bool {mdf@leftline}) and (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@t{% + \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline}) + and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@b{% + \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline}) + and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@noline{% + \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline}) + and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}} +\newrobustcmd*\mdf@test@single{% + \ifboolexpr{ not (test {\mdf@test@ltrb} or test {\mdf@test@ltr} or + test {\mdf@test@ltb} or test {\mdf@test@trb} or + test {\mdf@test@lrb} or test {\mdf@test@lb} or + test {\mdf@test@rb} or test {\mdf@test@tr} or + test {\mdf@test@lt} ) }} +\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{xcolor}% + + \endinput +%% +%% ================================================================ +%% Copyright (C) 2012 by Marco Daniel +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License (LPPL), either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Marco Daniel. +%% +%% Have fun! +%% +%% ================================================================ +%% +%% End of file `mdframed.sty'. diff --git a/Doc/needspace.sty b/Doc/needspace.sty new file mode 100644 index 0000000000..113d87216f --- /dev/null +++ b/Doc/needspace.sty @@ -0,0 +1,35 @@ + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{needspace}[2010/09/12 v1.3d reserve vertical space] + +\newcommand{\needspace}[1]{% + \begingroup + \setlength{\dimen@}{#1}% + \vskip\z@\@plus\dimen@ + \penalty -100\vskip\z@\@plus -\dimen@ + \vskip\dimen@ + \penalty 9999% + \vskip -\dimen@ + \vskip\z@skip % hide the previous |\vskip| from |\addvspace| + \endgroup +} + +\newcommand{\Needspace}{\@ifstar{\@sneedsp@}{\@needsp@}} + +\newcommand{\@sneedsp@}[1]{\par \penalty-100\begingroup + \setlength{\dimen@}{#1}% + \dimen@ii\pagegoal \advance\dimen@ii-\pagetotal + \ifdim \dimen@>\dimen@ii + \break + \fi\endgroup} + +\newcommand{\@needsp@}[1]{\par \penalty-100\begingroup + \setlength{\dimen@}{#1}% + \dimen@ii\pagegoal \advance\dimen@ii-\pagetotal + \ifdim \dimen@>\dimen@ii + \ifdim \dimen@ii>\z@ + \vfil + \fi + \break + \fi\endgroup} + diff --git a/Doc/zref-abspage.sty b/Doc/zref-abspage.sty new file mode 100644 index 0000000000..2ef46b3d24 --- /dev/null +++ b/Doc/zref-abspage.sty @@ -0,0 +1,66 @@ +%% +%% This is file `zref-abspage.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% zref.dtx (with options: `abspage') +%% +%% This is a generated file. +%% +%% Project: zref +%% Version: 2016/05/21 v2.26 +%% +%% Copyright (C) 2006-2012 by +%% Heiko Oberdiek +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% This work consists of the main source file zref.dtx +%% and the derived files +%% zref.sty, zref.pdf, zref.ins, zref.drv, zref-base.sty, +%% zref-abspage.sty, zref-abspos.sty, zref-counter.sty, +%% zref-dotfill.sty, zref-env.sty, zref-hyperref.sty, +%% zref-lastpage.sty, zref-marks.sty, zref-nextpage.sty, +%% zref-pageattr.sty, zref-pagelayout.sty, zref-perpage.sty, +%% zref-runs.sty, zref-savepos.sty, zref-thepage.sty, +%% zref-titleref.sty, zref-totpages.sty, zref-user.sty, +%% zref-xr.sty, zref-example.tex, zref-example-lastpage.tex, +%% zref-example-nextpage.tex, zref-test1.tex, +%% zref-test-base.tex, zref-test-runs.tex, +%% zref-test-titleref-memoir.tex. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{zref-abspage}% + [2016/05/21 v2.26 Module abspage for zref (HO)]% +\RequirePackage{zref-base}[2016/05/21] +\ifx\ZREF@base@ok Y% +\else + \expandafter\endinput +\fi +\RequirePackage{atbegshi}[2011/10/05]% +\begingroup + \let\@addtoreset\ltx@gobbletwo + \newcounter{abspage}% +\endgroup +\setcounter{abspage}{0}% +\AtBeginShipout{% + \stepcounter{abspage}% +}% +\zref@newprop*{abspage}[0]{\the\c@abspage}% +\zref@addprop\ZREF@mainlist{abspage}% +\endinput +%% +%% End of file `zref-abspage.sty'. diff --git a/Doc/zref-base.sty b/Doc/zref-base.sty new file mode 100644 index 0000000000..38cb9fa258 --- /dev/null +++ b/Doc/zref-base.sty @@ -0,0 +1,785 @@ +%% +%% This is file `zref-base.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% zref.dtx (with options: `base') +%% +%% This is a generated file. +%% +%% Project: zref +%% Version: 2016/05/21 v2.26 +%% +%% Copyright (C) 2006-2012 by +%% Heiko Oberdiek +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% This work consists of the main source file zref.dtx +%% and the derived files +%% zref.sty, zref.pdf, zref.ins, zref.drv, zref-base.sty, +%% zref-abspage.sty, zref-abspos.sty, zref-counter.sty, +%% zref-dotfill.sty, zref-env.sty, zref-hyperref.sty, +%% zref-lastpage.sty, zref-marks.sty, zref-nextpage.sty, +%% zref-pageattr.sty, zref-pagelayout.sty, zref-perpage.sty, +%% zref-runs.sty, zref-savepos.sty, zref-thepage.sty, +%% zref-titleref.sty, zref-totpages.sty, zref-user.sty, +%% zref-xr.sty, zref-example.tex, zref-example-lastpage.tex, +%% zref-example-nextpage.tex, zref-test1.tex, +%% zref-test-base.tex, zref-test-runs.tex, +%% zref-test-titleref-memoir.tex. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{zref-base}% + [2016/05/21 v2.26 Module base for zref (HO)]% +\RequirePackage{ltxcmds}[2010/12/02] +\RequirePackage{infwarerr}[2010/04/08] +\RequirePackage{kvsetkeys}[2010/03/01] +\RequirePackage{kvdefinekeys}[2010/03/01] +\RequirePackage{pdftexcmds}[2010/04/01] +\def\ZREF@name{zref} +\ltx@IfUndefined{protected}{% + \RequirePackage{makerobust}[2006/03/18]% + \def\ZREF@Robust#1#2{% + \def\ZREF@temp{\MakeRobustcommand#2}% + \afterassignment\ZREF@temp + #1#2% + }% +}{% + \def\ZREF@Robust#1{% + \protected#1% + }% +} +\def\ZREF@IfDefinable#1#2#3{% + \@ifdefinable{#1}{% + \ZREF@Robust{#2}#1#3% + }% +} +\def\ZREF@UpdatePdfTeX{Update pdfTeX.} +\newif\ifZREF@found +\def\ZREF@patch#1{% + \ltx@IfUndefined{#1}{% + \ltx@gobble + }{% + \expandafter\let\csname ZREF@org@#1\expandafter\endcsname + \csname #1\endcsname + \ltx@firstofone + }% +} +\ltx@IfUndefined{eTeXversion}{% + \PackageError\ZREF@name{% + Missing support for eTeX; package is abandoned% + }{% + Use a TeX compiler that support eTeX and enable eTeX % + in the format.% + }% + \endinput +}{}% +\RequirePackage{etexcmds}[2007/09/09] +\ifetex@unexpanded +\else + \PackageError\ZREF@name{% + Missing e-TeX's \string\unexpanded.\MessageBreak + Add \string\RequirePackage\string{etexcmds\string} before % + \string\documentclass% + }{% + Probably you are using some package (e.g. ConTeXt) that % + redefines \string\unexpanded% + }% + \expandafter\endinput +\fi +\RequirePackage{auxhook} +\AddLineBeginAux{% + \string\providecommand\string\zref@newlabel[2]{}% +} +\def\ZREF@RefPrefix{Z@R} +\ZREF@Robust\edef\zref@newlabel{% + \noexpand\@newl@bel{\ZREF@RefPrefix}% +} +\ZREF@Robust\def\zref@newlist#1{% + \zref@iflistundefined{#1}{% + \@ifdefinable{Z@L@#1}{% + \global\expandafter\let\csname Z@L@#1\endcsname\ltx@empty + \PackageInfo\ZREF@name{New property list: #1}% + }% + }{% + \PackageError\ZREF@name{% + Property list `#1' already exists% + }\@ehc + }% +} +\def\zref@iflistundefined#1{% + \ltx@ifundefined{Z@L@#1}% +} +\ZREF@Robust\def\zref@listexists#1{% + \zref@iflistundefined{#1}{% + \PackageError\ZREF@name{% + Property list `#1' does not exist% + }\@ehc + }% +} +\ZREF@Robust\def\zref@iflistcontainsprop#1#2{% + \zref@iflistundefined{#1}{% + \ltx@secondoftwo + }{% + \begingroup\expandafter\endgroup + \expandafter\in@ + \csname#2\expandafter\expandafter\expandafter\endcsname + \expandafter\expandafter\expandafter{\csname Z@L@#1\endcsname}% + \csname ltx@\ifin@ first\else second\fi oftwo\endcsname + }% +} +\def\zref@listforloop#1#2{% + \zref@listexists{#1}{% + \expandafter\expandafter\expandafter\@tfor + \expandafter\expandafter\expandafter\zref@prop + \expandafter\expandafter\expandafter:% + \expandafter\expandafter\expandafter=% + \csname Z@L@#1\endcsname + \do{% + \begingroup + \escapechar=-1 % + \edef\x{\endgroup + \def\noexpand\zref@prop{% + \expandafter\string\zref@prop + }% + }% + \x + #2\zref@prop + }% + }% +} +\ZREF@Robust\def\zref@addprops#1#2{% + \zref@listexists{#1}{% + \comma@parse{#2}{% + \zref@propexists\comma@entry{% + \zref@iflistcontainsprop{#1}\comma@entry{% + \PackageWarning\ZREF@name{% + Property `\comma@entry' is already in list `#1'% + }% + }{% + \begingroup\expandafter\endgroup + \expandafter\g@addto@macro + \csname Z@L@#1\expandafter\endcsname + \expandafter{\csname\comma@entry\endcsname}% + }% + }% + \ltx@gobble + }% + }% +} +\ZREF@Robust\def\zref@addprop#1#2{% + \zref@listexists{#1}{% + \zref@propexists{#2}{% + \zref@iflistcontainsprop{#1}{#2}{% + \PackageWarning\ZREF@name{% + Property `#2' is already in list `#1'% + }% + }{% + \begingroup\expandafter\endgroup + \expandafter\g@addto@macro + \csname Z@L@#1\expandafter\endcsname + \expandafter{\csname#2\endcsname}% + }% + }% + }% +} +\ZREF@Robust\def\zref@localaddprops#1#2{% + \zref@listexists{#1}{% + \comma@parse{#2}{% + \zref@propexists\comma@entry{% + \zref@iflistcontainsprop{#1}\comma@entry{% + \PackageWarning\ZREF@name{% + Property `\comma@entry' is already in list `#1'% + }% + }{% + \begingroup\expandafter\endgroup + \expandafter\ltx@LocalAppendToMacro + \csname Z@L@#1\expandafter\endcsname + \expandafter{\csname\comma@entry\endcsname}% + }% + }% + \ltx@gobble + }% + }% +} +\ZREF@Robust\def\zref@localaddprop#1#2{% + \zref@listexists{#1}{% + \zref@propexists{#2}{% + \zref@iflistcontainsprop{#1}{#2}{% + \PackageWarning\ZREF@name{% + Property `#2' is already in list `#1'% + }% + }{% + \begingroup\expandafter\endgroup + \expandafter\ltx@LocalAppendToMacro + \csname Z@L@#1\expandafter\endcsname + \expandafter{\csname#2\endcsname}% + }% + }% + }% +} +\ltx@IfUndefined{pdf@strcmp}{% + \ZREF@Robust\def\zref@delprop{% + \ZREF@delprop\gdef + }% + \ZREF@Robust\def\zref@localdelprop{% + \ZREF@delprop\def + }% + \def\ZREF@delprop#1#2#3{% + \zref@listexists{#2}{% + \begingroup + \escapechar=-1 % + \def\ZREF@param{#3}% + \@onelevel@sanitize\ZREF@param + \toks@{}% + \expandafter\expandafter\expandafter\ZREF@@delprop + \csname Z@L@#2\endcsname!% + \expandafter\endgroup + \expandafter#1\csname Z@L@#2\expandafter\endcsname + \expandafter{% + \the\toks@ + }% + }% + }% + \def\ZREF@@delprop#1{% + \expandafter\ZREF@@@delprop\expandafter{\string#1}#1% + }% + \def\ZREF@@@delprop#1#2{% + \ifx#2!% + \else + \def\ZREF@temp{#1}% + \@onelevel@sanitize\ZREF@temp + \ifx\ZREF@param\ZREF@temp + \else + \toks@\expandafter{% + \the\expandafter\toks@\csname#1\endcsname + }% + \fi + \expandafter\ZREF@@delprop + \fi + }% +}{% + \ZREF@Robust\def\zref@delprop{% + \ZREF@delprop\xdef + }% + \ZREF@Robust\def\zref@localdelprop{% + \ZREF@delprop\edef + }% + \def\ZREF@delprop#1#2#3{% + \zref@listexists{#2}{% + \def\ZREF@param{#3}% + \edef\ZREF@SavedEscapechar{\the\escapechar}% + \escapechar=-1 % + \expandafter#1\csname Z@L@#2% + \expandafter\expandafter\expandafter\endcsname{% + \expandafter\expandafter\expandafter\ZREF@@delprop + \csname Z@L@#2\endcsname!% + }% + \escapechar=\ZREF@SavedEscapechar\relax + }% + }% + \def\ZREF@@delprop#1{% + \expandafter\ZREF@@@delprop\expandafter{\string#1}#1% + }% + \def\ZREF@@@delprop#1#2{% + \ifx#2!% + \else + \ifnum\pdf@strcmp{#1}{\ZREF@param}=\ltx@zero + \else + \expandafter\noexpand\csname#1\endcsname + \fi + \expandafter\ZREF@@delprop + \fi + }% +} +\def\zref@ifpropundefined#1{% + \ltx@ifundefined{Z@E@#1}% +} +\ZREF@Robust\def\zref@propexists#1{% + \zref@ifpropundefined{#1}{% + \PackageError\ZREF@name{% + Property `#1' does not exist% + }\@ehc + }% +} +\ZREF@Robust\def\zref@newprop{% + \@ifstar{% + \let\ZREF@X\noexpand + \ZREF@newprop + }{% + \let\ZREF@X\ltx@empty + \ZREF@newprop + }% +} +\def\ZREF@newprop#1{% + \edef\ZREF@P{#1}% + \@onelevel@sanitize\ZREF@P + \begingroup + \ifx\ZREF@P\ZREF@par + \@PackageError\ZREF@name{% + Invalid property name `\ZREF@P'% + }{% + The property name `par' is not allowed % + because of internal reasons.% + \MessageBreak + \@ehc + }% + \def\ZREF@@newprop[##1]##2{\endgroup}% + \else + \zref@ifpropundefined\ZREF@P{% + \endgroup + \PackageInfo\ZREF@name{% + New property: \ZREF@P + }% + }{% + \@PackageError\ZREF@name{% + Property `\ZREF@P' already exists% + }\@ehc + \def\ZREF@@newprop[##1]##2{\endgroup}% + }% + \fi + \@ifnextchar[\ZREF@@newprop{\ZREF@@newprop[\zref@default]}% +} +\def\ZREF@par{par} +\@onelevel@sanitize\ZREF@par +\def\ZREF@@newprop[#1]{% + \global\@namedef{Z@D@\ZREF@P}{#1}% + \global\expandafter\let\csname Z@X@\ZREF@P\endcsname\ZREF@X + \begingroup\expandafter\endgroup + \expandafter\ZREF@@@newprop\csname\ZREF@P\endcsname + \expandafter\gdef\csname Z@C@\ZREF@P\endcsname{}% + \zref@setcurrent\ZREF@P +} +\def\ZREF@@@newprop#1{% + \expandafter + \gdef\csname Z@E@\ZREF@P\endcsname##1#1##2##3\ZREF@nil{##2}% +} +\ZREF@Robust\def\zref@showprop#1{% + \zref@ifpropundefined{#1}{% + \@PackageInfoNoLine{\ZREF@name}{% + Show property `#1': % + }% + }{% + \begingroup + \toks@\expandafter\expandafter\expandafter{% + \csname Z@C@#1\endcsname + }% + \edef\ZREF@value{\the\toks@}% + \ltx@onelevel@sanitize\ZREF@value + \toks@\expandafter\expandafter\expandafter{% + \csname Z@D@#1\endcsname + }% + \edef\ZREF@default{\the\toks@}% + \ltx@onelevel@sanitize\ZREF@default + \@PackageInfoNoLine{\ZREF@name}{% + Show property `#1':\MessageBreak + \expandafter\ifx\csname Z@X@#1\endcsname\ltx@empty + Immediate % + \else + Delayed % + \fi + value: [\ZREF@value]\MessageBreak + Default: [\ZREF@default]% + }% + \endgroup + }% +} +\ZREF@Robust\def\zref@setcurrent#1#2{% + \zref@propexists{#1}{% + \expandafter\def\csname Z@C@#1\endcsname{#2}% + }% +} +\def\ZREF@getcurrent#1{% + \romannumeral0% + \ltx@ifundefined{Z@C@#1}{% + \ltx@space + }{% + \expandafter\expandafter\expandafter\ltx@space + \csname Z@C@#1\endcsname + }% +} +\def\ZREF@wu@getcurrent#1{% + \etex@unexpanded\expandafter\expandafter\expandafter{% + \ZREF@getcurrent{#1}% + }% +} +\let\zref@getcurrent\ZREF@getcurrent +\ZREF@Robust\def\zref@label#1{% + \zref@labelbylist{#1}\ZREF@mainlist +} +\ZREF@Robust\def\zref@labelbylist#1#2{% + \@bsphack + \zref@listexists{#2}{% + \expandafter\expandafter\expandafter\ZREF@label + \expandafter\expandafter\expandafter{% + \csname Z@L@#2\endcsname + }{#1}% + }% + \@esphack +} +\ZREF@Robust\def\zref@labelbyprops#1#2{% + \@bsphack + \begingroup + \toks@{}% + \comma@parse{#2}{% + \zref@ifpropundefined\comma@entry{% + \PackageWarning\ZREF@name{% + Property `\comma@entry' is not known% + }% + }{% + \toks@\expandafter{% + \the\expandafter\toks@\csname\comma@entry\endcsname + }% + }% + \ltx@gobble + }% + \expandafter\endgroup + \expandafter\ZREF@label\expandafter{\the\toks@}{#1}% + \@esphack +} +\ZREF@Robust\def\zref@labelbykv#1#2{% + \@bsphack + \begingroup + \let\Z@L@ZREF@temp\ltx@empty + \kvsetkeys{ZREF@LABEL}{#1}% + \ifZREF@immediate + \expandafter\zref@wrapper@immediate\expandafter{% + \expandafter\ZREF@label\expandafter{\Z@L@ZREF@temp}{#2}% + }% + \else + \expandafter\ZREF@label\expandafter{\Z@L@ZREF@temp}{#2}% + \fi + \endgroup + \@esphack +} +\kv@define@key{ZREF@LABEL}{prop}{% + \edef\ZREF@param{#1}% + \zref@propexists\ZREF@param{% + \zref@iflistcontainsprop{ZREF@temp}\ZREF@param{}{% + \begingroup\expandafter\endgroup + \expandafter\ltx@LocalAppendToMacro + \expandafter\Z@L@ZREF@temp + \expandafter{\csname\ZREF@param\endcsname}% + }% + }% +} +\kv@define@key{ZREF@LABEL}{list}{% + \zref@listforloop{#1}{% + \zref@iflistcontainsprop{ZREF@temp}\zref@prop{}{% + \begingroup\expandafter\endgroup + \expandafter\ltx@LocalAppendToMacro + \expandafter\Z@L@ZREF@temp + \expandafter{\csname\zref@prop\endcsname}% + }% + \ltx@gobble + }% +} +\kv@define@key{ZREF@LABEL}{delprop}{% + \zref@propexists{#1}{% + \zref@localdelprop{ZREF@temp}{#1}% + }% +} +\kv@define@key{ZREF@LABEL}{immediate}[true]{% + \edef\ZREF@param{#1}% + \ifx\ZREF@param\ZREF@true + \ZREF@immediatetrue + \else + \ifx\ZREF@param\ZREF@false + \ZREF@immediatefalse + \else + \PackageWarning\ZREF@name{% + Option `immediate' expects `true' or `false'.\MessageBreak + Ignoring invalid value `\ZREF@param'% + }% + \fi + \fi +} +\def\ZREF@false{false} +\def\ZREF@true{true} +\kv@define@key{ZREF@LABEL}{values}[]{% + \kv@parse{#1}{% + \ifx\kv@value\relax + \@PackageWarning\ZREF@name{% + Missing value for property `\kv@key'% + }% + \expandafter\ltx@gobbletwo + \else + \expandafter\zref@setcurrent + \fi + }% +} +\newif\ifZREF@immediate +\ZREF@Robust{\long\def}\zref@wrapper@immediate#1{% + \begingroup + \ZREF@immediatetrue + \let\ZREF@org@write\write + \def\write{\immediate\ZREF@org@write}% + #1% + \endgroup +} +\def\ZREF@label#1#2{% + \if@filesw + \begingroup + \ifZREF@immediate + \let\ZREF@org@thepage\thepage + \fi + \protected@write\@auxout{% + \ifZREF@immediate + \let\thepage\ZREF@org@thepage + \fi + \let\ZREF@temp\ltx@empty + \@tfor\ZREF@P:=#1\do{% + \begingroup + \escapechar=-1 % + \edef\x{\endgroup + \def\noexpand\ZREF@P{% + \expandafter\string\ZREF@P + }% + }% + \x + \expandafter\ifx + \csname + \ifZREF@immediate + relax% + \else + Z@X@\ZREF@P% + \fi + \endcsname + \noexpand + \expandafter\let\csname Z@C@\ZREF@P\endcsname\relax + \fi + \toks@\expandafter{\ZREF@temp}% + \edef\ZREF@temp{% + \the\toks@ + \ltx@backslashchar\ZREF@P{% + \expandafter\noexpand\csname Z@C@\ZREF@P\endcsname + }% + }% + }% + }{% + \string\zref@newlabel{#2}{\ZREF@temp}% + }% + \endgroup + \fi +} +\def\ZREF@addtoks#1{% + \toks@\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\toks@#1% + }% +} +\def\zref@ifrefundefined#1{% + \ltx@ifundefined{Z@R@#1}% +} +\ZREF@IfDefinable\zifrefundefined\def{% + #1{% + \zref@wrapper@babel\ZREF@ifrefundefined{#1}% + }% +} +\def\ZREF@ifrefundefined#1{% + \zref@refused{#1}% + \zref@ifrefundefined{#1}% +} +\ZREF@Robust\def\zref@refused#1{% + \zref@wrapper@babel\ZREF@refused{#1}% +} +\def\ZREF@refused#1{% + \zref@ifrefundefined{#1}{% + \protect\G@refundefinedtrue + \@latex@warning{% + Reference `#1' on page \thepage \space undefined% + }% + }{}% +} +\def\zref@ifrefcontainsprop#1#2{% + \zref@ifrefundefined{#1}{% + \ltx@secondoftwo + }{% + \expandafter\ZREF@ifrefcontainsprop + \csname Z@E@#2\expandafter\endcsname + \csname#2\expandafter\expandafter\expandafter\endcsname + \expandafter\expandafter\expandafter{% + \csname Z@R@#1\endcsname + }% + }% +} +\def\ZREF@ifrefcontainsprop#1#2#3{% + \expandafter\ifx\expandafter\ZREF@novalue + #1#3#2\ZREF@novalue\ZREF@nil\ltx@empty + \expandafter\ltx@secondoftwo + \else + \expandafter\ltx@firstoftwo + \fi +} +\def\ZREF@novalue{\ZREF@NOVALUE} +\def\ZREF@extract#1#2{% + \romannumeral0% + \ltx@ifundefined{Z@D@#2}{% + \expandafter\ltx@space\zref@default + }{% + \expandafter\expandafter\expandafter\ZREF@@extract + \expandafter\expandafter\expandafter{% + \csname Z@D@#2\endcsname + }{#1}{#2}% + }% +} +\def\ZREF@@extract#1#2#3{% + \expandafter\expandafter\expandafter\ltx@space + \zref@extractdefault{#2}{#3}{#1}% +} +\def\ZREF@wu@extract#1#2{% + \etex@unexpanded\expandafter\expandafter\expandafter{% + \ZREF@extract{#1}{#2}% + }% +} +\let\zref@extract\ZREF@extract +\def\ZREF@extractdefault#1#2#3{% + \romannumeral0% + \zref@ifrefundefined{#1}\ltx@firstoftwo{% + \zref@ifpropundefined{#2}\ltx@firstoftwo\ltx@secondoftwo + }{% + \ltx@space + #3% + }{% + \expandafter\expandafter\expandafter\ltx@space + \csname Z@E@#2\expandafter\expandafter\expandafter\endcsname + \csname Z@R@#1\expandafter\endcsname + \csname#2\endcsname{#3}\ZREF@nil + }% +} +\def\ZREF@wu@extractdefault#1#2#3{% + \etex@unexpanded\expandafter\expandafter\expandafter{% + \ZREF@extractdefault{#1}{#2}{#3}% + }% +} +\let\zref@extractdefault\ZREF@extractdefault +\ZREF@Robust\def\zref@def@extract#1{% + \zref@wrapper@babel{\ZREF@def@extract{#1}}% +} +\def\ZREF@def@extract#1#2#3{% + \zref@refused{#2}% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#1% + \expandafter\expandafter\expandafter{% + \zref@extract{#2}{#3}% + }% +} +\ZREF@Robust\def\zref@def@extractdefault#1{% + \zref@wrapper@babel{\ZREF@def@extractdefault{#1}}% +} +\def\ZREF@def@extractdefault#1#2#3#4{% + \zref@refused{#2}% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#1% + \expandafter\expandafter\expandafter{% + \zref@extractdefault{#2}{#3}{#4}% + }% +} +\ZREF@Robust{\long\def}\ZREF@wrapper@unexpanded#1{% + \let\zref@wrapper@unexpanded\ltx@firstofone + \let\zref@getcurrent\ZREF@wu@getcurrent + \let\zref@extractdefault\ZREF@wu@extractdefault + \let\zref@extract\ZREF@wu@extract + #1% + \let\zref@wrapper@unexpanded\ZREF@wrapper@unexpanded + \let\zref@getcurrent\ZREF@getcurrent + \let\zref@extractdefault\ZREF@extractdefault + \let\zref@extract\ZREF@extract +} +\ltx@IfUndefined{etex@unexpanded}{% + \let\zref@wrapper@unexpanded\ltx@firstofone +}{% + \let\zref@wrapper@unexpanded\ZREF@wrapper@unexpanded +} +\ZREF@Robust{\long\def}\zref@wrapper@babel#1#2{% + \ifcsname if@safe@actives\endcsname + \expandafter\ltx@firstofone + \else + \expandafter\ltx@secondoftwo + \fi + {% + \if@safe@actives + \expandafter\ltx@secondoftwo + \else + \expandafter\ltx@firstoftwo + \fi + {% + \begingroup + \csname @safe@activestrue\endcsname + \edef\x{#2}% + \expandafter\endgroup + \expandafter\ZREF@wrapper@babel\expandafter{\x}{#1}% + }% + }{% + #1{#2}% + }% +} +\long\def\ZREF@wrapper@babel#1#2{% + #2{#1}% +} +\ZREF@Robust\def\zref@require@unique{% + \@ifundefined{c@zref@unique}{% + \begingroup + \let\@addtoreset\ltx@gobbletwo + \newcounter{zref@unique}% + \endgroup + \renewcommand*{\thezref@unique}{% + zref@\number\c@zref@unique + }% + }{}% +} +\ltx@IfUndefined{numexpr}{% + \def\ZREF@number#1{\number#1}% +}{% + \def\ZREF@number#1{\the\numexpr(#1)\relax}% +} +\ZREF@Robust\def\zref@setdefault#1{% + \def\zref@default{#1}% +} +\zref@setdefault{% + \nfss@text{\reset@font\bfseries ??}% +} +\ZREF@Robust\def\zref@setmainlist#1{% + \def\ZREF@mainlist{#1}% +} +\zref@setmainlist{main} +\zref@newlist\ZREF@mainlist +\zref@newprop{default}{\@currentlabel} +\zref@newprop*{page}{\thepage} +\zref@addprops\ZREF@mainlist{default,page} +\def\ZREF@NewPropAnchor{% + \zref@newprop{anchor}{% + \ltx@ifundefined{@currentHref}{}{\@currentHref}% + }% + \global\let\ZREF@NewPropAnchor\relax +} +\def\ZREF@NewPropTitle{% + \gdef\zref@titleref@current{}% + \zref@newprop{title}{\zref@titleref@current}% + \global\let\ZREF@NewPropTitle\relax +} +\def\ZREF@NewPropTheotype{% + \zref@newprop{theotype}{}% + \global\let\ZREF@NewPropTheotype\relax +} +\def\ZREF@NewPropPageValue{% + \zref@newprop*{pagevalue}[0]{\number\c@page}% + \global\let\ZREF@NewPropPageValue\relax +} +\let\ZREF@base@ok=Y +\endinput +%% +%% End of file `zref-base.sty'. diff --git a/FactoryKernels/GB_AxB__any_div_fc32.c b/FactoryKernels/GB_AxB__any_div_fc32.c index 995e8f392e..ab5fa9a475 100644 --- a/FactoryKernels/GB_AxB__any_div_fc32.c +++ b/FactoryKernels/GB_AxB__any_div_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_div_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_fc64.c b/FactoryKernels/GB_AxB__any_div_fc64.c index 013112b756..4b643533e3 100644 --- a/FactoryKernels/GB_AxB__any_div_fc64.c +++ b/FactoryKernels/GB_AxB__any_div_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -349,3 +356,5 @@ GrB_Info GB (_Asaxpy3B__any_div_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_fp32.c b/FactoryKernels/GB_AxB__any_div_fp32.c index 55d59244c2..82421c46e9 100644 --- a/FactoryKernels/GB_AxB__any_div_fp32.c +++ b/FactoryKernels/GB_AxB__any_div_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_div_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_fp64.c b/FactoryKernels/GB_AxB__any_div_fp64.c index 11b7e9d722..516465c21d 100644 --- a/FactoryKernels/GB_AxB__any_div_fp64.c +++ b/FactoryKernels/GB_AxB__any_div_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_div_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_int16.c b/FactoryKernels/GB_AxB__any_div_int16.c index b9c289ee9a..9547d7c5f5 100644 --- a/FactoryKernels/GB_AxB__any_div_int16.c +++ b/FactoryKernels/GB_AxB__any_div_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_div_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_int32.c b/FactoryKernels/GB_AxB__any_div_int32.c index de8a3f1ef7..d7c1363545 100644 --- a/FactoryKernels/GB_AxB__any_div_int32.c +++ b/FactoryKernels/GB_AxB__any_div_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_div_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_int64.c b/FactoryKernels/GB_AxB__any_div_int64.c index 6c245fbf31..3aaefedf57 100644 --- a/FactoryKernels/GB_AxB__any_div_int64.c +++ b/FactoryKernels/GB_AxB__any_div_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_div_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_int8.c b/FactoryKernels/GB_AxB__any_div_int8.c index 417b5fee80..3452602b6a 100644 --- a/FactoryKernels/GB_AxB__any_div_int8.c +++ b/FactoryKernels/GB_AxB__any_div_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_div_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_uint16.c b/FactoryKernels/GB_AxB__any_div_uint16.c index a030d058a9..5d85c84556 100644 --- a/FactoryKernels/GB_AxB__any_div_uint16.c +++ b/FactoryKernels/GB_AxB__any_div_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_div_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_uint32.c b/FactoryKernels/GB_AxB__any_div_uint32.c index 9da1a97cec..2095ed6af4 100644 --- a/FactoryKernels/GB_AxB__any_div_uint32.c +++ b/FactoryKernels/GB_AxB__any_div_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_div_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_uint64.c b/FactoryKernels/GB_AxB__any_div_uint64.c index f9b4b4c2fd..efc57b5f36 100644 --- a/FactoryKernels/GB_AxB__any_div_uint64.c +++ b/FactoryKernels/GB_AxB__any_div_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_div_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_div_uint8.c b/FactoryKernels/GB_AxB__any_div_uint8.c index 90d74f35e0..bea13f40b2 100644 --- a/FactoryKernels/GB_AxB__any_div_uint8.c +++ b/FactoryKernels/GB_AxB__any_div_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_div_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_bool.c b/FactoryKernels/GB_AxB__any_eq_bool.c index 3c09083d51..e28f182e6f 100644 --- a/FactoryKernels/GB_AxB__any_eq_bool.c +++ b/FactoryKernels/GB_AxB__any_eq_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_fp32.c b/FactoryKernels/GB_AxB__any_eq_fp32.c index 17a88f44f4..2cf4a6aae7 100644 --- a/FactoryKernels/GB_AxB__any_eq_fp32.c +++ b/FactoryKernels/GB_AxB__any_eq_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_fp64.c b/FactoryKernels/GB_AxB__any_eq_fp64.c index f2f71a7e61..943d3aeafe 100644 --- a/FactoryKernels/GB_AxB__any_eq_fp64.c +++ b/FactoryKernels/GB_AxB__any_eq_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_int16.c b/FactoryKernels/GB_AxB__any_eq_int16.c index f19b1cf491..5c534febb2 100644 --- a/FactoryKernels/GB_AxB__any_eq_int16.c +++ b/FactoryKernels/GB_AxB__any_eq_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_int32.c b/FactoryKernels/GB_AxB__any_eq_int32.c index 05774c4212..96d735fb78 100644 --- a/FactoryKernels/GB_AxB__any_eq_int32.c +++ b/FactoryKernels/GB_AxB__any_eq_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_int64.c b/FactoryKernels/GB_AxB__any_eq_int64.c index 896c48c74f..811bceb900 100644 --- a/FactoryKernels/GB_AxB__any_eq_int64.c +++ b/FactoryKernels/GB_AxB__any_eq_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_int8.c b/FactoryKernels/GB_AxB__any_eq_int8.c index acd06b9f40..252f310a65 100644 --- a/FactoryKernels/GB_AxB__any_eq_int8.c +++ b/FactoryKernels/GB_AxB__any_eq_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_uint16.c b/FactoryKernels/GB_AxB__any_eq_uint16.c index 4c360dd2dc..5e416053eb 100644 --- a/FactoryKernels/GB_AxB__any_eq_uint16.c +++ b/FactoryKernels/GB_AxB__any_eq_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_uint32.c b/FactoryKernels/GB_AxB__any_eq_uint32.c index cbf107db02..6f4b7bd38c 100644 --- a/FactoryKernels/GB_AxB__any_eq_uint32.c +++ b/FactoryKernels/GB_AxB__any_eq_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_uint64.c b/FactoryKernels/GB_AxB__any_eq_uint64.c index de1ef0436b..da4382fcea 100644 --- a/FactoryKernels/GB_AxB__any_eq_uint64.c +++ b/FactoryKernels/GB_AxB__any_eq_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_eq_uint8.c b/FactoryKernels/GB_AxB__any_eq_uint8.c index 10baa80774..fcdc3f5f82 100644 --- a/FactoryKernels/GB_AxB__any_eq_uint8.c +++ b/FactoryKernels/GB_AxB__any_eq_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_eq_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_bool.c b/FactoryKernels/GB_AxB__any_first_bool.c index 64939c2795..08c8b09fd7 100644 --- a/FactoryKernels/GB_AxB__any_first_bool.c +++ b/FactoryKernels/GB_AxB__any_first_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_first_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_fc32.c b/FactoryKernels/GB_AxB__any_first_fc32.c index 7134402c99..fc184d992e 100644 --- a/FactoryKernels/GB_AxB__any_first_fc32.c +++ b/FactoryKernels/GB_AxB__any_first_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -354,3 +361,5 @@ GrB_Info GB (_Asaxpy3B__any_first_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_fc64.c b/FactoryKernels/GB_AxB__any_first_fc64.c index d7aeccac28..e25787ec04 100644 --- a/FactoryKernels/GB_AxB__any_first_fc64.c +++ b/FactoryKernels/GB_AxB__any_first_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_first_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_fp32.c b/FactoryKernels/GB_AxB__any_first_fp32.c index 412a54074a..ac44c08102 100644 --- a/FactoryKernels/GB_AxB__any_first_fp32.c +++ b/FactoryKernels/GB_AxB__any_first_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -352,3 +359,5 @@ GrB_Info GB (_Asaxpy3B__any_first_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_fp64.c b/FactoryKernels/GB_AxB__any_first_fp64.c index 12a8ab7ad0..9b5e234380 100644 --- a/FactoryKernels/GB_AxB__any_first_fp64.c +++ b/FactoryKernels/GB_AxB__any_first_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -352,3 +359,5 @@ GrB_Info GB (_Asaxpy3B__any_first_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_int16.c b/FactoryKernels/GB_AxB__any_first_int16.c index c00f49fa02..20244c756f 100644 --- a/FactoryKernels/GB_AxB__any_first_int16.c +++ b/FactoryKernels/GB_AxB__any_first_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_first_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_int32.c b/FactoryKernels/GB_AxB__any_first_int32.c index 94994d0fb5..50ae76db78 100644 --- a/FactoryKernels/GB_AxB__any_first_int32.c +++ b/FactoryKernels/GB_AxB__any_first_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_first_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_int64.c b/FactoryKernels/GB_AxB__any_first_int64.c index a4fa50d4e7..9a1a8fea6e 100644 --- a/FactoryKernels/GB_AxB__any_first_int64.c +++ b/FactoryKernels/GB_AxB__any_first_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -352,3 +359,5 @@ GrB_Info GB (_Asaxpy3B__any_first_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_int8.c b/FactoryKernels/GB_AxB__any_first_int8.c index a74736e1a7..2e4a0d0ca9 100644 --- a/FactoryKernels/GB_AxB__any_first_int8.c +++ b/FactoryKernels/GB_AxB__any_first_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_first_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_uint16.c b/FactoryKernels/GB_AxB__any_first_uint16.c index 4eacf468c4..7867fcfae0 100644 --- a/FactoryKernels/GB_AxB__any_first_uint16.c +++ b/FactoryKernels/GB_AxB__any_first_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_first_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_uint32.c b/FactoryKernels/GB_AxB__any_first_uint32.c index 9a222dc506..41b1db4f61 100644 --- a/FactoryKernels/GB_AxB__any_first_uint32.c +++ b/FactoryKernels/GB_AxB__any_first_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_first_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_uint64.c b/FactoryKernels/GB_AxB__any_first_uint64.c index c4ed7f7138..8d03991168 100644 --- a/FactoryKernels/GB_AxB__any_first_uint64.c +++ b/FactoryKernels/GB_AxB__any_first_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -352,3 +359,5 @@ GrB_Info GB (_Asaxpy3B__any_first_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_first_uint8.c b/FactoryKernels/GB_AxB__any_first_uint8.c index 08fe6ec854..5fda203bc7 100644 --- a/FactoryKernels/GB_AxB__any_first_uint8.c +++ b/FactoryKernels/GB_AxB__any_first_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_first_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_firsti1_int32.c b/FactoryKernels/GB_AxB__any_firsti1_int32.c index 03c9792f8f..d115c2b0f3 100644 --- a/FactoryKernels/GB_AxB__any_firsti1_int32.c +++ b/FactoryKernels/GB_AxB__any_firsti1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -354,3 +361,5 @@ GrB_Info GB (_Asaxpy3B__any_firsti1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_firsti1_int64.c b/FactoryKernels/GB_AxB__any_firsti1_int64.c index 31e5ad7dfd..ae0ca09bc4 100644 --- a/FactoryKernels/GB_AxB__any_firsti1_int64.c +++ b/FactoryKernels/GB_AxB__any_firsti1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -355,3 +362,5 @@ GrB_Info GB (_Asaxpy3B__any_firsti1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_firsti_int32.c b/FactoryKernels/GB_AxB__any_firsti_int32.c index 29269523e2..1e3a8ed8ed 100644 --- a/FactoryKernels/GB_AxB__any_firsti_int32.c +++ b/FactoryKernels/GB_AxB__any_firsti_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_firsti_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_firsti_int64.c b/FactoryKernels/GB_AxB__any_firsti_int64.c index af5c6d8adb..0a72981224 100644 --- a/FactoryKernels/GB_AxB__any_firsti_int64.c +++ b/FactoryKernels/GB_AxB__any_firsti_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -354,3 +361,5 @@ GrB_Info GB (_Asaxpy3B__any_firsti_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_firstj1_int32.c b/FactoryKernels/GB_AxB__any_firstj1_int32.c index 1cc2dc3643..301cae615b 100644 --- a/FactoryKernels/GB_AxB__any_firstj1_int32.c +++ b/FactoryKernels/GB_AxB__any_firstj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -355,3 +362,5 @@ GrB_Info GB (_Asaxpy3B__any_firstj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_firstj1_int64.c b/FactoryKernels/GB_AxB__any_firstj1_int64.c index 4d9fca5347..b0ce56bb4d 100644 --- a/FactoryKernels/GB_AxB__any_firstj1_int64.c +++ b/FactoryKernels/GB_AxB__any_firstj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -356,3 +363,5 @@ GrB_Info GB (_Asaxpy3B__any_firstj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_firstj_int32.c b/FactoryKernels/GB_AxB__any_firstj_int32.c index 964bdf2b97..c55736159d 100644 --- a/FactoryKernels/GB_AxB__any_firstj_int32.c +++ b/FactoryKernels/GB_AxB__any_firstj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_firstj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_firstj_int64.c b/FactoryKernels/GB_AxB__any_firstj_int64.c index 787d0fbec9..81f0008847 100644 --- a/FactoryKernels/GB_AxB__any_firstj_int64.c +++ b/FactoryKernels/GB_AxB__any_firstj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -354,3 +361,5 @@ GrB_Info GB (_Asaxpy3B__any_firstj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_bool.c b/FactoryKernels/GB_AxB__any_ge_bool.c index 02d940b4a1..b5bd8228c1 100644 --- a/FactoryKernels/GB_AxB__any_ge_bool.c +++ b/FactoryKernels/GB_AxB__any_ge_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_fp32.c b/FactoryKernels/GB_AxB__any_ge_fp32.c index 073efd23c2..0b13bbe414 100644 --- a/FactoryKernels/GB_AxB__any_ge_fp32.c +++ b/FactoryKernels/GB_AxB__any_ge_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_fp64.c b/FactoryKernels/GB_AxB__any_ge_fp64.c index 23e4aad9eb..09524dc222 100644 --- a/FactoryKernels/GB_AxB__any_ge_fp64.c +++ b/FactoryKernels/GB_AxB__any_ge_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_int16.c b/FactoryKernels/GB_AxB__any_ge_int16.c index 4688468bd1..d03e66bece 100644 --- a/FactoryKernels/GB_AxB__any_ge_int16.c +++ b/FactoryKernels/GB_AxB__any_ge_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_int32.c b/FactoryKernels/GB_AxB__any_ge_int32.c index 2cdd62e476..9f40e7cdc1 100644 --- a/FactoryKernels/GB_AxB__any_ge_int32.c +++ b/FactoryKernels/GB_AxB__any_ge_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_int64.c b/FactoryKernels/GB_AxB__any_ge_int64.c index 012c073115..986784c6df 100644 --- a/FactoryKernels/GB_AxB__any_ge_int64.c +++ b/FactoryKernels/GB_AxB__any_ge_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_int8.c b/FactoryKernels/GB_AxB__any_ge_int8.c index 176564f172..c96cd9837f 100644 --- a/FactoryKernels/GB_AxB__any_ge_int8.c +++ b/FactoryKernels/GB_AxB__any_ge_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_uint16.c b/FactoryKernels/GB_AxB__any_ge_uint16.c index 30af637953..3444eb1808 100644 --- a/FactoryKernels/GB_AxB__any_ge_uint16.c +++ b/FactoryKernels/GB_AxB__any_ge_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_uint32.c b/FactoryKernels/GB_AxB__any_ge_uint32.c index 76df8ef9ef..54c917f2db 100644 --- a/FactoryKernels/GB_AxB__any_ge_uint32.c +++ b/FactoryKernels/GB_AxB__any_ge_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_uint64.c b/FactoryKernels/GB_AxB__any_ge_uint64.c index 11c98801d8..e381f3ec43 100644 --- a/FactoryKernels/GB_AxB__any_ge_uint64.c +++ b/FactoryKernels/GB_AxB__any_ge_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ge_uint8.c b/FactoryKernels/GB_AxB__any_ge_uint8.c index 497f5abace..269243e182 100644 --- a/FactoryKernels/GB_AxB__any_ge_uint8.c +++ b/FactoryKernels/GB_AxB__any_ge_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ge_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_bool.c b/FactoryKernels/GB_AxB__any_gt_bool.c index 2433f94b92..53643954fe 100644 --- a/FactoryKernels/GB_AxB__any_gt_bool.c +++ b/FactoryKernels/GB_AxB__any_gt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_fp32.c b/FactoryKernels/GB_AxB__any_gt_fp32.c index 8d2d057a63..6c4cea246c 100644 --- a/FactoryKernels/GB_AxB__any_gt_fp32.c +++ b/FactoryKernels/GB_AxB__any_gt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_fp64.c b/FactoryKernels/GB_AxB__any_gt_fp64.c index dabb4d93d4..0a6c256318 100644 --- a/FactoryKernels/GB_AxB__any_gt_fp64.c +++ b/FactoryKernels/GB_AxB__any_gt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_int16.c b/FactoryKernels/GB_AxB__any_gt_int16.c index ccb46fdde1..7c692acdec 100644 --- a/FactoryKernels/GB_AxB__any_gt_int16.c +++ b/FactoryKernels/GB_AxB__any_gt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_int32.c b/FactoryKernels/GB_AxB__any_gt_int32.c index 83969e7590..307eb3ade7 100644 --- a/FactoryKernels/GB_AxB__any_gt_int32.c +++ b/FactoryKernels/GB_AxB__any_gt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_int64.c b/FactoryKernels/GB_AxB__any_gt_int64.c index 7b161d510b..44d6d8d1f6 100644 --- a/FactoryKernels/GB_AxB__any_gt_int64.c +++ b/FactoryKernels/GB_AxB__any_gt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_int8.c b/FactoryKernels/GB_AxB__any_gt_int8.c index 9aa478a29c..fa3121c602 100644 --- a/FactoryKernels/GB_AxB__any_gt_int8.c +++ b/FactoryKernels/GB_AxB__any_gt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_uint16.c b/FactoryKernels/GB_AxB__any_gt_uint16.c index ff7cc5f1e6..b6546828b8 100644 --- a/FactoryKernels/GB_AxB__any_gt_uint16.c +++ b/FactoryKernels/GB_AxB__any_gt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_uint32.c b/FactoryKernels/GB_AxB__any_gt_uint32.c index ad6a03d443..76ee4a25ed 100644 --- a/FactoryKernels/GB_AxB__any_gt_uint32.c +++ b/FactoryKernels/GB_AxB__any_gt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_uint64.c b/FactoryKernels/GB_AxB__any_gt_uint64.c index a733f4a067..a03861a254 100644 --- a/FactoryKernels/GB_AxB__any_gt_uint64.c +++ b/FactoryKernels/GB_AxB__any_gt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_gt_uint8.c b/FactoryKernels/GB_AxB__any_gt_uint8.c index 48dcf9dfd4..bd75896967 100644 --- a/FactoryKernels/GB_AxB__any_gt_uint8.c +++ b/FactoryKernels/GB_AxB__any_gt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_gt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_land_bool.c b/FactoryKernels/GB_AxB__any_land_bool.c index 22d750df19..cd7a243a3d 100644 --- a/FactoryKernels/GB_AxB__any_land_bool.c +++ b/FactoryKernels/GB_AxB__any_land_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_land_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_bool.c b/FactoryKernels/GB_AxB__any_le_bool.c index f9403b0561..146ede6d33 100644 --- a/FactoryKernels/GB_AxB__any_le_bool.c +++ b/FactoryKernels/GB_AxB__any_le_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_fp32.c b/FactoryKernels/GB_AxB__any_le_fp32.c index 9485df4a5f..042ff997d8 100644 --- a/FactoryKernels/GB_AxB__any_le_fp32.c +++ b/FactoryKernels/GB_AxB__any_le_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_fp64.c b/FactoryKernels/GB_AxB__any_le_fp64.c index 941775ae9c..9d0dc61d31 100644 --- a/FactoryKernels/GB_AxB__any_le_fp64.c +++ b/FactoryKernels/GB_AxB__any_le_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_int16.c b/FactoryKernels/GB_AxB__any_le_int16.c index add0356aec..de357914a4 100644 --- a/FactoryKernels/GB_AxB__any_le_int16.c +++ b/FactoryKernels/GB_AxB__any_le_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_int32.c b/FactoryKernels/GB_AxB__any_le_int32.c index 33a8f6d5d8..f087ecb614 100644 --- a/FactoryKernels/GB_AxB__any_le_int32.c +++ b/FactoryKernels/GB_AxB__any_le_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_int64.c b/FactoryKernels/GB_AxB__any_le_int64.c index d251159ee6..7bb60ce029 100644 --- a/FactoryKernels/GB_AxB__any_le_int64.c +++ b/FactoryKernels/GB_AxB__any_le_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_int8.c b/FactoryKernels/GB_AxB__any_le_int8.c index 49a2e4eba3..b2f07c51b6 100644 --- a/FactoryKernels/GB_AxB__any_le_int8.c +++ b/FactoryKernels/GB_AxB__any_le_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_uint16.c b/FactoryKernels/GB_AxB__any_le_uint16.c index d81affd9c5..8e0c762e58 100644 --- a/FactoryKernels/GB_AxB__any_le_uint16.c +++ b/FactoryKernels/GB_AxB__any_le_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_uint32.c b/FactoryKernels/GB_AxB__any_le_uint32.c index 3dff114bd8..0c09f4c372 100644 --- a/FactoryKernels/GB_AxB__any_le_uint32.c +++ b/FactoryKernels/GB_AxB__any_le_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_uint64.c b/FactoryKernels/GB_AxB__any_le_uint64.c index c28ab22600..df10f1d45b 100644 --- a/FactoryKernels/GB_AxB__any_le_uint64.c +++ b/FactoryKernels/GB_AxB__any_le_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_le_uint8.c b/FactoryKernels/GB_AxB__any_le_uint8.c index 20fecda9a4..272c70ec28 100644 --- a/FactoryKernels/GB_AxB__any_le_uint8.c +++ b/FactoryKernels/GB_AxB__any_le_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_le_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lor_bool.c b/FactoryKernels/GB_AxB__any_lor_bool.c index 0e8e1bcf42..1b57187492 100644 --- a/FactoryKernels/GB_AxB__any_lor_bool.c +++ b/FactoryKernels/GB_AxB__any_lor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_bool.c b/FactoryKernels/GB_AxB__any_lt_bool.c index b20dbbfd9b..09eeec6572 100644 --- a/FactoryKernels/GB_AxB__any_lt_bool.c +++ b/FactoryKernels/GB_AxB__any_lt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_fp32.c b/FactoryKernels/GB_AxB__any_lt_fp32.c index 01226db186..ddfa77f421 100644 --- a/FactoryKernels/GB_AxB__any_lt_fp32.c +++ b/FactoryKernels/GB_AxB__any_lt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_fp64.c b/FactoryKernels/GB_AxB__any_lt_fp64.c index d7c77ce270..0136ef3fda 100644 --- a/FactoryKernels/GB_AxB__any_lt_fp64.c +++ b/FactoryKernels/GB_AxB__any_lt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_int16.c b/FactoryKernels/GB_AxB__any_lt_int16.c index 03a1bb227a..e1829dd875 100644 --- a/FactoryKernels/GB_AxB__any_lt_int16.c +++ b/FactoryKernels/GB_AxB__any_lt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_int32.c b/FactoryKernels/GB_AxB__any_lt_int32.c index e8a5c2008c..1a8a0b21ea 100644 --- a/FactoryKernels/GB_AxB__any_lt_int32.c +++ b/FactoryKernels/GB_AxB__any_lt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_int64.c b/FactoryKernels/GB_AxB__any_lt_int64.c index 3453569df4..70de260b7c 100644 --- a/FactoryKernels/GB_AxB__any_lt_int64.c +++ b/FactoryKernels/GB_AxB__any_lt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_int8.c b/FactoryKernels/GB_AxB__any_lt_int8.c index 93ee83b24b..49877c5989 100644 --- a/FactoryKernels/GB_AxB__any_lt_int8.c +++ b/FactoryKernels/GB_AxB__any_lt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_uint16.c b/FactoryKernels/GB_AxB__any_lt_uint16.c index 59f52de40b..c3f7d8d1ca 100644 --- a/FactoryKernels/GB_AxB__any_lt_uint16.c +++ b/FactoryKernels/GB_AxB__any_lt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_uint32.c b/FactoryKernels/GB_AxB__any_lt_uint32.c index 365f48d7e9..3e8144bf9f 100644 --- a/FactoryKernels/GB_AxB__any_lt_uint32.c +++ b/FactoryKernels/GB_AxB__any_lt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_uint64.c b/FactoryKernels/GB_AxB__any_lt_uint64.c index f3248fe6e8..8ae456514a 100644 --- a/FactoryKernels/GB_AxB__any_lt_uint64.c +++ b/FactoryKernels/GB_AxB__any_lt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lt_uint8.c b/FactoryKernels/GB_AxB__any_lt_uint8.c index a962f0bd47..092cf5f95b 100644 --- a/FactoryKernels/GB_AxB__any_lt_uint8.c +++ b/FactoryKernels/GB_AxB__any_lt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_lxor_bool.c b/FactoryKernels/GB_AxB__any_lxor_bool.c index f31a4cb6fd..564ffdb44a 100644 --- a/FactoryKernels/GB_AxB__any_lxor_bool.c +++ b/FactoryKernels/GB_AxB__any_lxor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_lxor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_fp32.c b/FactoryKernels/GB_AxB__any_max_fp32.c index e03c2466ea..3785c1fd2b 100644 --- a/FactoryKernels/GB_AxB__any_max_fp32.c +++ b/FactoryKernels/GB_AxB__any_max_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_max_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_fp64.c b/FactoryKernels/GB_AxB__any_max_fp64.c index 99c812d5af..f1f6532a00 100644 --- a/FactoryKernels/GB_AxB__any_max_fp64.c +++ b/FactoryKernels/GB_AxB__any_max_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_max_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_int16.c b/FactoryKernels/GB_AxB__any_max_int16.c index cfcac8b928..fd7a39080b 100644 --- a/FactoryKernels/GB_AxB__any_max_int16.c +++ b/FactoryKernels/GB_AxB__any_max_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_max_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_int32.c b/FactoryKernels/GB_AxB__any_max_int32.c index 4e47cd3ebe..03a1f5ec96 100644 --- a/FactoryKernels/GB_AxB__any_max_int32.c +++ b/FactoryKernels/GB_AxB__any_max_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_max_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_int64.c b/FactoryKernels/GB_AxB__any_max_int64.c index bc202c07dd..9376a40c88 100644 --- a/FactoryKernels/GB_AxB__any_max_int64.c +++ b/FactoryKernels/GB_AxB__any_max_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_max_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_int8.c b/FactoryKernels/GB_AxB__any_max_int8.c index 9451540946..48cfb1cc83 100644 --- a/FactoryKernels/GB_AxB__any_max_int8.c +++ b/FactoryKernels/GB_AxB__any_max_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_max_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_uint16.c b/FactoryKernels/GB_AxB__any_max_uint16.c index c578ab2f96..629608cf87 100644 --- a/FactoryKernels/GB_AxB__any_max_uint16.c +++ b/FactoryKernels/GB_AxB__any_max_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_max_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_uint32.c b/FactoryKernels/GB_AxB__any_max_uint32.c index c2bf4c08d4..c24d8726ab 100644 --- a/FactoryKernels/GB_AxB__any_max_uint32.c +++ b/FactoryKernels/GB_AxB__any_max_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_max_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_uint64.c b/FactoryKernels/GB_AxB__any_max_uint64.c index 9c61444515..40aba846ef 100644 --- a/FactoryKernels/GB_AxB__any_max_uint64.c +++ b/FactoryKernels/GB_AxB__any_max_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_max_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_max_uint8.c b/FactoryKernels/GB_AxB__any_max_uint8.c index d10d368564..579c9a86dc 100644 --- a/FactoryKernels/GB_AxB__any_max_uint8.c +++ b/FactoryKernels/GB_AxB__any_max_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_max_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_fp32.c b/FactoryKernels/GB_AxB__any_min_fp32.c index 3b89d45f61..87ea721cd4 100644 --- a/FactoryKernels/GB_AxB__any_min_fp32.c +++ b/FactoryKernels/GB_AxB__any_min_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_min_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_fp64.c b/FactoryKernels/GB_AxB__any_min_fp64.c index 004cb173db..4119ed4bf2 100644 --- a/FactoryKernels/GB_AxB__any_min_fp64.c +++ b/FactoryKernels/GB_AxB__any_min_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_min_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_int16.c b/FactoryKernels/GB_AxB__any_min_int16.c index 5d3efef04d..6fafb0f076 100644 --- a/FactoryKernels/GB_AxB__any_min_int16.c +++ b/FactoryKernels/GB_AxB__any_min_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_min_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_int32.c b/FactoryKernels/GB_AxB__any_min_int32.c index fff982cead..6365dc5e1f 100644 --- a/FactoryKernels/GB_AxB__any_min_int32.c +++ b/FactoryKernels/GB_AxB__any_min_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_min_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_int64.c b/FactoryKernels/GB_AxB__any_min_int64.c index 22864e0e99..9952ead30f 100644 --- a/FactoryKernels/GB_AxB__any_min_int64.c +++ b/FactoryKernels/GB_AxB__any_min_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_min_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_int8.c b/FactoryKernels/GB_AxB__any_min_int8.c index fbdb081dbe..eab7dfcfc6 100644 --- a/FactoryKernels/GB_AxB__any_min_int8.c +++ b/FactoryKernels/GB_AxB__any_min_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_min_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_uint16.c b/FactoryKernels/GB_AxB__any_min_uint16.c index 7df9231e50..2414b90f21 100644 --- a/FactoryKernels/GB_AxB__any_min_uint16.c +++ b/FactoryKernels/GB_AxB__any_min_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_min_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_uint32.c b/FactoryKernels/GB_AxB__any_min_uint32.c index 560a2a5c8d..98fbb52582 100644 --- a/FactoryKernels/GB_AxB__any_min_uint32.c +++ b/FactoryKernels/GB_AxB__any_min_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_min_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_uint64.c b/FactoryKernels/GB_AxB__any_min_uint64.c index 9d00b51086..84987fd3f5 100644 --- a/FactoryKernels/GB_AxB__any_min_uint64.c +++ b/FactoryKernels/GB_AxB__any_min_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_min_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_min_uint8.c b/FactoryKernels/GB_AxB__any_min_uint8.c index 9c302331bf..ae558388d6 100644 --- a/FactoryKernels/GB_AxB__any_min_uint8.c +++ b/FactoryKernels/GB_AxB__any_min_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_min_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_fc32.c b/FactoryKernels/GB_AxB__any_minus_fc32.c index ab4b8142a1..c852ea1f34 100644 --- a/FactoryKernels/GB_AxB__any_minus_fc32.c +++ b/FactoryKernels/GB_AxB__any_minus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_fc64.c b/FactoryKernels/GB_AxB__any_minus_fc64.c index 1136643192..d5af0541e3 100644 --- a/FactoryKernels/GB_AxB__any_minus_fc64.c +++ b/FactoryKernels/GB_AxB__any_minus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -349,3 +356,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_fp32.c b/FactoryKernels/GB_AxB__any_minus_fp32.c index 67ca970518..57472b1f00 100644 --- a/FactoryKernels/GB_AxB__any_minus_fp32.c +++ b/FactoryKernels/GB_AxB__any_minus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_fp64.c b/FactoryKernels/GB_AxB__any_minus_fp64.c index 32373c0e62..7f5925a740 100644 --- a/FactoryKernels/GB_AxB__any_minus_fp64.c +++ b/FactoryKernels/GB_AxB__any_minus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_int16.c b/FactoryKernels/GB_AxB__any_minus_int16.c index e01de14ee2..f650b73fa7 100644 --- a/FactoryKernels/GB_AxB__any_minus_int16.c +++ b/FactoryKernels/GB_AxB__any_minus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_int32.c b/FactoryKernels/GB_AxB__any_minus_int32.c index 4ddd93ae0c..81c2377b70 100644 --- a/FactoryKernels/GB_AxB__any_minus_int32.c +++ b/FactoryKernels/GB_AxB__any_minus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_int64.c b/FactoryKernels/GB_AxB__any_minus_int64.c index 229168d38a..13d7746c70 100644 --- a/FactoryKernels/GB_AxB__any_minus_int64.c +++ b/FactoryKernels/GB_AxB__any_minus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_int8.c b/FactoryKernels/GB_AxB__any_minus_int8.c index 7d8b64a7c1..5ecb548a88 100644 --- a/FactoryKernels/GB_AxB__any_minus_int8.c +++ b/FactoryKernels/GB_AxB__any_minus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_uint16.c b/FactoryKernels/GB_AxB__any_minus_uint16.c index 694aeeac9a..1b73b6e90e 100644 --- a/FactoryKernels/GB_AxB__any_minus_uint16.c +++ b/FactoryKernels/GB_AxB__any_minus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_uint32.c b/FactoryKernels/GB_AxB__any_minus_uint32.c index 53e365ec53..b40502e47c 100644 --- a/FactoryKernels/GB_AxB__any_minus_uint32.c +++ b/FactoryKernels/GB_AxB__any_minus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_uint64.c b/FactoryKernels/GB_AxB__any_minus_uint64.c index ead2e7f67e..dfc3dea095 100644 --- a/FactoryKernels/GB_AxB__any_minus_uint64.c +++ b/FactoryKernels/GB_AxB__any_minus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_minus_uint8.c b/FactoryKernels/GB_AxB__any_minus_uint8.c index 07be6097bd..2f306c0f7a 100644 --- a/FactoryKernels/GB_AxB__any_minus_uint8.c +++ b/FactoryKernels/GB_AxB__any_minus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_minus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_fp32.c b/FactoryKernels/GB_AxB__any_ne_fp32.c index c86471ace8..1e16614bc7 100644 --- a/FactoryKernels/GB_AxB__any_ne_fp32.c +++ b/FactoryKernels/GB_AxB__any_ne_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_fp64.c b/FactoryKernels/GB_AxB__any_ne_fp64.c index c86e00a893..730f1880d4 100644 --- a/FactoryKernels/GB_AxB__any_ne_fp64.c +++ b/FactoryKernels/GB_AxB__any_ne_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_int16.c b/FactoryKernels/GB_AxB__any_ne_int16.c index 845ed11603..668c4819a4 100644 --- a/FactoryKernels/GB_AxB__any_ne_int16.c +++ b/FactoryKernels/GB_AxB__any_ne_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_int32.c b/FactoryKernels/GB_AxB__any_ne_int32.c index 248d5ab140..33dad8e0c2 100644 --- a/FactoryKernels/GB_AxB__any_ne_int32.c +++ b/FactoryKernels/GB_AxB__any_ne_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_int64.c b/FactoryKernels/GB_AxB__any_ne_int64.c index 3f94094a04..35f5f2c225 100644 --- a/FactoryKernels/GB_AxB__any_ne_int64.c +++ b/FactoryKernels/GB_AxB__any_ne_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_int8.c b/FactoryKernels/GB_AxB__any_ne_int8.c index ac114a71a2..377d38c6ba 100644 --- a/FactoryKernels/GB_AxB__any_ne_int8.c +++ b/FactoryKernels/GB_AxB__any_ne_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_uint16.c b/FactoryKernels/GB_AxB__any_ne_uint16.c index 0ec00c96ef..2929bd2309 100644 --- a/FactoryKernels/GB_AxB__any_ne_uint16.c +++ b/FactoryKernels/GB_AxB__any_ne_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_uint32.c b/FactoryKernels/GB_AxB__any_ne_uint32.c index 90989196a3..ab0b98c2d3 100644 --- a/FactoryKernels/GB_AxB__any_ne_uint32.c +++ b/FactoryKernels/GB_AxB__any_ne_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_uint64.c b/FactoryKernels/GB_AxB__any_ne_uint64.c index a90acfc23b..ca87597de7 100644 --- a/FactoryKernels/GB_AxB__any_ne_uint64.c +++ b/FactoryKernels/GB_AxB__any_ne_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_ne_uint8.c b/FactoryKernels/GB_AxB__any_ne_uint8.c index 601f4bcf38..a0fedcf373 100644 --- a/FactoryKernels/GB_AxB__any_ne_uint8.c +++ b/FactoryKernels/GB_AxB__any_ne_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_ne_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_fc32.c b/FactoryKernels/GB_AxB__any_plus_fc32.c index a763dd6a14..93167f3226 100644 --- a/FactoryKernels/GB_AxB__any_plus_fc32.c +++ b/FactoryKernels/GB_AxB__any_plus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_fc64.c b/FactoryKernels/GB_AxB__any_plus_fc64.c index ad3a6cad38..b4fd91df1a 100644 --- a/FactoryKernels/GB_AxB__any_plus_fc64.c +++ b/FactoryKernels/GB_AxB__any_plus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -349,3 +356,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_fp32.c b/FactoryKernels/GB_AxB__any_plus_fp32.c index 5b1a05a4f9..a50c75e10e 100644 --- a/FactoryKernels/GB_AxB__any_plus_fp32.c +++ b/FactoryKernels/GB_AxB__any_plus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_fp64.c b/FactoryKernels/GB_AxB__any_plus_fp64.c index f6db4f7110..4693fffcaa 100644 --- a/FactoryKernels/GB_AxB__any_plus_fp64.c +++ b/FactoryKernels/GB_AxB__any_plus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_int16.c b/FactoryKernels/GB_AxB__any_plus_int16.c index 74c737c325..70229d7bd5 100644 --- a/FactoryKernels/GB_AxB__any_plus_int16.c +++ b/FactoryKernels/GB_AxB__any_plus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_int32.c b/FactoryKernels/GB_AxB__any_plus_int32.c index 1b692cfc13..2163e3af4a 100644 --- a/FactoryKernels/GB_AxB__any_plus_int32.c +++ b/FactoryKernels/GB_AxB__any_plus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_int64.c b/FactoryKernels/GB_AxB__any_plus_int64.c index eae29663ae..8e45bbdc00 100644 --- a/FactoryKernels/GB_AxB__any_plus_int64.c +++ b/FactoryKernels/GB_AxB__any_plus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_int8.c b/FactoryKernels/GB_AxB__any_plus_int8.c index 4a86a150e0..ffecb154ed 100644 --- a/FactoryKernels/GB_AxB__any_plus_int8.c +++ b/FactoryKernels/GB_AxB__any_plus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_uint16.c b/FactoryKernels/GB_AxB__any_plus_uint16.c index 5f5f881e78..ce4f332bf8 100644 --- a/FactoryKernels/GB_AxB__any_plus_uint16.c +++ b/FactoryKernels/GB_AxB__any_plus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_uint32.c b/FactoryKernels/GB_AxB__any_plus_uint32.c index 31883d8283..c7602e539f 100644 --- a/FactoryKernels/GB_AxB__any_plus_uint32.c +++ b/FactoryKernels/GB_AxB__any_plus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_uint64.c b/FactoryKernels/GB_AxB__any_plus_uint64.c index b917c1f4f9..8f4868183c 100644 --- a/FactoryKernels/GB_AxB__any_plus_uint64.c +++ b/FactoryKernels/GB_AxB__any_plus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_plus_uint8.c b/FactoryKernels/GB_AxB__any_plus_uint8.c index feebe070e5..ac749e437a 100644 --- a/FactoryKernels/GB_AxB__any_plus_uint8.c +++ b/FactoryKernels/GB_AxB__any_plus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_plus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_fc32.c b/FactoryKernels/GB_AxB__any_rdiv_fc32.c index 8c0de4699a..1a41a73e54 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_fc32.c +++ b/FactoryKernels/GB_AxB__any_rdiv_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_fc64.c b/FactoryKernels/GB_AxB__any_rdiv_fc64.c index fe98a57f30..6c467f3d6a 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_fc64.c +++ b/FactoryKernels/GB_AxB__any_rdiv_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -349,3 +356,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_fp32.c b/FactoryKernels/GB_AxB__any_rdiv_fp32.c index 183acf4afc..a26d50ff30 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_fp32.c +++ b/FactoryKernels/GB_AxB__any_rdiv_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_fp64.c b/FactoryKernels/GB_AxB__any_rdiv_fp64.c index c29cc1f371..b125bf51ae 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_fp64.c +++ b/FactoryKernels/GB_AxB__any_rdiv_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_int16.c b/FactoryKernels/GB_AxB__any_rdiv_int16.c index 660e207f92..e79a0ed78e 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_int16.c +++ b/FactoryKernels/GB_AxB__any_rdiv_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_int32.c b/FactoryKernels/GB_AxB__any_rdiv_int32.c index d68a5dd50a..27ba67da75 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_int32.c +++ b/FactoryKernels/GB_AxB__any_rdiv_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_int64.c b/FactoryKernels/GB_AxB__any_rdiv_int64.c index cfa2819d4c..ccde51c771 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_int64.c +++ b/FactoryKernels/GB_AxB__any_rdiv_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_int8.c b/FactoryKernels/GB_AxB__any_rdiv_int8.c index 9d177fab74..40693f1747 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_int8.c +++ b/FactoryKernels/GB_AxB__any_rdiv_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_uint16.c b/FactoryKernels/GB_AxB__any_rdiv_uint16.c index e52b509976..18101cca75 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_uint16.c +++ b/FactoryKernels/GB_AxB__any_rdiv_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_uint32.c b/FactoryKernels/GB_AxB__any_rdiv_uint32.c index 77f29f999b..63e5f9ecff 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_uint32.c +++ b/FactoryKernels/GB_AxB__any_rdiv_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_uint64.c b/FactoryKernels/GB_AxB__any_rdiv_uint64.c index 42e207a45d..daf7a64af4 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_uint64.c +++ b/FactoryKernels/GB_AxB__any_rdiv_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rdiv_uint8.c b/FactoryKernels/GB_AxB__any_rdiv_uint8.c index 94b6416b31..c49d949986 100644 --- a/FactoryKernels/GB_AxB__any_rdiv_uint8.c +++ b/FactoryKernels/GB_AxB__any_rdiv_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rdiv_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_fc32.c b/FactoryKernels/GB_AxB__any_rminus_fc32.c index aa717c729e..5d807bc93e 100644 --- a/FactoryKernels/GB_AxB__any_rminus_fc32.c +++ b/FactoryKernels/GB_AxB__any_rminus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_fc64.c b/FactoryKernels/GB_AxB__any_rminus_fc64.c index 6be133a331..dfab56db00 100644 --- a/FactoryKernels/GB_AxB__any_rminus_fc64.c +++ b/FactoryKernels/GB_AxB__any_rminus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -349,3 +356,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_fp32.c b/FactoryKernels/GB_AxB__any_rminus_fp32.c index 28813d5ad8..b87e206f72 100644 --- a/FactoryKernels/GB_AxB__any_rminus_fp32.c +++ b/FactoryKernels/GB_AxB__any_rminus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_fp64.c b/FactoryKernels/GB_AxB__any_rminus_fp64.c index 32be47f68d..f026ee6cb8 100644 --- a/FactoryKernels/GB_AxB__any_rminus_fp64.c +++ b/FactoryKernels/GB_AxB__any_rminus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_int16.c b/FactoryKernels/GB_AxB__any_rminus_int16.c index 43bbe0cc8e..2812726f1f 100644 --- a/FactoryKernels/GB_AxB__any_rminus_int16.c +++ b/FactoryKernels/GB_AxB__any_rminus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_int32.c b/FactoryKernels/GB_AxB__any_rminus_int32.c index d01ef95b3a..d3c852748a 100644 --- a/FactoryKernels/GB_AxB__any_rminus_int32.c +++ b/FactoryKernels/GB_AxB__any_rminus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_int64.c b/FactoryKernels/GB_AxB__any_rminus_int64.c index 1a20ce06d7..eb3ff772f7 100644 --- a/FactoryKernels/GB_AxB__any_rminus_int64.c +++ b/FactoryKernels/GB_AxB__any_rminus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_int8.c b/FactoryKernels/GB_AxB__any_rminus_int8.c index b1537e661b..6f0dd9c457 100644 --- a/FactoryKernels/GB_AxB__any_rminus_int8.c +++ b/FactoryKernels/GB_AxB__any_rminus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_uint16.c b/FactoryKernels/GB_AxB__any_rminus_uint16.c index e55526b434..585b56151b 100644 --- a/FactoryKernels/GB_AxB__any_rminus_uint16.c +++ b/FactoryKernels/GB_AxB__any_rminus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_uint32.c b/FactoryKernels/GB_AxB__any_rminus_uint32.c index 75bd2d3b63..143788eb4d 100644 --- a/FactoryKernels/GB_AxB__any_rminus_uint32.c +++ b/FactoryKernels/GB_AxB__any_rminus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_uint64.c b/FactoryKernels/GB_AxB__any_rminus_uint64.c index efcb9fb383..20cb911fc5 100644 --- a/FactoryKernels/GB_AxB__any_rminus_uint64.c +++ b/FactoryKernels/GB_AxB__any_rminus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_rminus_uint8.c b/FactoryKernels/GB_AxB__any_rminus_uint8.c index 0833785417..4b881f5ff1 100644 --- a/FactoryKernels/GB_AxB__any_rminus_uint8.c +++ b/FactoryKernels/GB_AxB__any_rminus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_rminus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_bool.c b/FactoryKernels/GB_AxB__any_second_bool.c index a7b43df624..a5f5d8a1dc 100644 --- a/FactoryKernels/GB_AxB__any_second_bool.c +++ b/FactoryKernels/GB_AxB__any_second_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_second_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_fc32.c b/FactoryKernels/GB_AxB__any_second_fc32.c index 5b8f8a470f..9281292544 100644 --- a/FactoryKernels/GB_AxB__any_second_fc32.c +++ b/FactoryKernels/GB_AxB__any_second_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_second_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_fc64.c b/FactoryKernels/GB_AxB__any_second_fc64.c index dbd5430d69..b09d9685ee 100644 --- a/FactoryKernels/GB_AxB__any_second_fc64.c +++ b/FactoryKernels/GB_AxB__any_second_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -349,3 +356,5 @@ GrB_Info GB (_Asaxpy3B__any_second_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_fp32.c b/FactoryKernels/GB_AxB__any_second_fp32.c index 6e48f00e51..fbb14c3bea 100644 --- a/FactoryKernels/GB_AxB__any_second_fp32.c +++ b/FactoryKernels/GB_AxB__any_second_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_second_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_fp64.c b/FactoryKernels/GB_AxB__any_second_fp64.c index 6e1ea36f7e..6c1d27c7ca 100644 --- a/FactoryKernels/GB_AxB__any_second_fp64.c +++ b/FactoryKernels/GB_AxB__any_second_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_second_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_int16.c b/FactoryKernels/GB_AxB__any_second_int16.c index 2f34b08ef2..3343c47eae 100644 --- a/FactoryKernels/GB_AxB__any_second_int16.c +++ b/FactoryKernels/GB_AxB__any_second_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_second_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_int32.c b/FactoryKernels/GB_AxB__any_second_int32.c index 500efc9948..84141ef7ed 100644 --- a/FactoryKernels/GB_AxB__any_second_int32.c +++ b/FactoryKernels/GB_AxB__any_second_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_second_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_int64.c b/FactoryKernels/GB_AxB__any_second_int64.c index 22e2deaba8..9c05bb9d43 100644 --- a/FactoryKernels/GB_AxB__any_second_int64.c +++ b/FactoryKernels/GB_AxB__any_second_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_second_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_int8.c b/FactoryKernels/GB_AxB__any_second_int8.c index 11615ca6d8..907f6669da 100644 --- a/FactoryKernels/GB_AxB__any_second_int8.c +++ b/FactoryKernels/GB_AxB__any_second_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_second_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_uint16.c b/FactoryKernels/GB_AxB__any_second_uint16.c index ebf72e9ed9..135d5b96ea 100644 --- a/FactoryKernels/GB_AxB__any_second_uint16.c +++ b/FactoryKernels/GB_AxB__any_second_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_second_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_uint32.c b/FactoryKernels/GB_AxB__any_second_uint32.c index 0feeb2d94e..af3a35bf14 100644 --- a/FactoryKernels/GB_AxB__any_second_uint32.c +++ b/FactoryKernels/GB_AxB__any_second_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_second_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_uint64.c b/FactoryKernels/GB_AxB__any_second_uint64.c index 76dc23780e..c343aa7181 100644 --- a/FactoryKernels/GB_AxB__any_second_uint64.c +++ b/FactoryKernels/GB_AxB__any_second_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_second_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_second_uint8.c b/FactoryKernels/GB_AxB__any_second_uint8.c index 92143d1253..b13a8095ef 100644 --- a/FactoryKernels/GB_AxB__any_second_uint8.c +++ b/FactoryKernels/GB_AxB__any_second_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_second_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_secondj1_int32.c b/FactoryKernels/GB_AxB__any_secondj1_int32.c index c7d683db86..07dd15d252 100644 --- a/FactoryKernels/GB_AxB__any_secondj1_int32.c +++ b/FactoryKernels/GB_AxB__any_secondj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -355,3 +362,5 @@ GrB_Info GB (_Asaxpy3B__any_secondj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_secondj1_int64.c b/FactoryKernels/GB_AxB__any_secondj1_int64.c index 2b3de283d1..9cf593bd7a 100644 --- a/FactoryKernels/GB_AxB__any_secondj1_int64.c +++ b/FactoryKernels/GB_AxB__any_secondj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -356,3 +363,5 @@ GrB_Info GB (_Asaxpy3B__any_secondj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_secondj_int32.c b/FactoryKernels/GB_AxB__any_secondj_int32.c index eba1d4ca31..8de5226f5e 100644 --- a/FactoryKernels/GB_AxB__any_secondj_int32.c +++ b/FactoryKernels/GB_AxB__any_secondj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_secondj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_secondj_int64.c b/FactoryKernels/GB_AxB__any_secondj_int64.c index 8d9dcead7c..2d084fdb35 100644 --- a/FactoryKernels/GB_AxB__any_secondj_int64.c +++ b/FactoryKernels/GB_AxB__any_secondj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -354,3 +361,5 @@ GrB_Info GB (_Asaxpy3B__any_secondj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_fc32.c b/FactoryKernels/GB_AxB__any_times_fc32.c index 13ba411512..452905c72b 100644 --- a/FactoryKernels/GB_AxB__any_times_fc32.c +++ b/FactoryKernels/GB_AxB__any_times_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -353,3 +360,5 @@ GrB_Info GB (_Asaxpy3B__any_times_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_fc64.c b/FactoryKernels/GB_AxB__any_times_fc64.c index be4aad98f9..e982bb480c 100644 --- a/FactoryKernels/GB_AxB__any_times_fc64.c +++ b/FactoryKernels/GB_AxB__any_times_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -349,3 +356,5 @@ GrB_Info GB (_Asaxpy3B__any_times_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_fp32.c b/FactoryKernels/GB_AxB__any_times_fp32.c index 2813875a87..0c67bdcdd7 100644 --- a/FactoryKernels/GB_AxB__any_times_fp32.c +++ b/FactoryKernels/GB_AxB__any_times_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_times_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_fp64.c b/FactoryKernels/GB_AxB__any_times_fp64.c index 89d1d62eeb..eb0064cf86 100644 --- a/FactoryKernels/GB_AxB__any_times_fp64.c +++ b/FactoryKernels/GB_AxB__any_times_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_times_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_int16.c b/FactoryKernels/GB_AxB__any_times_int16.c index 959384d8d1..139c7d0575 100644 --- a/FactoryKernels/GB_AxB__any_times_int16.c +++ b/FactoryKernels/GB_AxB__any_times_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_times_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_int32.c b/FactoryKernels/GB_AxB__any_times_int32.c index 498e8af6fd..03be32d73d 100644 --- a/FactoryKernels/GB_AxB__any_times_int32.c +++ b/FactoryKernels/GB_AxB__any_times_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_times_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_int64.c b/FactoryKernels/GB_AxB__any_times_int64.c index f8507249ba..064da10edc 100644 --- a/FactoryKernels/GB_AxB__any_times_int64.c +++ b/FactoryKernels/GB_AxB__any_times_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_times_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_int8.c b/FactoryKernels/GB_AxB__any_times_int8.c index c8c53fe6d5..c78715e62b 100644 --- a/FactoryKernels/GB_AxB__any_times_int8.c +++ b/FactoryKernels/GB_AxB__any_times_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_times_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_uint16.c b/FactoryKernels/GB_AxB__any_times_uint16.c index dbadfebfc1..07760566e0 100644 --- a/FactoryKernels/GB_AxB__any_times_uint16.c +++ b/FactoryKernels/GB_AxB__any_times_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_times_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_uint32.c b/FactoryKernels/GB_AxB__any_times_uint32.c index fb30ed3d02..68dd7b9e7a 100644 --- a/FactoryKernels/GB_AxB__any_times_uint32.c +++ b/FactoryKernels/GB_AxB__any_times_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_times_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_uint64.c b/FactoryKernels/GB_AxB__any_times_uint64.c index d46b74eb1f..1219ae7320 100644 --- a/FactoryKernels/GB_AxB__any_times_uint64.c +++ b/FactoryKernels/GB_AxB__any_times_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -351,3 +358,5 @@ GrB_Info GB (_Asaxpy3B__any_times_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__any_times_uint8.c b/FactoryKernels/GB_AxB__any_times_uint8.c index 5a9dadd9f2..30eab0c204 100644 --- a/FactoryKernels/GB_AxB__any_times_uint8.c +++ b/FactoryKernels/GB_AxB__any_times_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +357,5 @@ GrB_Info GB (_Asaxpy3B__any_times_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_band_uint16.c b/FactoryKernels/GB_AxB__band_band_uint16.c index 158fc0818c..bc54155bde 100644 --- a/FactoryKernels/GB_AxB__band_band_uint16.c +++ b/FactoryKernels/GB_AxB__band_band_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_band_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_band_uint32.c b/FactoryKernels/GB_AxB__band_band_uint32.c index e0f789f5a4..328216ddbb 100644 --- a/FactoryKernels/GB_AxB__band_band_uint32.c +++ b/FactoryKernels/GB_AxB__band_band_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_band_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_band_uint64.c b/FactoryKernels/GB_AxB__band_band_uint64.c index c43837338c..21a7f2d13e 100644 --- a/FactoryKernels/GB_AxB__band_band_uint64.c +++ b/FactoryKernels/GB_AxB__band_band_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__band_band_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_band_uint8.c b/FactoryKernels/GB_AxB__band_band_uint8.c index e11ba0e744..b0e1fff6a8 100644 --- a/FactoryKernels/GB_AxB__band_band_uint8.c +++ b/FactoryKernels/GB_AxB__band_band_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_band_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bor_uint16.c b/FactoryKernels/GB_AxB__band_bor_uint16.c index 7148b9cf94..7fa045e978 100644 --- a/FactoryKernels/GB_AxB__band_bor_uint16.c +++ b/FactoryKernels/GB_AxB__band_bor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bor_uint32.c b/FactoryKernels/GB_AxB__band_bor_uint32.c index a9a9058866..c3c4af5b3f 100644 --- a/FactoryKernels/GB_AxB__band_bor_uint32.c +++ b/FactoryKernels/GB_AxB__band_bor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bor_uint64.c b/FactoryKernels/GB_AxB__band_bor_uint64.c index bcacd23c25..5b9b164e25 100644 --- a/FactoryKernels/GB_AxB__band_bor_uint64.c +++ b/FactoryKernels/GB_AxB__band_bor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__band_bor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bor_uint8.c b/FactoryKernels/GB_AxB__band_bor_uint8.c index 904531f3fe..ccce807ed0 100644 --- a/FactoryKernels/GB_AxB__band_bor_uint8.c +++ b/FactoryKernels/GB_AxB__band_bor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bxnor_uint16.c b/FactoryKernels/GB_AxB__band_bxnor_uint16.c index 4f6816f885..54843fe4fe 100644 --- a/FactoryKernels/GB_AxB__band_bxnor_uint16.c +++ b/FactoryKernels/GB_AxB__band_bxnor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bxnor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bxnor_uint32.c b/FactoryKernels/GB_AxB__band_bxnor_uint32.c index 0c5a3eebf4..60775b7405 100644 --- a/FactoryKernels/GB_AxB__band_bxnor_uint32.c +++ b/FactoryKernels/GB_AxB__band_bxnor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bxnor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bxnor_uint64.c b/FactoryKernels/GB_AxB__band_bxnor_uint64.c index 704726827a..c62124613f 100644 --- a/FactoryKernels/GB_AxB__band_bxnor_uint64.c +++ b/FactoryKernels/GB_AxB__band_bxnor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__band_bxnor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bxnor_uint8.c b/FactoryKernels/GB_AxB__band_bxnor_uint8.c index cd44b08d3b..cba50e8142 100644 --- a/FactoryKernels/GB_AxB__band_bxnor_uint8.c +++ b/FactoryKernels/GB_AxB__band_bxnor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bxnor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bxor_uint16.c b/FactoryKernels/GB_AxB__band_bxor_uint16.c index cb75479c55..0b611b8122 100644 --- a/FactoryKernels/GB_AxB__band_bxor_uint16.c +++ b/FactoryKernels/GB_AxB__band_bxor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bxor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bxor_uint32.c b/FactoryKernels/GB_AxB__band_bxor_uint32.c index 773dbba254..e6d21ce52f 100644 --- a/FactoryKernels/GB_AxB__band_bxor_uint32.c +++ b/FactoryKernels/GB_AxB__band_bxor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bxor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bxor_uint64.c b/FactoryKernels/GB_AxB__band_bxor_uint64.c index 8cb272bb80..b1ff2d9872 100644 --- a/FactoryKernels/GB_AxB__band_bxor_uint64.c +++ b/FactoryKernels/GB_AxB__band_bxor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__band_bxor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__band_bxor_uint8.c b/FactoryKernels/GB_AxB__band_bxor_uint8.c index 950fa83216..6b6513ebec 100644 --- a/FactoryKernels/GB_AxB__band_bxor_uint8.c +++ b/FactoryKernels/GB_AxB__band_bxor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__band_bxor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_band_uint16.c b/FactoryKernels/GB_AxB__bor_band_uint16.c index 47ab592e06..0350c2017a 100644 --- a/FactoryKernels/GB_AxB__bor_band_uint16.c +++ b/FactoryKernels/GB_AxB__bor_band_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_band_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_band_uint32.c b/FactoryKernels/GB_AxB__bor_band_uint32.c index 7eddbdf853..98e7afdd58 100644 --- a/FactoryKernels/GB_AxB__bor_band_uint32.c +++ b/FactoryKernels/GB_AxB__bor_band_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_band_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_band_uint64.c b/FactoryKernels/GB_AxB__bor_band_uint64.c index 7270f42129..62ec09af3c 100644 --- a/FactoryKernels/GB_AxB__bor_band_uint64.c +++ b/FactoryKernels/GB_AxB__bor_band_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__bor_band_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_band_uint8.c b/FactoryKernels/GB_AxB__bor_band_uint8.c index 44452e2030..5de6d1ac9e 100644 --- a/FactoryKernels/GB_AxB__bor_band_uint8.c +++ b/FactoryKernels/GB_AxB__bor_band_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_band_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bor_uint16.c b/FactoryKernels/GB_AxB__bor_bor_uint16.c index c3da2f4140..2f6bcb8899 100644 --- a/FactoryKernels/GB_AxB__bor_bor_uint16.c +++ b/FactoryKernels/GB_AxB__bor_bor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bor_uint32.c b/FactoryKernels/GB_AxB__bor_bor_uint32.c index 95a7ff1864..e4a7814f42 100644 --- a/FactoryKernels/GB_AxB__bor_bor_uint32.c +++ b/FactoryKernels/GB_AxB__bor_bor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bor_uint64.c b/FactoryKernels/GB_AxB__bor_bor_uint64.c index 6015fb8903..090e0dcc35 100644 --- a/FactoryKernels/GB_AxB__bor_bor_uint64.c +++ b/FactoryKernels/GB_AxB__bor_bor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__bor_bor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bor_uint8.c b/FactoryKernels/GB_AxB__bor_bor_uint8.c index 6cfda86b9f..1006c67677 100644 --- a/FactoryKernels/GB_AxB__bor_bor_uint8.c +++ b/FactoryKernels/GB_AxB__bor_bor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bxnor_uint16.c b/FactoryKernels/GB_AxB__bor_bxnor_uint16.c index a630eada27..1e0197101e 100644 --- a/FactoryKernels/GB_AxB__bor_bxnor_uint16.c +++ b/FactoryKernels/GB_AxB__bor_bxnor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bxnor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bxnor_uint32.c b/FactoryKernels/GB_AxB__bor_bxnor_uint32.c index 76c0ee75c8..79571e664a 100644 --- a/FactoryKernels/GB_AxB__bor_bxnor_uint32.c +++ b/FactoryKernels/GB_AxB__bor_bxnor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bxnor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bxnor_uint64.c b/FactoryKernels/GB_AxB__bor_bxnor_uint64.c index 4fc6399f9e..9c28a343d5 100644 --- a/FactoryKernels/GB_AxB__bor_bxnor_uint64.c +++ b/FactoryKernels/GB_AxB__bor_bxnor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__bor_bxnor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bxnor_uint8.c b/FactoryKernels/GB_AxB__bor_bxnor_uint8.c index ff38cd920e..f536bda2ed 100644 --- a/FactoryKernels/GB_AxB__bor_bxnor_uint8.c +++ b/FactoryKernels/GB_AxB__bor_bxnor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bxnor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bxor_uint16.c b/FactoryKernels/GB_AxB__bor_bxor_uint16.c index 965e014c23..851e5b694c 100644 --- a/FactoryKernels/GB_AxB__bor_bxor_uint16.c +++ b/FactoryKernels/GB_AxB__bor_bxor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bxor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bxor_uint32.c b/FactoryKernels/GB_AxB__bor_bxor_uint32.c index eaa5ce21ea..934049e9c8 100644 --- a/FactoryKernels/GB_AxB__bor_bxor_uint32.c +++ b/FactoryKernels/GB_AxB__bor_bxor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bxor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bxor_uint64.c b/FactoryKernels/GB_AxB__bor_bxor_uint64.c index 8946c6808c..8757cee3af 100644 --- a/FactoryKernels/GB_AxB__bor_bxor_uint64.c +++ b/FactoryKernels/GB_AxB__bor_bxor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__bor_bxor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bor_bxor_uint8.c b/FactoryKernels/GB_AxB__bor_bxor_uint8.c index 7f3191edcf..cb36d64d3e 100644 --- a/FactoryKernels/GB_AxB__bor_bxor_uint8.c +++ b/FactoryKernels/GB_AxB__bor_bxor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__bor_bxor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_band_uint16.c b/FactoryKernels/GB_AxB__bxnor_band_uint16.c index 2265b2a8ce..352d30ef14 100644 --- a/FactoryKernels/GB_AxB__bxnor_band_uint16.c +++ b/FactoryKernels/GB_AxB__bxnor_band_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_band_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_band_uint32.c b/FactoryKernels/GB_AxB__bxnor_band_uint32.c index 678e1ca565..e43de43f90 100644 --- a/FactoryKernels/GB_AxB__bxnor_band_uint32.c +++ b/FactoryKernels/GB_AxB__bxnor_band_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_band_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_band_uint64.c b/FactoryKernels/GB_AxB__bxnor_band_uint64.c index fc248a01ef..a9a720dfb5 100644 --- a/FactoryKernels/GB_AxB__bxnor_band_uint64.c +++ b/FactoryKernels/GB_AxB__bxnor_band_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_band_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_band_uint8.c b/FactoryKernels/GB_AxB__bxnor_band_uint8.c index 2df638129c..359559b292 100644 --- a/FactoryKernels/GB_AxB__bxnor_band_uint8.c +++ b/FactoryKernels/GB_AxB__bxnor_band_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_band_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bor_uint16.c b/FactoryKernels/GB_AxB__bxnor_bor_uint16.c index f735db5e66..84731c654e 100644 --- a/FactoryKernels/GB_AxB__bxnor_bor_uint16.c +++ b/FactoryKernels/GB_AxB__bxnor_bor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bor_uint32.c b/FactoryKernels/GB_AxB__bxnor_bor_uint32.c index d1b449b3c7..3bed9b9b6e 100644 --- a/FactoryKernels/GB_AxB__bxnor_bor_uint32.c +++ b/FactoryKernels/GB_AxB__bxnor_bor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bor_uint64.c b/FactoryKernels/GB_AxB__bxnor_bor_uint64.c index 5aeabfd7e2..8be3595a83 100644 --- a/FactoryKernels/GB_AxB__bxnor_bor_uint64.c +++ b/FactoryKernels/GB_AxB__bxnor_bor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bor_uint8.c b/FactoryKernels/GB_AxB__bxnor_bor_uint8.c index 1c9d218736..779ca4d170 100644 --- a/FactoryKernels/GB_AxB__bxnor_bor_uint8.c +++ b/FactoryKernels/GB_AxB__bxnor_bor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bxnor_uint16.c b/FactoryKernels/GB_AxB__bxnor_bxnor_uint16.c index a475f6537e..e40941ad8d 100644 --- a/FactoryKernels/GB_AxB__bxnor_bxnor_uint16.c +++ b/FactoryKernels/GB_AxB__bxnor_bxnor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxnor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bxnor_uint32.c b/FactoryKernels/GB_AxB__bxnor_bxnor_uint32.c index 24ab6d1ade..71c531b00d 100644 --- a/FactoryKernels/GB_AxB__bxnor_bxnor_uint32.c +++ b/FactoryKernels/GB_AxB__bxnor_bxnor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxnor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bxnor_uint64.c b/FactoryKernels/GB_AxB__bxnor_bxnor_uint64.c index 9324cf2253..37ce1ff955 100644 --- a/FactoryKernels/GB_AxB__bxnor_bxnor_uint64.c +++ b/FactoryKernels/GB_AxB__bxnor_bxnor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxnor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bxnor_uint8.c b/FactoryKernels/GB_AxB__bxnor_bxnor_uint8.c index 123425e8f1..4f91784938 100644 --- a/FactoryKernels/GB_AxB__bxnor_bxnor_uint8.c +++ b/FactoryKernels/GB_AxB__bxnor_bxnor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxnor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bxor_uint16.c b/FactoryKernels/GB_AxB__bxnor_bxor_uint16.c index 2458d95bdb..d0080baf16 100644 --- a/FactoryKernels/GB_AxB__bxnor_bxor_uint16.c +++ b/FactoryKernels/GB_AxB__bxnor_bxor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bxor_uint32.c b/FactoryKernels/GB_AxB__bxnor_bxor_uint32.c index ace4f296d6..654d1f3dca 100644 --- a/FactoryKernels/GB_AxB__bxnor_bxor_uint32.c +++ b/FactoryKernels/GB_AxB__bxnor_bxor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bxor_uint64.c b/FactoryKernels/GB_AxB__bxnor_bxor_uint64.c index 10ec9af21c..7344b93b23 100644 --- a/FactoryKernels/GB_AxB__bxnor_bxor_uint64.c +++ b/FactoryKernels/GB_AxB__bxnor_bxor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxnor_bxor_uint8.c b/FactoryKernels/GB_AxB__bxnor_bxor_uint8.c index 0ca11d73b5..5054715263 100644 --- a/FactoryKernels/GB_AxB__bxnor_bxor_uint8.c +++ b/FactoryKernels/GB_AxB__bxnor_bxor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__bxnor_bxor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_band_uint16.c b/FactoryKernels/GB_AxB__bxor_band_uint16.c index 7b03a36a77..7c2dc8f832 100644 --- a/FactoryKernels/GB_AxB__bxor_band_uint16.c +++ b/FactoryKernels/GB_AxB__bxor_band_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_band_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_band_uint32.c b/FactoryKernels/GB_AxB__bxor_band_uint32.c index 3bc60b4613..54a4bae154 100644 --- a/FactoryKernels/GB_AxB__bxor_band_uint32.c +++ b/FactoryKernels/GB_AxB__bxor_band_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_band_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_band_uint64.c b/FactoryKernels/GB_AxB__bxor_band_uint64.c index de0c8d8dda..7b4ad50b6f 100644 --- a/FactoryKernels/GB_AxB__bxor_band_uint64.c +++ b/FactoryKernels/GB_AxB__bxor_band_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_band_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_band_uint8.c b/FactoryKernels/GB_AxB__bxor_band_uint8.c index 7568f68910..8c8a69964c 100644 --- a/FactoryKernels/GB_AxB__bxor_band_uint8.c +++ b/FactoryKernels/GB_AxB__bxor_band_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_band_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bor_uint16.c b/FactoryKernels/GB_AxB__bxor_bor_uint16.c index 368a08084d..691d59e58f 100644 --- a/FactoryKernels/GB_AxB__bxor_bor_uint16.c +++ b/FactoryKernels/GB_AxB__bxor_bor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bor_uint32.c b/FactoryKernels/GB_AxB__bxor_bor_uint32.c index 8d1974a0a5..3dd475a4ff 100644 --- a/FactoryKernels/GB_AxB__bxor_bor_uint32.c +++ b/FactoryKernels/GB_AxB__bxor_bor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bor_uint64.c b/FactoryKernels/GB_AxB__bxor_bor_uint64.c index 1e0cd013cc..907405d1e9 100644 --- a/FactoryKernels/GB_AxB__bxor_bor_uint64.c +++ b/FactoryKernels/GB_AxB__bxor_bor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bor_uint8.c b/FactoryKernels/GB_AxB__bxor_bor_uint8.c index f944b69568..3ddc662eff 100644 --- a/FactoryKernels/GB_AxB__bxor_bor_uint8.c +++ b/FactoryKernels/GB_AxB__bxor_bor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bxnor_uint16.c b/FactoryKernels/GB_AxB__bxor_bxnor_uint16.c index ae8fe28c07..e5a0d8457a 100644 --- a/FactoryKernels/GB_AxB__bxor_bxnor_uint16.c +++ b/FactoryKernels/GB_AxB__bxor_bxnor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bxnor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bxnor_uint32.c b/FactoryKernels/GB_AxB__bxor_bxnor_uint32.c index 719653b0b7..82e8225ed1 100644 --- a/FactoryKernels/GB_AxB__bxor_bxnor_uint32.c +++ b/FactoryKernels/GB_AxB__bxor_bxnor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bxnor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bxnor_uint64.c b/FactoryKernels/GB_AxB__bxor_bxnor_uint64.c index c434c2f763..f8b7f4c4f9 100644 --- a/FactoryKernels/GB_AxB__bxor_bxnor_uint64.c +++ b/FactoryKernels/GB_AxB__bxor_bxnor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bxnor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bxnor_uint8.c b/FactoryKernels/GB_AxB__bxor_bxnor_uint8.c index df0e1fef37..f74e62560d 100644 --- a/FactoryKernels/GB_AxB__bxor_bxnor_uint8.c +++ b/FactoryKernels/GB_AxB__bxor_bxnor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bxnor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bxor_uint16.c b/FactoryKernels/GB_AxB__bxor_bxor_uint16.c index 05097c546a..cd7382a0b9 100644 --- a/FactoryKernels/GB_AxB__bxor_bxor_uint16.c +++ b/FactoryKernels/GB_AxB__bxor_bxor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bxor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bxor_uint32.c b/FactoryKernels/GB_AxB__bxor_bxor_uint32.c index 19becdeb11..8dfe15b086 100644 --- a/FactoryKernels/GB_AxB__bxor_bxor_uint32.c +++ b/FactoryKernels/GB_AxB__bxor_bxor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bxor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bxor_uint64.c b/FactoryKernels/GB_AxB__bxor_bxor_uint64.c index 9be7525e14..6a66895056 100644 --- a/FactoryKernels/GB_AxB__bxor_bxor_uint64.c +++ b/FactoryKernels/GB_AxB__bxor_bxor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bxor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__bxor_bxor_uint8.c b/FactoryKernels/GB_AxB__bxor_bxor_uint8.c index ce9f86e5c7..021c931f07 100644 --- a/FactoryKernels/GB_AxB__bxor_bxor_uint8.c +++ b/FactoryKernels/GB_AxB__bxor_bxor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__bxor_bxor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_bool.c b/FactoryKernels/GB_AxB__eq_eq_bool.c index bf05d672f4..0669bb665f 100644 --- a/FactoryKernels/GB_AxB__eq_eq_bool.c +++ b/FactoryKernels/GB_AxB__eq_eq_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_fp32.c b/FactoryKernels/GB_AxB__eq_eq_fp32.c index 0e8de12e61..cadcd5225f 100644 --- a/FactoryKernels/GB_AxB__eq_eq_fp32.c +++ b/FactoryKernels/GB_AxB__eq_eq_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_fp64.c b/FactoryKernels/GB_AxB__eq_eq_fp64.c index f7bc6eea79..628ba25ca7 100644 --- a/FactoryKernels/GB_AxB__eq_eq_fp64.c +++ b/FactoryKernels/GB_AxB__eq_eq_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_int16.c b/FactoryKernels/GB_AxB__eq_eq_int16.c index 2b806e0ad4..cb0294990f 100644 --- a/FactoryKernels/GB_AxB__eq_eq_int16.c +++ b/FactoryKernels/GB_AxB__eq_eq_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_int32.c b/FactoryKernels/GB_AxB__eq_eq_int32.c index c0aab6668e..570433f0a6 100644 --- a/FactoryKernels/GB_AxB__eq_eq_int32.c +++ b/FactoryKernels/GB_AxB__eq_eq_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_int64.c b/FactoryKernels/GB_AxB__eq_eq_int64.c index 11268d027c..362c028fee 100644 --- a/FactoryKernels/GB_AxB__eq_eq_int64.c +++ b/FactoryKernels/GB_AxB__eq_eq_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_int8.c b/FactoryKernels/GB_AxB__eq_eq_int8.c index bba974cd9d..7e175f15b9 100644 --- a/FactoryKernels/GB_AxB__eq_eq_int8.c +++ b/FactoryKernels/GB_AxB__eq_eq_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_uint16.c b/FactoryKernels/GB_AxB__eq_eq_uint16.c index 2f46e7acdf..6b80816eb1 100644 --- a/FactoryKernels/GB_AxB__eq_eq_uint16.c +++ b/FactoryKernels/GB_AxB__eq_eq_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_uint32.c b/FactoryKernels/GB_AxB__eq_eq_uint32.c index bdc1b0b99c..273a4843af 100644 --- a/FactoryKernels/GB_AxB__eq_eq_uint32.c +++ b/FactoryKernels/GB_AxB__eq_eq_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_uint64.c b/FactoryKernels/GB_AxB__eq_eq_uint64.c index 5c8c273d27..f3a0bd7f20 100644 --- a/FactoryKernels/GB_AxB__eq_eq_uint64.c +++ b/FactoryKernels/GB_AxB__eq_eq_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_eq_uint8.c b/FactoryKernels/GB_AxB__eq_eq_uint8.c index fb273f64c0..1acf522b77 100644 --- a/FactoryKernels/GB_AxB__eq_eq_uint8.c +++ b/FactoryKernels/GB_AxB__eq_eq_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_eq_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_first_bool.c b/FactoryKernels/GB_AxB__eq_first_bool.c index 79d6aab1be..778e5b8627 100644 --- a/FactoryKernels/GB_AxB__eq_first_bool.c +++ b/FactoryKernels/GB_AxB__eq_first_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -452,3 +459,5 @@ GrB_Info GB (_Asaxpy3B__eq_first_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_bool.c b/FactoryKernels/GB_AxB__eq_ge_bool.c index d815a3f97a..0c8d0098c0 100644 --- a/FactoryKernels/GB_AxB__eq_ge_bool.c +++ b/FactoryKernels/GB_AxB__eq_ge_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_fp32.c b/FactoryKernels/GB_AxB__eq_ge_fp32.c index 005f5a76e0..4c18ca3af0 100644 --- a/FactoryKernels/GB_AxB__eq_ge_fp32.c +++ b/FactoryKernels/GB_AxB__eq_ge_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_fp64.c b/FactoryKernels/GB_AxB__eq_ge_fp64.c index 69a7bf783f..f046c24f76 100644 --- a/FactoryKernels/GB_AxB__eq_ge_fp64.c +++ b/FactoryKernels/GB_AxB__eq_ge_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_int16.c b/FactoryKernels/GB_AxB__eq_ge_int16.c index b8aa287683..45e0d84aa1 100644 --- a/FactoryKernels/GB_AxB__eq_ge_int16.c +++ b/FactoryKernels/GB_AxB__eq_ge_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_int32.c b/FactoryKernels/GB_AxB__eq_ge_int32.c index de6597610a..68972c7af9 100644 --- a/FactoryKernels/GB_AxB__eq_ge_int32.c +++ b/FactoryKernels/GB_AxB__eq_ge_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_int64.c b/FactoryKernels/GB_AxB__eq_ge_int64.c index 141af7ec43..d3182e80cc 100644 --- a/FactoryKernels/GB_AxB__eq_ge_int64.c +++ b/FactoryKernels/GB_AxB__eq_ge_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_int8.c b/FactoryKernels/GB_AxB__eq_ge_int8.c index 6f3e910abe..13f67cd2ab 100644 --- a/FactoryKernels/GB_AxB__eq_ge_int8.c +++ b/FactoryKernels/GB_AxB__eq_ge_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_uint16.c b/FactoryKernels/GB_AxB__eq_ge_uint16.c index b1e3778452..3f023dff2c 100644 --- a/FactoryKernels/GB_AxB__eq_ge_uint16.c +++ b/FactoryKernels/GB_AxB__eq_ge_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_uint32.c b/FactoryKernels/GB_AxB__eq_ge_uint32.c index 19ce0c196e..c825c00d63 100644 --- a/FactoryKernels/GB_AxB__eq_ge_uint32.c +++ b/FactoryKernels/GB_AxB__eq_ge_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_uint64.c b/FactoryKernels/GB_AxB__eq_ge_uint64.c index 6669eb7891..2c1ec1c45a 100644 --- a/FactoryKernels/GB_AxB__eq_ge_uint64.c +++ b/FactoryKernels/GB_AxB__eq_ge_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ge_uint8.c b/FactoryKernels/GB_AxB__eq_ge_uint8.c index ee6c6431c2..e67868cec3 100644 --- a/FactoryKernels/GB_AxB__eq_ge_uint8.c +++ b/FactoryKernels/GB_AxB__eq_ge_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ge_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_bool.c b/FactoryKernels/GB_AxB__eq_gt_bool.c index 4af5604109..edf3363389 100644 --- a/FactoryKernels/GB_AxB__eq_gt_bool.c +++ b/FactoryKernels/GB_AxB__eq_gt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_fp32.c b/FactoryKernels/GB_AxB__eq_gt_fp32.c index a6510db291..f324804e2a 100644 --- a/FactoryKernels/GB_AxB__eq_gt_fp32.c +++ b/FactoryKernels/GB_AxB__eq_gt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_fp64.c b/FactoryKernels/GB_AxB__eq_gt_fp64.c index 3b9bf177d3..bfbb4dba2b 100644 --- a/FactoryKernels/GB_AxB__eq_gt_fp64.c +++ b/FactoryKernels/GB_AxB__eq_gt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_int16.c b/FactoryKernels/GB_AxB__eq_gt_int16.c index 7d009246d6..8c947884e7 100644 --- a/FactoryKernels/GB_AxB__eq_gt_int16.c +++ b/FactoryKernels/GB_AxB__eq_gt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_int32.c b/FactoryKernels/GB_AxB__eq_gt_int32.c index f4a7588975..daebb60a11 100644 --- a/FactoryKernels/GB_AxB__eq_gt_int32.c +++ b/FactoryKernels/GB_AxB__eq_gt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_int64.c b/FactoryKernels/GB_AxB__eq_gt_int64.c index 2aa05d2bd2..5e00658a83 100644 --- a/FactoryKernels/GB_AxB__eq_gt_int64.c +++ b/FactoryKernels/GB_AxB__eq_gt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_int8.c b/FactoryKernels/GB_AxB__eq_gt_int8.c index ab332d2684..ddebcfbe00 100644 --- a/FactoryKernels/GB_AxB__eq_gt_int8.c +++ b/FactoryKernels/GB_AxB__eq_gt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_uint16.c b/FactoryKernels/GB_AxB__eq_gt_uint16.c index a1f786c915..71c3acb209 100644 --- a/FactoryKernels/GB_AxB__eq_gt_uint16.c +++ b/FactoryKernels/GB_AxB__eq_gt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_uint32.c b/FactoryKernels/GB_AxB__eq_gt_uint32.c index 4ca7d16a1a..decda8cf72 100644 --- a/FactoryKernels/GB_AxB__eq_gt_uint32.c +++ b/FactoryKernels/GB_AxB__eq_gt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_uint64.c b/FactoryKernels/GB_AxB__eq_gt_uint64.c index d4e7228bfc..e8c8be61d5 100644 --- a/FactoryKernels/GB_AxB__eq_gt_uint64.c +++ b/FactoryKernels/GB_AxB__eq_gt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_gt_uint8.c b/FactoryKernels/GB_AxB__eq_gt_uint8.c index 5110432c4f..e394f8cef4 100644 --- a/FactoryKernels/GB_AxB__eq_gt_uint8.c +++ b/FactoryKernels/GB_AxB__eq_gt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_gt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_land_bool.c b/FactoryKernels/GB_AxB__eq_land_bool.c index 5e58eb058f..7d588366b1 100644 --- a/FactoryKernels/GB_AxB__eq_land_bool.c +++ b/FactoryKernels/GB_AxB__eq_land_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_land_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_bool.c b/FactoryKernels/GB_AxB__eq_le_bool.c index 994d72d4c6..56600c83d8 100644 --- a/FactoryKernels/GB_AxB__eq_le_bool.c +++ b/FactoryKernels/GB_AxB__eq_le_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_fp32.c b/FactoryKernels/GB_AxB__eq_le_fp32.c index a426596f61..ef0584d741 100644 --- a/FactoryKernels/GB_AxB__eq_le_fp32.c +++ b/FactoryKernels/GB_AxB__eq_le_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_fp64.c b/FactoryKernels/GB_AxB__eq_le_fp64.c index 6c1f323265..5778e65b86 100644 --- a/FactoryKernels/GB_AxB__eq_le_fp64.c +++ b/FactoryKernels/GB_AxB__eq_le_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_int16.c b/FactoryKernels/GB_AxB__eq_le_int16.c index 8cbf33045d..ab5e038803 100644 --- a/FactoryKernels/GB_AxB__eq_le_int16.c +++ b/FactoryKernels/GB_AxB__eq_le_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_int32.c b/FactoryKernels/GB_AxB__eq_le_int32.c index 7764d33820..667b389411 100644 --- a/FactoryKernels/GB_AxB__eq_le_int32.c +++ b/FactoryKernels/GB_AxB__eq_le_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_int64.c b/FactoryKernels/GB_AxB__eq_le_int64.c index ccb6287a63..55dfbb5f4b 100644 --- a/FactoryKernels/GB_AxB__eq_le_int64.c +++ b/FactoryKernels/GB_AxB__eq_le_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_int8.c b/FactoryKernels/GB_AxB__eq_le_int8.c index 4594b3d3a4..2fb8b66052 100644 --- a/FactoryKernels/GB_AxB__eq_le_int8.c +++ b/FactoryKernels/GB_AxB__eq_le_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_uint16.c b/FactoryKernels/GB_AxB__eq_le_uint16.c index 055c197a34..26ba904c25 100644 --- a/FactoryKernels/GB_AxB__eq_le_uint16.c +++ b/FactoryKernels/GB_AxB__eq_le_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_uint32.c b/FactoryKernels/GB_AxB__eq_le_uint32.c index 988edfb471..08f4fe40be 100644 --- a/FactoryKernels/GB_AxB__eq_le_uint32.c +++ b/FactoryKernels/GB_AxB__eq_le_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_uint64.c b/FactoryKernels/GB_AxB__eq_le_uint64.c index e96a30e4d1..3cf94b34f3 100644 --- a/FactoryKernels/GB_AxB__eq_le_uint64.c +++ b/FactoryKernels/GB_AxB__eq_le_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_le_uint8.c b/FactoryKernels/GB_AxB__eq_le_uint8.c index 0e419b2bac..97ffe0e39d 100644 --- a/FactoryKernels/GB_AxB__eq_le_uint8.c +++ b/FactoryKernels/GB_AxB__eq_le_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_le_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lor_bool.c b/FactoryKernels/GB_AxB__eq_lor_bool.c index e4090e9923..b44d512026 100644 --- a/FactoryKernels/GB_AxB__eq_lor_bool.c +++ b/FactoryKernels/GB_AxB__eq_lor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_bool.c b/FactoryKernels/GB_AxB__eq_lt_bool.c index 45191ec887..7cf799ba54 100644 --- a/FactoryKernels/GB_AxB__eq_lt_bool.c +++ b/FactoryKernels/GB_AxB__eq_lt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_fp32.c b/FactoryKernels/GB_AxB__eq_lt_fp32.c index 2a679bda98..c2e69244e9 100644 --- a/FactoryKernels/GB_AxB__eq_lt_fp32.c +++ b/FactoryKernels/GB_AxB__eq_lt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_fp64.c b/FactoryKernels/GB_AxB__eq_lt_fp64.c index 70cc8f4f6d..03b2aee810 100644 --- a/FactoryKernels/GB_AxB__eq_lt_fp64.c +++ b/FactoryKernels/GB_AxB__eq_lt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_int16.c b/FactoryKernels/GB_AxB__eq_lt_int16.c index 4c3d7f75f1..36f8c9bc31 100644 --- a/FactoryKernels/GB_AxB__eq_lt_int16.c +++ b/FactoryKernels/GB_AxB__eq_lt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_int32.c b/FactoryKernels/GB_AxB__eq_lt_int32.c index dcaf54166d..08e341e507 100644 --- a/FactoryKernels/GB_AxB__eq_lt_int32.c +++ b/FactoryKernels/GB_AxB__eq_lt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_int64.c b/FactoryKernels/GB_AxB__eq_lt_int64.c index 701d2608a6..ed6f8d2839 100644 --- a/FactoryKernels/GB_AxB__eq_lt_int64.c +++ b/FactoryKernels/GB_AxB__eq_lt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_int8.c b/FactoryKernels/GB_AxB__eq_lt_int8.c index 9f870d3357..56367d6b3d 100644 --- a/FactoryKernels/GB_AxB__eq_lt_int8.c +++ b/FactoryKernels/GB_AxB__eq_lt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_uint16.c b/FactoryKernels/GB_AxB__eq_lt_uint16.c index b9025ad2b5..6c504f3397 100644 --- a/FactoryKernels/GB_AxB__eq_lt_uint16.c +++ b/FactoryKernels/GB_AxB__eq_lt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_uint32.c b/FactoryKernels/GB_AxB__eq_lt_uint32.c index 02b37ec8cb..5503d137eb 100644 --- a/FactoryKernels/GB_AxB__eq_lt_uint32.c +++ b/FactoryKernels/GB_AxB__eq_lt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_uint64.c b/FactoryKernels/GB_AxB__eq_lt_uint64.c index e7bcb49600..da06e06d69 100644 --- a/FactoryKernels/GB_AxB__eq_lt_uint64.c +++ b/FactoryKernels/GB_AxB__eq_lt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lt_uint8.c b/FactoryKernels/GB_AxB__eq_lt_uint8.c index eb1ba1bce4..d2c21c56cc 100644 --- a/FactoryKernels/GB_AxB__eq_lt_uint8.c +++ b/FactoryKernels/GB_AxB__eq_lt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_lxor_bool.c b/FactoryKernels/GB_AxB__eq_lxor_bool.c index 02e41fa30c..d1f19fc5f9 100644 --- a/FactoryKernels/GB_AxB__eq_lxor_bool.c +++ b/FactoryKernels/GB_AxB__eq_lxor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_lxor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_fp32.c b/FactoryKernels/GB_AxB__eq_ne_fp32.c index 85517a0bca..4a5b157348 100644 --- a/FactoryKernels/GB_AxB__eq_ne_fp32.c +++ b/FactoryKernels/GB_AxB__eq_ne_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_fp64.c b/FactoryKernels/GB_AxB__eq_ne_fp64.c index 64ce2b5276..5eb2bcfc83 100644 --- a/FactoryKernels/GB_AxB__eq_ne_fp64.c +++ b/FactoryKernels/GB_AxB__eq_ne_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_int16.c b/FactoryKernels/GB_AxB__eq_ne_int16.c index 00e956b483..f36ed80bb3 100644 --- a/FactoryKernels/GB_AxB__eq_ne_int16.c +++ b/FactoryKernels/GB_AxB__eq_ne_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_int32.c b/FactoryKernels/GB_AxB__eq_ne_int32.c index a843216151..efbe81cb5b 100644 --- a/FactoryKernels/GB_AxB__eq_ne_int32.c +++ b/FactoryKernels/GB_AxB__eq_ne_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_int64.c b/FactoryKernels/GB_AxB__eq_ne_int64.c index 7485d1a92a..1c56524e40 100644 --- a/FactoryKernels/GB_AxB__eq_ne_int64.c +++ b/FactoryKernels/GB_AxB__eq_ne_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_int8.c b/FactoryKernels/GB_AxB__eq_ne_int8.c index 5e6ce83c51..36cabb71ae 100644 --- a/FactoryKernels/GB_AxB__eq_ne_int8.c +++ b/FactoryKernels/GB_AxB__eq_ne_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_uint16.c b/FactoryKernels/GB_AxB__eq_ne_uint16.c index d3a9b7f850..e0204770de 100644 --- a/FactoryKernels/GB_AxB__eq_ne_uint16.c +++ b/FactoryKernels/GB_AxB__eq_ne_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_uint32.c b/FactoryKernels/GB_AxB__eq_ne_uint32.c index ddbcaf0e0c..eedc864147 100644 --- a/FactoryKernels/GB_AxB__eq_ne_uint32.c +++ b/FactoryKernels/GB_AxB__eq_ne_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_uint64.c b/FactoryKernels/GB_AxB__eq_ne_uint64.c index fa0bffff05..0ad834d772 100644 --- a/FactoryKernels/GB_AxB__eq_ne_uint64.c +++ b/FactoryKernels/GB_AxB__eq_ne_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_ne_uint8.c b/FactoryKernels/GB_AxB__eq_ne_uint8.c index 34c63f61b9..9053888d1f 100644 --- a/FactoryKernels/GB_AxB__eq_ne_uint8.c +++ b/FactoryKernels/GB_AxB__eq_ne_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_ne_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__eq_second_bool.c b/FactoryKernels/GB_AxB__eq_second_bool.c index fc9ffb8494..bd128340d1 100644 --- a/FactoryKernels/GB_AxB__eq_second_bool.c +++ b/FactoryKernels/GB_AxB__eq_second_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__eq_second_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_bool.c b/FactoryKernels/GB_AxB__land_eq_bool.c index 8e777250d2..3775de0772 100644 --- a/FactoryKernels/GB_AxB__land_eq_bool.c +++ b/FactoryKernels/GB_AxB__land_eq_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_fp32.c b/FactoryKernels/GB_AxB__land_eq_fp32.c index 3833e7b028..f897fad00e 100644 --- a/FactoryKernels/GB_AxB__land_eq_fp32.c +++ b/FactoryKernels/GB_AxB__land_eq_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_fp64.c b/FactoryKernels/GB_AxB__land_eq_fp64.c index a42996c7ed..21cc34554b 100644 --- a/FactoryKernels/GB_AxB__land_eq_fp64.c +++ b/FactoryKernels/GB_AxB__land_eq_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_int16.c b/FactoryKernels/GB_AxB__land_eq_int16.c index 25b9839e23..b4cff827ef 100644 --- a/FactoryKernels/GB_AxB__land_eq_int16.c +++ b/FactoryKernels/GB_AxB__land_eq_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_int32.c b/FactoryKernels/GB_AxB__land_eq_int32.c index bb16bed345..1043adaa60 100644 --- a/FactoryKernels/GB_AxB__land_eq_int32.c +++ b/FactoryKernels/GB_AxB__land_eq_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_int64.c b/FactoryKernels/GB_AxB__land_eq_int64.c index f45990736f..abc4a67691 100644 --- a/FactoryKernels/GB_AxB__land_eq_int64.c +++ b/FactoryKernels/GB_AxB__land_eq_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_int8.c b/FactoryKernels/GB_AxB__land_eq_int8.c index 8baaa55d1f..1a28d49142 100644 --- a/FactoryKernels/GB_AxB__land_eq_int8.c +++ b/FactoryKernels/GB_AxB__land_eq_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_uint16.c b/FactoryKernels/GB_AxB__land_eq_uint16.c index b96cba2c3a..b01c445496 100644 --- a/FactoryKernels/GB_AxB__land_eq_uint16.c +++ b/FactoryKernels/GB_AxB__land_eq_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_uint32.c b/FactoryKernels/GB_AxB__land_eq_uint32.c index 10bd1c1128..5d62ab62a8 100644 --- a/FactoryKernels/GB_AxB__land_eq_uint32.c +++ b/FactoryKernels/GB_AxB__land_eq_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_uint64.c b/FactoryKernels/GB_AxB__land_eq_uint64.c index 6226f27369..80acdb8a90 100644 --- a/FactoryKernels/GB_AxB__land_eq_uint64.c +++ b/FactoryKernels/GB_AxB__land_eq_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_eq_uint8.c b/FactoryKernels/GB_AxB__land_eq_uint8.c index a55d68140b..23b33ed74d 100644 --- a/FactoryKernels/GB_AxB__land_eq_uint8.c +++ b/FactoryKernels/GB_AxB__land_eq_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_eq_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_first_bool.c b/FactoryKernels/GB_AxB__land_first_bool.c index ea87563e08..db34994254 100644 --- a/FactoryKernels/GB_AxB__land_first_bool.c +++ b/FactoryKernels/GB_AxB__land_first_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__land_first_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_bool.c b/FactoryKernels/GB_AxB__land_ge_bool.c index 1094462b6d..24aff59a63 100644 --- a/FactoryKernels/GB_AxB__land_ge_bool.c +++ b/FactoryKernels/GB_AxB__land_ge_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_fp32.c b/FactoryKernels/GB_AxB__land_ge_fp32.c index 61abebc805..0ddcec1215 100644 --- a/FactoryKernels/GB_AxB__land_ge_fp32.c +++ b/FactoryKernels/GB_AxB__land_ge_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_fp64.c b/FactoryKernels/GB_AxB__land_ge_fp64.c index 5d3de622c9..4e712552b8 100644 --- a/FactoryKernels/GB_AxB__land_ge_fp64.c +++ b/FactoryKernels/GB_AxB__land_ge_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_int16.c b/FactoryKernels/GB_AxB__land_ge_int16.c index f727dd029f..96c87c0cb4 100644 --- a/FactoryKernels/GB_AxB__land_ge_int16.c +++ b/FactoryKernels/GB_AxB__land_ge_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_int32.c b/FactoryKernels/GB_AxB__land_ge_int32.c index caf93ab84d..62dbadb72e 100644 --- a/FactoryKernels/GB_AxB__land_ge_int32.c +++ b/FactoryKernels/GB_AxB__land_ge_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_int64.c b/FactoryKernels/GB_AxB__land_ge_int64.c index dfd54e8a57..3e6ec78139 100644 --- a/FactoryKernels/GB_AxB__land_ge_int64.c +++ b/FactoryKernels/GB_AxB__land_ge_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_int8.c b/FactoryKernels/GB_AxB__land_ge_int8.c index 91fa28943f..67687b58e7 100644 --- a/FactoryKernels/GB_AxB__land_ge_int8.c +++ b/FactoryKernels/GB_AxB__land_ge_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_uint16.c b/FactoryKernels/GB_AxB__land_ge_uint16.c index 759f3a2cf8..a54b61bfe5 100644 --- a/FactoryKernels/GB_AxB__land_ge_uint16.c +++ b/FactoryKernels/GB_AxB__land_ge_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_uint32.c b/FactoryKernels/GB_AxB__land_ge_uint32.c index 5665015bee..d5d038dd2b 100644 --- a/FactoryKernels/GB_AxB__land_ge_uint32.c +++ b/FactoryKernels/GB_AxB__land_ge_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_uint64.c b/FactoryKernels/GB_AxB__land_ge_uint64.c index 9b33d6a9a8..b2ae4881c5 100644 --- a/FactoryKernels/GB_AxB__land_ge_uint64.c +++ b/FactoryKernels/GB_AxB__land_ge_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ge_uint8.c b/FactoryKernels/GB_AxB__land_ge_uint8.c index 1a2481d42f..194c3c38bd 100644 --- a/FactoryKernels/GB_AxB__land_ge_uint8.c +++ b/FactoryKernels/GB_AxB__land_ge_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ge_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_bool.c b/FactoryKernels/GB_AxB__land_gt_bool.c index 0eb2829f68..a6cfdc6273 100644 --- a/FactoryKernels/GB_AxB__land_gt_bool.c +++ b/FactoryKernels/GB_AxB__land_gt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_fp32.c b/FactoryKernels/GB_AxB__land_gt_fp32.c index 754c4f4c31..1202685648 100644 --- a/FactoryKernels/GB_AxB__land_gt_fp32.c +++ b/FactoryKernels/GB_AxB__land_gt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_fp64.c b/FactoryKernels/GB_AxB__land_gt_fp64.c index c0454880b7..1a972654af 100644 --- a/FactoryKernels/GB_AxB__land_gt_fp64.c +++ b/FactoryKernels/GB_AxB__land_gt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_int16.c b/FactoryKernels/GB_AxB__land_gt_int16.c index b55a064b80..f45296df36 100644 --- a/FactoryKernels/GB_AxB__land_gt_int16.c +++ b/FactoryKernels/GB_AxB__land_gt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_int32.c b/FactoryKernels/GB_AxB__land_gt_int32.c index 122a645465..37c1085cb8 100644 --- a/FactoryKernels/GB_AxB__land_gt_int32.c +++ b/FactoryKernels/GB_AxB__land_gt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_int64.c b/FactoryKernels/GB_AxB__land_gt_int64.c index 9d81959e5c..60b54896bc 100644 --- a/FactoryKernels/GB_AxB__land_gt_int64.c +++ b/FactoryKernels/GB_AxB__land_gt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_int8.c b/FactoryKernels/GB_AxB__land_gt_int8.c index fcf051cd98..194aec706d 100644 --- a/FactoryKernels/GB_AxB__land_gt_int8.c +++ b/FactoryKernels/GB_AxB__land_gt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_uint16.c b/FactoryKernels/GB_AxB__land_gt_uint16.c index 7e57c5dc42..fc5f0f5eaa 100644 --- a/FactoryKernels/GB_AxB__land_gt_uint16.c +++ b/FactoryKernels/GB_AxB__land_gt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_uint32.c b/FactoryKernels/GB_AxB__land_gt_uint32.c index 509c293e1b..a1da877d3d 100644 --- a/FactoryKernels/GB_AxB__land_gt_uint32.c +++ b/FactoryKernels/GB_AxB__land_gt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_uint64.c b/FactoryKernels/GB_AxB__land_gt_uint64.c index 4706bd0b80..844e2ece66 100644 --- a/FactoryKernels/GB_AxB__land_gt_uint64.c +++ b/FactoryKernels/GB_AxB__land_gt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_gt_uint8.c b/FactoryKernels/GB_AxB__land_gt_uint8.c index 2eaf192f34..43fd77db81 100644 --- a/FactoryKernels/GB_AxB__land_gt_uint8.c +++ b/FactoryKernels/GB_AxB__land_gt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_gt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_land_bool.c b/FactoryKernels/GB_AxB__land_land_bool.c index 0f0374b6a5..0b1f22303b 100644 --- a/FactoryKernels/GB_AxB__land_land_bool.c +++ b/FactoryKernels/GB_AxB__land_land_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_land_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_bool.c b/FactoryKernels/GB_AxB__land_le_bool.c index c87ca628ae..9eb28838fa 100644 --- a/FactoryKernels/GB_AxB__land_le_bool.c +++ b/FactoryKernels/GB_AxB__land_le_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_fp32.c b/FactoryKernels/GB_AxB__land_le_fp32.c index 6d41077c9d..1e5ff60e76 100644 --- a/FactoryKernels/GB_AxB__land_le_fp32.c +++ b/FactoryKernels/GB_AxB__land_le_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_fp64.c b/FactoryKernels/GB_AxB__land_le_fp64.c index 921ab81137..f797c909ef 100644 --- a/FactoryKernels/GB_AxB__land_le_fp64.c +++ b/FactoryKernels/GB_AxB__land_le_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_int16.c b/FactoryKernels/GB_AxB__land_le_int16.c index 080bcf439b..4f133e7080 100644 --- a/FactoryKernels/GB_AxB__land_le_int16.c +++ b/FactoryKernels/GB_AxB__land_le_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_int32.c b/FactoryKernels/GB_AxB__land_le_int32.c index d061e2cacb..729faa4c93 100644 --- a/FactoryKernels/GB_AxB__land_le_int32.c +++ b/FactoryKernels/GB_AxB__land_le_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_int64.c b/FactoryKernels/GB_AxB__land_le_int64.c index 2538d0ce6e..cabddde5c3 100644 --- a/FactoryKernels/GB_AxB__land_le_int64.c +++ b/FactoryKernels/GB_AxB__land_le_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_int8.c b/FactoryKernels/GB_AxB__land_le_int8.c index 21df7113bb..ac20f8962f 100644 --- a/FactoryKernels/GB_AxB__land_le_int8.c +++ b/FactoryKernels/GB_AxB__land_le_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_uint16.c b/FactoryKernels/GB_AxB__land_le_uint16.c index aab6838e20..34aad5dd34 100644 --- a/FactoryKernels/GB_AxB__land_le_uint16.c +++ b/FactoryKernels/GB_AxB__land_le_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_uint32.c b/FactoryKernels/GB_AxB__land_le_uint32.c index f5e090e1cb..6528fd83e7 100644 --- a/FactoryKernels/GB_AxB__land_le_uint32.c +++ b/FactoryKernels/GB_AxB__land_le_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_uint64.c b/FactoryKernels/GB_AxB__land_le_uint64.c index 454385b2dc..f6cba32b41 100644 --- a/FactoryKernels/GB_AxB__land_le_uint64.c +++ b/FactoryKernels/GB_AxB__land_le_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_le_uint8.c b/FactoryKernels/GB_AxB__land_le_uint8.c index 4eaf292401..133bdb343e 100644 --- a/FactoryKernels/GB_AxB__land_le_uint8.c +++ b/FactoryKernels/GB_AxB__land_le_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_le_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lor_bool.c b/FactoryKernels/GB_AxB__land_lor_bool.c index 6001ea2f69..c664aadaa0 100644 --- a/FactoryKernels/GB_AxB__land_lor_bool.c +++ b/FactoryKernels/GB_AxB__land_lor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_bool.c b/FactoryKernels/GB_AxB__land_lt_bool.c index 2b0050dabb..a856c5cddf 100644 --- a/FactoryKernels/GB_AxB__land_lt_bool.c +++ b/FactoryKernels/GB_AxB__land_lt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_fp32.c b/FactoryKernels/GB_AxB__land_lt_fp32.c index 27bf5d85d7..75cf8d7cf5 100644 --- a/FactoryKernels/GB_AxB__land_lt_fp32.c +++ b/FactoryKernels/GB_AxB__land_lt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_fp64.c b/FactoryKernels/GB_AxB__land_lt_fp64.c index 09d65cabb9..f0dae3231f 100644 --- a/FactoryKernels/GB_AxB__land_lt_fp64.c +++ b/FactoryKernels/GB_AxB__land_lt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_int16.c b/FactoryKernels/GB_AxB__land_lt_int16.c index 5ea4481dee..5e8436937c 100644 --- a/FactoryKernels/GB_AxB__land_lt_int16.c +++ b/FactoryKernels/GB_AxB__land_lt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_int32.c b/FactoryKernels/GB_AxB__land_lt_int32.c index 812d090993..7892261062 100644 --- a/FactoryKernels/GB_AxB__land_lt_int32.c +++ b/FactoryKernels/GB_AxB__land_lt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_int64.c b/FactoryKernels/GB_AxB__land_lt_int64.c index 5f38bfb5d0..596f924cf5 100644 --- a/FactoryKernels/GB_AxB__land_lt_int64.c +++ b/FactoryKernels/GB_AxB__land_lt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_int8.c b/FactoryKernels/GB_AxB__land_lt_int8.c index 680a09edbe..a098e6eeb9 100644 --- a/FactoryKernels/GB_AxB__land_lt_int8.c +++ b/FactoryKernels/GB_AxB__land_lt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_uint16.c b/FactoryKernels/GB_AxB__land_lt_uint16.c index aecde97485..d796537b72 100644 --- a/FactoryKernels/GB_AxB__land_lt_uint16.c +++ b/FactoryKernels/GB_AxB__land_lt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_uint32.c b/FactoryKernels/GB_AxB__land_lt_uint32.c index 8a33f04364..931c7e7dcf 100644 --- a/FactoryKernels/GB_AxB__land_lt_uint32.c +++ b/FactoryKernels/GB_AxB__land_lt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_uint64.c b/FactoryKernels/GB_AxB__land_lt_uint64.c index b22b0b4d43..e75dcb43f0 100644 --- a/FactoryKernels/GB_AxB__land_lt_uint64.c +++ b/FactoryKernels/GB_AxB__land_lt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lt_uint8.c b/FactoryKernels/GB_AxB__land_lt_uint8.c index e5b8e26af3..fb67206a90 100644 --- a/FactoryKernels/GB_AxB__land_lt_uint8.c +++ b/FactoryKernels/GB_AxB__land_lt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_lxor_bool.c b/FactoryKernels/GB_AxB__land_lxor_bool.c index 89f7c377a8..0c8ad02eae 100644 --- a/FactoryKernels/GB_AxB__land_lxor_bool.c +++ b/FactoryKernels/GB_AxB__land_lxor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_lxor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_fp32.c b/FactoryKernels/GB_AxB__land_ne_fp32.c index 3fa67157ac..3d5f681365 100644 --- a/FactoryKernels/GB_AxB__land_ne_fp32.c +++ b/FactoryKernels/GB_AxB__land_ne_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_fp64.c b/FactoryKernels/GB_AxB__land_ne_fp64.c index 0b1d054a1a..bd5f32b819 100644 --- a/FactoryKernels/GB_AxB__land_ne_fp64.c +++ b/FactoryKernels/GB_AxB__land_ne_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_int16.c b/FactoryKernels/GB_AxB__land_ne_int16.c index b62a2c2537..3e23135204 100644 --- a/FactoryKernels/GB_AxB__land_ne_int16.c +++ b/FactoryKernels/GB_AxB__land_ne_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_int32.c b/FactoryKernels/GB_AxB__land_ne_int32.c index 48fe4b7db0..813b72895e 100644 --- a/FactoryKernels/GB_AxB__land_ne_int32.c +++ b/FactoryKernels/GB_AxB__land_ne_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_int64.c b/FactoryKernels/GB_AxB__land_ne_int64.c index 56bc3efb45..f18d412e57 100644 --- a/FactoryKernels/GB_AxB__land_ne_int64.c +++ b/FactoryKernels/GB_AxB__land_ne_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_int8.c b/FactoryKernels/GB_AxB__land_ne_int8.c index ba33121fc5..a903f1938e 100644 --- a/FactoryKernels/GB_AxB__land_ne_int8.c +++ b/FactoryKernels/GB_AxB__land_ne_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_uint16.c b/FactoryKernels/GB_AxB__land_ne_uint16.c index 5799abfc98..96c06bbab9 100644 --- a/FactoryKernels/GB_AxB__land_ne_uint16.c +++ b/FactoryKernels/GB_AxB__land_ne_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_uint32.c b/FactoryKernels/GB_AxB__land_ne_uint32.c index ef6b73db4e..10efbee29e 100644 --- a/FactoryKernels/GB_AxB__land_ne_uint32.c +++ b/FactoryKernels/GB_AxB__land_ne_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_uint64.c b/FactoryKernels/GB_AxB__land_ne_uint64.c index 9fb7e34fb0..42e45ace50 100644 --- a/FactoryKernels/GB_AxB__land_ne_uint64.c +++ b/FactoryKernels/GB_AxB__land_ne_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_ne_uint8.c b/FactoryKernels/GB_AxB__land_ne_uint8.c index 11d1437d6d..24e4049343 100644 --- a/FactoryKernels/GB_AxB__land_ne_uint8.c +++ b/FactoryKernels/GB_AxB__land_ne_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_ne_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__land_second_bool.c b/FactoryKernels/GB_AxB__land_second_bool.c index d1b3f954ee..a537e3f6dc 100644 --- a/FactoryKernels/GB_AxB__land_second_bool.c +++ b/FactoryKernels/GB_AxB__land_second_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__land_second_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_bool.c b/FactoryKernels/GB_AxB__lor_eq_bool.c index f71067f776..89dc9df495 100644 --- a/FactoryKernels/GB_AxB__lor_eq_bool.c +++ b/FactoryKernels/GB_AxB__lor_eq_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_fp32.c b/FactoryKernels/GB_AxB__lor_eq_fp32.c index 16d1bf2dce..8eef813f91 100644 --- a/FactoryKernels/GB_AxB__lor_eq_fp32.c +++ b/FactoryKernels/GB_AxB__lor_eq_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_fp64.c b/FactoryKernels/GB_AxB__lor_eq_fp64.c index 46593f5f5b..8d61d71d81 100644 --- a/FactoryKernels/GB_AxB__lor_eq_fp64.c +++ b/FactoryKernels/GB_AxB__lor_eq_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_int16.c b/FactoryKernels/GB_AxB__lor_eq_int16.c index e5e511869e..c1baa01e64 100644 --- a/FactoryKernels/GB_AxB__lor_eq_int16.c +++ b/FactoryKernels/GB_AxB__lor_eq_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_int32.c b/FactoryKernels/GB_AxB__lor_eq_int32.c index 8cb6ebe4c7..67b29f3c76 100644 --- a/FactoryKernels/GB_AxB__lor_eq_int32.c +++ b/FactoryKernels/GB_AxB__lor_eq_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_int64.c b/FactoryKernels/GB_AxB__lor_eq_int64.c index 22c10ec0ac..f53c4c98a8 100644 --- a/FactoryKernels/GB_AxB__lor_eq_int64.c +++ b/FactoryKernels/GB_AxB__lor_eq_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_int8.c b/FactoryKernels/GB_AxB__lor_eq_int8.c index 8cec3603fb..44667798fc 100644 --- a/FactoryKernels/GB_AxB__lor_eq_int8.c +++ b/FactoryKernels/GB_AxB__lor_eq_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_uint16.c b/FactoryKernels/GB_AxB__lor_eq_uint16.c index 70144da84b..b5ec5232ce 100644 --- a/FactoryKernels/GB_AxB__lor_eq_uint16.c +++ b/FactoryKernels/GB_AxB__lor_eq_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_uint32.c b/FactoryKernels/GB_AxB__lor_eq_uint32.c index 622537dcb8..af2f0f43ca 100644 --- a/FactoryKernels/GB_AxB__lor_eq_uint32.c +++ b/FactoryKernels/GB_AxB__lor_eq_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_uint64.c b/FactoryKernels/GB_AxB__lor_eq_uint64.c index 48b07bbc2d..b41027a60c 100644 --- a/FactoryKernels/GB_AxB__lor_eq_uint64.c +++ b/FactoryKernels/GB_AxB__lor_eq_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_eq_uint8.c b/FactoryKernels/GB_AxB__lor_eq_uint8.c index e40a143730..aaa4408f52 100644 --- a/FactoryKernels/GB_AxB__lor_eq_uint8.c +++ b/FactoryKernels/GB_AxB__lor_eq_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_eq_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_first_bool.c b/FactoryKernels/GB_AxB__lor_first_bool.c index 2dd69d1212..b83d2b5543 100644 --- a/FactoryKernels/GB_AxB__lor_first_bool.c +++ b/FactoryKernels/GB_AxB__lor_first_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__lor_first_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_bool.c b/FactoryKernels/GB_AxB__lor_ge_bool.c index d20b63bbb8..31255b702d 100644 --- a/FactoryKernels/GB_AxB__lor_ge_bool.c +++ b/FactoryKernels/GB_AxB__lor_ge_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_fp32.c b/FactoryKernels/GB_AxB__lor_ge_fp32.c index cf1de89bea..75594d6473 100644 --- a/FactoryKernels/GB_AxB__lor_ge_fp32.c +++ b/FactoryKernels/GB_AxB__lor_ge_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_fp64.c b/FactoryKernels/GB_AxB__lor_ge_fp64.c index b5e7865c33..cf09ca4bf3 100644 --- a/FactoryKernels/GB_AxB__lor_ge_fp64.c +++ b/FactoryKernels/GB_AxB__lor_ge_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_int16.c b/FactoryKernels/GB_AxB__lor_ge_int16.c index e2dfd3b053..6b236f30e7 100644 --- a/FactoryKernels/GB_AxB__lor_ge_int16.c +++ b/FactoryKernels/GB_AxB__lor_ge_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_int32.c b/FactoryKernels/GB_AxB__lor_ge_int32.c index 98043d7443..933a1c703e 100644 --- a/FactoryKernels/GB_AxB__lor_ge_int32.c +++ b/FactoryKernels/GB_AxB__lor_ge_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_int64.c b/FactoryKernels/GB_AxB__lor_ge_int64.c index 13e0266cda..f8b5301ed5 100644 --- a/FactoryKernels/GB_AxB__lor_ge_int64.c +++ b/FactoryKernels/GB_AxB__lor_ge_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_int8.c b/FactoryKernels/GB_AxB__lor_ge_int8.c index 8b95a55299..562901fdf7 100644 --- a/FactoryKernels/GB_AxB__lor_ge_int8.c +++ b/FactoryKernels/GB_AxB__lor_ge_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_uint16.c b/FactoryKernels/GB_AxB__lor_ge_uint16.c index 1efc0f7c15..5c6159cf60 100644 --- a/FactoryKernels/GB_AxB__lor_ge_uint16.c +++ b/FactoryKernels/GB_AxB__lor_ge_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_uint32.c b/FactoryKernels/GB_AxB__lor_ge_uint32.c index 08c1cbf86b..87df86e023 100644 --- a/FactoryKernels/GB_AxB__lor_ge_uint32.c +++ b/FactoryKernels/GB_AxB__lor_ge_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_uint64.c b/FactoryKernels/GB_AxB__lor_ge_uint64.c index a6a22fba83..ca014d5618 100644 --- a/FactoryKernels/GB_AxB__lor_ge_uint64.c +++ b/FactoryKernels/GB_AxB__lor_ge_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ge_uint8.c b/FactoryKernels/GB_AxB__lor_ge_uint8.c index 47083b89c8..5412fd152b 100644 --- a/FactoryKernels/GB_AxB__lor_ge_uint8.c +++ b/FactoryKernels/GB_AxB__lor_ge_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ge_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_bool.c b/FactoryKernels/GB_AxB__lor_gt_bool.c index 980fce66eb..624a5bcc4d 100644 --- a/FactoryKernels/GB_AxB__lor_gt_bool.c +++ b/FactoryKernels/GB_AxB__lor_gt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_fp32.c b/FactoryKernels/GB_AxB__lor_gt_fp32.c index b6626ba97c..ce73b1a52c 100644 --- a/FactoryKernels/GB_AxB__lor_gt_fp32.c +++ b/FactoryKernels/GB_AxB__lor_gt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_fp64.c b/FactoryKernels/GB_AxB__lor_gt_fp64.c index f811dcc56f..6bc21d9c03 100644 --- a/FactoryKernels/GB_AxB__lor_gt_fp64.c +++ b/FactoryKernels/GB_AxB__lor_gt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_int16.c b/FactoryKernels/GB_AxB__lor_gt_int16.c index 41b36b95e8..8b236c28a9 100644 --- a/FactoryKernels/GB_AxB__lor_gt_int16.c +++ b/FactoryKernels/GB_AxB__lor_gt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_int32.c b/FactoryKernels/GB_AxB__lor_gt_int32.c index be13cd66bf..a20f1d8bbc 100644 --- a/FactoryKernels/GB_AxB__lor_gt_int32.c +++ b/FactoryKernels/GB_AxB__lor_gt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_int64.c b/FactoryKernels/GB_AxB__lor_gt_int64.c index 0da1ca7ce0..e8f2b56b75 100644 --- a/FactoryKernels/GB_AxB__lor_gt_int64.c +++ b/FactoryKernels/GB_AxB__lor_gt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_int8.c b/FactoryKernels/GB_AxB__lor_gt_int8.c index 8118e60ffe..b178e65e64 100644 --- a/FactoryKernels/GB_AxB__lor_gt_int8.c +++ b/FactoryKernels/GB_AxB__lor_gt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_uint16.c b/FactoryKernels/GB_AxB__lor_gt_uint16.c index dbc2df3290..99743ff3b4 100644 --- a/FactoryKernels/GB_AxB__lor_gt_uint16.c +++ b/FactoryKernels/GB_AxB__lor_gt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_uint32.c b/FactoryKernels/GB_AxB__lor_gt_uint32.c index aca20c5cee..5bdaf7be2b 100644 --- a/FactoryKernels/GB_AxB__lor_gt_uint32.c +++ b/FactoryKernels/GB_AxB__lor_gt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_uint64.c b/FactoryKernels/GB_AxB__lor_gt_uint64.c index 520b3faa35..b40ddbfc4c 100644 --- a/FactoryKernels/GB_AxB__lor_gt_uint64.c +++ b/FactoryKernels/GB_AxB__lor_gt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_gt_uint8.c b/FactoryKernels/GB_AxB__lor_gt_uint8.c index 66edbc2094..544d22e591 100644 --- a/FactoryKernels/GB_AxB__lor_gt_uint8.c +++ b/FactoryKernels/GB_AxB__lor_gt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_gt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_land_bool.c b/FactoryKernels/GB_AxB__lor_land_bool.c index 52221bca5a..9335a93816 100644 --- a/FactoryKernels/GB_AxB__lor_land_bool.c +++ b/FactoryKernels/GB_AxB__lor_land_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_land_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_bool.c b/FactoryKernels/GB_AxB__lor_le_bool.c index 3b9a4c4357..6e504209ef 100644 --- a/FactoryKernels/GB_AxB__lor_le_bool.c +++ b/FactoryKernels/GB_AxB__lor_le_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_fp32.c b/FactoryKernels/GB_AxB__lor_le_fp32.c index d2c237db1f..723a9a9800 100644 --- a/FactoryKernels/GB_AxB__lor_le_fp32.c +++ b/FactoryKernels/GB_AxB__lor_le_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_fp64.c b/FactoryKernels/GB_AxB__lor_le_fp64.c index 4feaba3aa6..68d1552f70 100644 --- a/FactoryKernels/GB_AxB__lor_le_fp64.c +++ b/FactoryKernels/GB_AxB__lor_le_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_int16.c b/FactoryKernels/GB_AxB__lor_le_int16.c index dcd71669a2..236f7b1659 100644 --- a/FactoryKernels/GB_AxB__lor_le_int16.c +++ b/FactoryKernels/GB_AxB__lor_le_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_int32.c b/FactoryKernels/GB_AxB__lor_le_int32.c index 607d7ff10f..d371a2dc55 100644 --- a/FactoryKernels/GB_AxB__lor_le_int32.c +++ b/FactoryKernels/GB_AxB__lor_le_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_int64.c b/FactoryKernels/GB_AxB__lor_le_int64.c index f0fe8a3d1a..073552aaf5 100644 --- a/FactoryKernels/GB_AxB__lor_le_int64.c +++ b/FactoryKernels/GB_AxB__lor_le_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_int8.c b/FactoryKernels/GB_AxB__lor_le_int8.c index 6c2c8eca41..6d6bf735e5 100644 --- a/FactoryKernels/GB_AxB__lor_le_int8.c +++ b/FactoryKernels/GB_AxB__lor_le_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_uint16.c b/FactoryKernels/GB_AxB__lor_le_uint16.c index e613cfad27..cae7f3e561 100644 --- a/FactoryKernels/GB_AxB__lor_le_uint16.c +++ b/FactoryKernels/GB_AxB__lor_le_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_uint32.c b/FactoryKernels/GB_AxB__lor_le_uint32.c index ff6e8f7840..04b3067386 100644 --- a/FactoryKernels/GB_AxB__lor_le_uint32.c +++ b/FactoryKernels/GB_AxB__lor_le_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_uint64.c b/FactoryKernels/GB_AxB__lor_le_uint64.c index 537586ec2f..53fa806e3e 100644 --- a/FactoryKernels/GB_AxB__lor_le_uint64.c +++ b/FactoryKernels/GB_AxB__lor_le_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_le_uint8.c b/FactoryKernels/GB_AxB__lor_le_uint8.c index 131d6e020e..556f019f32 100644 --- a/FactoryKernels/GB_AxB__lor_le_uint8.c +++ b/FactoryKernels/GB_AxB__lor_le_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_le_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lor_bool.c b/FactoryKernels/GB_AxB__lor_lor_bool.c index f981ac8d62..555de3fe68 100644 --- a/FactoryKernels/GB_AxB__lor_lor_bool.c +++ b/FactoryKernels/GB_AxB__lor_lor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_bool.c b/FactoryKernels/GB_AxB__lor_lt_bool.c index d5e97eaeb1..13a4a4932b 100644 --- a/FactoryKernels/GB_AxB__lor_lt_bool.c +++ b/FactoryKernels/GB_AxB__lor_lt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_fp32.c b/FactoryKernels/GB_AxB__lor_lt_fp32.c index fd0e558ad2..a515e3b46c 100644 --- a/FactoryKernels/GB_AxB__lor_lt_fp32.c +++ b/FactoryKernels/GB_AxB__lor_lt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_fp64.c b/FactoryKernels/GB_AxB__lor_lt_fp64.c index 642297a1dc..08c0ee010b 100644 --- a/FactoryKernels/GB_AxB__lor_lt_fp64.c +++ b/FactoryKernels/GB_AxB__lor_lt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_int16.c b/FactoryKernels/GB_AxB__lor_lt_int16.c index 9c1ebd2974..aa1e7c85a7 100644 --- a/FactoryKernels/GB_AxB__lor_lt_int16.c +++ b/FactoryKernels/GB_AxB__lor_lt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_int32.c b/FactoryKernels/GB_AxB__lor_lt_int32.c index ac40080765..782ad7aff4 100644 --- a/FactoryKernels/GB_AxB__lor_lt_int32.c +++ b/FactoryKernels/GB_AxB__lor_lt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_int64.c b/FactoryKernels/GB_AxB__lor_lt_int64.c index 9389b643c6..04cb2cbfde 100644 --- a/FactoryKernels/GB_AxB__lor_lt_int64.c +++ b/FactoryKernels/GB_AxB__lor_lt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_int8.c b/FactoryKernels/GB_AxB__lor_lt_int8.c index 9f71437831..93aabc92c1 100644 --- a/FactoryKernels/GB_AxB__lor_lt_int8.c +++ b/FactoryKernels/GB_AxB__lor_lt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_uint16.c b/FactoryKernels/GB_AxB__lor_lt_uint16.c index 27b86dfa09..207d37ceee 100644 --- a/FactoryKernels/GB_AxB__lor_lt_uint16.c +++ b/FactoryKernels/GB_AxB__lor_lt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_uint32.c b/FactoryKernels/GB_AxB__lor_lt_uint32.c index 25aea0d7fc..d79ee0db35 100644 --- a/FactoryKernels/GB_AxB__lor_lt_uint32.c +++ b/FactoryKernels/GB_AxB__lor_lt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_uint64.c b/FactoryKernels/GB_AxB__lor_lt_uint64.c index e8ff208bfa..64ba9a7b22 100644 --- a/FactoryKernels/GB_AxB__lor_lt_uint64.c +++ b/FactoryKernels/GB_AxB__lor_lt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lt_uint8.c b/FactoryKernels/GB_AxB__lor_lt_uint8.c index 40bdf2c6a1..b6bb307a48 100644 --- a/FactoryKernels/GB_AxB__lor_lt_uint8.c +++ b/FactoryKernels/GB_AxB__lor_lt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_lxor_bool.c b/FactoryKernels/GB_AxB__lor_lxor_bool.c index 866d5b53f0..943b4ad7da 100644 --- a/FactoryKernels/GB_AxB__lor_lxor_bool.c +++ b/FactoryKernels/GB_AxB__lor_lxor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_lxor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_fp32.c b/FactoryKernels/GB_AxB__lor_ne_fp32.c index b5d4d52ce1..c77d2dc8ff 100644 --- a/FactoryKernels/GB_AxB__lor_ne_fp32.c +++ b/FactoryKernels/GB_AxB__lor_ne_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_fp64.c b/FactoryKernels/GB_AxB__lor_ne_fp64.c index 4733ed57f0..62b85e75d8 100644 --- a/FactoryKernels/GB_AxB__lor_ne_fp64.c +++ b/FactoryKernels/GB_AxB__lor_ne_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_int16.c b/FactoryKernels/GB_AxB__lor_ne_int16.c index b232e24cba..c168cfd63b 100644 --- a/FactoryKernels/GB_AxB__lor_ne_int16.c +++ b/FactoryKernels/GB_AxB__lor_ne_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_int32.c b/FactoryKernels/GB_AxB__lor_ne_int32.c index 17581f5555..adebee6a59 100644 --- a/FactoryKernels/GB_AxB__lor_ne_int32.c +++ b/FactoryKernels/GB_AxB__lor_ne_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_int64.c b/FactoryKernels/GB_AxB__lor_ne_int64.c index acc7c62127..782688017c 100644 --- a/FactoryKernels/GB_AxB__lor_ne_int64.c +++ b/FactoryKernels/GB_AxB__lor_ne_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_int8.c b/FactoryKernels/GB_AxB__lor_ne_int8.c index ae304ac6b0..5a068f3fd0 100644 --- a/FactoryKernels/GB_AxB__lor_ne_int8.c +++ b/FactoryKernels/GB_AxB__lor_ne_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_uint16.c b/FactoryKernels/GB_AxB__lor_ne_uint16.c index e5b973b3c3..efd54ee9ca 100644 --- a/FactoryKernels/GB_AxB__lor_ne_uint16.c +++ b/FactoryKernels/GB_AxB__lor_ne_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_uint32.c b/FactoryKernels/GB_AxB__lor_ne_uint32.c index 418a04a931..fb1d0a727e 100644 --- a/FactoryKernels/GB_AxB__lor_ne_uint32.c +++ b/FactoryKernels/GB_AxB__lor_ne_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_uint64.c b/FactoryKernels/GB_AxB__lor_ne_uint64.c index 48cf7ab1de..62c0271884 100644 --- a/FactoryKernels/GB_AxB__lor_ne_uint64.c +++ b/FactoryKernels/GB_AxB__lor_ne_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_ne_uint8.c b/FactoryKernels/GB_AxB__lor_ne_uint8.c index 517bd2e4e4..9d3223c572 100644 --- a/FactoryKernels/GB_AxB__lor_ne_uint8.c +++ b/FactoryKernels/GB_AxB__lor_ne_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_ne_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lor_second_bool.c b/FactoryKernels/GB_AxB__lor_second_bool.c index e9ec38e769..be999680e7 100644 --- a/FactoryKernels/GB_AxB__lor_second_bool.c +++ b/FactoryKernels/GB_AxB__lor_second_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__lor_second_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_bool.c b/FactoryKernels/GB_AxB__lxor_eq_bool.c index c0f7741d31..0875c446b5 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_bool.c +++ b/FactoryKernels/GB_AxB__lxor_eq_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_fp32.c b/FactoryKernels/GB_AxB__lxor_eq_fp32.c index 9b012ad7ca..163f841ba5 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_fp32.c +++ b/FactoryKernels/GB_AxB__lxor_eq_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_fp64.c b/FactoryKernels/GB_AxB__lxor_eq_fp64.c index 59b816e4fd..63f5ed05e0 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_fp64.c +++ b/FactoryKernels/GB_AxB__lxor_eq_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_int16.c b/FactoryKernels/GB_AxB__lxor_eq_int16.c index 9d2f90a12a..208206fb86 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_int16.c +++ b/FactoryKernels/GB_AxB__lxor_eq_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_int32.c b/FactoryKernels/GB_AxB__lxor_eq_int32.c index 58d738fc68..9d517d72f6 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_int32.c +++ b/FactoryKernels/GB_AxB__lxor_eq_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_int64.c b/FactoryKernels/GB_AxB__lxor_eq_int64.c index f15d5f3c6f..de03a502f0 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_int64.c +++ b/FactoryKernels/GB_AxB__lxor_eq_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_int8.c b/FactoryKernels/GB_AxB__lxor_eq_int8.c index 3072f1d1b4..11fa66cd93 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_int8.c +++ b/FactoryKernels/GB_AxB__lxor_eq_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_uint16.c b/FactoryKernels/GB_AxB__lxor_eq_uint16.c index c9fc27b849..2d6afce8e8 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_uint16.c +++ b/FactoryKernels/GB_AxB__lxor_eq_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_uint32.c b/FactoryKernels/GB_AxB__lxor_eq_uint32.c index e6db83e8f5..db2629d666 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_uint32.c +++ b/FactoryKernels/GB_AxB__lxor_eq_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_uint64.c b/FactoryKernels/GB_AxB__lxor_eq_uint64.c index 176368f4de..a098835c08 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_uint64.c +++ b/FactoryKernels/GB_AxB__lxor_eq_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_eq_uint8.c b/FactoryKernels/GB_AxB__lxor_eq_uint8.c index 541af0b01c..207daeeceb 100644 --- a/FactoryKernels/GB_AxB__lxor_eq_uint8.c +++ b/FactoryKernels/GB_AxB__lxor_eq_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_eq_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_first_bool.c b/FactoryKernels/GB_AxB__lxor_first_bool.c index 691a86ff83..2181534dd9 100644 --- a/FactoryKernels/GB_AxB__lxor_first_bool.c +++ b/FactoryKernels/GB_AxB__lxor_first_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__lxor_first_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_bool.c b/FactoryKernels/GB_AxB__lxor_ge_bool.c index 72866df8fe..fc16363f80 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_bool.c +++ b/FactoryKernels/GB_AxB__lxor_ge_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_fp32.c b/FactoryKernels/GB_AxB__lxor_ge_fp32.c index 9025b81e2f..a829941a27 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_fp32.c +++ b/FactoryKernels/GB_AxB__lxor_ge_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_fp64.c b/FactoryKernels/GB_AxB__lxor_ge_fp64.c index 9faf6a79a2..1131720485 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_fp64.c +++ b/FactoryKernels/GB_AxB__lxor_ge_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_int16.c b/FactoryKernels/GB_AxB__lxor_ge_int16.c index 1a85b8c319..0e6fb7909c 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_int16.c +++ b/FactoryKernels/GB_AxB__lxor_ge_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_int32.c b/FactoryKernels/GB_AxB__lxor_ge_int32.c index cbd9301629..b629ae77aa 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_int32.c +++ b/FactoryKernels/GB_AxB__lxor_ge_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_int64.c b/FactoryKernels/GB_AxB__lxor_ge_int64.c index 719a619d49..a4d2775a63 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_int64.c +++ b/FactoryKernels/GB_AxB__lxor_ge_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_int8.c b/FactoryKernels/GB_AxB__lxor_ge_int8.c index ee38f6588e..299578cd1a 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_int8.c +++ b/FactoryKernels/GB_AxB__lxor_ge_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_uint16.c b/FactoryKernels/GB_AxB__lxor_ge_uint16.c index eb6746fbf5..35c33547fa 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_uint16.c +++ b/FactoryKernels/GB_AxB__lxor_ge_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_uint32.c b/FactoryKernels/GB_AxB__lxor_ge_uint32.c index a8bee7f5bc..17c15d56df 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_uint32.c +++ b/FactoryKernels/GB_AxB__lxor_ge_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_uint64.c b/FactoryKernels/GB_AxB__lxor_ge_uint64.c index ab34610565..03345e34e4 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_uint64.c +++ b/FactoryKernels/GB_AxB__lxor_ge_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ge_uint8.c b/FactoryKernels/GB_AxB__lxor_ge_uint8.c index 8d918a788b..224e0e76e1 100644 --- a/FactoryKernels/GB_AxB__lxor_ge_uint8.c +++ b/FactoryKernels/GB_AxB__lxor_ge_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ge_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_bool.c b/FactoryKernels/GB_AxB__lxor_gt_bool.c index 6d4e03b8b6..8f1168beab 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_bool.c +++ b/FactoryKernels/GB_AxB__lxor_gt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_fp32.c b/FactoryKernels/GB_AxB__lxor_gt_fp32.c index 8468330ef3..3959f7c2fd 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_fp32.c +++ b/FactoryKernels/GB_AxB__lxor_gt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_fp64.c b/FactoryKernels/GB_AxB__lxor_gt_fp64.c index edf21565c0..43a97cf900 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_fp64.c +++ b/FactoryKernels/GB_AxB__lxor_gt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_int16.c b/FactoryKernels/GB_AxB__lxor_gt_int16.c index 3f4cbbaf00..129c644728 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_int16.c +++ b/FactoryKernels/GB_AxB__lxor_gt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_int32.c b/FactoryKernels/GB_AxB__lxor_gt_int32.c index 9359ba1538..538f250ff1 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_int32.c +++ b/FactoryKernels/GB_AxB__lxor_gt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_int64.c b/FactoryKernels/GB_AxB__lxor_gt_int64.c index c61c246003..d708fd3132 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_int64.c +++ b/FactoryKernels/GB_AxB__lxor_gt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_int8.c b/FactoryKernels/GB_AxB__lxor_gt_int8.c index d041de8e22..b6dafec9c6 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_int8.c +++ b/FactoryKernels/GB_AxB__lxor_gt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_uint16.c b/FactoryKernels/GB_AxB__lxor_gt_uint16.c index e4e19698b6..63e99a5cac 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_uint16.c +++ b/FactoryKernels/GB_AxB__lxor_gt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_uint32.c b/FactoryKernels/GB_AxB__lxor_gt_uint32.c index 9c18cf2edc..0db8e0b13a 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_uint32.c +++ b/FactoryKernels/GB_AxB__lxor_gt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_uint64.c b/FactoryKernels/GB_AxB__lxor_gt_uint64.c index 4ab3121246..d48833dda2 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_uint64.c +++ b/FactoryKernels/GB_AxB__lxor_gt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_gt_uint8.c b/FactoryKernels/GB_AxB__lxor_gt_uint8.c index 5ed5ecb9d7..bc9e1f325f 100644 --- a/FactoryKernels/GB_AxB__lxor_gt_uint8.c +++ b/FactoryKernels/GB_AxB__lxor_gt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_gt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_land_bool.c b/FactoryKernels/GB_AxB__lxor_land_bool.c index 252e6449b0..02801168bc 100644 --- a/FactoryKernels/GB_AxB__lxor_land_bool.c +++ b/FactoryKernels/GB_AxB__lxor_land_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_land_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_bool.c b/FactoryKernels/GB_AxB__lxor_le_bool.c index 68f8df94d5..9882dc23cf 100644 --- a/FactoryKernels/GB_AxB__lxor_le_bool.c +++ b/FactoryKernels/GB_AxB__lxor_le_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_fp32.c b/FactoryKernels/GB_AxB__lxor_le_fp32.c index a4a46a001d..47add980c4 100644 --- a/FactoryKernels/GB_AxB__lxor_le_fp32.c +++ b/FactoryKernels/GB_AxB__lxor_le_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_fp64.c b/FactoryKernels/GB_AxB__lxor_le_fp64.c index f5e3b0e27d..0e0a72440b 100644 --- a/FactoryKernels/GB_AxB__lxor_le_fp64.c +++ b/FactoryKernels/GB_AxB__lxor_le_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_int16.c b/FactoryKernels/GB_AxB__lxor_le_int16.c index 46c114c030..554f13c5b8 100644 --- a/FactoryKernels/GB_AxB__lxor_le_int16.c +++ b/FactoryKernels/GB_AxB__lxor_le_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_int32.c b/FactoryKernels/GB_AxB__lxor_le_int32.c index a29b310978..5f7cf99d08 100644 --- a/FactoryKernels/GB_AxB__lxor_le_int32.c +++ b/FactoryKernels/GB_AxB__lxor_le_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_int64.c b/FactoryKernels/GB_AxB__lxor_le_int64.c index 4785a3874d..92a227b2a3 100644 --- a/FactoryKernels/GB_AxB__lxor_le_int64.c +++ b/FactoryKernels/GB_AxB__lxor_le_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_int8.c b/FactoryKernels/GB_AxB__lxor_le_int8.c index 6f6574bc50..0d641f391e 100644 --- a/FactoryKernels/GB_AxB__lxor_le_int8.c +++ b/FactoryKernels/GB_AxB__lxor_le_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_uint16.c b/FactoryKernels/GB_AxB__lxor_le_uint16.c index dd67424603..1ff58b6235 100644 --- a/FactoryKernels/GB_AxB__lxor_le_uint16.c +++ b/FactoryKernels/GB_AxB__lxor_le_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_uint32.c b/FactoryKernels/GB_AxB__lxor_le_uint32.c index 66403998bc..73785498db 100644 --- a/FactoryKernels/GB_AxB__lxor_le_uint32.c +++ b/FactoryKernels/GB_AxB__lxor_le_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_uint64.c b/FactoryKernels/GB_AxB__lxor_le_uint64.c index 6503984ebc..7b1c1506dd 100644 --- a/FactoryKernels/GB_AxB__lxor_le_uint64.c +++ b/FactoryKernels/GB_AxB__lxor_le_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_le_uint8.c b/FactoryKernels/GB_AxB__lxor_le_uint8.c index 502ca7ded8..d99cfb1d1b 100644 --- a/FactoryKernels/GB_AxB__lxor_le_uint8.c +++ b/FactoryKernels/GB_AxB__lxor_le_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_le_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lor_bool.c b/FactoryKernels/GB_AxB__lxor_lor_bool.c index e26503cbfa..2626d5de31 100644 --- a/FactoryKernels/GB_AxB__lxor_lor_bool.c +++ b/FactoryKernels/GB_AxB__lxor_lor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_bool.c b/FactoryKernels/GB_AxB__lxor_lt_bool.c index b0ef9f97f3..606037b93b 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_bool.c +++ b/FactoryKernels/GB_AxB__lxor_lt_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_fp32.c b/FactoryKernels/GB_AxB__lxor_lt_fp32.c index e5191eea4f..7e9998eea0 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_fp32.c +++ b/FactoryKernels/GB_AxB__lxor_lt_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_fp64.c b/FactoryKernels/GB_AxB__lxor_lt_fp64.c index cfc37665b0..2c912e8367 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_fp64.c +++ b/FactoryKernels/GB_AxB__lxor_lt_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_int16.c b/FactoryKernels/GB_AxB__lxor_lt_int16.c index 2650a2d618..99380e2d65 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_int16.c +++ b/FactoryKernels/GB_AxB__lxor_lt_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_int32.c b/FactoryKernels/GB_AxB__lxor_lt_int32.c index 8fa594441e..250c4b179d 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_int32.c +++ b/FactoryKernels/GB_AxB__lxor_lt_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_int64.c b/FactoryKernels/GB_AxB__lxor_lt_int64.c index c4ee865c0a..c602de9369 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_int64.c +++ b/FactoryKernels/GB_AxB__lxor_lt_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_int8.c b/FactoryKernels/GB_AxB__lxor_lt_int8.c index f687f71c8b..a990dcc529 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_int8.c +++ b/FactoryKernels/GB_AxB__lxor_lt_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_uint16.c b/FactoryKernels/GB_AxB__lxor_lt_uint16.c index fb4e4b6836..ff8e274b01 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_uint16.c +++ b/FactoryKernels/GB_AxB__lxor_lt_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_uint32.c b/FactoryKernels/GB_AxB__lxor_lt_uint32.c index aeee25412f..ceaa5d9950 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_uint32.c +++ b/FactoryKernels/GB_AxB__lxor_lt_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_uint64.c b/FactoryKernels/GB_AxB__lxor_lt_uint64.c index 549d9a3124..9d624853d6 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_uint64.c +++ b/FactoryKernels/GB_AxB__lxor_lt_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lt_uint8.c b/FactoryKernels/GB_AxB__lxor_lt_uint8.c index 63b74723a4..1e52e17f38 100644 --- a/FactoryKernels/GB_AxB__lxor_lt_uint8.c +++ b/FactoryKernels/GB_AxB__lxor_lt_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lt_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_lxor_bool.c b/FactoryKernels/GB_AxB__lxor_lxor_bool.c index e0ddc68ecd..9d7a55f87b 100644 --- a/FactoryKernels/GB_AxB__lxor_lxor_bool.c +++ b/FactoryKernels/GB_AxB__lxor_lxor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_lxor_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_fp32.c b/FactoryKernels/GB_AxB__lxor_ne_fp32.c index 9d09abccbd..1de1b596a7 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_fp32.c +++ b/FactoryKernels/GB_AxB__lxor_ne_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_fp64.c b/FactoryKernels/GB_AxB__lxor_ne_fp64.c index f3b16dcdc2..d5056bbb6d 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_fp64.c +++ b/FactoryKernels/GB_AxB__lxor_ne_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_int16.c b/FactoryKernels/GB_AxB__lxor_ne_int16.c index 447eeba93c..b79ad3f5b9 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_int16.c +++ b/FactoryKernels/GB_AxB__lxor_ne_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_int32.c b/FactoryKernels/GB_AxB__lxor_ne_int32.c index d489109742..15ef91b6d1 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_int32.c +++ b/FactoryKernels/GB_AxB__lxor_ne_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_int64.c b/FactoryKernels/GB_AxB__lxor_ne_int64.c index 6e95ac6ed3..e85bfb0aa8 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_int64.c +++ b/FactoryKernels/GB_AxB__lxor_ne_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_int8.c b/FactoryKernels/GB_AxB__lxor_ne_int8.c index d0c4ba35fd..a7ecbb42ef 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_int8.c +++ b/FactoryKernels/GB_AxB__lxor_ne_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_uint16.c b/FactoryKernels/GB_AxB__lxor_ne_uint16.c index 876817fca6..f70c8968c9 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_uint16.c +++ b/FactoryKernels/GB_AxB__lxor_ne_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_uint32.c b/FactoryKernels/GB_AxB__lxor_ne_uint32.c index 5f06f93a4f..9c555114a0 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_uint32.c +++ b/FactoryKernels/GB_AxB__lxor_ne_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_uint64.c b/FactoryKernels/GB_AxB__lxor_ne_uint64.c index 1352d54bdd..c6e9838181 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_uint64.c +++ b/FactoryKernels/GB_AxB__lxor_ne_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_ne_uint8.c b/FactoryKernels/GB_AxB__lxor_ne_uint8.c index 821ad17d3f..4576c917e2 100644 --- a/FactoryKernels/GB_AxB__lxor_ne_uint8.c +++ b/FactoryKernels/GB_AxB__lxor_ne_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_ne_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_pair_bool.c b/FactoryKernels/GB_AxB__lxor_pair_bool.c index 40de7ead7d..44ad7fec0d 100644 --- a/FactoryKernels/GB_AxB__lxor_pair_bool.c +++ b/FactoryKernels/GB_AxB__lxor_pair_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__lxor_pair_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__lxor_second_bool.c b/FactoryKernels/GB_AxB__lxor_second_bool.c index d70b85afd6..e52779a680 100644 --- a/FactoryKernels/GB_AxB__lxor_second_bool.c +++ b/FactoryKernels/GB_AxB__lxor_second_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__lxor_second_bool) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_fp32.c b/FactoryKernels/GB_AxB__max_div_fp32.c index 15b117a200..29210b0b66 100644 --- a/FactoryKernels/GB_AxB__max_div_fp32.c +++ b/FactoryKernels/GB_AxB__max_div_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_div_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_fp64.c b/FactoryKernels/GB_AxB__max_div_fp64.c index 9e928b370c..160fd2884d 100644 --- a/FactoryKernels/GB_AxB__max_div_fp64.c +++ b/FactoryKernels/GB_AxB__max_div_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_div_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_int16.c b/FactoryKernels/GB_AxB__max_div_int16.c index b0d3ec6102..aded75447f 100644 --- a/FactoryKernels/GB_AxB__max_div_int16.c +++ b/FactoryKernels/GB_AxB__max_div_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_div_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_int32.c b/FactoryKernels/GB_AxB__max_div_int32.c index 9382d1985c..8e8a79549d 100644 --- a/FactoryKernels/GB_AxB__max_div_int32.c +++ b/FactoryKernels/GB_AxB__max_div_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_div_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_int64.c b/FactoryKernels/GB_AxB__max_div_int64.c index 31a348c546..6aae1e4683 100644 --- a/FactoryKernels/GB_AxB__max_div_int64.c +++ b/FactoryKernels/GB_AxB__max_div_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_div_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_int8.c b/FactoryKernels/GB_AxB__max_div_int8.c index a97fbde36c..5616c6f34d 100644 --- a/FactoryKernels/GB_AxB__max_div_int8.c +++ b/FactoryKernels/GB_AxB__max_div_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_div_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_uint16.c b/FactoryKernels/GB_AxB__max_div_uint16.c index 5347e5d999..ea7c0ad44b 100644 --- a/FactoryKernels/GB_AxB__max_div_uint16.c +++ b/FactoryKernels/GB_AxB__max_div_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_div_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_uint32.c b/FactoryKernels/GB_AxB__max_div_uint32.c index b1e10dec59..c89c60ce85 100644 --- a/FactoryKernels/GB_AxB__max_div_uint32.c +++ b/FactoryKernels/GB_AxB__max_div_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_div_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_uint64.c b/FactoryKernels/GB_AxB__max_div_uint64.c index 8d833e3e26..af8737a5d4 100644 --- a/FactoryKernels/GB_AxB__max_div_uint64.c +++ b/FactoryKernels/GB_AxB__max_div_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_div_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_div_uint8.c b/FactoryKernels/GB_AxB__max_div_uint8.c index 1c57d5abc7..6a13fecd90 100644 --- a/FactoryKernels/GB_AxB__max_div_uint8.c +++ b/FactoryKernels/GB_AxB__max_div_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_div_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_fp32.c b/FactoryKernels/GB_AxB__max_first_fp32.c index 3c7a1fd5f7..30580322a3 100644 --- a/FactoryKernels/GB_AxB__max_first_fp32.c +++ b/FactoryKernels/GB_AxB__max_first_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__max_first_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_fp64.c b/FactoryKernels/GB_AxB__max_first_fp64.c index 344417af0c..6ae4d744a3 100644 --- a/FactoryKernels/GB_AxB__max_first_fp64.c +++ b/FactoryKernels/GB_AxB__max_first_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__max_first_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_int16.c b/FactoryKernels/GB_AxB__max_first_int16.c index 94c246212d..97c183e7a5 100644 --- a/FactoryKernels/GB_AxB__max_first_int16.c +++ b/FactoryKernels/GB_AxB__max_first_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_first_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_int32.c b/FactoryKernels/GB_AxB__max_first_int32.c index b66c6a5f66..44ba5d8533 100644 --- a/FactoryKernels/GB_AxB__max_first_int32.c +++ b/FactoryKernels/GB_AxB__max_first_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_first_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_int64.c b/FactoryKernels/GB_AxB__max_first_int64.c index 04dfc5ce7c..eaff231bbe 100644 --- a/FactoryKernels/GB_AxB__max_first_int64.c +++ b/FactoryKernels/GB_AxB__max_first_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_first_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_int8.c b/FactoryKernels/GB_AxB__max_first_int8.c index 0ce73fc39e..eb153ecaf3 100644 --- a/FactoryKernels/GB_AxB__max_first_int8.c +++ b/FactoryKernels/GB_AxB__max_first_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_first_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_uint16.c b/FactoryKernels/GB_AxB__max_first_uint16.c index 279d1e0b77..90864160c8 100644 --- a/FactoryKernels/GB_AxB__max_first_uint16.c +++ b/FactoryKernels/GB_AxB__max_first_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_first_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_uint32.c b/FactoryKernels/GB_AxB__max_first_uint32.c index 24eeac6830..a4ad5fa6c5 100644 --- a/FactoryKernels/GB_AxB__max_first_uint32.c +++ b/FactoryKernels/GB_AxB__max_first_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_first_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_uint64.c b/FactoryKernels/GB_AxB__max_first_uint64.c index 00ee1cedc7..ca4b5a6e98 100644 --- a/FactoryKernels/GB_AxB__max_first_uint64.c +++ b/FactoryKernels/GB_AxB__max_first_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -461,3 +468,5 @@ GrB_Info GB (_Asaxpy3B__max_first_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_first_uint8.c b/FactoryKernels/GB_AxB__max_first_uint8.c index 648adaa9ab..203aa55936 100644 --- a/FactoryKernels/GB_AxB__max_first_uint8.c +++ b/FactoryKernels/GB_AxB__max_first_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_first_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_firsti1_int32.c b/FactoryKernels/GB_AxB__max_firsti1_int32.c index fcf0ab2a81..338ce5e22d 100644 --- a/FactoryKernels/GB_AxB__max_firsti1_int32.c +++ b/FactoryKernels/GB_AxB__max_firsti1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__max_firsti1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_firsti1_int64.c b/FactoryKernels/GB_AxB__max_firsti1_int64.c index f772a473b0..6225ab20db 100644 --- a/FactoryKernels/GB_AxB__max_firsti1_int64.c +++ b/FactoryKernels/GB_AxB__max_firsti1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_firsti1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_firsti_int32.c b/FactoryKernels/GB_AxB__max_firsti_int32.c index c5c8652dbc..328aa6eb2e 100644 --- a/FactoryKernels/GB_AxB__max_firsti_int32.c +++ b/FactoryKernels/GB_AxB__max_firsti_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__max_firsti_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_firsti_int64.c b/FactoryKernels/GB_AxB__max_firsti_int64.c index 9371cecfcd..c2eefeece6 100644 --- a/FactoryKernels/GB_AxB__max_firsti_int64.c +++ b/FactoryKernels/GB_AxB__max_firsti_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_firsti_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_firstj1_int32.c b/FactoryKernels/GB_AxB__max_firstj1_int32.c index cfba5aa541..a57e3727f6 100644 --- a/FactoryKernels/GB_AxB__max_firstj1_int32.c +++ b/FactoryKernels/GB_AxB__max_firstj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_firstj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_firstj1_int64.c b/FactoryKernels/GB_AxB__max_firstj1_int64.c index 30df9a94c8..8284813b65 100644 --- a/FactoryKernels/GB_AxB__max_firstj1_int64.c +++ b/FactoryKernels/GB_AxB__max_firstj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -461,3 +468,5 @@ GrB_Info GB (_Asaxpy3B__max_firstj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_firstj_int32.c b/FactoryKernels/GB_AxB__max_firstj_int32.c index 29a4890155..5bc7030795 100644 --- a/FactoryKernels/GB_AxB__max_firstj_int32.c +++ b/FactoryKernels/GB_AxB__max_firstj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_firstj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_firstj_int64.c b/FactoryKernels/GB_AxB__max_firstj_int64.c index 70ce0b388b..b4fed100e5 100644 --- a/FactoryKernels/GB_AxB__max_firstj_int64.c +++ b/FactoryKernels/GB_AxB__max_firstj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_firstj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_fp32.c b/FactoryKernels/GB_AxB__max_max_fp32.c index 35334c5f68..c45c3fbc42 100644 --- a/FactoryKernels/GB_AxB__max_max_fp32.c +++ b/FactoryKernels/GB_AxB__max_max_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_max_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_fp64.c b/FactoryKernels/GB_AxB__max_max_fp64.c index a9dfb27d64..ba82bb07fa 100644 --- a/FactoryKernels/GB_AxB__max_max_fp64.c +++ b/FactoryKernels/GB_AxB__max_max_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_max_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_int16.c b/FactoryKernels/GB_AxB__max_max_int16.c index 09c5a74edd..cbb8f10ef6 100644 --- a/FactoryKernels/GB_AxB__max_max_int16.c +++ b/FactoryKernels/GB_AxB__max_max_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_max_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_int32.c b/FactoryKernels/GB_AxB__max_max_int32.c index 5dd42825c9..4e957daa80 100644 --- a/FactoryKernels/GB_AxB__max_max_int32.c +++ b/FactoryKernels/GB_AxB__max_max_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_max_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_int64.c b/FactoryKernels/GB_AxB__max_max_int64.c index 20ee1cb964..46fec35377 100644 --- a/FactoryKernels/GB_AxB__max_max_int64.c +++ b/FactoryKernels/GB_AxB__max_max_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_max_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_int8.c b/FactoryKernels/GB_AxB__max_max_int8.c index 7e546547cc..c73b057b8f 100644 --- a/FactoryKernels/GB_AxB__max_max_int8.c +++ b/FactoryKernels/GB_AxB__max_max_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_max_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_uint16.c b/FactoryKernels/GB_AxB__max_max_uint16.c index e294bdcbf3..8045eab1c9 100644 --- a/FactoryKernels/GB_AxB__max_max_uint16.c +++ b/FactoryKernels/GB_AxB__max_max_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_max_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_uint32.c b/FactoryKernels/GB_AxB__max_max_uint32.c index ff2868ffad..a9eacda86d 100644 --- a/FactoryKernels/GB_AxB__max_max_uint32.c +++ b/FactoryKernels/GB_AxB__max_max_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_max_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_uint64.c b/FactoryKernels/GB_AxB__max_max_uint64.c index 8f993049ad..5cdb7c4b5a 100644 --- a/FactoryKernels/GB_AxB__max_max_uint64.c +++ b/FactoryKernels/GB_AxB__max_max_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_max_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_max_uint8.c b/FactoryKernels/GB_AxB__max_max_uint8.c index 9933dc04da..20a4738ced 100644 --- a/FactoryKernels/GB_AxB__max_max_uint8.c +++ b/FactoryKernels/GB_AxB__max_max_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_max_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_fp32.c b/FactoryKernels/GB_AxB__max_min_fp32.c index fdce666577..aa3e749e6d 100644 --- a/FactoryKernels/GB_AxB__max_min_fp32.c +++ b/FactoryKernels/GB_AxB__max_min_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_min_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_fp64.c b/FactoryKernels/GB_AxB__max_min_fp64.c index 3d9a40e611..d40bcd38bb 100644 --- a/FactoryKernels/GB_AxB__max_min_fp64.c +++ b/FactoryKernels/GB_AxB__max_min_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_min_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_int16.c b/FactoryKernels/GB_AxB__max_min_int16.c index 4ffe690383..f1bae22233 100644 --- a/FactoryKernels/GB_AxB__max_min_int16.c +++ b/FactoryKernels/GB_AxB__max_min_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_min_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_int32.c b/FactoryKernels/GB_AxB__max_min_int32.c index 2b3260861e..8c894e5809 100644 --- a/FactoryKernels/GB_AxB__max_min_int32.c +++ b/FactoryKernels/GB_AxB__max_min_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_min_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_int64.c b/FactoryKernels/GB_AxB__max_min_int64.c index 113b48d3ee..701cfcac76 100644 --- a/FactoryKernels/GB_AxB__max_min_int64.c +++ b/FactoryKernels/GB_AxB__max_min_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_min_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_int8.c b/FactoryKernels/GB_AxB__max_min_int8.c index 18e8b22432..f67f87d681 100644 --- a/FactoryKernels/GB_AxB__max_min_int8.c +++ b/FactoryKernels/GB_AxB__max_min_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_min_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_uint16.c b/FactoryKernels/GB_AxB__max_min_uint16.c index a76506cdb5..422461883f 100644 --- a/FactoryKernels/GB_AxB__max_min_uint16.c +++ b/FactoryKernels/GB_AxB__max_min_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_min_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_uint32.c b/FactoryKernels/GB_AxB__max_min_uint32.c index 104f3bb478..77df58efd7 100644 --- a/FactoryKernels/GB_AxB__max_min_uint32.c +++ b/FactoryKernels/GB_AxB__max_min_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_min_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_uint64.c b/FactoryKernels/GB_AxB__max_min_uint64.c index b5b7a1ee8a..91ecef7c81 100644 --- a/FactoryKernels/GB_AxB__max_min_uint64.c +++ b/FactoryKernels/GB_AxB__max_min_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_min_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_min_uint8.c b/FactoryKernels/GB_AxB__max_min_uint8.c index c4a5dfc1e8..b9cade61b9 100644 --- a/FactoryKernels/GB_AxB__max_min_uint8.c +++ b/FactoryKernels/GB_AxB__max_min_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_min_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_fp32.c b/FactoryKernels/GB_AxB__max_minus_fp32.c index c74a465918..8dc77f41cc 100644 --- a/FactoryKernels/GB_AxB__max_minus_fp32.c +++ b/FactoryKernels/GB_AxB__max_minus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_fp64.c b/FactoryKernels/GB_AxB__max_minus_fp64.c index c3c3a1d8ca..b40107cbd8 100644 --- a/FactoryKernels/GB_AxB__max_minus_fp64.c +++ b/FactoryKernels/GB_AxB__max_minus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_int16.c b/FactoryKernels/GB_AxB__max_minus_int16.c index c7df2755b0..e0cf1e90cf 100644 --- a/FactoryKernels/GB_AxB__max_minus_int16.c +++ b/FactoryKernels/GB_AxB__max_minus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_int32.c b/FactoryKernels/GB_AxB__max_minus_int32.c index 96e939360b..8ab096d9d8 100644 --- a/FactoryKernels/GB_AxB__max_minus_int32.c +++ b/FactoryKernels/GB_AxB__max_minus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_int64.c b/FactoryKernels/GB_AxB__max_minus_int64.c index f8766d5cc0..02f214c7c5 100644 --- a/FactoryKernels/GB_AxB__max_minus_int64.c +++ b/FactoryKernels/GB_AxB__max_minus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_int8.c b/FactoryKernels/GB_AxB__max_minus_int8.c index 7c2e64b8b8..6c8ad8fe59 100644 --- a/FactoryKernels/GB_AxB__max_minus_int8.c +++ b/FactoryKernels/GB_AxB__max_minus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_uint16.c b/FactoryKernels/GB_AxB__max_minus_uint16.c index 47fccbd81a..65e4982cee 100644 --- a/FactoryKernels/GB_AxB__max_minus_uint16.c +++ b/FactoryKernels/GB_AxB__max_minus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_uint32.c b/FactoryKernels/GB_AxB__max_minus_uint32.c index b2999e0f14..da0b5ec3ea 100644 --- a/FactoryKernels/GB_AxB__max_minus_uint32.c +++ b/FactoryKernels/GB_AxB__max_minus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_uint64.c b/FactoryKernels/GB_AxB__max_minus_uint64.c index 8038196e42..7f49d4fd3a 100644 --- a/FactoryKernels/GB_AxB__max_minus_uint64.c +++ b/FactoryKernels/GB_AxB__max_minus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_minus_uint8.c b/FactoryKernels/GB_AxB__max_minus_uint8.c index baa87e3de4..514b223f06 100644 --- a/FactoryKernels/GB_AxB__max_minus_uint8.c +++ b/FactoryKernels/GB_AxB__max_minus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_minus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_fp32.c b/FactoryKernels/GB_AxB__max_plus_fp32.c index b47638b2ae..fecbd8c4f0 100644 --- a/FactoryKernels/GB_AxB__max_plus_fp32.c +++ b/FactoryKernels/GB_AxB__max_plus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_fp64.c b/FactoryKernels/GB_AxB__max_plus_fp64.c index 61289597ec..5b0a3cb9a8 100644 --- a/FactoryKernels/GB_AxB__max_plus_fp64.c +++ b/FactoryKernels/GB_AxB__max_plus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_int16.c b/FactoryKernels/GB_AxB__max_plus_int16.c index 7d7056f031..23a1eb20ef 100644 --- a/FactoryKernels/GB_AxB__max_plus_int16.c +++ b/FactoryKernels/GB_AxB__max_plus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_int32.c b/FactoryKernels/GB_AxB__max_plus_int32.c index 9365c7e53d..a142b1f6b4 100644 --- a/FactoryKernels/GB_AxB__max_plus_int32.c +++ b/FactoryKernels/GB_AxB__max_plus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_int64.c b/FactoryKernels/GB_AxB__max_plus_int64.c index cb7540edb1..6c71c0c72e 100644 --- a/FactoryKernels/GB_AxB__max_plus_int64.c +++ b/FactoryKernels/GB_AxB__max_plus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_int8.c b/FactoryKernels/GB_AxB__max_plus_int8.c index a5d5f070c7..5a92e15f49 100644 --- a/FactoryKernels/GB_AxB__max_plus_int8.c +++ b/FactoryKernels/GB_AxB__max_plus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_uint16.c b/FactoryKernels/GB_AxB__max_plus_uint16.c index 400cdfe6b0..e099976e65 100644 --- a/FactoryKernels/GB_AxB__max_plus_uint16.c +++ b/FactoryKernels/GB_AxB__max_plus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_uint32.c b/FactoryKernels/GB_AxB__max_plus_uint32.c index 33e8a7a2fd..5ff1e1dd11 100644 --- a/FactoryKernels/GB_AxB__max_plus_uint32.c +++ b/FactoryKernels/GB_AxB__max_plus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_uint64.c b/FactoryKernels/GB_AxB__max_plus_uint64.c index 7f47ddb20d..21e2767d6c 100644 --- a/FactoryKernels/GB_AxB__max_plus_uint64.c +++ b/FactoryKernels/GB_AxB__max_plus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_plus_uint8.c b/FactoryKernels/GB_AxB__max_plus_uint8.c index 559a7a11e4..3874e56f4c 100644 --- a/FactoryKernels/GB_AxB__max_plus_uint8.c +++ b/FactoryKernels/GB_AxB__max_plus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_plus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_fp32.c b/FactoryKernels/GB_AxB__max_rdiv_fp32.c index 47e496f521..624d6a07b2 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_fp32.c +++ b/FactoryKernels/GB_AxB__max_rdiv_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_fp64.c b/FactoryKernels/GB_AxB__max_rdiv_fp64.c index 8c9287f744..7013503320 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_fp64.c +++ b/FactoryKernels/GB_AxB__max_rdiv_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_int16.c b/FactoryKernels/GB_AxB__max_rdiv_int16.c index 19aeb3034b..561629ebbd 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_int16.c +++ b/FactoryKernels/GB_AxB__max_rdiv_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_int32.c b/FactoryKernels/GB_AxB__max_rdiv_int32.c index 1f0be5c64c..d26e479368 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_int32.c +++ b/FactoryKernels/GB_AxB__max_rdiv_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_int64.c b/FactoryKernels/GB_AxB__max_rdiv_int64.c index f747e11fa2..fd731ebd78 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_int64.c +++ b/FactoryKernels/GB_AxB__max_rdiv_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_int8.c b/FactoryKernels/GB_AxB__max_rdiv_int8.c index 580e37b631..6929d47f6e 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_int8.c +++ b/FactoryKernels/GB_AxB__max_rdiv_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_uint16.c b/FactoryKernels/GB_AxB__max_rdiv_uint16.c index 0db9925cf4..26d1c8a260 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_uint16.c +++ b/FactoryKernels/GB_AxB__max_rdiv_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_uint32.c b/FactoryKernels/GB_AxB__max_rdiv_uint32.c index 7bbe0ed285..024c716ed6 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_uint32.c +++ b/FactoryKernels/GB_AxB__max_rdiv_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_uint64.c b/FactoryKernels/GB_AxB__max_rdiv_uint64.c index 41d9133ee2..41cdea448d 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_uint64.c +++ b/FactoryKernels/GB_AxB__max_rdiv_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rdiv_uint8.c b/FactoryKernels/GB_AxB__max_rdiv_uint8.c index c3fdc430bc..8d5b6a1f43 100644 --- a/FactoryKernels/GB_AxB__max_rdiv_uint8.c +++ b/FactoryKernels/GB_AxB__max_rdiv_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_rdiv_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_fp32.c b/FactoryKernels/GB_AxB__max_rminus_fp32.c index 4ce1abded3..d71ead7172 100644 --- a/FactoryKernels/GB_AxB__max_rminus_fp32.c +++ b/FactoryKernels/GB_AxB__max_rminus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_fp64.c b/FactoryKernels/GB_AxB__max_rminus_fp64.c index db37dee25e..26f6a5dfc9 100644 --- a/FactoryKernels/GB_AxB__max_rminus_fp64.c +++ b/FactoryKernels/GB_AxB__max_rminus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_int16.c b/FactoryKernels/GB_AxB__max_rminus_int16.c index e047e2e626..571bbb0fe2 100644 --- a/FactoryKernels/GB_AxB__max_rminus_int16.c +++ b/FactoryKernels/GB_AxB__max_rminus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_int32.c b/FactoryKernels/GB_AxB__max_rminus_int32.c index af6b7bff2d..73d77a9eb3 100644 --- a/FactoryKernels/GB_AxB__max_rminus_int32.c +++ b/FactoryKernels/GB_AxB__max_rminus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_int64.c b/FactoryKernels/GB_AxB__max_rminus_int64.c index 828eb58c61..e0626fc7fe 100644 --- a/FactoryKernels/GB_AxB__max_rminus_int64.c +++ b/FactoryKernels/GB_AxB__max_rminus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_int8.c b/FactoryKernels/GB_AxB__max_rminus_int8.c index 28c0e98fe7..6099b70831 100644 --- a/FactoryKernels/GB_AxB__max_rminus_int8.c +++ b/FactoryKernels/GB_AxB__max_rminus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_uint16.c b/FactoryKernels/GB_AxB__max_rminus_uint16.c index e1976bddb0..56bcd71bbb 100644 --- a/FactoryKernels/GB_AxB__max_rminus_uint16.c +++ b/FactoryKernels/GB_AxB__max_rminus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_uint32.c b/FactoryKernels/GB_AxB__max_rminus_uint32.c index abc696ad6b..a62353d519 100644 --- a/FactoryKernels/GB_AxB__max_rminus_uint32.c +++ b/FactoryKernels/GB_AxB__max_rminus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_uint64.c b/FactoryKernels/GB_AxB__max_rminus_uint64.c index 65456f5e24..b2432b6e8a 100644 --- a/FactoryKernels/GB_AxB__max_rminus_uint64.c +++ b/FactoryKernels/GB_AxB__max_rminus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_rminus_uint8.c b/FactoryKernels/GB_AxB__max_rminus_uint8.c index a233cc087c..df1193c1b2 100644 --- a/FactoryKernels/GB_AxB__max_rminus_uint8.c +++ b/FactoryKernels/GB_AxB__max_rminus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_rminus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_fp32.c b/FactoryKernels/GB_AxB__max_second_fp32.c index 2e2bf3e162..06d76c0886 100644 --- a/FactoryKernels/GB_AxB__max_second_fp32.c +++ b/FactoryKernels/GB_AxB__max_second_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_second_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_fp64.c b/FactoryKernels/GB_AxB__max_second_fp64.c index 55c8795d53..e83181fc3d 100644 --- a/FactoryKernels/GB_AxB__max_second_fp64.c +++ b/FactoryKernels/GB_AxB__max_second_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_second_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_int16.c b/FactoryKernels/GB_AxB__max_second_int16.c index 23573abe38..96a9d7e8cf 100644 --- a/FactoryKernels/GB_AxB__max_second_int16.c +++ b/FactoryKernels/GB_AxB__max_second_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_second_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_int32.c b/FactoryKernels/GB_AxB__max_second_int32.c index ff7d9636be..44567921af 100644 --- a/FactoryKernels/GB_AxB__max_second_int32.c +++ b/FactoryKernels/GB_AxB__max_second_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_second_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_int64.c b/FactoryKernels/GB_AxB__max_second_int64.c index 2bb86362a0..54e1f8e783 100644 --- a/FactoryKernels/GB_AxB__max_second_int64.c +++ b/FactoryKernels/GB_AxB__max_second_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_second_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_int8.c b/FactoryKernels/GB_AxB__max_second_int8.c index 0d3a7f680d..8856c9e806 100644 --- a/FactoryKernels/GB_AxB__max_second_int8.c +++ b/FactoryKernels/GB_AxB__max_second_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_second_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_uint16.c b/FactoryKernels/GB_AxB__max_second_uint16.c index d926da00ec..e770fda368 100644 --- a/FactoryKernels/GB_AxB__max_second_uint16.c +++ b/FactoryKernels/GB_AxB__max_second_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_second_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_uint32.c b/FactoryKernels/GB_AxB__max_second_uint32.c index 06c4a85ac0..52fb3c4504 100644 --- a/FactoryKernels/GB_AxB__max_second_uint32.c +++ b/FactoryKernels/GB_AxB__max_second_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_second_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_uint64.c b/FactoryKernels/GB_AxB__max_second_uint64.c index e5764a1e71..8fc1a7cd87 100644 --- a/FactoryKernels/GB_AxB__max_second_uint64.c +++ b/FactoryKernels/GB_AxB__max_second_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_second_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_second_uint8.c b/FactoryKernels/GB_AxB__max_second_uint8.c index 6474ec2d59..b0065c4e9b 100644 --- a/FactoryKernels/GB_AxB__max_second_uint8.c +++ b/FactoryKernels/GB_AxB__max_second_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_second_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_secondj1_int32.c b/FactoryKernels/GB_AxB__max_secondj1_int32.c index 268ccb7ba1..6778d5146d 100644 --- a/FactoryKernels/GB_AxB__max_secondj1_int32.c +++ b/FactoryKernels/GB_AxB__max_secondj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_secondj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_secondj1_int64.c b/FactoryKernels/GB_AxB__max_secondj1_int64.c index 809eee28bd..6c4413025b 100644 --- a/FactoryKernels/GB_AxB__max_secondj1_int64.c +++ b/FactoryKernels/GB_AxB__max_secondj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_secondj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_secondj_int32.c b/FactoryKernels/GB_AxB__max_secondj_int32.c index e979bc1b5f..450c6cf463 100644 --- a/FactoryKernels/GB_AxB__max_secondj_int32.c +++ b/FactoryKernels/GB_AxB__max_secondj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__max_secondj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_secondj_int64.c b/FactoryKernels/GB_AxB__max_secondj_int64.c index 62f3a65617..364f08b242 100644 --- a/FactoryKernels/GB_AxB__max_secondj_int64.c +++ b/FactoryKernels/GB_AxB__max_secondj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_secondj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_fp32.c b/FactoryKernels/GB_AxB__max_times_fp32.c index dbb0c5096b..a1808f0d83 100644 --- a/FactoryKernels/GB_AxB__max_times_fp32.c +++ b/FactoryKernels/GB_AxB__max_times_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_times_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_fp64.c b/FactoryKernels/GB_AxB__max_times_fp64.c index 4c15fb7c04..7190a7447c 100644 --- a/FactoryKernels/GB_AxB__max_times_fp64.c +++ b/FactoryKernels/GB_AxB__max_times_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__max_times_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_int16.c b/FactoryKernels/GB_AxB__max_times_int16.c index adb9de65d4..630b5bd2fb 100644 --- a/FactoryKernels/GB_AxB__max_times_int16.c +++ b/FactoryKernels/GB_AxB__max_times_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_times_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_int32.c b/FactoryKernels/GB_AxB__max_times_int32.c index bcf52945fa..3128066341 100644 --- a/FactoryKernels/GB_AxB__max_times_int32.c +++ b/FactoryKernels/GB_AxB__max_times_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__max_times_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_int64.c b/FactoryKernels/GB_AxB__max_times_int64.c index 982ed99a08..a9371ccc25 100644 --- a/FactoryKernels/GB_AxB__max_times_int64.c +++ b/FactoryKernels/GB_AxB__max_times_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__max_times_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_int8.c b/FactoryKernels/GB_AxB__max_times_int8.c index 62f70d6b3f..6634fe08ef 100644 --- a/FactoryKernels/GB_AxB__max_times_int8.c +++ b/FactoryKernels/GB_AxB__max_times_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_times_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_uint16.c b/FactoryKernels/GB_AxB__max_times_uint16.c index 6bf03da8c9..d66453c63c 100644 --- a/FactoryKernels/GB_AxB__max_times_uint16.c +++ b/FactoryKernels/GB_AxB__max_times_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_times_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_uint32.c b/FactoryKernels/GB_AxB__max_times_uint32.c index 151fffc177..51bf2e64f2 100644 --- a/FactoryKernels/GB_AxB__max_times_uint32.c +++ b/FactoryKernels/GB_AxB__max_times_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_times_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_uint64.c b/FactoryKernels/GB_AxB__max_times_uint64.c index dbc64b9380..9ec767cd17 100644 --- a/FactoryKernels/GB_AxB__max_times_uint64.c +++ b/FactoryKernels/GB_AxB__max_times_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__max_times_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__max_times_uint8.c b/FactoryKernels/GB_AxB__max_times_uint8.c index e7f2668221..fa4ad28f5b 100644 --- a/FactoryKernels/GB_AxB__max_times_uint8.c +++ b/FactoryKernels/GB_AxB__max_times_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__max_times_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_fp32.c b/FactoryKernels/GB_AxB__min_div_fp32.c index 14881db279..5d9f788bcf 100644 --- a/FactoryKernels/GB_AxB__min_div_fp32.c +++ b/FactoryKernels/GB_AxB__min_div_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_div_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_fp64.c b/FactoryKernels/GB_AxB__min_div_fp64.c index bf08c27e22..dfab1c4b2e 100644 --- a/FactoryKernels/GB_AxB__min_div_fp64.c +++ b/FactoryKernels/GB_AxB__min_div_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_div_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_int16.c b/FactoryKernels/GB_AxB__min_div_int16.c index caa7d9464a..4b036a1071 100644 --- a/FactoryKernels/GB_AxB__min_div_int16.c +++ b/FactoryKernels/GB_AxB__min_div_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_div_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_int32.c b/FactoryKernels/GB_AxB__min_div_int32.c index 8e762af781..704dd842b9 100644 --- a/FactoryKernels/GB_AxB__min_div_int32.c +++ b/FactoryKernels/GB_AxB__min_div_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_div_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_int64.c b/FactoryKernels/GB_AxB__min_div_int64.c index af74f45de7..0edd1f2a15 100644 --- a/FactoryKernels/GB_AxB__min_div_int64.c +++ b/FactoryKernels/GB_AxB__min_div_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_div_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_int8.c b/FactoryKernels/GB_AxB__min_div_int8.c index 00af3dee3c..8e142070e0 100644 --- a/FactoryKernels/GB_AxB__min_div_int8.c +++ b/FactoryKernels/GB_AxB__min_div_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_div_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_uint16.c b/FactoryKernels/GB_AxB__min_div_uint16.c index e7cc100026..bbcf327363 100644 --- a/FactoryKernels/GB_AxB__min_div_uint16.c +++ b/FactoryKernels/GB_AxB__min_div_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_div_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_uint32.c b/FactoryKernels/GB_AxB__min_div_uint32.c index 8b0b824851..6d3c45a9e2 100644 --- a/FactoryKernels/GB_AxB__min_div_uint32.c +++ b/FactoryKernels/GB_AxB__min_div_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_div_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_uint64.c b/FactoryKernels/GB_AxB__min_div_uint64.c index 3a0140e74a..f805da5e45 100644 --- a/FactoryKernels/GB_AxB__min_div_uint64.c +++ b/FactoryKernels/GB_AxB__min_div_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_div_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_div_uint8.c b/FactoryKernels/GB_AxB__min_div_uint8.c index 0e3096405b..ac83192254 100644 --- a/FactoryKernels/GB_AxB__min_div_uint8.c +++ b/FactoryKernels/GB_AxB__min_div_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_div_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_fp32.c b/FactoryKernels/GB_AxB__min_first_fp32.c index 788468de68..3e14a973ae 100644 --- a/FactoryKernels/GB_AxB__min_first_fp32.c +++ b/FactoryKernels/GB_AxB__min_first_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__min_first_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_fp64.c b/FactoryKernels/GB_AxB__min_first_fp64.c index d2ca7b9e6c..6cdef3e347 100644 --- a/FactoryKernels/GB_AxB__min_first_fp64.c +++ b/FactoryKernels/GB_AxB__min_first_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__min_first_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_int16.c b/FactoryKernels/GB_AxB__min_first_int16.c index 557e82f4c8..ec506fbb11 100644 --- a/FactoryKernels/GB_AxB__min_first_int16.c +++ b/FactoryKernels/GB_AxB__min_first_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_first_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_int32.c b/FactoryKernels/GB_AxB__min_first_int32.c index 9472453419..7bdb78cbac 100644 --- a/FactoryKernels/GB_AxB__min_first_int32.c +++ b/FactoryKernels/GB_AxB__min_first_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_first_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_int64.c b/FactoryKernels/GB_AxB__min_first_int64.c index d6301732bb..c67ed686b8 100644 --- a/FactoryKernels/GB_AxB__min_first_int64.c +++ b/FactoryKernels/GB_AxB__min_first_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_first_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_int8.c b/FactoryKernels/GB_AxB__min_first_int8.c index 0b3ffe90ab..aef368ff0f 100644 --- a/FactoryKernels/GB_AxB__min_first_int8.c +++ b/FactoryKernels/GB_AxB__min_first_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_first_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_uint16.c b/FactoryKernels/GB_AxB__min_first_uint16.c index cc77b95ad4..3e0d056d16 100644 --- a/FactoryKernels/GB_AxB__min_first_uint16.c +++ b/FactoryKernels/GB_AxB__min_first_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_first_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_uint32.c b/FactoryKernels/GB_AxB__min_first_uint32.c index 3461137fcb..8512ce9c4a 100644 --- a/FactoryKernels/GB_AxB__min_first_uint32.c +++ b/FactoryKernels/GB_AxB__min_first_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_first_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_uint64.c b/FactoryKernels/GB_AxB__min_first_uint64.c index 14565c9cda..fb48fe2e7c 100644 --- a/FactoryKernels/GB_AxB__min_first_uint64.c +++ b/FactoryKernels/GB_AxB__min_first_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -461,3 +468,5 @@ GrB_Info GB (_Asaxpy3B__min_first_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_first_uint8.c b/FactoryKernels/GB_AxB__min_first_uint8.c index f6f2f7f674..e0d6553b29 100644 --- a/FactoryKernels/GB_AxB__min_first_uint8.c +++ b/FactoryKernels/GB_AxB__min_first_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_first_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_firsti1_int32.c b/FactoryKernels/GB_AxB__min_firsti1_int32.c index 6b7b8d5500..b8600eb833 100644 --- a/FactoryKernels/GB_AxB__min_firsti1_int32.c +++ b/FactoryKernels/GB_AxB__min_firsti1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__min_firsti1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_firsti1_int64.c b/FactoryKernels/GB_AxB__min_firsti1_int64.c index 688326aab2..90d2700b3c 100644 --- a/FactoryKernels/GB_AxB__min_firsti1_int64.c +++ b/FactoryKernels/GB_AxB__min_firsti1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_firsti1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_firsti_int32.c b/FactoryKernels/GB_AxB__min_firsti_int32.c index 3ebe8b8199..afdc136cb1 100644 --- a/FactoryKernels/GB_AxB__min_firsti_int32.c +++ b/FactoryKernels/GB_AxB__min_firsti_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__min_firsti_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_firsti_int64.c b/FactoryKernels/GB_AxB__min_firsti_int64.c index df6c407ae9..f71e818a48 100644 --- a/FactoryKernels/GB_AxB__min_firsti_int64.c +++ b/FactoryKernels/GB_AxB__min_firsti_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_firsti_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_firstj1_int32.c b/FactoryKernels/GB_AxB__min_firstj1_int32.c index af72929876..bf71dab79c 100644 --- a/FactoryKernels/GB_AxB__min_firstj1_int32.c +++ b/FactoryKernels/GB_AxB__min_firstj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_firstj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_firstj1_int64.c b/FactoryKernels/GB_AxB__min_firstj1_int64.c index 4b34cc3be2..0c4e6fa4cb 100644 --- a/FactoryKernels/GB_AxB__min_firstj1_int64.c +++ b/FactoryKernels/GB_AxB__min_firstj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -461,3 +468,5 @@ GrB_Info GB (_Asaxpy3B__min_firstj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_firstj_int32.c b/FactoryKernels/GB_AxB__min_firstj_int32.c index ef44067f0b..b167e78031 100644 --- a/FactoryKernels/GB_AxB__min_firstj_int32.c +++ b/FactoryKernels/GB_AxB__min_firstj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_firstj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_firstj_int64.c b/FactoryKernels/GB_AxB__min_firstj_int64.c index 33697f0d0b..db55959310 100644 --- a/FactoryKernels/GB_AxB__min_firstj_int64.c +++ b/FactoryKernels/GB_AxB__min_firstj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_firstj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_fp32.c b/FactoryKernels/GB_AxB__min_max_fp32.c index f2ae8899a1..51d97294ec 100644 --- a/FactoryKernels/GB_AxB__min_max_fp32.c +++ b/FactoryKernels/GB_AxB__min_max_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_max_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_fp64.c b/FactoryKernels/GB_AxB__min_max_fp64.c index cbaf0d2e34..ac04ed96e1 100644 --- a/FactoryKernels/GB_AxB__min_max_fp64.c +++ b/FactoryKernels/GB_AxB__min_max_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_max_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_int16.c b/FactoryKernels/GB_AxB__min_max_int16.c index 9c6cff2056..4e0da6d45f 100644 --- a/FactoryKernels/GB_AxB__min_max_int16.c +++ b/FactoryKernels/GB_AxB__min_max_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_max_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_int32.c b/FactoryKernels/GB_AxB__min_max_int32.c index 5f6debb69e..7322cd7204 100644 --- a/FactoryKernels/GB_AxB__min_max_int32.c +++ b/FactoryKernels/GB_AxB__min_max_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_max_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_int64.c b/FactoryKernels/GB_AxB__min_max_int64.c index 2e367d4148..f7890abff4 100644 --- a/FactoryKernels/GB_AxB__min_max_int64.c +++ b/FactoryKernels/GB_AxB__min_max_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_max_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_int8.c b/FactoryKernels/GB_AxB__min_max_int8.c index 076e9926e9..57a66e68f3 100644 --- a/FactoryKernels/GB_AxB__min_max_int8.c +++ b/FactoryKernels/GB_AxB__min_max_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_max_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_uint16.c b/FactoryKernels/GB_AxB__min_max_uint16.c index c0db9d174c..f7d6b6d622 100644 --- a/FactoryKernels/GB_AxB__min_max_uint16.c +++ b/FactoryKernels/GB_AxB__min_max_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_max_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_uint32.c b/FactoryKernels/GB_AxB__min_max_uint32.c index c7645fe93b..57f168b1b5 100644 --- a/FactoryKernels/GB_AxB__min_max_uint32.c +++ b/FactoryKernels/GB_AxB__min_max_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_max_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_uint64.c b/FactoryKernels/GB_AxB__min_max_uint64.c index 077b0d5b05..49c1f236dc 100644 --- a/FactoryKernels/GB_AxB__min_max_uint64.c +++ b/FactoryKernels/GB_AxB__min_max_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_max_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_max_uint8.c b/FactoryKernels/GB_AxB__min_max_uint8.c index 61c8698143..5965606293 100644 --- a/FactoryKernels/GB_AxB__min_max_uint8.c +++ b/FactoryKernels/GB_AxB__min_max_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_max_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_fp32.c b/FactoryKernels/GB_AxB__min_min_fp32.c index 831be321bf..c2bbf7f59c 100644 --- a/FactoryKernels/GB_AxB__min_min_fp32.c +++ b/FactoryKernels/GB_AxB__min_min_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_min_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_fp64.c b/FactoryKernels/GB_AxB__min_min_fp64.c index ca32463037..a5cf3ac6a3 100644 --- a/FactoryKernels/GB_AxB__min_min_fp64.c +++ b/FactoryKernels/GB_AxB__min_min_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_min_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_int16.c b/FactoryKernels/GB_AxB__min_min_int16.c index 842b992ad5..ce07516455 100644 --- a/FactoryKernels/GB_AxB__min_min_int16.c +++ b/FactoryKernels/GB_AxB__min_min_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_min_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_int32.c b/FactoryKernels/GB_AxB__min_min_int32.c index b3131ecab2..ef5db08c99 100644 --- a/FactoryKernels/GB_AxB__min_min_int32.c +++ b/FactoryKernels/GB_AxB__min_min_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_min_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_int64.c b/FactoryKernels/GB_AxB__min_min_int64.c index aae696a364..0bc08e1f7b 100644 --- a/FactoryKernels/GB_AxB__min_min_int64.c +++ b/FactoryKernels/GB_AxB__min_min_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_min_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_int8.c b/FactoryKernels/GB_AxB__min_min_int8.c index 30394b3d9f..a288d2a8e1 100644 --- a/FactoryKernels/GB_AxB__min_min_int8.c +++ b/FactoryKernels/GB_AxB__min_min_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_min_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_uint16.c b/FactoryKernels/GB_AxB__min_min_uint16.c index 6ba94058c0..b317407483 100644 --- a/FactoryKernels/GB_AxB__min_min_uint16.c +++ b/FactoryKernels/GB_AxB__min_min_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_min_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_uint32.c b/FactoryKernels/GB_AxB__min_min_uint32.c index e749336192..003d19674c 100644 --- a/FactoryKernels/GB_AxB__min_min_uint32.c +++ b/FactoryKernels/GB_AxB__min_min_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_min_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_uint64.c b/FactoryKernels/GB_AxB__min_min_uint64.c index 5705914a1a..9616d184af 100644 --- a/FactoryKernels/GB_AxB__min_min_uint64.c +++ b/FactoryKernels/GB_AxB__min_min_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_min_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_min_uint8.c b/FactoryKernels/GB_AxB__min_min_uint8.c index 4a4b598987..0971dc07c3 100644 --- a/FactoryKernels/GB_AxB__min_min_uint8.c +++ b/FactoryKernels/GB_AxB__min_min_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_min_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_fp32.c b/FactoryKernels/GB_AxB__min_minus_fp32.c index 5c6aeb7c26..41e330199a 100644 --- a/FactoryKernels/GB_AxB__min_minus_fp32.c +++ b/FactoryKernels/GB_AxB__min_minus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_fp64.c b/FactoryKernels/GB_AxB__min_minus_fp64.c index 2e057b327d..a3bddf3673 100644 --- a/FactoryKernels/GB_AxB__min_minus_fp64.c +++ b/FactoryKernels/GB_AxB__min_minus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_int16.c b/FactoryKernels/GB_AxB__min_minus_int16.c index d9b951fb8e..6d99899589 100644 --- a/FactoryKernels/GB_AxB__min_minus_int16.c +++ b/FactoryKernels/GB_AxB__min_minus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_int32.c b/FactoryKernels/GB_AxB__min_minus_int32.c index 019b8f4ef3..e8f5dbc113 100644 --- a/FactoryKernels/GB_AxB__min_minus_int32.c +++ b/FactoryKernels/GB_AxB__min_minus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_int64.c b/FactoryKernels/GB_AxB__min_minus_int64.c index ae43a6c7c6..73ee947ec3 100644 --- a/FactoryKernels/GB_AxB__min_minus_int64.c +++ b/FactoryKernels/GB_AxB__min_minus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_int8.c b/FactoryKernels/GB_AxB__min_minus_int8.c index d0e9a12465..eeb3447857 100644 --- a/FactoryKernels/GB_AxB__min_minus_int8.c +++ b/FactoryKernels/GB_AxB__min_minus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_uint16.c b/FactoryKernels/GB_AxB__min_minus_uint16.c index 81ea779143..2ac04707e0 100644 --- a/FactoryKernels/GB_AxB__min_minus_uint16.c +++ b/FactoryKernels/GB_AxB__min_minus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_uint32.c b/FactoryKernels/GB_AxB__min_minus_uint32.c index a373e6eb34..2df186a14f 100644 --- a/FactoryKernels/GB_AxB__min_minus_uint32.c +++ b/FactoryKernels/GB_AxB__min_minus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_uint64.c b/FactoryKernels/GB_AxB__min_minus_uint64.c index b58d50d07b..fbb89c6520 100644 --- a/FactoryKernels/GB_AxB__min_minus_uint64.c +++ b/FactoryKernels/GB_AxB__min_minus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_minus_uint8.c b/FactoryKernels/GB_AxB__min_minus_uint8.c index 41bb0d97aa..7262624fb8 100644 --- a/FactoryKernels/GB_AxB__min_minus_uint8.c +++ b/FactoryKernels/GB_AxB__min_minus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_minus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_fp32.c b/FactoryKernels/GB_AxB__min_plus_fp32.c index c592a9ba1d..665081f060 100644 --- a/FactoryKernels/GB_AxB__min_plus_fp32.c +++ b/FactoryKernels/GB_AxB__min_plus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_fp64.c b/FactoryKernels/GB_AxB__min_plus_fp64.c index 680125c4de..07e93e1c0e 100644 --- a/FactoryKernels/GB_AxB__min_plus_fp64.c +++ b/FactoryKernels/GB_AxB__min_plus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_int16.c b/FactoryKernels/GB_AxB__min_plus_int16.c index e5dbc534bf..a5767d7ae5 100644 --- a/FactoryKernels/GB_AxB__min_plus_int16.c +++ b/FactoryKernels/GB_AxB__min_plus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_int32.c b/FactoryKernels/GB_AxB__min_plus_int32.c index 904d5c0222..a0fe4550c1 100644 --- a/FactoryKernels/GB_AxB__min_plus_int32.c +++ b/FactoryKernels/GB_AxB__min_plus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_int64.c b/FactoryKernels/GB_AxB__min_plus_int64.c index 8ae8c89d44..64b3fd2978 100644 --- a/FactoryKernels/GB_AxB__min_plus_int64.c +++ b/FactoryKernels/GB_AxB__min_plus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_int8.c b/FactoryKernels/GB_AxB__min_plus_int8.c index 2865e7a57d..72a35b5eb2 100644 --- a/FactoryKernels/GB_AxB__min_plus_int8.c +++ b/FactoryKernels/GB_AxB__min_plus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_uint16.c b/FactoryKernels/GB_AxB__min_plus_uint16.c index 733b3e6adf..aaa954ebb5 100644 --- a/FactoryKernels/GB_AxB__min_plus_uint16.c +++ b/FactoryKernels/GB_AxB__min_plus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_uint32.c b/FactoryKernels/GB_AxB__min_plus_uint32.c index 2af3a4919c..a827bd07b6 100644 --- a/FactoryKernels/GB_AxB__min_plus_uint32.c +++ b/FactoryKernels/GB_AxB__min_plus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_uint64.c b/FactoryKernels/GB_AxB__min_plus_uint64.c index 69dc82be2d..596b189774 100644 --- a/FactoryKernels/GB_AxB__min_plus_uint64.c +++ b/FactoryKernels/GB_AxB__min_plus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_plus_uint8.c b/FactoryKernels/GB_AxB__min_plus_uint8.c index 55cd5f6b1c..0466a2922d 100644 --- a/FactoryKernels/GB_AxB__min_plus_uint8.c +++ b/FactoryKernels/GB_AxB__min_plus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_plus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_fp32.c b/FactoryKernels/GB_AxB__min_rdiv_fp32.c index 8e01396c62..9a0278a928 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_fp32.c +++ b/FactoryKernels/GB_AxB__min_rdiv_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_fp64.c b/FactoryKernels/GB_AxB__min_rdiv_fp64.c index 47be370044..c3ed9e831a 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_fp64.c +++ b/FactoryKernels/GB_AxB__min_rdiv_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_int16.c b/FactoryKernels/GB_AxB__min_rdiv_int16.c index d3799cc4e6..f71af7cb89 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_int16.c +++ b/FactoryKernels/GB_AxB__min_rdiv_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_int32.c b/FactoryKernels/GB_AxB__min_rdiv_int32.c index 84a4bf0f65..ada992f635 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_int32.c +++ b/FactoryKernels/GB_AxB__min_rdiv_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_int64.c b/FactoryKernels/GB_AxB__min_rdiv_int64.c index b88a613670..55db22663c 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_int64.c +++ b/FactoryKernels/GB_AxB__min_rdiv_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_int8.c b/FactoryKernels/GB_AxB__min_rdiv_int8.c index 9d331a057c..780f939cf3 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_int8.c +++ b/FactoryKernels/GB_AxB__min_rdiv_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_uint16.c b/FactoryKernels/GB_AxB__min_rdiv_uint16.c index 24e600785b..8cbbae1e2d 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_uint16.c +++ b/FactoryKernels/GB_AxB__min_rdiv_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_uint32.c b/FactoryKernels/GB_AxB__min_rdiv_uint32.c index fa67c9ce19..30bbabf86d 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_uint32.c +++ b/FactoryKernels/GB_AxB__min_rdiv_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_uint64.c b/FactoryKernels/GB_AxB__min_rdiv_uint64.c index 9a75b5457f..a5789ad74f 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_uint64.c +++ b/FactoryKernels/GB_AxB__min_rdiv_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rdiv_uint8.c b/FactoryKernels/GB_AxB__min_rdiv_uint8.c index 7c0c4b59ed..9b0e80be36 100644 --- a/FactoryKernels/GB_AxB__min_rdiv_uint8.c +++ b/FactoryKernels/GB_AxB__min_rdiv_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_rdiv_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_fp32.c b/FactoryKernels/GB_AxB__min_rminus_fp32.c index 64e3d97c06..2db24cda73 100644 --- a/FactoryKernels/GB_AxB__min_rminus_fp32.c +++ b/FactoryKernels/GB_AxB__min_rminus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_fp64.c b/FactoryKernels/GB_AxB__min_rminus_fp64.c index 6119c05b20..4988ff2347 100644 --- a/FactoryKernels/GB_AxB__min_rminus_fp64.c +++ b/FactoryKernels/GB_AxB__min_rminus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_int16.c b/FactoryKernels/GB_AxB__min_rminus_int16.c index ae15dbfadd..a000baa33d 100644 --- a/FactoryKernels/GB_AxB__min_rminus_int16.c +++ b/FactoryKernels/GB_AxB__min_rminus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_int32.c b/FactoryKernels/GB_AxB__min_rminus_int32.c index 2b24bfcf68..747086ca1e 100644 --- a/FactoryKernels/GB_AxB__min_rminus_int32.c +++ b/FactoryKernels/GB_AxB__min_rminus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_int64.c b/FactoryKernels/GB_AxB__min_rminus_int64.c index 43b60d36ae..0b653f991f 100644 --- a/FactoryKernels/GB_AxB__min_rminus_int64.c +++ b/FactoryKernels/GB_AxB__min_rminus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_int8.c b/FactoryKernels/GB_AxB__min_rminus_int8.c index 1cae697c1e..e737c7d83d 100644 --- a/FactoryKernels/GB_AxB__min_rminus_int8.c +++ b/FactoryKernels/GB_AxB__min_rminus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_uint16.c b/FactoryKernels/GB_AxB__min_rminus_uint16.c index 03f4577455..6a62f92616 100644 --- a/FactoryKernels/GB_AxB__min_rminus_uint16.c +++ b/FactoryKernels/GB_AxB__min_rminus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_uint32.c b/FactoryKernels/GB_AxB__min_rminus_uint32.c index a02b99042e..342aa5dd1d 100644 --- a/FactoryKernels/GB_AxB__min_rminus_uint32.c +++ b/FactoryKernels/GB_AxB__min_rminus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_uint64.c b/FactoryKernels/GB_AxB__min_rminus_uint64.c index f30b025ff6..89c974fbf8 100644 --- a/FactoryKernels/GB_AxB__min_rminus_uint64.c +++ b/FactoryKernels/GB_AxB__min_rminus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_rminus_uint8.c b/FactoryKernels/GB_AxB__min_rminus_uint8.c index 42902fb190..0c3d88bfaa 100644 --- a/FactoryKernels/GB_AxB__min_rminus_uint8.c +++ b/FactoryKernels/GB_AxB__min_rminus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_rminus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_fp32.c b/FactoryKernels/GB_AxB__min_second_fp32.c index f37d4d826d..c9d0e9b72a 100644 --- a/FactoryKernels/GB_AxB__min_second_fp32.c +++ b/FactoryKernels/GB_AxB__min_second_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_second_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_fp64.c b/FactoryKernels/GB_AxB__min_second_fp64.c index b726404def..b4c4c79161 100644 --- a/FactoryKernels/GB_AxB__min_second_fp64.c +++ b/FactoryKernels/GB_AxB__min_second_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_second_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_int16.c b/FactoryKernels/GB_AxB__min_second_int16.c index 8e1e34df8a..78b04ab626 100644 --- a/FactoryKernels/GB_AxB__min_second_int16.c +++ b/FactoryKernels/GB_AxB__min_second_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_second_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_int32.c b/FactoryKernels/GB_AxB__min_second_int32.c index 9537f4fd2f..d8f46ac89b 100644 --- a/FactoryKernels/GB_AxB__min_second_int32.c +++ b/FactoryKernels/GB_AxB__min_second_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_second_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_int64.c b/FactoryKernels/GB_AxB__min_second_int64.c index 3ca7ac84d8..8a08679d8c 100644 --- a/FactoryKernels/GB_AxB__min_second_int64.c +++ b/FactoryKernels/GB_AxB__min_second_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_second_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_int8.c b/FactoryKernels/GB_AxB__min_second_int8.c index b2885a571c..1f422cdd68 100644 --- a/FactoryKernels/GB_AxB__min_second_int8.c +++ b/FactoryKernels/GB_AxB__min_second_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_second_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_uint16.c b/FactoryKernels/GB_AxB__min_second_uint16.c index e7818d8cff..1878dcfb7f 100644 --- a/FactoryKernels/GB_AxB__min_second_uint16.c +++ b/FactoryKernels/GB_AxB__min_second_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_second_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_uint32.c b/FactoryKernels/GB_AxB__min_second_uint32.c index 41d73b12c4..bbe11a72ac 100644 --- a/FactoryKernels/GB_AxB__min_second_uint32.c +++ b/FactoryKernels/GB_AxB__min_second_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_second_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_uint64.c b/FactoryKernels/GB_AxB__min_second_uint64.c index 464d0ad575..76c1d945d5 100644 --- a/FactoryKernels/GB_AxB__min_second_uint64.c +++ b/FactoryKernels/GB_AxB__min_second_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_second_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_second_uint8.c b/FactoryKernels/GB_AxB__min_second_uint8.c index dd33b09f09..d49c81d444 100644 --- a/FactoryKernels/GB_AxB__min_second_uint8.c +++ b/FactoryKernels/GB_AxB__min_second_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_second_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_secondj1_int32.c b/FactoryKernels/GB_AxB__min_secondj1_int32.c index da7a6836f8..cde5e41e7b 100644 --- a/FactoryKernels/GB_AxB__min_secondj1_int32.c +++ b/FactoryKernels/GB_AxB__min_secondj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_secondj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_secondj1_int64.c b/FactoryKernels/GB_AxB__min_secondj1_int64.c index 1e8d4a39cd..e47305b047 100644 --- a/FactoryKernels/GB_AxB__min_secondj1_int64.c +++ b/FactoryKernels/GB_AxB__min_secondj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_secondj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_secondj_int32.c b/FactoryKernels/GB_AxB__min_secondj_int32.c index 5f51ee0f48..7e1cfba103 100644 --- a/FactoryKernels/GB_AxB__min_secondj_int32.c +++ b/FactoryKernels/GB_AxB__min_secondj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__min_secondj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_secondj_int64.c b/FactoryKernels/GB_AxB__min_secondj_int64.c index 82deaf64ad..2153d52ff9 100644 --- a/FactoryKernels/GB_AxB__min_secondj_int64.c +++ b/FactoryKernels/GB_AxB__min_secondj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_secondj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_fp32.c b/FactoryKernels/GB_AxB__min_times_fp32.c index 8f66c27ae3..eeed9f26b1 100644 --- a/FactoryKernels/GB_AxB__min_times_fp32.c +++ b/FactoryKernels/GB_AxB__min_times_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_times_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_fp64.c b/FactoryKernels/GB_AxB__min_times_fp64.c index c558682201..238f312df6 100644 --- a/FactoryKernels/GB_AxB__min_times_fp64.c +++ b/FactoryKernels/GB_AxB__min_times_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__min_times_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_int16.c b/FactoryKernels/GB_AxB__min_times_int16.c index c80d3c21ca..6c64dd56c5 100644 --- a/FactoryKernels/GB_AxB__min_times_int16.c +++ b/FactoryKernels/GB_AxB__min_times_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_times_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_int32.c b/FactoryKernels/GB_AxB__min_times_int32.c index d7345f2ff6..85bce94129 100644 --- a/FactoryKernels/GB_AxB__min_times_int32.c +++ b/FactoryKernels/GB_AxB__min_times_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__min_times_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_int64.c b/FactoryKernels/GB_AxB__min_times_int64.c index 06eac019ae..9d1e1df905 100644 --- a/FactoryKernels/GB_AxB__min_times_int64.c +++ b/FactoryKernels/GB_AxB__min_times_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__min_times_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_int8.c b/FactoryKernels/GB_AxB__min_times_int8.c index f599063789..81e98fa227 100644 --- a/FactoryKernels/GB_AxB__min_times_int8.c +++ b/FactoryKernels/GB_AxB__min_times_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_times_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_uint16.c b/FactoryKernels/GB_AxB__min_times_uint16.c index f8d35bc1e1..ef0f5883d3 100644 --- a/FactoryKernels/GB_AxB__min_times_uint16.c +++ b/FactoryKernels/GB_AxB__min_times_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_times_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_uint32.c b/FactoryKernels/GB_AxB__min_times_uint32.c index 3556975b55..d87048ca54 100644 --- a/FactoryKernels/GB_AxB__min_times_uint32.c +++ b/FactoryKernels/GB_AxB__min_times_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_times_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_uint64.c b/FactoryKernels/GB_AxB__min_times_uint64.c index dc04559e72..23a16cc712 100644 --- a/FactoryKernels/GB_AxB__min_times_uint64.c +++ b/FactoryKernels/GB_AxB__min_times_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__min_times_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__min_times_uint8.c b/FactoryKernels/GB_AxB__min_times_uint8.c index d384c68348..410e2977e0 100644 --- a/FactoryKernels/GB_AxB__min_times_uint8.c +++ b/FactoryKernels/GB_AxB__min_times_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__min_times_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_fc32.c b/FactoryKernels/GB_AxB__plus_div_fc32.c index 48d4229d6d..9162bd759c 100644 --- a/FactoryKernels/GB_AxB__plus_div_fc32.c +++ b/FactoryKernels/GB_AxB__plus_div_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_fc64.c b/FactoryKernels/GB_AxB__plus_div_fc64.c index b7a3243b8c..ce6f17c30e 100644 --- a/FactoryKernels/GB_AxB__plus_div_fc64.c +++ b/FactoryKernels/GB_AxB__plus_div_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_fp32.c b/FactoryKernels/GB_AxB__plus_div_fp32.c index 76ced02a73..fede413e35 100644 --- a/FactoryKernels/GB_AxB__plus_div_fp32.c +++ b/FactoryKernels/GB_AxB__plus_div_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_fp64.c b/FactoryKernels/GB_AxB__plus_div_fp64.c index f76c37b124..17a46c3ca6 100644 --- a/FactoryKernels/GB_AxB__plus_div_fp64.c +++ b/FactoryKernels/GB_AxB__plus_div_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_int16.c b/FactoryKernels/GB_AxB__plus_div_int16.c index 616bca022f..385428e74b 100644 --- a/FactoryKernels/GB_AxB__plus_div_int16.c +++ b/FactoryKernels/GB_AxB__plus_div_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_int32.c b/FactoryKernels/GB_AxB__plus_div_int32.c index f54379a563..62827a0ac8 100644 --- a/FactoryKernels/GB_AxB__plus_div_int32.c +++ b/FactoryKernels/GB_AxB__plus_div_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_int64.c b/FactoryKernels/GB_AxB__plus_div_int64.c index 7215aea923..230d72959c 100644 --- a/FactoryKernels/GB_AxB__plus_div_int64.c +++ b/FactoryKernels/GB_AxB__plus_div_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_int8.c b/FactoryKernels/GB_AxB__plus_div_int8.c index dfa40c5c30..caf4efc9dd 100644 --- a/FactoryKernels/GB_AxB__plus_div_int8.c +++ b/FactoryKernels/GB_AxB__plus_div_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_uint16.c b/FactoryKernels/GB_AxB__plus_div_uint16.c index 0ad83321a5..ff6fede9df 100644 --- a/FactoryKernels/GB_AxB__plus_div_uint16.c +++ b/FactoryKernels/GB_AxB__plus_div_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_uint32.c b/FactoryKernels/GB_AxB__plus_div_uint32.c index 09a7394203..6f1fd84f73 100644 --- a/FactoryKernels/GB_AxB__plus_div_uint32.c +++ b/FactoryKernels/GB_AxB__plus_div_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_uint64.c b/FactoryKernels/GB_AxB__plus_div_uint64.c index fe338e94f2..b90a8090e7 100644 --- a/FactoryKernels/GB_AxB__plus_div_uint64.c +++ b/FactoryKernels/GB_AxB__plus_div_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_div_uint8.c b/FactoryKernels/GB_AxB__plus_div_uint8.c index f2ba6621d4..97b3b95799 100644 --- a/FactoryKernels/GB_AxB__plus_div_uint8.c +++ b/FactoryKernels/GB_AxB__plus_div_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_div_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_fc32.c b/FactoryKernels/GB_AxB__plus_first_fc32.c index 585e6ebefb..d744d54050 100644 --- a/FactoryKernels/GB_AxB__plus_first_fc32.c +++ b/FactoryKernels/GB_AxB__plus_first_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_fc64.c b/FactoryKernels/GB_AxB__plus_first_fc64.c index 78f54d621d..72141af872 100644 --- a/FactoryKernels/GB_AxB__plus_first_fc64.c +++ b/FactoryKernels/GB_AxB__plus_first_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_fp32.c b/FactoryKernels/GB_AxB__plus_first_fp32.c index aae98a9fca..ec1b6e2b31 100644 --- a/FactoryKernels/GB_AxB__plus_first_fp32.c +++ b/FactoryKernels/GB_AxB__plus_first_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_fp64.c b/FactoryKernels/GB_AxB__plus_first_fp64.c index af7a4cd0ce..6f2c37e560 100644 --- a/FactoryKernels/GB_AxB__plus_first_fp64.c +++ b/FactoryKernels/GB_AxB__plus_first_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_int16.c b/FactoryKernels/GB_AxB__plus_first_int16.c index 10cfa677f8..01aa1cb8d6 100644 --- a/FactoryKernels/GB_AxB__plus_first_int16.c +++ b/FactoryKernels/GB_AxB__plus_first_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_int32.c b/FactoryKernels/GB_AxB__plus_first_int32.c index a2f36f1a38..ca660c78ab 100644 --- a/FactoryKernels/GB_AxB__plus_first_int32.c +++ b/FactoryKernels/GB_AxB__plus_first_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_int64.c b/FactoryKernels/GB_AxB__plus_first_int64.c index 025f03149c..b12582abbc 100644 --- a/FactoryKernels/GB_AxB__plus_first_int64.c +++ b/FactoryKernels/GB_AxB__plus_first_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_int8.c b/FactoryKernels/GB_AxB__plus_first_int8.c index b47f163f2e..3c48b6e7c0 100644 --- a/FactoryKernels/GB_AxB__plus_first_int8.c +++ b/FactoryKernels/GB_AxB__plus_first_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_uint16.c b/FactoryKernels/GB_AxB__plus_first_uint16.c index 6194fc9b2a..d48ae38407 100644 --- a/FactoryKernels/GB_AxB__plus_first_uint16.c +++ b/FactoryKernels/GB_AxB__plus_first_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_uint32.c b/FactoryKernels/GB_AxB__plus_first_uint32.c index d146e48462..6e9e355f2b 100644 --- a/FactoryKernels/GB_AxB__plus_first_uint32.c +++ b/FactoryKernels/GB_AxB__plus_first_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_uint64.c b/FactoryKernels/GB_AxB__plus_first_uint64.c index 0e36874f95..bbfb8aad2a 100644 --- a/FactoryKernels/GB_AxB__plus_first_uint64.c +++ b/FactoryKernels/GB_AxB__plus_first_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_first_uint8.c b/FactoryKernels/GB_AxB__plus_first_uint8.c index 6d82f7ab24..ff69d0b9ff 100644 --- a/FactoryKernels/GB_AxB__plus_first_uint8.c +++ b/FactoryKernels/GB_AxB__plus_first_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -455,3 +462,5 @@ GrB_Info GB (_Asaxpy3B__plus_first_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_firsti1_int32.c b/FactoryKernels/GB_AxB__plus_firsti1_int32.c index 45e0104d58..ceae9bd34c 100644 --- a/FactoryKernels/GB_AxB__plus_firsti1_int32.c +++ b/FactoryKernels/GB_AxB__plus_firsti1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__plus_firsti1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_firsti1_int64.c b/FactoryKernels/GB_AxB__plus_firsti1_int64.c index 500a24b19a..16c95fa22e 100644 --- a/FactoryKernels/GB_AxB__plus_firsti1_int64.c +++ b/FactoryKernels/GB_AxB__plus_firsti1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__plus_firsti1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_firsti_int32.c b/FactoryKernels/GB_AxB__plus_firsti_int32.c index f54da8938d..b580af8005 100644 --- a/FactoryKernels/GB_AxB__plus_firsti_int32.c +++ b/FactoryKernels/GB_AxB__plus_firsti_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_firsti_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_firsti_int64.c b/FactoryKernels/GB_AxB__plus_firsti_int64.c index d8cf5cba62..2dcfde7d91 100644 --- a/FactoryKernels/GB_AxB__plus_firsti_int64.c +++ b/FactoryKernels/GB_AxB__plus_firsti_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_firsti_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_firstj1_int32.c b/FactoryKernels/GB_AxB__plus_firstj1_int32.c index ee14d542e5..37130ea4f0 100644 --- a/FactoryKernels/GB_AxB__plus_firstj1_int32.c +++ b/FactoryKernels/GB_AxB__plus_firstj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__plus_firstj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_firstj1_int64.c b/FactoryKernels/GB_AxB__plus_firstj1_int64.c index 1bba74791e..ced095e907 100644 --- a/FactoryKernels/GB_AxB__plus_firstj1_int64.c +++ b/FactoryKernels/GB_AxB__plus_firstj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__plus_firstj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_firstj_int32.c b/FactoryKernels/GB_AxB__plus_firstj_int32.c index 67d8396010..9ddbd565f6 100644 --- a/FactoryKernels/GB_AxB__plus_firstj_int32.c +++ b/FactoryKernels/GB_AxB__plus_firstj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_firstj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_firstj_int64.c b/FactoryKernels/GB_AxB__plus_firstj_int64.c index 285e3eaa46..a0b2cc54b8 100644 --- a/FactoryKernels/GB_AxB__plus_firstj_int64.c +++ b/FactoryKernels/GB_AxB__plus_firstj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_firstj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_fp32.c b/FactoryKernels/GB_AxB__plus_land_fp32.c index db5ba56658..c37cf82f24 100644 --- a/FactoryKernels/GB_AxB__plus_land_fp32.c +++ b/FactoryKernels/GB_AxB__plus_land_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_fp64.c b/FactoryKernels/GB_AxB__plus_land_fp64.c index d31ee2aa8a..485ad8b2c1 100644 --- a/FactoryKernels/GB_AxB__plus_land_fp64.c +++ b/FactoryKernels/GB_AxB__plus_land_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_int16.c b/FactoryKernels/GB_AxB__plus_land_int16.c index 1e5695dd74..aa95efaf07 100644 --- a/FactoryKernels/GB_AxB__plus_land_int16.c +++ b/FactoryKernels/GB_AxB__plus_land_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_int32.c b/FactoryKernels/GB_AxB__plus_land_int32.c index cc559f51f3..d2e4c704d5 100644 --- a/FactoryKernels/GB_AxB__plus_land_int32.c +++ b/FactoryKernels/GB_AxB__plus_land_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_int64.c b/FactoryKernels/GB_AxB__plus_land_int64.c index 6a99f7ab8a..5de304fafb 100644 --- a/FactoryKernels/GB_AxB__plus_land_int64.c +++ b/FactoryKernels/GB_AxB__plus_land_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_int8.c b/FactoryKernels/GB_AxB__plus_land_int8.c index 9464d73c8a..426077c39f 100644 --- a/FactoryKernels/GB_AxB__plus_land_int8.c +++ b/FactoryKernels/GB_AxB__plus_land_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_uint16.c b/FactoryKernels/GB_AxB__plus_land_uint16.c index 794f6177a2..d1ebd911fb 100644 --- a/FactoryKernels/GB_AxB__plus_land_uint16.c +++ b/FactoryKernels/GB_AxB__plus_land_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_uint32.c b/FactoryKernels/GB_AxB__plus_land_uint32.c index 84e2e8557f..b107f7a578 100644 --- a/FactoryKernels/GB_AxB__plus_land_uint32.c +++ b/FactoryKernels/GB_AxB__plus_land_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_uint64.c b/FactoryKernels/GB_AxB__plus_land_uint64.c index 83bb5093d2..2e39051596 100644 --- a/FactoryKernels/GB_AxB__plus_land_uint64.c +++ b/FactoryKernels/GB_AxB__plus_land_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_land_uint8.c b/FactoryKernels/GB_AxB__plus_land_uint8.c index 90582fffef..235565f56a 100644 --- a/FactoryKernels/GB_AxB__plus_land_uint8.c +++ b/FactoryKernels/GB_AxB__plus_land_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_land_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_fp32.c b/FactoryKernels/GB_AxB__plus_lor_fp32.c index beefdf421b..558cabeb7e 100644 --- a/FactoryKernels/GB_AxB__plus_lor_fp32.c +++ b/FactoryKernels/GB_AxB__plus_lor_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_fp64.c b/FactoryKernels/GB_AxB__plus_lor_fp64.c index 9a70343bfa..f5cf9102ca 100644 --- a/FactoryKernels/GB_AxB__plus_lor_fp64.c +++ b/FactoryKernels/GB_AxB__plus_lor_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_int16.c b/FactoryKernels/GB_AxB__plus_lor_int16.c index 2c77a59ad2..7f571fe363 100644 --- a/FactoryKernels/GB_AxB__plus_lor_int16.c +++ b/FactoryKernels/GB_AxB__plus_lor_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_int32.c b/FactoryKernels/GB_AxB__plus_lor_int32.c index 981609ec28..fb95f2e5d9 100644 --- a/FactoryKernels/GB_AxB__plus_lor_int32.c +++ b/FactoryKernels/GB_AxB__plus_lor_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_int64.c b/FactoryKernels/GB_AxB__plus_lor_int64.c index c89045ade8..460ecb9966 100644 --- a/FactoryKernels/GB_AxB__plus_lor_int64.c +++ b/FactoryKernels/GB_AxB__plus_lor_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_int8.c b/FactoryKernels/GB_AxB__plus_lor_int8.c index 4f093f17a9..99019ebe5e 100644 --- a/FactoryKernels/GB_AxB__plus_lor_int8.c +++ b/FactoryKernels/GB_AxB__plus_lor_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_uint16.c b/FactoryKernels/GB_AxB__plus_lor_uint16.c index f608bd76c3..a134c74d4d 100644 --- a/FactoryKernels/GB_AxB__plus_lor_uint16.c +++ b/FactoryKernels/GB_AxB__plus_lor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_uint32.c b/FactoryKernels/GB_AxB__plus_lor_uint32.c index 432b0fbbcb..0d868f2df5 100644 --- a/FactoryKernels/GB_AxB__plus_lor_uint32.c +++ b/FactoryKernels/GB_AxB__plus_lor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_uint64.c b/FactoryKernels/GB_AxB__plus_lor_uint64.c index 9c8860768a..a241f867a2 100644 --- a/FactoryKernels/GB_AxB__plus_lor_uint64.c +++ b/FactoryKernels/GB_AxB__plus_lor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lor_uint8.c b/FactoryKernels/GB_AxB__plus_lor_uint8.c index 831fd18084..709e225ac3 100644 --- a/FactoryKernels/GB_AxB__plus_lor_uint8.c +++ b/FactoryKernels/GB_AxB__plus_lor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_fp32.c b/FactoryKernels/GB_AxB__plus_lxor_fp32.c index 253dae990f..f102f5dc91 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_fp32.c +++ b/FactoryKernels/GB_AxB__plus_lxor_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_fp64.c b/FactoryKernels/GB_AxB__plus_lxor_fp64.c index f68b03130e..e7051bced0 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_fp64.c +++ b/FactoryKernels/GB_AxB__plus_lxor_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_int16.c b/FactoryKernels/GB_AxB__plus_lxor_int16.c index 23b301c514..18b0bef6bf 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_int16.c +++ b/FactoryKernels/GB_AxB__plus_lxor_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_int32.c b/FactoryKernels/GB_AxB__plus_lxor_int32.c index 49abfc6f54..19bc447e7e 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_int32.c +++ b/FactoryKernels/GB_AxB__plus_lxor_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_int64.c b/FactoryKernels/GB_AxB__plus_lxor_int64.c index 981db9bb2b..c4fb620f49 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_int64.c +++ b/FactoryKernels/GB_AxB__plus_lxor_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_int8.c b/FactoryKernels/GB_AxB__plus_lxor_int8.c index 420e6b2d79..7783680f22 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_int8.c +++ b/FactoryKernels/GB_AxB__plus_lxor_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_uint16.c b/FactoryKernels/GB_AxB__plus_lxor_uint16.c index 07d2e49c52..e183725d79 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_uint16.c +++ b/FactoryKernels/GB_AxB__plus_lxor_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_uint32.c b/FactoryKernels/GB_AxB__plus_lxor_uint32.c index 8bd4b0a03c..1e7659e2da 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_uint32.c +++ b/FactoryKernels/GB_AxB__plus_lxor_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_uint64.c b/FactoryKernels/GB_AxB__plus_lxor_uint64.c index ef13e833d9..97bfb418d8 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_uint64.c +++ b/FactoryKernels/GB_AxB__plus_lxor_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_lxor_uint8.c b/FactoryKernels/GB_AxB__plus_lxor_uint8.c index eba9c9368f..52f47e1e47 100644 --- a/FactoryKernels/GB_AxB__plus_lxor_uint8.c +++ b/FactoryKernels/GB_AxB__plus_lxor_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_lxor_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_fp32.c b/FactoryKernels/GB_AxB__plus_max_fp32.c index b4c52b5edb..ee8c42b825 100644 --- a/FactoryKernels/GB_AxB__plus_max_fp32.c +++ b/FactoryKernels/GB_AxB__plus_max_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_fp64.c b/FactoryKernels/GB_AxB__plus_max_fp64.c index ed89ffdde9..6bd4905987 100644 --- a/FactoryKernels/GB_AxB__plus_max_fp64.c +++ b/FactoryKernels/GB_AxB__plus_max_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_int16.c b/FactoryKernels/GB_AxB__plus_max_int16.c index 0f7138922c..0c162e9ffb 100644 --- a/FactoryKernels/GB_AxB__plus_max_int16.c +++ b/FactoryKernels/GB_AxB__plus_max_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_int32.c b/FactoryKernels/GB_AxB__plus_max_int32.c index ab744ccca2..610322bff5 100644 --- a/FactoryKernels/GB_AxB__plus_max_int32.c +++ b/FactoryKernels/GB_AxB__plus_max_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_int64.c b/FactoryKernels/GB_AxB__plus_max_int64.c index 9c0d420708..c66080f6ad 100644 --- a/FactoryKernels/GB_AxB__plus_max_int64.c +++ b/FactoryKernels/GB_AxB__plus_max_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_int8.c b/FactoryKernels/GB_AxB__plus_max_int8.c index 8295e1840e..6a2dd47cd2 100644 --- a/FactoryKernels/GB_AxB__plus_max_int8.c +++ b/FactoryKernels/GB_AxB__plus_max_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_uint16.c b/FactoryKernels/GB_AxB__plus_max_uint16.c index 9e7fe5612a..d357ea1e92 100644 --- a/FactoryKernels/GB_AxB__plus_max_uint16.c +++ b/FactoryKernels/GB_AxB__plus_max_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_uint32.c b/FactoryKernels/GB_AxB__plus_max_uint32.c index a60e19deaf..03f9e7599f 100644 --- a/FactoryKernels/GB_AxB__plus_max_uint32.c +++ b/FactoryKernels/GB_AxB__plus_max_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_uint64.c b/FactoryKernels/GB_AxB__plus_max_uint64.c index 1db9214f99..9bea1dbf44 100644 --- a/FactoryKernels/GB_AxB__plus_max_uint64.c +++ b/FactoryKernels/GB_AxB__plus_max_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_max_uint8.c b/FactoryKernels/GB_AxB__plus_max_uint8.c index 159898e2f6..3737e4e92b 100644 --- a/FactoryKernels/GB_AxB__plus_max_uint8.c +++ b/FactoryKernels/GB_AxB__plus_max_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_max_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_fp32.c b/FactoryKernels/GB_AxB__plus_min_fp32.c index 40b3996b04..c7c1c5426d 100644 --- a/FactoryKernels/GB_AxB__plus_min_fp32.c +++ b/FactoryKernels/GB_AxB__plus_min_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_fp64.c b/FactoryKernels/GB_AxB__plus_min_fp64.c index 8946808bb5..6b873c95c0 100644 --- a/FactoryKernels/GB_AxB__plus_min_fp64.c +++ b/FactoryKernels/GB_AxB__plus_min_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_int16.c b/FactoryKernels/GB_AxB__plus_min_int16.c index c49a7fab82..aeca60a4c2 100644 --- a/FactoryKernels/GB_AxB__plus_min_int16.c +++ b/FactoryKernels/GB_AxB__plus_min_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_int32.c b/FactoryKernels/GB_AxB__plus_min_int32.c index 176be5b2e0..0b99d796b0 100644 --- a/FactoryKernels/GB_AxB__plus_min_int32.c +++ b/FactoryKernels/GB_AxB__plus_min_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_int64.c b/FactoryKernels/GB_AxB__plus_min_int64.c index b548aa64f0..baa0be6ede 100644 --- a/FactoryKernels/GB_AxB__plus_min_int64.c +++ b/FactoryKernels/GB_AxB__plus_min_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_int8.c b/FactoryKernels/GB_AxB__plus_min_int8.c index 5fecc49430..7332bf531a 100644 --- a/FactoryKernels/GB_AxB__plus_min_int8.c +++ b/FactoryKernels/GB_AxB__plus_min_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_uint16.c b/FactoryKernels/GB_AxB__plus_min_uint16.c index 47448ccfba..c891672f1d 100644 --- a/FactoryKernels/GB_AxB__plus_min_uint16.c +++ b/FactoryKernels/GB_AxB__plus_min_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_uint32.c b/FactoryKernels/GB_AxB__plus_min_uint32.c index ab67500774..70d27afdf6 100644 --- a/FactoryKernels/GB_AxB__plus_min_uint32.c +++ b/FactoryKernels/GB_AxB__plus_min_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_uint64.c b/FactoryKernels/GB_AxB__plus_min_uint64.c index 5a1233a5e0..52839e6c44 100644 --- a/FactoryKernels/GB_AxB__plus_min_uint64.c +++ b/FactoryKernels/GB_AxB__plus_min_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_min_uint8.c b/FactoryKernels/GB_AxB__plus_min_uint8.c index 8353a716af..343efd9791 100644 --- a/FactoryKernels/GB_AxB__plus_min_uint8.c +++ b/FactoryKernels/GB_AxB__plus_min_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_min_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_fc32.c b/FactoryKernels/GB_AxB__plus_minus_fc32.c index 55ffb2125f..ad59a11ff4 100644 --- a/FactoryKernels/GB_AxB__plus_minus_fc32.c +++ b/FactoryKernels/GB_AxB__plus_minus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_fc64.c b/FactoryKernels/GB_AxB__plus_minus_fc64.c index bdccac9d3c..87aa526927 100644 --- a/FactoryKernels/GB_AxB__plus_minus_fc64.c +++ b/FactoryKernels/GB_AxB__plus_minus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_fp32.c b/FactoryKernels/GB_AxB__plus_minus_fp32.c index f209f5a990..16ee229d7c 100644 --- a/FactoryKernels/GB_AxB__plus_minus_fp32.c +++ b/FactoryKernels/GB_AxB__plus_minus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_fp64.c b/FactoryKernels/GB_AxB__plus_minus_fp64.c index 69544368f5..686362b9ab 100644 --- a/FactoryKernels/GB_AxB__plus_minus_fp64.c +++ b/FactoryKernels/GB_AxB__plus_minus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_int16.c b/FactoryKernels/GB_AxB__plus_minus_int16.c index 5d7e46bf41..7959e31865 100644 --- a/FactoryKernels/GB_AxB__plus_minus_int16.c +++ b/FactoryKernels/GB_AxB__plus_minus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_int32.c b/FactoryKernels/GB_AxB__plus_minus_int32.c index b8005efe97..2e7f32e076 100644 --- a/FactoryKernels/GB_AxB__plus_minus_int32.c +++ b/FactoryKernels/GB_AxB__plus_minus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_int64.c b/FactoryKernels/GB_AxB__plus_minus_int64.c index 90614e6b46..73985778b3 100644 --- a/FactoryKernels/GB_AxB__plus_minus_int64.c +++ b/FactoryKernels/GB_AxB__plus_minus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_int8.c b/FactoryKernels/GB_AxB__plus_minus_int8.c index 33658d1de6..4ddbc6f51c 100644 --- a/FactoryKernels/GB_AxB__plus_minus_int8.c +++ b/FactoryKernels/GB_AxB__plus_minus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_uint16.c b/FactoryKernels/GB_AxB__plus_minus_uint16.c index ea57a88603..ece1950a05 100644 --- a/FactoryKernels/GB_AxB__plus_minus_uint16.c +++ b/FactoryKernels/GB_AxB__plus_minus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_uint32.c b/FactoryKernels/GB_AxB__plus_minus_uint32.c index 0cbf469fcd..ca20f247b4 100644 --- a/FactoryKernels/GB_AxB__plus_minus_uint32.c +++ b/FactoryKernels/GB_AxB__plus_minus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_uint64.c b/FactoryKernels/GB_AxB__plus_minus_uint64.c index 9deed4b3a1..5b5a09fefc 100644 --- a/FactoryKernels/GB_AxB__plus_minus_uint64.c +++ b/FactoryKernels/GB_AxB__plus_minus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_minus_uint8.c b/FactoryKernels/GB_AxB__plus_minus_uint8.c index fb65fdaf0c..516cc906b8 100644 --- a/FactoryKernels/GB_AxB__plus_minus_uint8.c +++ b/FactoryKernels/GB_AxB__plus_minus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_minus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_fc32.c b/FactoryKernels/GB_AxB__plus_pair_fc32.c index c1bb12796e..b05369a308 100644 --- a/FactoryKernels/GB_AxB__plus_pair_fc32.c +++ b/FactoryKernels/GB_AxB__plus_pair_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_fc64.c b/FactoryKernels/GB_AxB__plus_pair_fc64.c index 1857982f98..48c844e963 100644 --- a/FactoryKernels/GB_AxB__plus_pair_fc64.c +++ b/FactoryKernels/GB_AxB__plus_pair_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_fp32.c b/FactoryKernels/GB_AxB__plus_pair_fp32.c index 0874a4d65f..60034a8eb7 100644 --- a/FactoryKernels/GB_AxB__plus_pair_fp32.c +++ b/FactoryKernels/GB_AxB__plus_pair_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_fp64.c b/FactoryKernels/GB_AxB__plus_pair_fp64.c index 0a7258d179..3fb1973b64 100644 --- a/FactoryKernels/GB_AxB__plus_pair_fp64.c +++ b/FactoryKernels/GB_AxB__plus_pair_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_int16.c b/FactoryKernels/GB_AxB__plus_pair_int16.c index 6669618f8e..eab61c790b 100644 --- a/FactoryKernels/GB_AxB__plus_pair_int16.c +++ b/FactoryKernels/GB_AxB__plus_pair_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_int32.c b/FactoryKernels/GB_AxB__plus_pair_int32.c index 6a2a281ff0..66248f0cb8 100644 --- a/FactoryKernels/GB_AxB__plus_pair_int32.c +++ b/FactoryKernels/GB_AxB__plus_pair_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_int64.c b/FactoryKernels/GB_AxB__plus_pair_int64.c index 3c405ae306..e4f1c0c8fc 100644 --- a/FactoryKernels/GB_AxB__plus_pair_int64.c +++ b/FactoryKernels/GB_AxB__plus_pair_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_int8.c b/FactoryKernels/GB_AxB__plus_pair_int8.c index dfae65b13a..611f7ab7c5 100644 --- a/FactoryKernels/GB_AxB__plus_pair_int8.c +++ b/FactoryKernels/GB_AxB__plus_pair_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_uint16.c b/FactoryKernels/GB_AxB__plus_pair_uint16.c index 18bffa288e..c23a353ab2 100644 --- a/FactoryKernels/GB_AxB__plus_pair_uint16.c +++ b/FactoryKernels/GB_AxB__plus_pair_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_uint32.c b/FactoryKernels/GB_AxB__plus_pair_uint32.c index 9ea1d1fd39..1ae15af373 100644 --- a/FactoryKernels/GB_AxB__plus_pair_uint32.c +++ b/FactoryKernels/GB_AxB__plus_pair_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_uint64.c b/FactoryKernels/GB_AxB__plus_pair_uint64.c index b09770cd7e..2286492440 100644 --- a/FactoryKernels/GB_AxB__plus_pair_uint64.c +++ b/FactoryKernels/GB_AxB__plus_pair_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -460,3 +467,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_pair_uint8.c b/FactoryKernels/GB_AxB__plus_pair_uint8.c index 2916803aa5..aaa3cdb4d2 100644 --- a/FactoryKernels/GB_AxB__plus_pair_uint8.c +++ b/FactoryKernels/GB_AxB__plus_pair_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__plus_pair_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_fc32.c b/FactoryKernels/GB_AxB__plus_plus_fc32.c index 60e2b4e289..3076610120 100644 --- a/FactoryKernels/GB_AxB__plus_plus_fc32.c +++ b/FactoryKernels/GB_AxB__plus_plus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_fc64.c b/FactoryKernels/GB_AxB__plus_plus_fc64.c index 5a70f42987..3f5af4219d 100644 --- a/FactoryKernels/GB_AxB__plus_plus_fc64.c +++ b/FactoryKernels/GB_AxB__plus_plus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_fp32.c b/FactoryKernels/GB_AxB__plus_plus_fp32.c index 208e11ea08..72a8790585 100644 --- a/FactoryKernels/GB_AxB__plus_plus_fp32.c +++ b/FactoryKernels/GB_AxB__plus_plus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_fp64.c b/FactoryKernels/GB_AxB__plus_plus_fp64.c index 15c543c3a6..991f2ca229 100644 --- a/FactoryKernels/GB_AxB__plus_plus_fp64.c +++ b/FactoryKernels/GB_AxB__plus_plus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_int16.c b/FactoryKernels/GB_AxB__plus_plus_int16.c index 47a24b5e05..b3428eb997 100644 --- a/FactoryKernels/GB_AxB__plus_plus_int16.c +++ b/FactoryKernels/GB_AxB__plus_plus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_int32.c b/FactoryKernels/GB_AxB__plus_plus_int32.c index 810d34165b..5d2a36e844 100644 --- a/FactoryKernels/GB_AxB__plus_plus_int32.c +++ b/FactoryKernels/GB_AxB__plus_plus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_int64.c b/FactoryKernels/GB_AxB__plus_plus_int64.c index b34ccb151c..5f4c92777f 100644 --- a/FactoryKernels/GB_AxB__plus_plus_int64.c +++ b/FactoryKernels/GB_AxB__plus_plus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_int8.c b/FactoryKernels/GB_AxB__plus_plus_int8.c index 9c1c658468..56d20dbd74 100644 --- a/FactoryKernels/GB_AxB__plus_plus_int8.c +++ b/FactoryKernels/GB_AxB__plus_plus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_uint16.c b/FactoryKernels/GB_AxB__plus_plus_uint16.c index f5be5640ef..58ec8f0b75 100644 --- a/FactoryKernels/GB_AxB__plus_plus_uint16.c +++ b/FactoryKernels/GB_AxB__plus_plus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_uint32.c b/FactoryKernels/GB_AxB__plus_plus_uint32.c index 17fcfa4ba9..0f9cdf0464 100644 --- a/FactoryKernels/GB_AxB__plus_plus_uint32.c +++ b/FactoryKernels/GB_AxB__plus_plus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_uint64.c b/FactoryKernels/GB_AxB__plus_plus_uint64.c index ebe6f76192..b9e62f1fe0 100644 --- a/FactoryKernels/GB_AxB__plus_plus_uint64.c +++ b/FactoryKernels/GB_AxB__plus_plus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_plus_uint8.c b/FactoryKernels/GB_AxB__plus_plus_uint8.c index b3fff9ff49..6a3d7123ad 100644 --- a/FactoryKernels/GB_AxB__plus_plus_uint8.c +++ b/FactoryKernels/GB_AxB__plus_plus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_plus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_fc32.c b/FactoryKernels/GB_AxB__plus_rdiv_fc32.c index 3fce2cdf0b..8557a8dc9a 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_fc32.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_fc64.c b/FactoryKernels/GB_AxB__plus_rdiv_fc64.c index 7359fb6380..b3b18deb3b 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_fc64.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_fp32.c b/FactoryKernels/GB_AxB__plus_rdiv_fp32.c index 0433005f9c..5f5648bca5 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_fp32.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_fp64.c b/FactoryKernels/GB_AxB__plus_rdiv_fp64.c index 9c5c33c522..69a46c30d1 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_fp64.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_int16.c b/FactoryKernels/GB_AxB__plus_rdiv_int16.c index 697a6a896a..db6af97383 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_int16.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_int32.c b/FactoryKernels/GB_AxB__plus_rdiv_int32.c index 681db76f7e..41292c82a8 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_int32.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_int64.c b/FactoryKernels/GB_AxB__plus_rdiv_int64.c index e53f1b8e7a..65c41fe623 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_int64.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_int8.c b/FactoryKernels/GB_AxB__plus_rdiv_int8.c index 0c97b6c2c8..d4be4de3c0 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_int8.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_uint16.c b/FactoryKernels/GB_AxB__plus_rdiv_uint16.c index 0e8fb68192..eb99cb752b 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_uint16.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_uint32.c b/FactoryKernels/GB_AxB__plus_rdiv_uint32.c index 06ab020166..f918ca1239 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_uint32.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_uint64.c b/FactoryKernels/GB_AxB__plus_rdiv_uint64.c index 5dd600a093..76036d6be2 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_uint64.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rdiv_uint8.c b/FactoryKernels/GB_AxB__plus_rdiv_uint8.c index bfe8996ac0..abae69a7be 100644 --- a/FactoryKernels/GB_AxB__plus_rdiv_uint8.c +++ b/FactoryKernels/GB_AxB__plus_rdiv_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rdiv_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_fc32.c b/FactoryKernels/GB_AxB__plus_rminus_fc32.c index eb5f7cfb9c..40ac3c938f 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_fc32.c +++ b/FactoryKernels/GB_AxB__plus_rminus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_fc64.c b/FactoryKernels/GB_AxB__plus_rminus_fc64.c index 3f50a091eb..2c39e3ba2f 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_fc64.c +++ b/FactoryKernels/GB_AxB__plus_rminus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_fp32.c b/FactoryKernels/GB_AxB__plus_rminus_fp32.c index b56b1ba5c6..6bad7f656e 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_fp32.c +++ b/FactoryKernels/GB_AxB__plus_rminus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_fp64.c b/FactoryKernels/GB_AxB__plus_rminus_fp64.c index a69f7610c7..ca1187d89c 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_fp64.c +++ b/FactoryKernels/GB_AxB__plus_rminus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_int16.c b/FactoryKernels/GB_AxB__plus_rminus_int16.c index cdb09f11ae..8962570d82 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_int16.c +++ b/FactoryKernels/GB_AxB__plus_rminus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_int32.c b/FactoryKernels/GB_AxB__plus_rminus_int32.c index a6b950a580..faad15a3d3 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_int32.c +++ b/FactoryKernels/GB_AxB__plus_rminus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_int64.c b/FactoryKernels/GB_AxB__plus_rminus_int64.c index f0bdcf1b8a..85a55c69ff 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_int64.c +++ b/FactoryKernels/GB_AxB__plus_rminus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_int8.c b/FactoryKernels/GB_AxB__plus_rminus_int8.c index 58783eeefb..490e7139d0 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_int8.c +++ b/FactoryKernels/GB_AxB__plus_rminus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_uint16.c b/FactoryKernels/GB_AxB__plus_rminus_uint16.c index 3a16dfcb33..77bf421aba 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_uint16.c +++ b/FactoryKernels/GB_AxB__plus_rminus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_uint32.c b/FactoryKernels/GB_AxB__plus_rminus_uint32.c index 7c16101892..dab785deae 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_uint32.c +++ b/FactoryKernels/GB_AxB__plus_rminus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_uint64.c b/FactoryKernels/GB_AxB__plus_rminus_uint64.c index 27865d4f91..db711490f3 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_uint64.c +++ b/FactoryKernels/GB_AxB__plus_rminus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_rminus_uint8.c b/FactoryKernels/GB_AxB__plus_rminus_uint8.c index 37b21503c9..fc0c2688a9 100644 --- a/FactoryKernels/GB_AxB__plus_rminus_uint8.c +++ b/FactoryKernels/GB_AxB__plus_rminus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_rminus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_fc32.c b/FactoryKernels/GB_AxB__plus_second_fc32.c index 031ffe3f50..c738421824 100644 --- a/FactoryKernels/GB_AxB__plus_second_fc32.c +++ b/FactoryKernels/GB_AxB__plus_second_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_fc64.c b/FactoryKernels/GB_AxB__plus_second_fc64.c index 98be22ea43..2de7c09d01 100644 --- a/FactoryKernels/GB_AxB__plus_second_fc64.c +++ b/FactoryKernels/GB_AxB__plus_second_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_fp32.c b/FactoryKernels/GB_AxB__plus_second_fp32.c index c449eae00d..ed6d0f6040 100644 --- a/FactoryKernels/GB_AxB__plus_second_fp32.c +++ b/FactoryKernels/GB_AxB__plus_second_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_fp64.c b/FactoryKernels/GB_AxB__plus_second_fp64.c index a3e17bbed3..649f2b2f9f 100644 --- a/FactoryKernels/GB_AxB__plus_second_fp64.c +++ b/FactoryKernels/GB_AxB__plus_second_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_int16.c b/FactoryKernels/GB_AxB__plus_second_int16.c index 93635e40c4..5f6ab04607 100644 --- a/FactoryKernels/GB_AxB__plus_second_int16.c +++ b/FactoryKernels/GB_AxB__plus_second_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_int32.c b/FactoryKernels/GB_AxB__plus_second_int32.c index 17162dee38..b56c368208 100644 --- a/FactoryKernels/GB_AxB__plus_second_int32.c +++ b/FactoryKernels/GB_AxB__plus_second_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_int64.c b/FactoryKernels/GB_AxB__plus_second_int64.c index f0f40408f0..746ddc210d 100644 --- a/FactoryKernels/GB_AxB__plus_second_int64.c +++ b/FactoryKernels/GB_AxB__plus_second_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_int8.c b/FactoryKernels/GB_AxB__plus_second_int8.c index 4aca83f2fa..d5546c3ee3 100644 --- a/FactoryKernels/GB_AxB__plus_second_int8.c +++ b/FactoryKernels/GB_AxB__plus_second_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_uint16.c b/FactoryKernels/GB_AxB__plus_second_uint16.c index a12f47dc3e..f2bb3cb3cf 100644 --- a/FactoryKernels/GB_AxB__plus_second_uint16.c +++ b/FactoryKernels/GB_AxB__plus_second_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_uint32.c b/FactoryKernels/GB_AxB__plus_second_uint32.c index 0fe650177a..f4bad664e3 100644 --- a/FactoryKernels/GB_AxB__plus_second_uint32.c +++ b/FactoryKernels/GB_AxB__plus_second_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_uint64.c b/FactoryKernels/GB_AxB__plus_second_uint64.c index 0420f0b7c6..c6ef2c490d 100644 --- a/FactoryKernels/GB_AxB__plus_second_uint64.c +++ b/FactoryKernels/GB_AxB__plus_second_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_second_uint8.c b/FactoryKernels/GB_AxB__plus_second_uint8.c index 0502a709bb..cc4c481fc2 100644 --- a/FactoryKernels/GB_AxB__plus_second_uint8.c +++ b/FactoryKernels/GB_AxB__plus_second_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_second_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_secondj1_int32.c b/FactoryKernels/GB_AxB__plus_secondj1_int32.c index 3ec406214a..24e1be6531 100644 --- a/FactoryKernels/GB_AxB__plus_secondj1_int32.c +++ b/FactoryKernels/GB_AxB__plus_secondj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__plus_secondj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_secondj1_int64.c b/FactoryKernels/GB_AxB__plus_secondj1_int64.c index 73e0610493..a199fd6fd6 100644 --- a/FactoryKernels/GB_AxB__plus_secondj1_int64.c +++ b/FactoryKernels/GB_AxB__plus_secondj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -459,3 +466,5 @@ GrB_Info GB (_Asaxpy3B__plus_secondj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_secondj_int32.c b/FactoryKernels/GB_AxB__plus_secondj_int32.c index ed1d97a891..a5cdcb3a78 100644 --- a/FactoryKernels/GB_AxB__plus_secondj_int32.c +++ b/FactoryKernels/GB_AxB__plus_secondj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_secondj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_secondj_int64.c b/FactoryKernels/GB_AxB__plus_secondj_int64.c index 5713046a30..d5f9f48929 100644 --- a/FactoryKernels/GB_AxB__plus_secondj_int64.c +++ b/FactoryKernels/GB_AxB__plus_secondj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_secondj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_fc32.c b/FactoryKernels/GB_AxB__plus_times_fc32.c index b5a98b8e9b..acea50d301 100644 --- a/FactoryKernels/GB_AxB__plus_times_fc32.c +++ b/FactoryKernels/GB_AxB__plus_times_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_fc64.c b/FactoryKernels/GB_AxB__plus_times_fc64.c index 1fa3c5fc9c..826b04e4cf 100644 --- a/FactoryKernels/GB_AxB__plus_times_fc64.c +++ b/FactoryKernels/GB_AxB__plus_times_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_fp32.c b/FactoryKernels/GB_AxB__plus_times_fp32.c index f2fa0f0bfc..4f99228de3 100644 --- a/FactoryKernels/GB_AxB__plus_times_fp32.c +++ b/FactoryKernels/GB_AxB__plus_times_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -524,3 +531,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_fp64.c b/FactoryKernels/GB_AxB__plus_times_fp64.c index 40d1d7d2ae..b48d9c2415 100644 --- a/FactoryKernels/GB_AxB__plus_times_fp64.c +++ b/FactoryKernels/GB_AxB__plus_times_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -524,3 +531,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_int16.c b/FactoryKernels/GB_AxB__plus_times_int16.c index 585a088f37..64ad118c0c 100644 --- a/FactoryKernels/GB_AxB__plus_times_int16.c +++ b/FactoryKernels/GB_AxB__plus_times_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_int32.c b/FactoryKernels/GB_AxB__plus_times_int32.c index ec80e122be..1a3c3132f3 100644 --- a/FactoryKernels/GB_AxB__plus_times_int32.c +++ b/FactoryKernels/GB_AxB__plus_times_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_int64.c b/FactoryKernels/GB_AxB__plus_times_int64.c index bc11ddf3e4..9f1492bc5d 100644 --- a/FactoryKernels/GB_AxB__plus_times_int64.c +++ b/FactoryKernels/GB_AxB__plus_times_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_int8.c b/FactoryKernels/GB_AxB__plus_times_int8.c index eec7019605..8a515ce86a 100644 --- a/FactoryKernels/GB_AxB__plus_times_int8.c +++ b/FactoryKernels/GB_AxB__plus_times_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_uint16.c b/FactoryKernels/GB_AxB__plus_times_uint16.c index ec883607ec..e6eb22900b 100644 --- a/FactoryKernels/GB_AxB__plus_times_uint16.c +++ b/FactoryKernels/GB_AxB__plus_times_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_uint32.c b/FactoryKernels/GB_AxB__plus_times_uint32.c index a493e87537..3833b4ae88 100644 --- a/FactoryKernels/GB_AxB__plus_times_uint32.c +++ b/FactoryKernels/GB_AxB__plus_times_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_uint64.c b/FactoryKernels/GB_AxB__plus_times_uint64.c index 1a28d4ea62..2dbbe91d4a 100644 --- a/FactoryKernels/GB_AxB__plus_times_uint64.c +++ b/FactoryKernels/GB_AxB__plus_times_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__plus_times_uint8.c b/FactoryKernels/GB_AxB__plus_times_uint8.c index c5a3a5acd2..896fed148d 100644 --- a/FactoryKernels/GB_AxB__plus_times_uint8.c +++ b/FactoryKernels/GB_AxB__plus_times_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__plus_times_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_fc32.c b/FactoryKernels/GB_AxB__times_div_fc32.c index 83d7b398a8..4db197786c 100644 --- a/FactoryKernels/GB_AxB__times_div_fc32.c +++ b/FactoryKernels/GB_AxB__times_div_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_div_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_fc64.c b/FactoryKernels/GB_AxB__times_div_fc64.c index 6453026f04..4e7e6b17cc 100644 --- a/FactoryKernels/GB_AxB__times_div_fc64.c +++ b/FactoryKernels/GB_AxB__times_div_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -450,3 +457,5 @@ GrB_Info GB (_Asaxpy3B__times_div_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_fp32.c b/FactoryKernels/GB_AxB__times_div_fp32.c index 96445a2f14..838614aaf3 100644 --- a/FactoryKernels/GB_AxB__times_div_fp32.c +++ b/FactoryKernels/GB_AxB__times_div_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_div_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_fp64.c b/FactoryKernels/GB_AxB__times_div_fp64.c index 419bc36594..b8b8db9967 100644 --- a/FactoryKernels/GB_AxB__times_div_fp64.c +++ b/FactoryKernels/GB_AxB__times_div_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_div_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_int16.c b/FactoryKernels/GB_AxB__times_div_int16.c index 89e0ed82ca..ce34c9b802 100644 --- a/FactoryKernels/GB_AxB__times_div_int16.c +++ b/FactoryKernels/GB_AxB__times_div_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_div_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_int32.c b/FactoryKernels/GB_AxB__times_div_int32.c index 2c3ab224e3..c2847105e4 100644 --- a/FactoryKernels/GB_AxB__times_div_int32.c +++ b/FactoryKernels/GB_AxB__times_div_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_div_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_int64.c b/FactoryKernels/GB_AxB__times_div_int64.c index 992074a978..536ee3de5b 100644 --- a/FactoryKernels/GB_AxB__times_div_int64.c +++ b/FactoryKernels/GB_AxB__times_div_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_div_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_int8.c b/FactoryKernels/GB_AxB__times_div_int8.c index 5ced5aa65c..4d702d6343 100644 --- a/FactoryKernels/GB_AxB__times_div_int8.c +++ b/FactoryKernels/GB_AxB__times_div_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_div_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_uint16.c b/FactoryKernels/GB_AxB__times_div_uint16.c index 5ebd917873..cb7de2e51b 100644 --- a/FactoryKernels/GB_AxB__times_div_uint16.c +++ b/FactoryKernels/GB_AxB__times_div_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_div_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_uint32.c b/FactoryKernels/GB_AxB__times_div_uint32.c index 0d22c99d4b..08be58a173 100644 --- a/FactoryKernels/GB_AxB__times_div_uint32.c +++ b/FactoryKernels/GB_AxB__times_div_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_div_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_uint64.c b/FactoryKernels/GB_AxB__times_div_uint64.c index a2b15e924d..163cb8c554 100644 --- a/FactoryKernels/GB_AxB__times_div_uint64.c +++ b/FactoryKernels/GB_AxB__times_div_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_div_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_div_uint8.c b/FactoryKernels/GB_AxB__times_div_uint8.c index fe0869254b..7bc3cdc08b 100644 --- a/FactoryKernels/GB_AxB__times_div_uint8.c +++ b/FactoryKernels/GB_AxB__times_div_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_div_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_fc32.c b/FactoryKernels/GB_AxB__times_first_fc32.c index 1ab5d4e4d9..d05fdda979 100644 --- a/FactoryKernels/GB_AxB__times_first_fc32.c +++ b/FactoryKernels/GB_AxB__times_first_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__times_first_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_fc64.c b/FactoryKernels/GB_AxB__times_first_fc64.c index f9538e3824..401a65a55f 100644 --- a/FactoryKernels/GB_AxB__times_first_fc64.c +++ b/FactoryKernels/GB_AxB__times_first_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -451,3 +458,5 @@ GrB_Info GB (_Asaxpy3B__times_first_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_fp32.c b/FactoryKernels/GB_AxB__times_first_fp32.c index 640e104690..c35d470f16 100644 --- a/FactoryKernels/GB_AxB__times_first_fp32.c +++ b/FactoryKernels/GB_AxB__times_first_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__times_first_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_fp64.c b/FactoryKernels/GB_AxB__times_first_fp64.c index f3cc395e4e..b31a5ea2f4 100644 --- a/FactoryKernels/GB_AxB__times_first_fp64.c +++ b/FactoryKernels/GB_AxB__times_first_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -454,3 +461,5 @@ GrB_Info GB (_Asaxpy3B__times_first_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_int16.c b/FactoryKernels/GB_AxB__times_first_int16.c index 1634bd96b1..89118d2ef4 100644 --- a/FactoryKernels/GB_AxB__times_first_int16.c +++ b/FactoryKernels/GB_AxB__times_first_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_first_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_int32.c b/FactoryKernels/GB_AxB__times_first_int32.c index cd052f612b..310d072adf 100644 --- a/FactoryKernels/GB_AxB__times_first_int32.c +++ b/FactoryKernels/GB_AxB__times_first_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_first_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_int64.c b/FactoryKernels/GB_AxB__times_first_int64.c index 2c5f162f9f..d91877374e 100644 --- a/FactoryKernels/GB_AxB__times_first_int64.c +++ b/FactoryKernels/GB_AxB__times_first_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__times_first_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_int8.c b/FactoryKernels/GB_AxB__times_first_int8.c index 2584ab529e..b4a81a12cb 100644 --- a/FactoryKernels/GB_AxB__times_first_int8.c +++ b/FactoryKernels/GB_AxB__times_first_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__times_first_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_uint16.c b/FactoryKernels/GB_AxB__times_first_uint16.c index d5524ee1c1..a00d31d75b 100644 --- a/FactoryKernels/GB_AxB__times_first_uint16.c +++ b/FactoryKernels/GB_AxB__times_first_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_first_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_uint32.c b/FactoryKernels/GB_AxB__times_first_uint32.c index 4b5257ab99..a0ae02e127 100644 --- a/FactoryKernels/GB_AxB__times_first_uint32.c +++ b/FactoryKernels/GB_AxB__times_first_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_first_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_uint64.c b/FactoryKernels/GB_AxB__times_first_uint64.c index a3919ebad0..a04d1bde1d 100644 --- a/FactoryKernels/GB_AxB__times_first_uint64.c +++ b/FactoryKernels/GB_AxB__times_first_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__times_first_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_first_uint8.c b/FactoryKernels/GB_AxB__times_first_uint8.c index 84e0d053b5..9e2281e62a 100644 --- a/FactoryKernels/GB_AxB__times_first_uint8.c +++ b/FactoryKernels/GB_AxB__times_first_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__times_first_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_firsti1_int32.c b/FactoryKernels/GB_AxB__times_firsti1_int32.c index 5c615eb74f..96dca28122 100644 --- a/FactoryKernels/GB_AxB__times_firsti1_int32.c +++ b/FactoryKernels/GB_AxB__times_firsti1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_firsti1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_firsti1_int64.c b/FactoryKernels/GB_AxB__times_firsti1_int64.c index 137c7a4ce2..846904d3f4 100644 --- a/FactoryKernels/GB_AxB__times_firsti1_int64.c +++ b/FactoryKernels/GB_AxB__times_firsti1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_firsti1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_firsti_int32.c b/FactoryKernels/GB_AxB__times_firsti_int32.c index dc3ee44043..b3bcadb7d5 100644 --- a/FactoryKernels/GB_AxB__times_firsti_int32.c +++ b/FactoryKernels/GB_AxB__times_firsti_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_firsti_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_firsti_int64.c b/FactoryKernels/GB_AxB__times_firsti_int64.c index 51236a54f9..68888e0297 100644 --- a/FactoryKernels/GB_AxB__times_firsti_int64.c +++ b/FactoryKernels/GB_AxB__times_firsti_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_firsti_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_firstj1_int32.c b/FactoryKernels/GB_AxB__times_firstj1_int32.c index 0e8ac5e9c5..df53557736 100644 --- a/FactoryKernels/GB_AxB__times_firstj1_int32.c +++ b/FactoryKernels/GB_AxB__times_firstj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__times_firstj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_firstj1_int64.c b/FactoryKernels/GB_AxB__times_firstj1_int64.c index e406eb0337..18322a4233 100644 --- a/FactoryKernels/GB_AxB__times_firstj1_int64.c +++ b/FactoryKernels/GB_AxB__times_firstj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__times_firstj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_firstj_int32.c b/FactoryKernels/GB_AxB__times_firstj_int32.c index fdd58c0b2b..830c4d74c7 100644 --- a/FactoryKernels/GB_AxB__times_firstj_int32.c +++ b/FactoryKernels/GB_AxB__times_firstj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_firstj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_firstj_int64.c b/FactoryKernels/GB_AxB__times_firstj_int64.c index 26e1cd8259..7ea4597589 100644 --- a/FactoryKernels/GB_AxB__times_firstj_int64.c +++ b/FactoryKernels/GB_AxB__times_firstj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_firstj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_fp32.c b/FactoryKernels/GB_AxB__times_max_fp32.c index 92824809a7..94858994b5 100644 --- a/FactoryKernels/GB_AxB__times_max_fp32.c +++ b/FactoryKernels/GB_AxB__times_max_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_max_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_fp64.c b/FactoryKernels/GB_AxB__times_max_fp64.c index 3fbca9e927..491680637c 100644 --- a/FactoryKernels/GB_AxB__times_max_fp64.c +++ b/FactoryKernels/GB_AxB__times_max_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_max_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_int16.c b/FactoryKernels/GB_AxB__times_max_int16.c index 422b522b1e..c9b0c71d9d 100644 --- a/FactoryKernels/GB_AxB__times_max_int16.c +++ b/FactoryKernels/GB_AxB__times_max_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_max_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_int32.c b/FactoryKernels/GB_AxB__times_max_int32.c index 56752b8da7..21df36d0e4 100644 --- a/FactoryKernels/GB_AxB__times_max_int32.c +++ b/FactoryKernels/GB_AxB__times_max_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_max_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_int64.c b/FactoryKernels/GB_AxB__times_max_int64.c index 458558cbfc..7351dc6829 100644 --- a/FactoryKernels/GB_AxB__times_max_int64.c +++ b/FactoryKernels/GB_AxB__times_max_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_max_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_int8.c b/FactoryKernels/GB_AxB__times_max_int8.c index 252c213d99..1987313ff5 100644 --- a/FactoryKernels/GB_AxB__times_max_int8.c +++ b/FactoryKernels/GB_AxB__times_max_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_max_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_uint16.c b/FactoryKernels/GB_AxB__times_max_uint16.c index 59d59a7df9..792d7e3322 100644 --- a/FactoryKernels/GB_AxB__times_max_uint16.c +++ b/FactoryKernels/GB_AxB__times_max_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_max_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_uint32.c b/FactoryKernels/GB_AxB__times_max_uint32.c index a9e7ad1997..07f68965be 100644 --- a/FactoryKernels/GB_AxB__times_max_uint32.c +++ b/FactoryKernels/GB_AxB__times_max_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_max_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_uint64.c b/FactoryKernels/GB_AxB__times_max_uint64.c index 940abf3d89..7eff3ed520 100644 --- a/FactoryKernels/GB_AxB__times_max_uint64.c +++ b/FactoryKernels/GB_AxB__times_max_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_max_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_max_uint8.c b/FactoryKernels/GB_AxB__times_max_uint8.c index b4b3d154cf..a2d25b5e86 100644 --- a/FactoryKernels/GB_AxB__times_max_uint8.c +++ b/FactoryKernels/GB_AxB__times_max_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_max_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_fp32.c b/FactoryKernels/GB_AxB__times_min_fp32.c index e546d59a38..423ca10822 100644 --- a/FactoryKernels/GB_AxB__times_min_fp32.c +++ b/FactoryKernels/GB_AxB__times_min_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_min_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_fp64.c b/FactoryKernels/GB_AxB__times_min_fp64.c index caf95892ab..70941a612d 100644 --- a/FactoryKernels/GB_AxB__times_min_fp64.c +++ b/FactoryKernels/GB_AxB__times_min_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_min_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_int16.c b/FactoryKernels/GB_AxB__times_min_int16.c index 77483020c5..90fb3a7c53 100644 --- a/FactoryKernels/GB_AxB__times_min_int16.c +++ b/FactoryKernels/GB_AxB__times_min_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_min_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_int32.c b/FactoryKernels/GB_AxB__times_min_int32.c index b8f997f7fb..a228c3b1cf 100644 --- a/FactoryKernels/GB_AxB__times_min_int32.c +++ b/FactoryKernels/GB_AxB__times_min_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_min_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_int64.c b/FactoryKernels/GB_AxB__times_min_int64.c index 31e6fd94d2..04f8119fff 100644 --- a/FactoryKernels/GB_AxB__times_min_int64.c +++ b/FactoryKernels/GB_AxB__times_min_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_min_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_int8.c b/FactoryKernels/GB_AxB__times_min_int8.c index 4902615e7b..8a495ff649 100644 --- a/FactoryKernels/GB_AxB__times_min_int8.c +++ b/FactoryKernels/GB_AxB__times_min_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_min_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_uint16.c b/FactoryKernels/GB_AxB__times_min_uint16.c index 1faf70326e..706d710ed1 100644 --- a/FactoryKernels/GB_AxB__times_min_uint16.c +++ b/FactoryKernels/GB_AxB__times_min_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_min_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_uint32.c b/FactoryKernels/GB_AxB__times_min_uint32.c index 278b74caf7..123e1a43c0 100644 --- a/FactoryKernels/GB_AxB__times_min_uint32.c +++ b/FactoryKernels/GB_AxB__times_min_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_min_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_uint64.c b/FactoryKernels/GB_AxB__times_min_uint64.c index a459bdc5e8..511966397a 100644 --- a/FactoryKernels/GB_AxB__times_min_uint64.c +++ b/FactoryKernels/GB_AxB__times_min_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_min_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_min_uint8.c b/FactoryKernels/GB_AxB__times_min_uint8.c index 24296904d5..42223a76ce 100644 --- a/FactoryKernels/GB_AxB__times_min_uint8.c +++ b/FactoryKernels/GB_AxB__times_min_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_min_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_fc32.c b/FactoryKernels/GB_AxB__times_minus_fc32.c index 842cd5d6c1..b7eb67e023 100644 --- a/FactoryKernels/GB_AxB__times_minus_fc32.c +++ b/FactoryKernels/GB_AxB__times_minus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_fc64.c b/FactoryKernels/GB_AxB__times_minus_fc64.c index 83814099f3..82ec5d6ad2 100644 --- a/FactoryKernels/GB_AxB__times_minus_fc64.c +++ b/FactoryKernels/GB_AxB__times_minus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -450,3 +457,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_fp32.c b/FactoryKernels/GB_AxB__times_minus_fp32.c index 887fe1d65f..d427ebaf82 100644 --- a/FactoryKernels/GB_AxB__times_minus_fp32.c +++ b/FactoryKernels/GB_AxB__times_minus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_fp64.c b/FactoryKernels/GB_AxB__times_minus_fp64.c index 00bda81c58..8047acfa03 100644 --- a/FactoryKernels/GB_AxB__times_minus_fp64.c +++ b/FactoryKernels/GB_AxB__times_minus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_int16.c b/FactoryKernels/GB_AxB__times_minus_int16.c index d101aeeb8d..93401c7835 100644 --- a/FactoryKernels/GB_AxB__times_minus_int16.c +++ b/FactoryKernels/GB_AxB__times_minus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_int32.c b/FactoryKernels/GB_AxB__times_minus_int32.c index c4e6c7a630..3e7461d495 100644 --- a/FactoryKernels/GB_AxB__times_minus_int32.c +++ b/FactoryKernels/GB_AxB__times_minus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_int64.c b/FactoryKernels/GB_AxB__times_minus_int64.c index 738fe7baa2..6d7a17a5ea 100644 --- a/FactoryKernels/GB_AxB__times_minus_int64.c +++ b/FactoryKernels/GB_AxB__times_minus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_int8.c b/FactoryKernels/GB_AxB__times_minus_int8.c index e9ea26b5f4..a690900ae9 100644 --- a/FactoryKernels/GB_AxB__times_minus_int8.c +++ b/FactoryKernels/GB_AxB__times_minus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_uint16.c b/FactoryKernels/GB_AxB__times_minus_uint16.c index c744b0a26d..a5020d8751 100644 --- a/FactoryKernels/GB_AxB__times_minus_uint16.c +++ b/FactoryKernels/GB_AxB__times_minus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_uint32.c b/FactoryKernels/GB_AxB__times_minus_uint32.c index 3e3037b01a..6ba4ea29e4 100644 --- a/FactoryKernels/GB_AxB__times_minus_uint32.c +++ b/FactoryKernels/GB_AxB__times_minus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_uint64.c b/FactoryKernels/GB_AxB__times_minus_uint64.c index 385401819d..6c67709187 100644 --- a/FactoryKernels/GB_AxB__times_minus_uint64.c +++ b/FactoryKernels/GB_AxB__times_minus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_minus_uint8.c b/FactoryKernels/GB_AxB__times_minus_uint8.c index f8803999f5..7e9435553f 100644 --- a/FactoryKernels/GB_AxB__times_minus_uint8.c +++ b/FactoryKernels/GB_AxB__times_minus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_minus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_fc32.c b/FactoryKernels/GB_AxB__times_plus_fc32.c index 2bb9af2ff0..3fafe592e6 100644 --- a/FactoryKernels/GB_AxB__times_plus_fc32.c +++ b/FactoryKernels/GB_AxB__times_plus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_fc64.c b/FactoryKernels/GB_AxB__times_plus_fc64.c index f462b3e69d..2b716f1a35 100644 --- a/FactoryKernels/GB_AxB__times_plus_fc64.c +++ b/FactoryKernels/GB_AxB__times_plus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -450,3 +457,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_fp32.c b/FactoryKernels/GB_AxB__times_plus_fp32.c index 04f2e1a40a..d40b23b9a8 100644 --- a/FactoryKernels/GB_AxB__times_plus_fp32.c +++ b/FactoryKernels/GB_AxB__times_plus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_fp64.c b/FactoryKernels/GB_AxB__times_plus_fp64.c index fc719c6ede..cb531077be 100644 --- a/FactoryKernels/GB_AxB__times_plus_fp64.c +++ b/FactoryKernels/GB_AxB__times_plus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_int16.c b/FactoryKernels/GB_AxB__times_plus_int16.c index 6e096e6569..535075095f 100644 --- a/FactoryKernels/GB_AxB__times_plus_int16.c +++ b/FactoryKernels/GB_AxB__times_plus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_int32.c b/FactoryKernels/GB_AxB__times_plus_int32.c index 6c4e12d433..34c352c0c9 100644 --- a/FactoryKernels/GB_AxB__times_plus_int32.c +++ b/FactoryKernels/GB_AxB__times_plus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_int64.c b/FactoryKernels/GB_AxB__times_plus_int64.c index e223439171..542617d8b4 100644 --- a/FactoryKernels/GB_AxB__times_plus_int64.c +++ b/FactoryKernels/GB_AxB__times_plus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_int8.c b/FactoryKernels/GB_AxB__times_plus_int8.c index 6c0a4db986..a0d39c944e 100644 --- a/FactoryKernels/GB_AxB__times_plus_int8.c +++ b/FactoryKernels/GB_AxB__times_plus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_uint16.c b/FactoryKernels/GB_AxB__times_plus_uint16.c index b996009be5..ea84d01c97 100644 --- a/FactoryKernels/GB_AxB__times_plus_uint16.c +++ b/FactoryKernels/GB_AxB__times_plus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_uint32.c b/FactoryKernels/GB_AxB__times_plus_uint32.c index 41b83ffd74..efab3eb637 100644 --- a/FactoryKernels/GB_AxB__times_plus_uint32.c +++ b/FactoryKernels/GB_AxB__times_plus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_uint64.c b/FactoryKernels/GB_AxB__times_plus_uint64.c index f6e101f9fa..58e96bc4af 100644 --- a/FactoryKernels/GB_AxB__times_plus_uint64.c +++ b/FactoryKernels/GB_AxB__times_plus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_plus_uint8.c b/FactoryKernels/GB_AxB__times_plus_uint8.c index 90234d510e..ee2c67af13 100644 --- a/FactoryKernels/GB_AxB__times_plus_uint8.c +++ b/FactoryKernels/GB_AxB__times_plus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_plus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_fc32.c b/FactoryKernels/GB_AxB__times_rdiv_fc32.c index ebb1551e34..9ace35a11c 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_fc32.c +++ b/FactoryKernels/GB_AxB__times_rdiv_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_fc64.c b/FactoryKernels/GB_AxB__times_rdiv_fc64.c index f7b83a5a8a..e90075d59c 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_fc64.c +++ b/FactoryKernels/GB_AxB__times_rdiv_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -450,3 +457,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_fp32.c b/FactoryKernels/GB_AxB__times_rdiv_fp32.c index d9d5f2ff22..358d136577 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_fp32.c +++ b/FactoryKernels/GB_AxB__times_rdiv_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_fp64.c b/FactoryKernels/GB_AxB__times_rdiv_fp64.c index 5cacb7c957..766efdbb55 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_fp64.c +++ b/FactoryKernels/GB_AxB__times_rdiv_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_int16.c b/FactoryKernels/GB_AxB__times_rdiv_int16.c index d3ccf51e25..71f8268ce9 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_int16.c +++ b/FactoryKernels/GB_AxB__times_rdiv_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_int32.c b/FactoryKernels/GB_AxB__times_rdiv_int32.c index 79cc77cbfa..8e0eba881d 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_int32.c +++ b/FactoryKernels/GB_AxB__times_rdiv_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_int64.c b/FactoryKernels/GB_AxB__times_rdiv_int64.c index 6ad75805e6..d9c46dd329 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_int64.c +++ b/FactoryKernels/GB_AxB__times_rdiv_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_int8.c b/FactoryKernels/GB_AxB__times_rdiv_int8.c index e6f5a9d221..cb7f523988 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_int8.c +++ b/FactoryKernels/GB_AxB__times_rdiv_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_uint16.c b/FactoryKernels/GB_AxB__times_rdiv_uint16.c index f054177160..80ba9f11ca 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_uint16.c +++ b/FactoryKernels/GB_AxB__times_rdiv_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_uint32.c b/FactoryKernels/GB_AxB__times_rdiv_uint32.c index 8282ff801a..e76ee2a875 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_uint32.c +++ b/FactoryKernels/GB_AxB__times_rdiv_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_uint64.c b/FactoryKernels/GB_AxB__times_rdiv_uint64.c index 993fc8a849..62e0967204 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_uint64.c +++ b/FactoryKernels/GB_AxB__times_rdiv_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rdiv_uint8.c b/FactoryKernels/GB_AxB__times_rdiv_uint8.c index 50666205ae..2fe1ad8ca9 100644 --- a/FactoryKernels/GB_AxB__times_rdiv_uint8.c +++ b/FactoryKernels/GB_AxB__times_rdiv_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_rdiv_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_fc32.c b/FactoryKernels/GB_AxB__times_rminus_fc32.c index 96388362a2..73b062e556 100644 --- a/FactoryKernels/GB_AxB__times_rminus_fc32.c +++ b/FactoryKernels/GB_AxB__times_rminus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_fc64.c b/FactoryKernels/GB_AxB__times_rminus_fc64.c index fd57aab9bd..9645050646 100644 --- a/FactoryKernels/GB_AxB__times_rminus_fc64.c +++ b/FactoryKernels/GB_AxB__times_rminus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -450,3 +457,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_fp32.c b/FactoryKernels/GB_AxB__times_rminus_fp32.c index d41dd96a50..07e3ad7426 100644 --- a/FactoryKernels/GB_AxB__times_rminus_fp32.c +++ b/FactoryKernels/GB_AxB__times_rminus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_fp64.c b/FactoryKernels/GB_AxB__times_rminus_fp64.c index e67c7f5ad0..8b6aa912e6 100644 --- a/FactoryKernels/GB_AxB__times_rminus_fp64.c +++ b/FactoryKernels/GB_AxB__times_rminus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_int16.c b/FactoryKernels/GB_AxB__times_rminus_int16.c index 1a0db0ddc9..d54ab27758 100644 --- a/FactoryKernels/GB_AxB__times_rminus_int16.c +++ b/FactoryKernels/GB_AxB__times_rminus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_int32.c b/FactoryKernels/GB_AxB__times_rminus_int32.c index f88547ba8c..f029e2eb67 100644 --- a/FactoryKernels/GB_AxB__times_rminus_int32.c +++ b/FactoryKernels/GB_AxB__times_rminus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_int64.c b/FactoryKernels/GB_AxB__times_rminus_int64.c index 58bd61e7c4..fc83d7371d 100644 --- a/FactoryKernels/GB_AxB__times_rminus_int64.c +++ b/FactoryKernels/GB_AxB__times_rminus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_int8.c b/FactoryKernels/GB_AxB__times_rminus_int8.c index f237f12888..629e8ac753 100644 --- a/FactoryKernels/GB_AxB__times_rminus_int8.c +++ b/FactoryKernels/GB_AxB__times_rminus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_uint16.c b/FactoryKernels/GB_AxB__times_rminus_uint16.c index f90fdbacfd..e5874b7269 100644 --- a/FactoryKernels/GB_AxB__times_rminus_uint16.c +++ b/FactoryKernels/GB_AxB__times_rminus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_uint32.c b/FactoryKernels/GB_AxB__times_rminus_uint32.c index fe4febd26a..461bd0f21e 100644 --- a/FactoryKernels/GB_AxB__times_rminus_uint32.c +++ b/FactoryKernels/GB_AxB__times_rminus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_uint64.c b/FactoryKernels/GB_AxB__times_rminus_uint64.c index c1694addd8..77c69b0d2c 100644 --- a/FactoryKernels/GB_AxB__times_rminus_uint64.c +++ b/FactoryKernels/GB_AxB__times_rminus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_rminus_uint8.c b/FactoryKernels/GB_AxB__times_rminus_uint8.c index 0ba387902c..20e3edcc4d 100644 --- a/FactoryKernels/GB_AxB__times_rminus_uint8.c +++ b/FactoryKernels/GB_AxB__times_rminus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_rminus_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_fc32.c b/FactoryKernels/GB_AxB__times_second_fc32.c index b6d90e9ee4..d093527c40 100644 --- a/FactoryKernels/GB_AxB__times_second_fc32.c +++ b/FactoryKernels/GB_AxB__times_second_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_second_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_fc64.c b/FactoryKernels/GB_AxB__times_second_fc64.c index 7ecadb7805..29f5d16300 100644 --- a/FactoryKernels/GB_AxB__times_second_fc64.c +++ b/FactoryKernels/GB_AxB__times_second_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -450,3 +457,5 @@ GrB_Info GB (_Asaxpy3B__times_second_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_fp32.c b/FactoryKernels/GB_AxB__times_second_fp32.c index 3f6080534d..8b929e4521 100644 --- a/FactoryKernels/GB_AxB__times_second_fp32.c +++ b/FactoryKernels/GB_AxB__times_second_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_second_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_fp64.c b/FactoryKernels/GB_AxB__times_second_fp64.c index 2fda0ab4d3..982c81ab8d 100644 --- a/FactoryKernels/GB_AxB__times_second_fp64.c +++ b/FactoryKernels/GB_AxB__times_second_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_second_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_int16.c b/FactoryKernels/GB_AxB__times_second_int16.c index 2ba373753e..78bce391ed 100644 --- a/FactoryKernels/GB_AxB__times_second_int16.c +++ b/FactoryKernels/GB_AxB__times_second_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_second_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_int32.c b/FactoryKernels/GB_AxB__times_second_int32.c index 15d902c2bb..7eb8a805b0 100644 --- a/FactoryKernels/GB_AxB__times_second_int32.c +++ b/FactoryKernels/GB_AxB__times_second_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_second_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_int64.c b/FactoryKernels/GB_AxB__times_second_int64.c index 87d207dab6..c8b2e9a0d6 100644 --- a/FactoryKernels/GB_AxB__times_second_int64.c +++ b/FactoryKernels/GB_AxB__times_second_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_second_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_int8.c b/FactoryKernels/GB_AxB__times_second_int8.c index c939c310ee..3707b67dd2 100644 --- a/FactoryKernels/GB_AxB__times_second_int8.c +++ b/FactoryKernels/GB_AxB__times_second_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_second_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_uint16.c b/FactoryKernels/GB_AxB__times_second_uint16.c index 613572b064..a898e1ca71 100644 --- a/FactoryKernels/GB_AxB__times_second_uint16.c +++ b/FactoryKernels/GB_AxB__times_second_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_second_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_uint32.c b/FactoryKernels/GB_AxB__times_second_uint32.c index 76a1921710..2761b39021 100644 --- a/FactoryKernels/GB_AxB__times_second_uint32.c +++ b/FactoryKernels/GB_AxB__times_second_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_second_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_uint64.c b/FactoryKernels/GB_AxB__times_second_uint64.c index 5f5b1b1a38..fcdfc69736 100644 --- a/FactoryKernels/GB_AxB__times_second_uint64.c +++ b/FactoryKernels/GB_AxB__times_second_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_second_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_second_uint8.c b/FactoryKernels/GB_AxB__times_second_uint8.c index bd0fb595b4..7eebc40245 100644 --- a/FactoryKernels/GB_AxB__times_second_uint8.c +++ b/FactoryKernels/GB_AxB__times_second_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_second_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_secondj1_int32.c b/FactoryKernels/GB_AxB__times_secondj1_int32.c index 3b9340cd02..e73b296ac7 100644 --- a/FactoryKernels/GB_AxB__times_secondj1_int32.c +++ b/FactoryKernels/GB_AxB__times_secondj1_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__times_secondj1_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_secondj1_int64.c b/FactoryKernels/GB_AxB__times_secondj1_int64.c index 04d9f05cda..3de13b7c62 100644 --- a/FactoryKernels/GB_AxB__times_secondj1_int64.c +++ b/FactoryKernels/GB_AxB__times_secondj1_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -458,3 +465,5 @@ GrB_Info GB (_Asaxpy3B__times_secondj1_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_secondj_int32.c b/FactoryKernels/GB_AxB__times_secondj_int32.c index 5961c12a66..80fb73b328 100644 --- a/FactoryKernels/GB_AxB__times_secondj_int32.c +++ b/FactoryKernels/GB_AxB__times_secondj_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_secondj_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_secondj_int64.c b/FactoryKernels/GB_AxB__times_secondj_int64.c index f187fb76a4..bda597809f 100644 --- a/FactoryKernels/GB_AxB__times_secondj_int64.c +++ b/FactoryKernels/GB_AxB__times_secondj_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_secondj_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_fc32.c b/FactoryKernels/GB_AxB__times_times_fc32.c index 7210ccb2d2..82d54dd869 100644 --- a/FactoryKernels/GB_AxB__times_times_fc32.c +++ b/FactoryKernels/GB_AxB__times_times_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_times_fc32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_fc64.c b/FactoryKernels/GB_AxB__times_times_fc64.c index 179bb61cb8..99b2d2e899 100644 --- a/FactoryKernels/GB_AxB__times_times_fc64.c +++ b/FactoryKernels/GB_AxB__times_times_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -450,3 +457,5 @@ GrB_Info GB (_Asaxpy3B__times_times_fc64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_fp32.c b/FactoryKernels/GB_AxB__times_times_fp32.c index 62f1ba6d4b..7ca39594d9 100644 --- a/FactoryKernels/GB_AxB__times_times_fp32.c +++ b/FactoryKernels/GB_AxB__times_times_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_times_fp32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_fp64.c b/FactoryKernels/GB_AxB__times_times_fp64.c index 24f7c6db90..ca03717b92 100644 --- a/FactoryKernels/GB_AxB__times_times_fp64.c +++ b/FactoryKernels/GB_AxB__times_times_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -453,3 +460,5 @@ GrB_Info GB (_Asaxpy3B__times_times_fp64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_int16.c b/FactoryKernels/GB_AxB__times_times_int16.c index 4e159bb82d..4ec5f36846 100644 --- a/FactoryKernels/GB_AxB__times_times_int16.c +++ b/FactoryKernels/GB_AxB__times_times_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_times_int16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_int32.c b/FactoryKernels/GB_AxB__times_times_int32.c index 5b273059bf..815ac50ef7 100644 --- a/FactoryKernels/GB_AxB__times_times_int32.c +++ b/FactoryKernels/GB_AxB__times_times_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_times_int32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_int64.c b/FactoryKernels/GB_AxB__times_times_int64.c index b9db74cfc5..5c523c57ef 100644 --- a/FactoryKernels/GB_AxB__times_times_int64.c +++ b/FactoryKernels/GB_AxB__times_times_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_times_int64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_int8.c b/FactoryKernels/GB_AxB__times_times_int8.c index 3b96d4d4e3..67d8bbabca 100644 --- a/FactoryKernels/GB_AxB__times_times_int8.c +++ b/FactoryKernels/GB_AxB__times_times_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_times_int8) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_uint16.c b/FactoryKernels/GB_AxB__times_times_uint16.c index a7454c230c..f27d101686 100644 --- a/FactoryKernels/GB_AxB__times_times_uint16.c +++ b/FactoryKernels/GB_AxB__times_times_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_times_uint16) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_uint32.c b/FactoryKernels/GB_AxB__times_times_uint32.c index c0b3b2a2b6..80da442623 100644 --- a/FactoryKernels/GB_AxB__times_times_uint32.c +++ b/FactoryKernels/GB_AxB__times_times_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -456,3 +463,5 @@ GrB_Info GB (_Asaxpy3B__times_times_uint32) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_uint64.c b/FactoryKernels/GB_AxB__times_times_uint64.c index 8d5ff0f959..37fcf66b99 100644 --- a/FactoryKernels/GB_AxB__times_times_uint64.c +++ b/FactoryKernels/GB_AxB__times_times_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_times_uint64) #endif +#endif + diff --git a/FactoryKernels/GB_AxB__times_times_uint8.c b/FactoryKernels/GB_AxB__times_times_uint8.c index 2054c9d61c..3f915e215d 100644 --- a/FactoryKernels/GB_AxB__times_times_uint8.c +++ b/FactoryKernels/GB_AxB__times_times_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -457,3 +464,5 @@ GrB_Info GB (_Asaxpy3B__times_times_uint8) #endif +#endif + diff --git a/FactoryKernels/GB_aop__atan2_fp32.c b/FactoryKernels/GB_aop__atan2_fp32.c index d9b8e58ae4..bec45b3048 100644 --- a/FactoryKernels/GB_aop__atan2_fp32.c +++ b/FactoryKernels/GB_aop__atan2_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__atan2_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__atan2_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__atan2_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__atan2_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__atan2_fp64.c b/FactoryKernels/GB_aop__atan2_fp64.c index 627b1cc5b0..74cbf3d460 100644 --- a/FactoryKernels/GB_aop__atan2_fp64.c +++ b/FactoryKernels/GB_aop__atan2_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__atan2_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__atan2_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__atan2_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__atan2_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__band_int16.c b/FactoryKernels/GB_aop__band_int16.c index 9a4f05cd76..ac20db3fcf 100644 --- a/FactoryKernels/GB_aop__band_int16.c +++ b/FactoryKernels/GB_aop__band_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__band_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__band_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__band_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__band_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__band_int32.c b/FactoryKernels/GB_aop__band_int32.c index fb7737cb29..7c4ed7f451 100644 --- a/FactoryKernels/GB_aop__band_int32.c +++ b/FactoryKernels/GB_aop__band_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__band_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__band_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__band_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__band_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__band_int64.c b/FactoryKernels/GB_aop__band_int64.c index 28457d2631..daee3e566f 100644 --- a/FactoryKernels/GB_aop__band_int64.c +++ b/FactoryKernels/GB_aop__band_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__band_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__band_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__band_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__band_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__band_int8.c b/FactoryKernels/GB_aop__band_int8.c index 50e56b3617..e4e5960bba 100644 --- a/FactoryKernels/GB_aop__band_int8.c +++ b/FactoryKernels/GB_aop__band_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__band_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__band_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__band_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__band_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__band_uint16.c b/FactoryKernels/GB_aop__band_uint16.c index dca75c555d..f299978c8e 100644 --- a/FactoryKernels/GB_aop__band_uint16.c +++ b/FactoryKernels/GB_aop__band_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__band_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__band_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__band_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__band_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__band_uint32.c b/FactoryKernels/GB_aop__band_uint32.c index 1c13453241..2487185ee6 100644 --- a/FactoryKernels/GB_aop__band_uint32.c +++ b/FactoryKernels/GB_aop__band_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__band_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__band_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__band_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__band_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__band_uint64.c b/FactoryKernels/GB_aop__band_uint64.c index 157e102413..71d09b1fcd 100644 --- a/FactoryKernels/GB_aop__band_uint64.c +++ b/FactoryKernels/GB_aop__band_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__band_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__band_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__band_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__band_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__band_uint8.c b/FactoryKernels/GB_aop__band_uint8.c index 8680c11ad6..64d86e50cb 100644 --- a/FactoryKernels/GB_aop__band_uint8.c +++ b/FactoryKernels/GB_aop__band_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__band_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__band_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__band_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__band_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bclr_int16.c b/FactoryKernels/GB_aop__bclr_int16.c index 41b6cb175d..577eac05f9 100644 --- a/FactoryKernels/GB_aop__bclr_int16.c +++ b/FactoryKernels/GB_aop__bclr_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bclr_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bclr_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bclr_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bclr_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bclr_int32.c b/FactoryKernels/GB_aop__bclr_int32.c index abc0e19446..e4541b23df 100644 --- a/FactoryKernels/GB_aop__bclr_int32.c +++ b/FactoryKernels/GB_aop__bclr_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bclr_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bclr_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bclr_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bclr_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bclr_int64.c b/FactoryKernels/GB_aop__bclr_int64.c index 14c780d6d6..25fdf6f932 100644 --- a/FactoryKernels/GB_aop__bclr_int64.c +++ b/FactoryKernels/GB_aop__bclr_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bclr_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bclr_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bclr_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bclr_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bclr_int8.c b/FactoryKernels/GB_aop__bclr_int8.c index bf4c70ef1f..e9c9ac07d9 100644 --- a/FactoryKernels/GB_aop__bclr_int8.c +++ b/FactoryKernels/GB_aop__bclr_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bclr_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bclr_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bclr_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bclr_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bclr_uint16.c b/FactoryKernels/GB_aop__bclr_uint16.c index 73b06b395a..5e6a7670bd 100644 --- a/FactoryKernels/GB_aop__bclr_uint16.c +++ b/FactoryKernels/GB_aop__bclr_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bclr_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bclr_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bclr_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bclr_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bclr_uint32.c b/FactoryKernels/GB_aop__bclr_uint32.c index 20f89effa6..6f62d4fbe2 100644 --- a/FactoryKernels/GB_aop__bclr_uint32.c +++ b/FactoryKernels/GB_aop__bclr_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bclr_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bclr_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bclr_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bclr_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bclr_uint64.c b/FactoryKernels/GB_aop__bclr_uint64.c index 00f5d03379..1d5539047f 100644 --- a/FactoryKernels/GB_aop__bclr_uint64.c +++ b/FactoryKernels/GB_aop__bclr_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bclr_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bclr_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bclr_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bclr_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bclr_uint8.c b/FactoryKernels/GB_aop__bclr_uint8.c index b7830374db..46190e3c15 100644 --- a/FactoryKernels/GB_aop__bclr_uint8.c +++ b/FactoryKernels/GB_aop__bclr_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bclr_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bclr_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bclr_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bclr_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bget_int16.c b/FactoryKernels/GB_aop__bget_int16.c index a581cfdb83..a69bee8837 100644 --- a/FactoryKernels/GB_aop__bget_int16.c +++ b/FactoryKernels/GB_aop__bget_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bget_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bget_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bget_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bget_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bget_int32.c b/FactoryKernels/GB_aop__bget_int32.c index 1ead5ca06c..181995149d 100644 --- a/FactoryKernels/GB_aop__bget_int32.c +++ b/FactoryKernels/GB_aop__bget_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bget_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bget_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bget_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bget_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bget_int64.c b/FactoryKernels/GB_aop__bget_int64.c index 76fdd4e0b8..eedaf7d40b 100644 --- a/FactoryKernels/GB_aop__bget_int64.c +++ b/FactoryKernels/GB_aop__bget_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bget_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bget_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bget_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bget_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bget_int8.c b/FactoryKernels/GB_aop__bget_int8.c index 45a7bf3877..a4cc74f7f8 100644 --- a/FactoryKernels/GB_aop__bget_int8.c +++ b/FactoryKernels/GB_aop__bget_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bget_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bget_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bget_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bget_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bget_uint16.c b/FactoryKernels/GB_aop__bget_uint16.c index b117edfc57..2eda3e1841 100644 --- a/FactoryKernels/GB_aop__bget_uint16.c +++ b/FactoryKernels/GB_aop__bget_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bget_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bget_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bget_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bget_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bget_uint32.c b/FactoryKernels/GB_aop__bget_uint32.c index 62c998c66c..51f0483d2d 100644 --- a/FactoryKernels/GB_aop__bget_uint32.c +++ b/FactoryKernels/GB_aop__bget_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bget_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bget_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bget_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bget_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bget_uint64.c b/FactoryKernels/GB_aop__bget_uint64.c index 461551158e..1f54826a82 100644 --- a/FactoryKernels/GB_aop__bget_uint64.c +++ b/FactoryKernels/GB_aop__bget_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bget_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bget_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bget_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bget_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bget_uint8.c b/FactoryKernels/GB_aop__bget_uint8.c index 68cd190f4b..f7ff3832ea 100644 --- a/FactoryKernels/GB_aop__bget_uint8.c +++ b/FactoryKernels/GB_aop__bget_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bget_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bget_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bget_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bget_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bor_int16.c b/FactoryKernels/GB_aop__bor_int16.c index 0ad28c1760..ddf9501c7c 100644 --- a/FactoryKernels/GB_aop__bor_int16.c +++ b/FactoryKernels/GB_aop__bor_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bor_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bor_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bor_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bor_int32.c b/FactoryKernels/GB_aop__bor_int32.c index 89e49bdf72..91cbae1da4 100644 --- a/FactoryKernels/GB_aop__bor_int32.c +++ b/FactoryKernels/GB_aop__bor_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bor_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bor_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bor_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bor_int64.c b/FactoryKernels/GB_aop__bor_int64.c index a090ceb13b..7f8588e279 100644 --- a/FactoryKernels/GB_aop__bor_int64.c +++ b/FactoryKernels/GB_aop__bor_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bor_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bor_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bor_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bor_int8.c b/FactoryKernels/GB_aop__bor_int8.c index b628685041..eef00cd90c 100644 --- a/FactoryKernels/GB_aop__bor_int8.c +++ b/FactoryKernels/GB_aop__bor_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bor_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bor_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bor_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bor_uint16.c b/FactoryKernels/GB_aop__bor_uint16.c index d06c3b1633..a06df08987 100644 --- a/FactoryKernels/GB_aop__bor_uint16.c +++ b/FactoryKernels/GB_aop__bor_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bor_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bor_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bor_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bor_uint32.c b/FactoryKernels/GB_aop__bor_uint32.c index 0dbc9f0889..0e286cde45 100644 --- a/FactoryKernels/GB_aop__bor_uint32.c +++ b/FactoryKernels/GB_aop__bor_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bor_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bor_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bor_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bor_uint64.c b/FactoryKernels/GB_aop__bor_uint64.c index 1eda5a52f7..d2325e8cf6 100644 --- a/FactoryKernels/GB_aop__bor_uint64.c +++ b/FactoryKernels/GB_aop__bor_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bor_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bor_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bor_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bor_uint8.c b/FactoryKernels/GB_aop__bor_uint8.c index 0c99da794b..a8343120f3 100644 --- a/FactoryKernels/GB_aop__bor_uint8.c +++ b/FactoryKernels/GB_aop__bor_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bor_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bor_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bor_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bset_int16.c b/FactoryKernels/GB_aop__bset_int16.c index 3a00355f81..cc0b8ee3b4 100644 --- a/FactoryKernels/GB_aop__bset_int16.c +++ b/FactoryKernels/GB_aop__bset_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bset_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bset_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bset_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bset_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bset_int32.c b/FactoryKernels/GB_aop__bset_int32.c index 47e117d1ce..9355a82768 100644 --- a/FactoryKernels/GB_aop__bset_int32.c +++ b/FactoryKernels/GB_aop__bset_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bset_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bset_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bset_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bset_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bset_int64.c b/FactoryKernels/GB_aop__bset_int64.c index 31ee49b222..8bfa3f22c5 100644 --- a/FactoryKernels/GB_aop__bset_int64.c +++ b/FactoryKernels/GB_aop__bset_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bset_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bset_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bset_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bset_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bset_int8.c b/FactoryKernels/GB_aop__bset_int8.c index dafa55a7e4..c5b3124093 100644 --- a/FactoryKernels/GB_aop__bset_int8.c +++ b/FactoryKernels/GB_aop__bset_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bset_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bset_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bset_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bset_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bset_uint16.c b/FactoryKernels/GB_aop__bset_uint16.c index d2a144c358..6964790e1b 100644 --- a/FactoryKernels/GB_aop__bset_uint16.c +++ b/FactoryKernels/GB_aop__bset_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bset_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bset_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bset_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bset_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bset_uint32.c b/FactoryKernels/GB_aop__bset_uint32.c index 6a53cb62cd..1feb4cd159 100644 --- a/FactoryKernels/GB_aop__bset_uint32.c +++ b/FactoryKernels/GB_aop__bset_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bset_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bset_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bset_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bset_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bset_uint64.c b/FactoryKernels/GB_aop__bset_uint64.c index f2c5932eed..47cadfb22a 100644 --- a/FactoryKernels/GB_aop__bset_uint64.c +++ b/FactoryKernels/GB_aop__bset_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bset_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bset_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bset_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bset_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bset_uint8.c b/FactoryKernels/GB_aop__bset_uint8.c index ed53a60125..baef2213fd 100644 --- a/FactoryKernels/GB_aop__bset_uint8.c +++ b/FactoryKernels/GB_aop__bset_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bset_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bset_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bset_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bset_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bshift_int16.c b/FactoryKernels/GB_aop__bshift_int16.c index 4cff3c30fc..1a02e65da5 100644 --- a/FactoryKernels/GB_aop__bshift_int16.c +++ b/FactoryKernels/GB_aop__bshift_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = ((int8_t) Ax [A_iso ? 0 : (pA)]) -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bshift_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bshift_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bshift_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bshift_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bshift_int32.c b/FactoryKernels/GB_aop__bshift_int32.c index 47ae3d260b..d67108e05a 100644 --- a/FactoryKernels/GB_aop__bshift_int32.c +++ b/FactoryKernels/GB_aop__bshift_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = ((int8_t) Ax [A_iso ? 0 : (pA)]) -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bshift_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bshift_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bshift_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bshift_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bshift_int64.c b/FactoryKernels/GB_aop__bshift_int64.c index 78414fba32..b4739bf8c8 100644 --- a/FactoryKernels/GB_aop__bshift_int64.c +++ b/FactoryKernels/GB_aop__bshift_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = ((int8_t) Ax [A_iso ? 0 : (pA)]) -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bshift_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bshift_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bshift_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bshift_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bshift_int8.c b/FactoryKernels/GB_aop__bshift_int8.c index 7f06e9c629..d3450c6d2c 100644 --- a/FactoryKernels/GB_aop__bshift_int8.c +++ b/FactoryKernels/GB_aop__bshift_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bshift_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bshift_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bshift_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bshift_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bshift_uint16.c b/FactoryKernels/GB_aop__bshift_uint16.c index a128ab0b27..b3a9232de9 100644 --- a/FactoryKernels/GB_aop__bshift_uint16.c +++ b/FactoryKernels/GB_aop__bshift_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = ((int8_t) Ax [A_iso ? 0 : (pA)]) -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bshift_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bshift_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bshift_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bshift_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bshift_uint32.c b/FactoryKernels/GB_aop__bshift_uint32.c index 15776009e9..8e3c0363b1 100644 --- a/FactoryKernels/GB_aop__bshift_uint32.c +++ b/FactoryKernels/GB_aop__bshift_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = ((int8_t) Ax [A_iso ? 0 : (pA)]) -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bshift_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bshift_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bshift_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bshift_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bshift_uint64.c b/FactoryKernels/GB_aop__bshift_uint64.c index 688cd62a1c..f9c4fe5de9 100644 --- a/FactoryKernels/GB_aop__bshift_uint64.c +++ b/FactoryKernels/GB_aop__bshift_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = ((int8_t) Ax [A_iso ? 0 : (pA)]) -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bshift_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bshift_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bshift_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bshift_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bshift_uint8.c b/FactoryKernels/GB_aop__bshift_uint8.c index 75f686e37c..9c490c4177 100644 --- a/FactoryKernels/GB_aop__bshift_uint8.c +++ b/FactoryKernels/GB_aop__bshift_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = ((int8_t) Ax [A_iso ? 0 : (pA)]) -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : ((int8_t) Ax [pA]) +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bshift_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bshift_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bshift_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bshift_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxnor_int16.c b/FactoryKernels/GB_aop__bxnor_int16.c index 90cdc7db5c..01c0d98f51 100644 --- a/FactoryKernels/GB_aop__bxnor_int16.c +++ b/FactoryKernels/GB_aop__bxnor_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxnor_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxnor_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxnor_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxnor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxnor_int32.c b/FactoryKernels/GB_aop__bxnor_int32.c index e7cb0e17c2..bd82492edd 100644 --- a/FactoryKernels/GB_aop__bxnor_int32.c +++ b/FactoryKernels/GB_aop__bxnor_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxnor_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxnor_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxnor_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxnor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxnor_int64.c b/FactoryKernels/GB_aop__bxnor_int64.c index d880e40484..02af0a3fb6 100644 --- a/FactoryKernels/GB_aop__bxnor_int64.c +++ b/FactoryKernels/GB_aop__bxnor_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxnor_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxnor_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxnor_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxnor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxnor_int8.c b/FactoryKernels/GB_aop__bxnor_int8.c index 78f5379d9a..b7b4f67de2 100644 --- a/FactoryKernels/GB_aop__bxnor_int8.c +++ b/FactoryKernels/GB_aop__bxnor_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxnor_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxnor_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxnor_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxnor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxnor_uint16.c b/FactoryKernels/GB_aop__bxnor_uint16.c index 52849198e8..29b479b5ea 100644 --- a/FactoryKernels/GB_aop__bxnor_uint16.c +++ b/FactoryKernels/GB_aop__bxnor_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxnor_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxnor_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxnor_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxnor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxnor_uint32.c b/FactoryKernels/GB_aop__bxnor_uint32.c index 02e31928c3..25acf9a678 100644 --- a/FactoryKernels/GB_aop__bxnor_uint32.c +++ b/FactoryKernels/GB_aop__bxnor_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxnor_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxnor_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxnor_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxnor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxnor_uint64.c b/FactoryKernels/GB_aop__bxnor_uint64.c index 4f81be98d9..447d6c984d 100644 --- a/FactoryKernels/GB_aop__bxnor_uint64.c +++ b/FactoryKernels/GB_aop__bxnor_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxnor_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxnor_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxnor_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxnor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxnor_uint8.c b/FactoryKernels/GB_aop__bxnor_uint8.c index 5945e26daa..c7f6b44162 100644 --- a/FactoryKernels/GB_aop__bxnor_uint8.c +++ b/FactoryKernels/GB_aop__bxnor_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxnor_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxnor_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxnor_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxnor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxor_int16.c b/FactoryKernels/GB_aop__bxor_int16.c index 12d577c7a1..e621e549e5 100644 --- a/FactoryKernels/GB_aop__bxor_int16.c +++ b/FactoryKernels/GB_aop__bxor_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxor_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxor_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxor_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxor_int32.c b/FactoryKernels/GB_aop__bxor_int32.c index 9b65f877ae..761a2f61d5 100644 --- a/FactoryKernels/GB_aop__bxor_int32.c +++ b/FactoryKernels/GB_aop__bxor_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxor_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxor_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxor_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxor_int64.c b/FactoryKernels/GB_aop__bxor_int64.c index 2afc7d3798..966f3814be 100644 --- a/FactoryKernels/GB_aop__bxor_int64.c +++ b/FactoryKernels/GB_aop__bxor_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxor_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxor_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxor_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxor_int8.c b/FactoryKernels/GB_aop__bxor_int8.c index 1b4bac5c26..6fec34d7e0 100644 --- a/FactoryKernels/GB_aop__bxor_int8.c +++ b/FactoryKernels/GB_aop__bxor_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxor_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxor_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxor_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxor_uint16.c b/FactoryKernels/GB_aop__bxor_uint16.c index b2a91650f5..4affe75b4a 100644 --- a/FactoryKernels/GB_aop__bxor_uint16.c +++ b/FactoryKernels/GB_aop__bxor_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxor_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxor_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxor_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxor_uint32.c b/FactoryKernels/GB_aop__bxor_uint32.c index e1fde23f26..3ccf015257 100644 --- a/FactoryKernels/GB_aop__bxor_uint32.c +++ b/FactoryKernels/GB_aop__bxor_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxor_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxor_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxor_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxor_uint64.c b/FactoryKernels/GB_aop__bxor_uint64.c index 75b34af725..5c25cc562a 100644 --- a/FactoryKernels/GB_aop__bxor_uint64.c +++ b/FactoryKernels/GB_aop__bxor_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxor_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxor_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxor_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__bxor_uint8.c b/FactoryKernels/GB_aop__bxor_uint8.c index 28a60772eb..82280b5b2c 100644 --- a/FactoryKernels/GB_aop__bxor_uint8.c +++ b/FactoryKernels/GB_aop__bxor_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__bxor_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__bxor_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__bxor_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__bxor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__copysign_fp32.c b/FactoryKernels/GB_aop__copysign_fp32.c index 277a6fb650..3161abb151 100644 --- a/FactoryKernels/GB_aop__copysign_fp32.c +++ b/FactoryKernels/GB_aop__copysign_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__copysign_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__copysign_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__copysign_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__copysign_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__copysign_fp64.c b/FactoryKernels/GB_aop__copysign_fp64.c index 33f06064dc..6b233556e8 100644 --- a/FactoryKernels/GB_aop__copysign_fp64.c +++ b/FactoryKernels/GB_aop__copysign_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__copysign_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__copysign_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__copysign_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__copysign_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_fc32.c b/FactoryKernels/GB_aop__div_fc32.c index fafce5fba1..68ded3a2ec 100644 --- a/FactoryKernels/GB_aop__div_fc32.c +++ b/FactoryKernels/GB_aop__div_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_fc64.c b/FactoryKernels/GB_aop__div_fc64.c index 64dfada76a..a2ce36536e 100644 --- a/FactoryKernels/GB_aop__div_fc64.c +++ b/FactoryKernels/GB_aop__div_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_fp32.c b/FactoryKernels/GB_aop__div_fp32.c index 12ff4c52bf..f0c7501ac6 100644 --- a/FactoryKernels/GB_aop__div_fp32.c +++ b/FactoryKernels/GB_aop__div_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_fp64.c b/FactoryKernels/GB_aop__div_fp64.c index 86688e9759..a36ccbe04a 100644 --- a/FactoryKernels/GB_aop__div_fp64.c +++ b/FactoryKernels/GB_aop__div_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_int16.c b/FactoryKernels/GB_aop__div_int16.c index 09aa30a1b9..db675c5c95 100644 --- a/FactoryKernels/GB_aop__div_int16.c +++ b/FactoryKernels/GB_aop__div_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_int32.c b/FactoryKernels/GB_aop__div_int32.c index 66942436cd..543a9db1a2 100644 --- a/FactoryKernels/GB_aop__div_int32.c +++ b/FactoryKernels/GB_aop__div_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_int64.c b/FactoryKernels/GB_aop__div_int64.c index 44a5efe1fe..02fff3bc7e 100644 --- a/FactoryKernels/GB_aop__div_int64.c +++ b/FactoryKernels/GB_aop__div_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_int8.c b/FactoryKernels/GB_aop__div_int8.c index e0f96fd4e9..e43212401d 100644 --- a/FactoryKernels/GB_aop__div_int8.c +++ b/FactoryKernels/GB_aop__div_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_uint16.c b/FactoryKernels/GB_aop__div_uint16.c index 79bfa878e6..d4e4787cd9 100644 --- a/FactoryKernels/GB_aop__div_uint16.c +++ b/FactoryKernels/GB_aop__div_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_uint32.c b/FactoryKernels/GB_aop__div_uint32.c index 9bad434bd0..76cfae4555 100644 --- a/FactoryKernels/GB_aop__div_uint32.c +++ b/FactoryKernels/GB_aop__div_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_uint64.c b/FactoryKernels/GB_aop__div_uint64.c index 45b9693f1c..4b9800448c 100644 --- a/FactoryKernels/GB_aop__div_uint64.c +++ b/FactoryKernels/GB_aop__div_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__div_uint8.c b/FactoryKernels/GB_aop__div_uint8.c index 49296965ab..a6fb87464d 100644 --- a/FactoryKernels/GB_aop__div_uint8.c +++ b/FactoryKernels/GB_aop__div_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__div_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__div_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__div_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__div_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__eq_bool.c b/FactoryKernels/GB_aop__eq_bool.c index ecc3ac8003..5a2436330a 100644 --- a/FactoryKernels/GB_aop__eq_bool.c +++ b/FactoryKernels/GB_aop__eq_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__eq_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__eq_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__eq_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__eq_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__fmod_fp32.c b/FactoryKernels/GB_aop__fmod_fp32.c index 4cd1b705bf..bf4bb0cae8 100644 --- a/FactoryKernels/GB_aop__fmod_fp32.c +++ b/FactoryKernels/GB_aop__fmod_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__fmod_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__fmod_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__fmod_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__fmod_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__fmod_fp64.c b/FactoryKernels/GB_aop__fmod_fp64.c index 4b63a1ee17..15b3abba65 100644 --- a/FactoryKernels/GB_aop__fmod_fp64.c +++ b/FactoryKernels/GB_aop__fmod_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__fmod_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__fmod_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__fmod_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__fmod_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__ge_bool.c b/FactoryKernels/GB_aop__ge_bool.c index 3bd4930bca..aacaa7e611 100644 --- a/FactoryKernels/GB_aop__ge_bool.c +++ b/FactoryKernels/GB_aop__ge_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__ge_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__ge_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__ge_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__ge_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__gt_bool.c b/FactoryKernels/GB_aop__gt_bool.c index b7983870c1..12f0b75e4a 100644 --- a/FactoryKernels/GB_aop__gt_bool.c +++ b/FactoryKernels/GB_aop__gt_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__gt_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__gt_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__gt_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__gt_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__hypot_fp32.c b/FactoryKernels/GB_aop__hypot_fp32.c index 225cc19a68..5889dc6b66 100644 --- a/FactoryKernels/GB_aop__hypot_fp32.c +++ b/FactoryKernels/GB_aop__hypot_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__hypot_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__hypot_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__hypot_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__hypot_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__hypot_fp64.c b/FactoryKernels/GB_aop__hypot_fp64.c index 00032be73f..271fb76d72 100644 --- a/FactoryKernels/GB_aop__hypot_fp64.c +++ b/FactoryKernels/GB_aop__hypot_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__hypot_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__hypot_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__hypot_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__hypot_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__include.h b/FactoryKernels/GB_aop__include.h index 0150d712b5..61795d224f 100644 --- a/FactoryKernels/GB_aop__include.h +++ b/FactoryKernels/GB_aop__include.h @@ -1542,838 +1542,6 @@ GrB_Info GB (_subassign_22__rdiv_fc64) const GB_void *ywork_handle ) ; -GrB_Info GB (_subassign_23__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_fc32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__iseq_fc64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_fc32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isne_fc64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isgt_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__islt_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isge_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - -GrB_Info GB (_subassign_23__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) ; - -GrB_Info GB (_subassign_22__isle_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) ; - GrB_Info GB (_subassign_23__eq_bool) ( GrB_Matrix C, diff --git a/FactoryKernels/GB_aop__iseq_fc32.c b/FactoryKernels/GB_aop__iseq_fc32.c deleted file mode 100644 index b8fb82a15c..0000000000 --- a/FactoryKernels/GB_aop__iseq_fc32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = GB_FC32_iseq (x, y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t -#define GB_DECLAREY(ywork) GxB_FC32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE GxB_FC32_t -#define GB_C_TYPE GxB_FC32_t -#define GB_DECLAREC(cwork) GxB_FC32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_FC32) || defined(GxB_NO_ISEQ_FC32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_fc32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_fc64.c b/FactoryKernels/GB_aop__iseq_fc64.c deleted file mode 100644 index fc822d92b5..0000000000 --- a/FactoryKernels/GB_aop__iseq_fc64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = GB_FC64_iseq (x, y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t -#define GB_DECLAREY(ywork) GxB_FC64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE GxB_FC64_t -#define GB_C_TYPE GxB_FC64_t -#define GB_DECLAREC(cwork) GxB_FC64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_FC64) || defined(GxB_NO_ISEQ_FC64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_fc64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_fp32.c b/FactoryKernels/GB_aop__iseq_fp32.c deleted file mode 100644 index d2441125c5..0000000000 --- a/FactoryKernels/GB_aop__iseq_fp32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float -#define GB_DECLAREY(ywork) float ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE float -#define GB_C_TYPE float -#define GB_DECLAREC(cwork) float cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_FP32) || defined(GxB_NO_ISEQ_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_fp64.c b/FactoryKernels/GB_aop__iseq_fp64.c deleted file mode 100644 index 4915609587..0000000000 --- a/FactoryKernels/GB_aop__iseq_fp64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double -#define GB_DECLAREY(ywork) double ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE double -#define GB_C_TYPE double -#define GB_DECLAREC(cwork) double cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_FP64) || defined(GxB_NO_ISEQ_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_int16.c b/FactoryKernels/GB_aop__iseq_int16.c deleted file mode 100644 index cd5e891eac..0000000000 --- a/FactoryKernels/GB_aop__iseq_int16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t -#define GB_DECLAREY(ywork) int16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int16_t -#define GB_C_TYPE int16_t -#define GB_DECLAREC(cwork) int16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_INT16) || defined(GxB_NO_ISEQ_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_int32.c b/FactoryKernels/GB_aop__iseq_int32.c deleted file mode 100644 index 5e19c3962a..0000000000 --- a/FactoryKernels/GB_aop__iseq_int32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t -#define GB_DECLAREY(ywork) int32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int32_t -#define GB_C_TYPE int32_t -#define GB_DECLAREC(cwork) int32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_INT32) || defined(GxB_NO_ISEQ_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_int64.c b/FactoryKernels/GB_aop__iseq_int64.c deleted file mode 100644 index 204dfef873..0000000000 --- a/FactoryKernels/GB_aop__iseq_int64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t -#define GB_DECLAREY(ywork) int64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int64_t -#define GB_C_TYPE int64_t -#define GB_DECLAREC(cwork) int64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_INT64) || defined(GxB_NO_ISEQ_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_int8.c b/FactoryKernels/GB_aop__iseq_int8.c deleted file mode 100644 index 1e1718ad21..0000000000 --- a/FactoryKernels/GB_aop__iseq_int8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t -#define GB_DECLAREY(ywork) int8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int8_t -#define GB_C_TYPE int8_t -#define GB_DECLAREC(cwork) int8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_INT8) || defined(GxB_NO_ISEQ_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_uint16.c b/FactoryKernels/GB_aop__iseq_uint16.c deleted file mode 100644 index bddd695f69..0000000000 --- a/FactoryKernels/GB_aop__iseq_uint16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t -#define GB_DECLAREY(ywork) uint16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint16_t -#define GB_C_TYPE uint16_t -#define GB_DECLAREC(cwork) uint16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISEQ_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_uint32.c b/FactoryKernels/GB_aop__iseq_uint32.c deleted file mode 100644 index ed834235c8..0000000000 --- a/FactoryKernels/GB_aop__iseq_uint32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t -#define GB_DECLAREY(ywork) uint32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint32_t -#define GB_C_TYPE uint32_t -#define GB_DECLAREC(cwork) uint32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISEQ_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_uint64.c b/FactoryKernels/GB_aop__iseq_uint64.c deleted file mode 100644 index 25737fd62b..0000000000 --- a/FactoryKernels/GB_aop__iseq_uint64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t -#define GB_DECLAREY(ywork) uint64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint64_t -#define GB_C_TYPE uint64_t -#define GB_DECLAREC(cwork) uint64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISEQ_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__iseq_uint8.c b/FactoryKernels/GB_aop__iseq_uint8.c deleted file mode 100644 index 9e78285472..0000000000 --- a/FactoryKernels/GB_aop__iseq_uint8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) == (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t -#define GB_DECLAREY(ywork) uint8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint8_t -#define GB_C_TYPE uint8_t -#define GB_DECLAREC(cwork) uint8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISEQ_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__iseq_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_fp32.c b/FactoryKernels/GB_aop__isge_fp32.c deleted file mode 100644 index ef6ba6d26d..0000000000 --- a/FactoryKernels/GB_aop__isge_fp32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float -#define GB_DECLAREY(ywork) float ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE float -#define GB_C_TYPE float -#define GB_DECLAREC(cwork) float cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_FP32) || defined(GxB_NO_ISGE_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_fp64.c b/FactoryKernels/GB_aop__isge_fp64.c deleted file mode 100644 index cf7fd50343..0000000000 --- a/FactoryKernels/GB_aop__isge_fp64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double -#define GB_DECLAREY(ywork) double ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE double -#define GB_C_TYPE double -#define GB_DECLAREC(cwork) double cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_FP64) || defined(GxB_NO_ISGE_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_int16.c b/FactoryKernels/GB_aop__isge_int16.c deleted file mode 100644 index cc612c0088..0000000000 --- a/FactoryKernels/GB_aop__isge_int16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t -#define GB_DECLAREY(ywork) int16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int16_t -#define GB_C_TYPE int16_t -#define GB_DECLAREC(cwork) int16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_INT16) || defined(GxB_NO_ISGE_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_int32.c b/FactoryKernels/GB_aop__isge_int32.c deleted file mode 100644 index 6e833a8a50..0000000000 --- a/FactoryKernels/GB_aop__isge_int32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t -#define GB_DECLAREY(ywork) int32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int32_t -#define GB_C_TYPE int32_t -#define GB_DECLAREC(cwork) int32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_INT32) || defined(GxB_NO_ISGE_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_int64.c b/FactoryKernels/GB_aop__isge_int64.c deleted file mode 100644 index f5793cdaf8..0000000000 --- a/FactoryKernels/GB_aop__isge_int64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t -#define GB_DECLAREY(ywork) int64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int64_t -#define GB_C_TYPE int64_t -#define GB_DECLAREC(cwork) int64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_INT64) || defined(GxB_NO_ISGE_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_int8.c b/FactoryKernels/GB_aop__isge_int8.c deleted file mode 100644 index 2ce609b405..0000000000 --- a/FactoryKernels/GB_aop__isge_int8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t -#define GB_DECLAREY(ywork) int8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int8_t -#define GB_C_TYPE int8_t -#define GB_DECLAREC(cwork) int8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_INT8) || defined(GxB_NO_ISGE_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_uint16.c b/FactoryKernels/GB_aop__isge_uint16.c deleted file mode 100644 index 48b51a59bd..0000000000 --- a/FactoryKernels/GB_aop__isge_uint16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t -#define GB_DECLAREY(ywork) uint16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint16_t -#define GB_C_TYPE uint16_t -#define GB_DECLAREC(cwork) uint16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISGE_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_uint32.c b/FactoryKernels/GB_aop__isge_uint32.c deleted file mode 100644 index 3a5d0ef1e6..0000000000 --- a/FactoryKernels/GB_aop__isge_uint32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t -#define GB_DECLAREY(ywork) uint32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint32_t -#define GB_C_TYPE uint32_t -#define GB_DECLAREC(cwork) uint32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISGE_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_uint64.c b/FactoryKernels/GB_aop__isge_uint64.c deleted file mode 100644 index 381c3a3fa1..0000000000 --- a/FactoryKernels/GB_aop__isge_uint64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t -#define GB_DECLAREY(ywork) uint64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint64_t -#define GB_C_TYPE uint64_t -#define GB_DECLAREC(cwork) uint64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISGE_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isge_uint8.c b/FactoryKernels/GB_aop__isge_uint8.c deleted file mode 100644 index 02ac091c12..0000000000 --- a/FactoryKernels/GB_aop__isge_uint8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) >= (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t -#define GB_DECLAREY(ywork) uint8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint8_t -#define GB_C_TYPE uint8_t -#define GB_DECLAREC(cwork) uint8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISGE_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isge_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_fp32.c b/FactoryKernels/GB_aop__isgt_fp32.c deleted file mode 100644 index 2edc9f3915..0000000000 --- a/FactoryKernels/GB_aop__isgt_fp32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float -#define GB_DECLAREY(ywork) float ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE float -#define GB_C_TYPE float -#define GB_DECLAREC(cwork) float cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_FP32) || defined(GxB_NO_ISGT_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_fp64.c b/FactoryKernels/GB_aop__isgt_fp64.c deleted file mode 100644 index dbe3fe9b41..0000000000 --- a/FactoryKernels/GB_aop__isgt_fp64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double -#define GB_DECLAREY(ywork) double ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE double -#define GB_C_TYPE double -#define GB_DECLAREC(cwork) double cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_FP64) || defined(GxB_NO_ISGT_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_int16.c b/FactoryKernels/GB_aop__isgt_int16.c deleted file mode 100644 index 9ce3b5343f..0000000000 --- a/FactoryKernels/GB_aop__isgt_int16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t -#define GB_DECLAREY(ywork) int16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int16_t -#define GB_C_TYPE int16_t -#define GB_DECLAREC(cwork) int16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_INT16) || defined(GxB_NO_ISGT_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_int32.c b/FactoryKernels/GB_aop__isgt_int32.c deleted file mode 100644 index c6dd4df507..0000000000 --- a/FactoryKernels/GB_aop__isgt_int32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t -#define GB_DECLAREY(ywork) int32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int32_t -#define GB_C_TYPE int32_t -#define GB_DECLAREC(cwork) int32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_INT32) || defined(GxB_NO_ISGT_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_int64.c b/FactoryKernels/GB_aop__isgt_int64.c deleted file mode 100644 index d81f630b17..0000000000 --- a/FactoryKernels/GB_aop__isgt_int64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t -#define GB_DECLAREY(ywork) int64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int64_t -#define GB_C_TYPE int64_t -#define GB_DECLAREC(cwork) int64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_INT64) || defined(GxB_NO_ISGT_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_int8.c b/FactoryKernels/GB_aop__isgt_int8.c deleted file mode 100644 index 21f994c06b..0000000000 --- a/FactoryKernels/GB_aop__isgt_int8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t -#define GB_DECLAREY(ywork) int8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int8_t -#define GB_C_TYPE int8_t -#define GB_DECLAREC(cwork) int8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_INT8) || defined(GxB_NO_ISGT_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_uint16.c b/FactoryKernels/GB_aop__isgt_uint16.c deleted file mode 100644 index 55be8873e9..0000000000 --- a/FactoryKernels/GB_aop__isgt_uint16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t -#define GB_DECLAREY(ywork) uint16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint16_t -#define GB_C_TYPE uint16_t -#define GB_DECLAREC(cwork) uint16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISGT_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_uint32.c b/FactoryKernels/GB_aop__isgt_uint32.c deleted file mode 100644 index a7a638055f..0000000000 --- a/FactoryKernels/GB_aop__isgt_uint32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t -#define GB_DECLAREY(ywork) uint32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint32_t -#define GB_C_TYPE uint32_t -#define GB_DECLAREC(cwork) uint32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISGT_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_uint64.c b/FactoryKernels/GB_aop__isgt_uint64.c deleted file mode 100644 index 795abbfb4d..0000000000 --- a/FactoryKernels/GB_aop__isgt_uint64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t -#define GB_DECLAREY(ywork) uint64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint64_t -#define GB_C_TYPE uint64_t -#define GB_DECLAREC(cwork) uint64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISGT_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isgt_uint8.c b/FactoryKernels/GB_aop__isgt_uint8.c deleted file mode 100644 index e0ad7f842f..0000000000 --- a/FactoryKernels/GB_aop__isgt_uint8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) > (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t -#define GB_DECLAREY(ywork) uint8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint8_t -#define GB_C_TYPE uint8_t -#define GB_DECLAREC(cwork) uint8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISGT_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isgt_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_fp32.c b/FactoryKernels/GB_aop__isle_fp32.c deleted file mode 100644 index ed9142e54c..0000000000 --- a/FactoryKernels/GB_aop__isle_fp32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float -#define GB_DECLAREY(ywork) float ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE float -#define GB_C_TYPE float -#define GB_DECLAREC(cwork) float cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_FP32) || defined(GxB_NO_ISLE_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_fp64.c b/FactoryKernels/GB_aop__isle_fp64.c deleted file mode 100644 index 18f02c32bd..0000000000 --- a/FactoryKernels/GB_aop__isle_fp64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double -#define GB_DECLAREY(ywork) double ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE double -#define GB_C_TYPE double -#define GB_DECLAREC(cwork) double cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_FP64) || defined(GxB_NO_ISLE_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_int16.c b/FactoryKernels/GB_aop__isle_int16.c deleted file mode 100644 index dc3c06e563..0000000000 --- a/FactoryKernels/GB_aop__isle_int16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t -#define GB_DECLAREY(ywork) int16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int16_t -#define GB_C_TYPE int16_t -#define GB_DECLAREC(cwork) int16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_INT16) || defined(GxB_NO_ISLE_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_int32.c b/FactoryKernels/GB_aop__isle_int32.c deleted file mode 100644 index f3d33075d5..0000000000 --- a/FactoryKernels/GB_aop__isle_int32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t -#define GB_DECLAREY(ywork) int32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int32_t -#define GB_C_TYPE int32_t -#define GB_DECLAREC(cwork) int32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_INT32) || defined(GxB_NO_ISLE_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_int64.c b/FactoryKernels/GB_aop__isle_int64.c deleted file mode 100644 index 812a512c7e..0000000000 --- a/FactoryKernels/GB_aop__isle_int64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t -#define GB_DECLAREY(ywork) int64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int64_t -#define GB_C_TYPE int64_t -#define GB_DECLAREC(cwork) int64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_INT64) || defined(GxB_NO_ISLE_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_int8.c b/FactoryKernels/GB_aop__isle_int8.c deleted file mode 100644 index 06699fcfc1..0000000000 --- a/FactoryKernels/GB_aop__isle_int8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t -#define GB_DECLAREY(ywork) int8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int8_t -#define GB_C_TYPE int8_t -#define GB_DECLAREC(cwork) int8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_INT8) || defined(GxB_NO_ISLE_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_uint16.c b/FactoryKernels/GB_aop__isle_uint16.c deleted file mode 100644 index 36894f31c5..0000000000 --- a/FactoryKernels/GB_aop__isle_uint16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t -#define GB_DECLAREY(ywork) uint16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint16_t -#define GB_C_TYPE uint16_t -#define GB_DECLAREC(cwork) uint16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISLE_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_uint32.c b/FactoryKernels/GB_aop__isle_uint32.c deleted file mode 100644 index fc7b2b61c9..0000000000 --- a/FactoryKernels/GB_aop__isle_uint32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t -#define GB_DECLAREY(ywork) uint32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint32_t -#define GB_C_TYPE uint32_t -#define GB_DECLAREC(cwork) uint32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISLE_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_uint64.c b/FactoryKernels/GB_aop__isle_uint64.c deleted file mode 100644 index 423f3f74b0..0000000000 --- a/FactoryKernels/GB_aop__isle_uint64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t -#define GB_DECLAREY(ywork) uint64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint64_t -#define GB_C_TYPE uint64_t -#define GB_DECLAREC(cwork) uint64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISLE_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isle_uint8.c b/FactoryKernels/GB_aop__isle_uint8.c deleted file mode 100644 index 37f41d522b..0000000000 --- a/FactoryKernels/GB_aop__isle_uint8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) <= (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t -#define GB_DECLAREY(ywork) uint8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint8_t -#define GB_C_TYPE uint8_t -#define GB_DECLAREC(cwork) uint8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISLE_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isle_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_fp32.c b/FactoryKernels/GB_aop__islt_fp32.c deleted file mode 100644 index 687fe96e1e..0000000000 --- a/FactoryKernels/GB_aop__islt_fp32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float -#define GB_DECLAREY(ywork) float ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE float -#define GB_C_TYPE float -#define GB_DECLAREC(cwork) float cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_FP32) || defined(GxB_NO_ISLT_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_fp64.c b/FactoryKernels/GB_aop__islt_fp64.c deleted file mode 100644 index 9a04da9828..0000000000 --- a/FactoryKernels/GB_aop__islt_fp64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double -#define GB_DECLAREY(ywork) double ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE double -#define GB_C_TYPE double -#define GB_DECLAREC(cwork) double cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_FP64) || defined(GxB_NO_ISLT_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_int16.c b/FactoryKernels/GB_aop__islt_int16.c deleted file mode 100644 index ae47513a1f..0000000000 --- a/FactoryKernels/GB_aop__islt_int16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t -#define GB_DECLAREY(ywork) int16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int16_t -#define GB_C_TYPE int16_t -#define GB_DECLAREC(cwork) int16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_INT16) || defined(GxB_NO_ISLT_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_int32.c b/FactoryKernels/GB_aop__islt_int32.c deleted file mode 100644 index 5085bc38e9..0000000000 --- a/FactoryKernels/GB_aop__islt_int32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t -#define GB_DECLAREY(ywork) int32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int32_t -#define GB_C_TYPE int32_t -#define GB_DECLAREC(cwork) int32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_INT32) || defined(GxB_NO_ISLT_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_int64.c b/FactoryKernels/GB_aop__islt_int64.c deleted file mode 100644 index 0f524c4d0d..0000000000 --- a/FactoryKernels/GB_aop__islt_int64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t -#define GB_DECLAREY(ywork) int64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int64_t -#define GB_C_TYPE int64_t -#define GB_DECLAREC(cwork) int64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_INT64) || defined(GxB_NO_ISLT_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_int8.c b/FactoryKernels/GB_aop__islt_int8.c deleted file mode 100644 index ed13301294..0000000000 --- a/FactoryKernels/GB_aop__islt_int8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t -#define GB_DECLAREY(ywork) int8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int8_t -#define GB_C_TYPE int8_t -#define GB_DECLAREC(cwork) int8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_INT8) || defined(GxB_NO_ISLT_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_uint16.c b/FactoryKernels/GB_aop__islt_uint16.c deleted file mode 100644 index 3bcaa1cf23..0000000000 --- a/FactoryKernels/GB_aop__islt_uint16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t -#define GB_DECLAREY(ywork) uint16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint16_t -#define GB_C_TYPE uint16_t -#define GB_DECLAREC(cwork) uint16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISLT_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_uint32.c b/FactoryKernels/GB_aop__islt_uint32.c deleted file mode 100644 index d5402a6d39..0000000000 --- a/FactoryKernels/GB_aop__islt_uint32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t -#define GB_DECLAREY(ywork) uint32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint32_t -#define GB_C_TYPE uint32_t -#define GB_DECLAREC(cwork) uint32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISLT_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_uint64.c b/FactoryKernels/GB_aop__islt_uint64.c deleted file mode 100644 index a8eb81cc30..0000000000 --- a/FactoryKernels/GB_aop__islt_uint64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t -#define GB_DECLAREY(ywork) uint64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint64_t -#define GB_C_TYPE uint64_t -#define GB_DECLAREC(cwork) uint64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISLT_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__islt_uint8.c b/FactoryKernels/GB_aop__islt_uint8.c deleted file mode 100644 index e345f7538c..0000000000 --- a/FactoryKernels/GB_aop__islt_uint8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) < (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t -#define GB_DECLAREY(ywork) uint8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint8_t -#define GB_C_TYPE uint8_t -#define GB_DECLAREC(cwork) uint8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISLT_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__islt_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_fc32.c b/FactoryKernels/GB_aop__isne_fc32.c deleted file mode 100644 index 7d1d07394a..0000000000 --- a/FactoryKernels/GB_aop__isne_fc32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = GB_FC32_isne (x, y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t -#define GB_DECLAREY(ywork) GxB_FC32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE GxB_FC32_t -#define GB_C_TYPE GxB_FC32_t -#define GB_DECLAREC(cwork) GxB_FC32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_FC32) || defined(GxB_NO_ISNE_FC32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_fc32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_fc64.c b/FactoryKernels/GB_aop__isne_fc64.c deleted file mode 100644 index f2bb8c7c86..0000000000 --- a/FactoryKernels/GB_aop__isne_fc64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = GB_FC64_isne (x, y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t -#define GB_DECLAREY(ywork) GxB_FC64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE GxB_FC64_t -#define GB_C_TYPE GxB_FC64_t -#define GB_DECLAREC(cwork) GxB_FC64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_FC64) || defined(GxB_NO_ISNE_FC64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_fc64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_fp32.c b/FactoryKernels/GB_aop__isne_fp32.c deleted file mode 100644 index 987208a69f..0000000000 --- a/FactoryKernels/GB_aop__isne_fp32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float -#define GB_DECLAREY(ywork) float ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE float -#define GB_C_TYPE float -#define GB_DECLAREC(cwork) float cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_FP32) || defined(GxB_NO_ISNE_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_fp32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_fp64.c b/FactoryKernels/GB_aop__isne_fp64.c deleted file mode 100644 index 2a2003305d..0000000000 --- a/FactoryKernels/GB_aop__isne_fp64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double -#define GB_DECLAREY(ywork) double ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE double -#define GB_C_TYPE double -#define GB_DECLAREC(cwork) double cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_FP64) || defined(GxB_NO_ISNE_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_fp64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_int16.c b/FactoryKernels/GB_aop__isne_int16.c deleted file mode 100644 index 7add502aa9..0000000000 --- a/FactoryKernels/GB_aop__isne_int16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t -#define GB_DECLAREY(ywork) int16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int16_t -#define GB_C_TYPE int16_t -#define GB_DECLAREC(cwork) int16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_INT16) || defined(GxB_NO_ISNE_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_int16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_int32.c b/FactoryKernels/GB_aop__isne_int32.c deleted file mode 100644 index 89bae897a9..0000000000 --- a/FactoryKernels/GB_aop__isne_int32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t -#define GB_DECLAREY(ywork) int32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int32_t -#define GB_C_TYPE int32_t -#define GB_DECLAREC(cwork) int32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_INT32) || defined(GxB_NO_ISNE_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_int32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_int64.c b/FactoryKernels/GB_aop__isne_int64.c deleted file mode 100644 index f95b7dde35..0000000000 --- a/FactoryKernels/GB_aop__isne_int64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t -#define GB_DECLAREY(ywork) int64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int64_t -#define GB_C_TYPE int64_t -#define GB_DECLAREC(cwork) int64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_INT64) || defined(GxB_NO_ISNE_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_int64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_int8.c b/FactoryKernels/GB_aop__isne_int8.c deleted file mode 100644 index ef301dbf25..0000000000 --- a/FactoryKernels/GB_aop__isne_int8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t -#define GB_DECLAREY(ywork) int8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE int8_t -#define GB_C_TYPE int8_t -#define GB_DECLAREC(cwork) int8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_INT8) || defined(GxB_NO_ISNE_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_int8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_uint16.c b/FactoryKernels/GB_aop__isne_uint16.c deleted file mode 100644 index c8d13b758a..0000000000 --- a/FactoryKernels/GB_aop__isne_uint16.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t -#define GB_DECLAREY(ywork) uint16_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint16_t -#define GB_C_TYPE uint16_t -#define GB_DECLAREC(cwork) uint16_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISNE_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_uint16) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_uint32.c b/FactoryKernels/GB_aop__isne_uint32.c deleted file mode 100644 index ade44b2543..0000000000 --- a/FactoryKernels/GB_aop__isne_uint32.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t -#define GB_DECLAREY(ywork) uint32_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint32_t -#define GB_C_TYPE uint32_t -#define GB_DECLAREC(cwork) uint32_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISNE_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_uint32) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_uint64.c b/FactoryKernels/GB_aop__isne_uint64.c deleted file mode 100644 index d16ca6c296..0000000000 --- a/FactoryKernels/GB_aop__isne_uint64.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t -#define GB_DECLAREY(ywork) uint64_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint64_t -#define GB_C_TYPE uint64_t -#define GB_DECLAREC(cwork) uint64_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISNE_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_uint64) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__isne_uint8.c b/FactoryKernels/GB_aop__isne_uint8.c deleted file mode 100644 index bd06a98601..0000000000 --- a/FactoryKernels/GB_aop__isne_uint8.c +++ /dev/null @@ -1,103 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_aop: assign/subassign kernels with accum -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C(I,J) += A - -#include "GB.h" -#include "GB_control.h" -#include "slice/GB_ek_slice.h" -#include "FactoryKernels/GB_aop__include.h" - -// accum operator -#define GB_ACCUM_OP(z,x,y) z = ((x) != (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t -#define GB_DECLAREY(ywork) uint8_t ywork -#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) ywork = Ax [(A_iso) ? 0 : (pA)] - -// A and C matrices -#define GB_A_TYPE uint8_t -#define GB_C_TYPE uint8_t -#define GB_DECLAREC(cwork) uint8_t cwork -#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork -#define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) - -// C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ - GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) - -// C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ -} - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISNE_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C += A, accumulate a sparse matrix into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_23__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - GB_Werk Werk -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_23_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C += y, accumulate a scalar into a dense matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_subassign_22__isne_uint8) -( - GrB_Matrix C, - const GB_void *ywork_handle -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - // get the scalar ywork for C += ywork, of type GB_Y_TYPE - GB_Y_TYPE ywork = (*((GB_Y_TYPE *) ywork_handle)) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - #include "assign/template/GB_subassign_22_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_aop__land_bool.c b/FactoryKernels/GB_aop__land_bool.c index 2f6d9e87de..896c70008f 100644 --- a/FactoryKernels/GB_aop__land_bool.c +++ b/FactoryKernels/GB_aop__land_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_fp32.c b/FactoryKernels/GB_aop__land_fp32.c index 845cf9a124..51986b33f1 100644 --- a/FactoryKernels/GB_aop__land_fp32.c +++ b/FactoryKernels/GB_aop__land_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_fp64.c b/FactoryKernels/GB_aop__land_fp64.c index e43caee117..18993ba487 100644 --- a/FactoryKernels/GB_aop__land_fp64.c +++ b/FactoryKernels/GB_aop__land_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_int16.c b/FactoryKernels/GB_aop__land_int16.c index 11d6503263..94e4698958 100644 --- a/FactoryKernels/GB_aop__land_int16.c +++ b/FactoryKernels/GB_aop__land_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_int32.c b/FactoryKernels/GB_aop__land_int32.c index 489c59baa2..c42b605195 100644 --- a/FactoryKernels/GB_aop__land_int32.c +++ b/FactoryKernels/GB_aop__land_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_int64.c b/FactoryKernels/GB_aop__land_int64.c index d6a34c772f..242fb92775 100644 --- a/FactoryKernels/GB_aop__land_int64.c +++ b/FactoryKernels/GB_aop__land_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_int8.c b/FactoryKernels/GB_aop__land_int8.c index 3e49f0b48f..7a775fbd5e 100644 --- a/FactoryKernels/GB_aop__land_int8.c +++ b/FactoryKernels/GB_aop__land_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_uint16.c b/FactoryKernels/GB_aop__land_uint16.c index 0482271f56..fecad9758c 100644 --- a/FactoryKernels/GB_aop__land_uint16.c +++ b/FactoryKernels/GB_aop__land_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_uint32.c b/FactoryKernels/GB_aop__land_uint32.c index 4248c883ae..32f6084948 100644 --- a/FactoryKernels/GB_aop__land_uint32.c +++ b/FactoryKernels/GB_aop__land_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_uint64.c b/FactoryKernels/GB_aop__land_uint64.c index d0b8c42dae..64c9a71ccb 100644 --- a/FactoryKernels/GB_aop__land_uint64.c +++ b/FactoryKernels/GB_aop__land_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__land_uint8.c b/FactoryKernels/GB_aop__land_uint8.c index f29e176552..2b40ed9cbf 100644 --- a/FactoryKernels/GB_aop__land_uint8.c +++ b/FactoryKernels/GB_aop__land_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__land_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__land_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__land_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__land_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__ldexp_fp32.c b/FactoryKernels/GB_aop__ldexp_fp32.c index e430cc2857..052d068e69 100644 --- a/FactoryKernels/GB_aop__ldexp_fp32.c +++ b/FactoryKernels/GB_aop__ldexp_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__ldexp_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__ldexp_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__ldexp_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__ldexp_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__ldexp_fp64.c b/FactoryKernels/GB_aop__ldexp_fp64.c index 3c2123b06e..6ba872dd2e 100644 --- a/FactoryKernels/GB_aop__ldexp_fp64.c +++ b/FactoryKernels/GB_aop__ldexp_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__ldexp_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__ldexp_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__ldexp_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__ldexp_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__le_bool.c b/FactoryKernels/GB_aop__le_bool.c index 468e36a7dd..57d08c518a 100644 --- a/FactoryKernels/GB_aop__le_bool.c +++ b/FactoryKernels/GB_aop__le_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__le_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__le_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__le_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__le_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_bool.c b/FactoryKernels/GB_aop__lor_bool.c index 0762caac64..a4a9a1b818 100644 --- a/FactoryKernels/GB_aop__lor_bool.c +++ b/FactoryKernels/GB_aop__lor_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_fp32.c b/FactoryKernels/GB_aop__lor_fp32.c index 3ef5a0e2de..619b5b40d4 100644 --- a/FactoryKernels/GB_aop__lor_fp32.c +++ b/FactoryKernels/GB_aop__lor_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_fp64.c b/FactoryKernels/GB_aop__lor_fp64.c index 9db886d89d..12e95520df 100644 --- a/FactoryKernels/GB_aop__lor_fp64.c +++ b/FactoryKernels/GB_aop__lor_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_int16.c b/FactoryKernels/GB_aop__lor_int16.c index e56c8231e8..c71b79c17f 100644 --- a/FactoryKernels/GB_aop__lor_int16.c +++ b/FactoryKernels/GB_aop__lor_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_int32.c b/FactoryKernels/GB_aop__lor_int32.c index 3e2f84e869..f605cefc90 100644 --- a/FactoryKernels/GB_aop__lor_int32.c +++ b/FactoryKernels/GB_aop__lor_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_int64.c b/FactoryKernels/GB_aop__lor_int64.c index 5a46254a77..f17e1c20bd 100644 --- a/FactoryKernels/GB_aop__lor_int64.c +++ b/FactoryKernels/GB_aop__lor_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_int8.c b/FactoryKernels/GB_aop__lor_int8.c index 5fc2d2431f..7bdedee370 100644 --- a/FactoryKernels/GB_aop__lor_int8.c +++ b/FactoryKernels/GB_aop__lor_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_uint16.c b/FactoryKernels/GB_aop__lor_uint16.c index 5dd32d7ede..0d03bff934 100644 --- a/FactoryKernels/GB_aop__lor_uint16.c +++ b/FactoryKernels/GB_aop__lor_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_uint32.c b/FactoryKernels/GB_aop__lor_uint32.c index 9d142bf83e..cbbaa37a5d 100644 --- a/FactoryKernels/GB_aop__lor_uint32.c +++ b/FactoryKernels/GB_aop__lor_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_uint64.c b/FactoryKernels/GB_aop__lor_uint64.c index 9c96018762..2673e6cd61 100644 --- a/FactoryKernels/GB_aop__lor_uint64.c +++ b/FactoryKernels/GB_aop__lor_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lor_uint8.c b/FactoryKernels/GB_aop__lor_uint8.c index e0ca86fe4f..83e7240c4f 100644 --- a/FactoryKernels/GB_aop__lor_uint8.c +++ b/FactoryKernels/GB_aop__lor_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lor_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lor_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lor_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lt_bool.c b/FactoryKernels/GB_aop__lt_bool.c index 040ccb13cf..ef3d422c40 100644 --- a/FactoryKernels/GB_aop__lt_bool.c +++ b/FactoryKernels/GB_aop__lt_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lt_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lt_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lt_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lt_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_bool.c b/FactoryKernels/GB_aop__lxor_bool.c index 264f0bf355..6b1da2cadd 100644 --- a/FactoryKernels/GB_aop__lxor_bool.c +++ b/FactoryKernels/GB_aop__lxor_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_fp32.c b/FactoryKernels/GB_aop__lxor_fp32.c index 933bf4ec42..01c37f39e1 100644 --- a/FactoryKernels/GB_aop__lxor_fp32.c +++ b/FactoryKernels/GB_aop__lxor_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_fp64.c b/FactoryKernels/GB_aop__lxor_fp64.c index 071c5df97c..6d53b0de9b 100644 --- a/FactoryKernels/GB_aop__lxor_fp64.c +++ b/FactoryKernels/GB_aop__lxor_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_int16.c b/FactoryKernels/GB_aop__lxor_int16.c index 984c6d7ff5..52dbbfe8c0 100644 --- a/FactoryKernels/GB_aop__lxor_int16.c +++ b/FactoryKernels/GB_aop__lxor_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_int32.c b/FactoryKernels/GB_aop__lxor_int32.c index 01ac0789dc..b530f04b39 100644 --- a/FactoryKernels/GB_aop__lxor_int32.c +++ b/FactoryKernels/GB_aop__lxor_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_int64.c b/FactoryKernels/GB_aop__lxor_int64.c index d0af5e450f..761ff0fdb3 100644 --- a/FactoryKernels/GB_aop__lxor_int64.c +++ b/FactoryKernels/GB_aop__lxor_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_int8.c b/FactoryKernels/GB_aop__lxor_int8.c index f12b00c16a..9b6ff05078 100644 --- a/FactoryKernels/GB_aop__lxor_int8.c +++ b/FactoryKernels/GB_aop__lxor_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_uint16.c b/FactoryKernels/GB_aop__lxor_uint16.c index 0ad829a429..a9b0c02065 100644 --- a/FactoryKernels/GB_aop__lxor_uint16.c +++ b/FactoryKernels/GB_aop__lxor_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_uint32.c b/FactoryKernels/GB_aop__lxor_uint32.c index 693218c506..1e5cd9d30c 100644 --- a/FactoryKernels/GB_aop__lxor_uint32.c +++ b/FactoryKernels/GB_aop__lxor_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_uint64.c b/FactoryKernels/GB_aop__lxor_uint64.c index 89a3cce1e6..bb7f891eec 100644 --- a/FactoryKernels/GB_aop__lxor_uint64.c +++ b/FactoryKernels/GB_aop__lxor_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__lxor_uint8.c b/FactoryKernels/GB_aop__lxor_uint8.c index cd8d97f200..2a45f5796b 100644 --- a/FactoryKernels/GB_aop__lxor_uint8.c +++ b/FactoryKernels/GB_aop__lxor_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__lxor_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__lxor_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__lxor_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__lxor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_fp32.c b/FactoryKernels/GB_aop__max_fp32.c index c7c88eb1d9..8c4aebfb75 100644 --- a/FactoryKernels/GB_aop__max_fp32.c +++ b/FactoryKernels/GB_aop__max_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_fp64.c b/FactoryKernels/GB_aop__max_fp64.c index e0ad1733ae..8b203253a4 100644 --- a/FactoryKernels/GB_aop__max_fp64.c +++ b/FactoryKernels/GB_aop__max_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_int16.c b/FactoryKernels/GB_aop__max_int16.c index 837a2f9d2a..9e3490f75e 100644 --- a/FactoryKernels/GB_aop__max_int16.c +++ b/FactoryKernels/GB_aop__max_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_int32.c b/FactoryKernels/GB_aop__max_int32.c index 477dfa5ca2..e715b39420 100644 --- a/FactoryKernels/GB_aop__max_int32.c +++ b/FactoryKernels/GB_aop__max_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_int64.c b/FactoryKernels/GB_aop__max_int64.c index a57beea264..ca7c01f035 100644 --- a/FactoryKernels/GB_aop__max_int64.c +++ b/FactoryKernels/GB_aop__max_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_int8.c b/FactoryKernels/GB_aop__max_int8.c index acafd58e5d..056d892996 100644 --- a/FactoryKernels/GB_aop__max_int8.c +++ b/FactoryKernels/GB_aop__max_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_uint16.c b/FactoryKernels/GB_aop__max_uint16.c index e40cfc76ae..cad46b2992 100644 --- a/FactoryKernels/GB_aop__max_uint16.c +++ b/FactoryKernels/GB_aop__max_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_uint32.c b/FactoryKernels/GB_aop__max_uint32.c index 3aeca76e21..2ea9b77ec9 100644 --- a/FactoryKernels/GB_aop__max_uint32.c +++ b/FactoryKernels/GB_aop__max_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_uint64.c b/FactoryKernels/GB_aop__max_uint64.c index 56232c332c..2b4cf284f8 100644 --- a/FactoryKernels/GB_aop__max_uint64.c +++ b/FactoryKernels/GB_aop__max_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__max_uint8.c b/FactoryKernels/GB_aop__max_uint8.c index eca73b6adb..47434971ef 100644 --- a/FactoryKernels/GB_aop__max_uint8.c +++ b/FactoryKernels/GB_aop__max_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__max_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__max_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__max_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__max_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_fp32.c b/FactoryKernels/GB_aop__min_fp32.c index f189e39f27..26d9637c61 100644 --- a/FactoryKernels/GB_aop__min_fp32.c +++ b/FactoryKernels/GB_aop__min_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_fp64.c b/FactoryKernels/GB_aop__min_fp64.c index 83f535566e..d98d385b6d 100644 --- a/FactoryKernels/GB_aop__min_fp64.c +++ b/FactoryKernels/GB_aop__min_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_int16.c b/FactoryKernels/GB_aop__min_int16.c index 2ce2fc5ccc..a5a6143ff7 100644 --- a/FactoryKernels/GB_aop__min_int16.c +++ b/FactoryKernels/GB_aop__min_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_int32.c b/FactoryKernels/GB_aop__min_int32.c index 0656de83bc..69d31626a4 100644 --- a/FactoryKernels/GB_aop__min_int32.c +++ b/FactoryKernels/GB_aop__min_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_int64.c b/FactoryKernels/GB_aop__min_int64.c index 7f5e0f1db5..25a6c7ce63 100644 --- a/FactoryKernels/GB_aop__min_int64.c +++ b/FactoryKernels/GB_aop__min_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_int8.c b/FactoryKernels/GB_aop__min_int8.c index 7e6e99d8ed..92ca3a1766 100644 --- a/FactoryKernels/GB_aop__min_int8.c +++ b/FactoryKernels/GB_aop__min_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_uint16.c b/FactoryKernels/GB_aop__min_uint16.c index 81fe4a0028..7c419dd1a6 100644 --- a/FactoryKernels/GB_aop__min_uint16.c +++ b/FactoryKernels/GB_aop__min_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_uint32.c b/FactoryKernels/GB_aop__min_uint32.c index e74933ea09..710381b43d 100644 --- a/FactoryKernels/GB_aop__min_uint32.c +++ b/FactoryKernels/GB_aop__min_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_uint64.c b/FactoryKernels/GB_aop__min_uint64.c index 3363a950b5..ab707d7f60 100644 --- a/FactoryKernels/GB_aop__min_uint64.c +++ b/FactoryKernels/GB_aop__min_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__min_uint8.c b/FactoryKernels/GB_aop__min_uint8.c index 1394532a89..d3a40fc001 100644 --- a/FactoryKernels/GB_aop__min_uint8.c +++ b/FactoryKernels/GB_aop__min_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__min_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__min_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__min_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__min_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_fc32.c b/FactoryKernels/GB_aop__minus_fc32.c index 8a9971859d..e0d9922845 100644 --- a/FactoryKernels/GB_aop__minus_fc32.c +++ b/FactoryKernels/GB_aop__minus_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_fc64.c b/FactoryKernels/GB_aop__minus_fc64.c index fa5c588cb9..4661e41b29 100644 --- a/FactoryKernels/GB_aop__minus_fc64.c +++ b/FactoryKernels/GB_aop__minus_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_fp32.c b/FactoryKernels/GB_aop__minus_fp32.c index 91d9ee2431..b17f1154cd 100644 --- a/FactoryKernels/GB_aop__minus_fp32.c +++ b/FactoryKernels/GB_aop__minus_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_fp64.c b/FactoryKernels/GB_aop__minus_fp64.c index 19c373792f..ac241bc0f1 100644 --- a/FactoryKernels/GB_aop__minus_fp64.c +++ b/FactoryKernels/GB_aop__minus_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_int16.c b/FactoryKernels/GB_aop__minus_int16.c index 5c6eac77ff..db04b4f726 100644 --- a/FactoryKernels/GB_aop__minus_int16.c +++ b/FactoryKernels/GB_aop__minus_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_int32.c b/FactoryKernels/GB_aop__minus_int32.c index 2d22ded924..bb5263e81f 100644 --- a/FactoryKernels/GB_aop__minus_int32.c +++ b/FactoryKernels/GB_aop__minus_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_int64.c b/FactoryKernels/GB_aop__minus_int64.c index 8ddffa473a..005a35ac42 100644 --- a/FactoryKernels/GB_aop__minus_int64.c +++ b/FactoryKernels/GB_aop__minus_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_int8.c b/FactoryKernels/GB_aop__minus_int8.c index 4932216a8b..7b7e92dfdf 100644 --- a/FactoryKernels/GB_aop__minus_int8.c +++ b/FactoryKernels/GB_aop__minus_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_uint16.c b/FactoryKernels/GB_aop__minus_uint16.c index 19de785001..4557d0f44a 100644 --- a/FactoryKernels/GB_aop__minus_uint16.c +++ b/FactoryKernels/GB_aop__minus_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_uint32.c b/FactoryKernels/GB_aop__minus_uint32.c index c17727b372..d4e2f65ed1 100644 --- a/FactoryKernels/GB_aop__minus_uint32.c +++ b/FactoryKernels/GB_aop__minus_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_uint64.c b/FactoryKernels/GB_aop__minus_uint64.c index c8ff492eea..c53ec11ad7 100644 --- a/FactoryKernels/GB_aop__minus_uint64.c +++ b/FactoryKernels/GB_aop__minus_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__minus_uint8.c b/FactoryKernels/GB_aop__minus_uint8.c index ae7b9f0d9f..ad701b0a7d 100644 --- a/FactoryKernels/GB_aop__minus_uint8.c +++ b/FactoryKernels/GB_aop__minus_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__minus_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__minus_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__minus_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__minus_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_bool.c b/FactoryKernels/GB_aop__pair_bool.c index c4e4d004af..b2b7a51c3c 100644 --- a/FactoryKernels/GB_aop__pair_bool.c +++ b/FactoryKernels/GB_aop__pair_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_fc32.c b/FactoryKernels/GB_aop__pair_fc32.c index 9df06832a8..7df4504c1c 100644 --- a/FactoryKernels/GB_aop__pair_fc32.c +++ b/FactoryKernels/GB_aop__pair_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_fc64.c b/FactoryKernels/GB_aop__pair_fc64.c index a1f97a1fdf..d50f396951 100644 --- a/FactoryKernels/GB_aop__pair_fc64.c +++ b/FactoryKernels/GB_aop__pair_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_fp32.c b/FactoryKernels/GB_aop__pair_fp32.c index 69416aba39..4bb799c375 100644 --- a/FactoryKernels/GB_aop__pair_fp32.c +++ b/FactoryKernels/GB_aop__pair_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_fp64.c b/FactoryKernels/GB_aop__pair_fp64.c index 54c8e90f08..d3eed9c6af 100644 --- a/FactoryKernels/GB_aop__pair_fp64.c +++ b/FactoryKernels/GB_aop__pair_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_int16.c b/FactoryKernels/GB_aop__pair_int16.c index f2f77982cc..5b11ba0c57 100644 --- a/FactoryKernels/GB_aop__pair_int16.c +++ b/FactoryKernels/GB_aop__pair_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_int32.c b/FactoryKernels/GB_aop__pair_int32.c index c2f0178a2a..89fd7120f6 100644 --- a/FactoryKernels/GB_aop__pair_int32.c +++ b/FactoryKernels/GB_aop__pair_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_int64.c b/FactoryKernels/GB_aop__pair_int64.c index 13afaf93a4..b0980da3e6 100644 --- a/FactoryKernels/GB_aop__pair_int64.c +++ b/FactoryKernels/GB_aop__pair_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_int8.c b/FactoryKernels/GB_aop__pair_int8.c index 9e87ff8162..40442db719 100644 --- a/FactoryKernels/GB_aop__pair_int8.c +++ b/FactoryKernels/GB_aop__pair_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_uint16.c b/FactoryKernels/GB_aop__pair_uint16.c index 647f7cd5bf..4c5a2c2c6d 100644 --- a/FactoryKernels/GB_aop__pair_uint16.c +++ b/FactoryKernels/GB_aop__pair_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_uint32.c b/FactoryKernels/GB_aop__pair_uint32.c index a492bc87ad..9222ee0c82 100644 --- a/FactoryKernels/GB_aop__pair_uint32.c +++ b/FactoryKernels/GB_aop__pair_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_uint64.c b/FactoryKernels/GB_aop__pair_uint64.c index 02acca30b9..2d9e40d25a 100644 --- a/FactoryKernels/GB_aop__pair_uint64.c +++ b/FactoryKernels/GB_aop__pair_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pair_uint8.c b/FactoryKernels/GB_aop__pair_uint8.c index f4fec6671f..d10ebe8f92 100644 --- a/FactoryKernels/GB_aop__pair_uint8.c +++ b/FactoryKernels/GB_aop__pair_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pair_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pair_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pair_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pair_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_fc32.c b/FactoryKernels/GB_aop__plus_fc32.c index 8296de3ba8..fa534f3ab0 100644 --- a/FactoryKernels/GB_aop__plus_fc32.c +++ b/FactoryKernels/GB_aop__plus_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_fc64.c b/FactoryKernels/GB_aop__plus_fc64.c index 9629d6664b..757be5dfc7 100644 --- a/FactoryKernels/GB_aop__plus_fc64.c +++ b/FactoryKernels/GB_aop__plus_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_fp32.c b/FactoryKernels/GB_aop__plus_fp32.c index 126b8084a5..18e3688688 100644 --- a/FactoryKernels/GB_aop__plus_fp32.c +++ b/FactoryKernels/GB_aop__plus_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_fp64.c b/FactoryKernels/GB_aop__plus_fp64.c index 349b5721b1..ff634d7e10 100644 --- a/FactoryKernels/GB_aop__plus_fp64.c +++ b/FactoryKernels/GB_aop__plus_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_int16.c b/FactoryKernels/GB_aop__plus_int16.c index b6d7e31412..6c194761fb 100644 --- a/FactoryKernels/GB_aop__plus_int16.c +++ b/FactoryKernels/GB_aop__plus_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_int32.c b/FactoryKernels/GB_aop__plus_int32.c index 4015d8a9bd..c602b5a444 100644 --- a/FactoryKernels/GB_aop__plus_int32.c +++ b/FactoryKernels/GB_aop__plus_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_int64.c b/FactoryKernels/GB_aop__plus_int64.c index 36976f5a53..469e1f55dc 100644 --- a/FactoryKernels/GB_aop__plus_int64.c +++ b/FactoryKernels/GB_aop__plus_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_int8.c b/FactoryKernels/GB_aop__plus_int8.c index f6d3e324aa..4811c99978 100644 --- a/FactoryKernels/GB_aop__plus_int8.c +++ b/FactoryKernels/GB_aop__plus_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_uint16.c b/FactoryKernels/GB_aop__plus_uint16.c index d09c2b3ce3..6c64d98ee2 100644 --- a/FactoryKernels/GB_aop__plus_uint16.c +++ b/FactoryKernels/GB_aop__plus_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_uint32.c b/FactoryKernels/GB_aop__plus_uint32.c index 5da2ec6320..fdca1f888e 100644 --- a/FactoryKernels/GB_aop__plus_uint32.c +++ b/FactoryKernels/GB_aop__plus_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_uint64.c b/FactoryKernels/GB_aop__plus_uint64.c index 03b749f574..003bd0cfbd 100644 --- a/FactoryKernels/GB_aop__plus_uint64.c +++ b/FactoryKernels/GB_aop__plus_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__plus_uint8.c b/FactoryKernels/GB_aop__plus_uint8.c index ff685d69df..b7629b3d46 100644 --- a/FactoryKernels/GB_aop__plus_uint8.c +++ b/FactoryKernels/GB_aop__plus_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__plus_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__plus_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__plus_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__plus_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_fc32.c b/FactoryKernels/GB_aop__pow_fc32.c index 7175182b14..e69f767887 100644 --- a/FactoryKernels/GB_aop__pow_fc32.c +++ b/FactoryKernels/GB_aop__pow_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_fc64.c b/FactoryKernels/GB_aop__pow_fc64.c index d94087ffbb..9ba8329c15 100644 --- a/FactoryKernels/GB_aop__pow_fc64.c +++ b/FactoryKernels/GB_aop__pow_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_fp32.c b/FactoryKernels/GB_aop__pow_fp32.c index 2fcb6f3828..35d6c5d514 100644 --- a/FactoryKernels/GB_aop__pow_fp32.c +++ b/FactoryKernels/GB_aop__pow_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_fp64.c b/FactoryKernels/GB_aop__pow_fp64.c index 3a8fc16618..3fea4eb024 100644 --- a/FactoryKernels/GB_aop__pow_fp64.c +++ b/FactoryKernels/GB_aop__pow_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_int16.c b/FactoryKernels/GB_aop__pow_int16.c index 42c00fd8e7..26f0cbb7d2 100644 --- a/FactoryKernels/GB_aop__pow_int16.c +++ b/FactoryKernels/GB_aop__pow_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_int32.c b/FactoryKernels/GB_aop__pow_int32.c index b519f2e823..2d16716cb8 100644 --- a/FactoryKernels/GB_aop__pow_int32.c +++ b/FactoryKernels/GB_aop__pow_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_int64.c b/FactoryKernels/GB_aop__pow_int64.c index 5f3356ba97..2fb0bf4f07 100644 --- a/FactoryKernels/GB_aop__pow_int64.c +++ b/FactoryKernels/GB_aop__pow_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_int8.c b/FactoryKernels/GB_aop__pow_int8.c index 97ecfc56f8..6586e8983c 100644 --- a/FactoryKernels/GB_aop__pow_int8.c +++ b/FactoryKernels/GB_aop__pow_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_uint16.c b/FactoryKernels/GB_aop__pow_uint16.c index 5ff355f79a..8366fa8a43 100644 --- a/FactoryKernels/GB_aop__pow_uint16.c +++ b/FactoryKernels/GB_aop__pow_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_uint32.c b/FactoryKernels/GB_aop__pow_uint32.c index 595af85039..b03999a889 100644 --- a/FactoryKernels/GB_aop__pow_uint32.c +++ b/FactoryKernels/GB_aop__pow_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_uint64.c b/FactoryKernels/GB_aop__pow_uint64.c index 1d164fe0a0..543f04500b 100644 --- a/FactoryKernels/GB_aop__pow_uint64.c +++ b/FactoryKernels/GB_aop__pow_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__pow_uint8.c b/FactoryKernels/GB_aop__pow_uint8.c index 54717c477f..d3749f0d57 100644 --- a/FactoryKernels/GB_aop__pow_uint8.c +++ b/FactoryKernels/GB_aop__pow_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__pow_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__pow_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__pow_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__pow_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_fc32.c b/FactoryKernels/GB_aop__rdiv_fc32.c index d9a7d88872..d5fb9f16b9 100644 --- a/FactoryKernels/GB_aop__rdiv_fc32.c +++ b/FactoryKernels/GB_aop__rdiv_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_fc64.c b/FactoryKernels/GB_aop__rdiv_fc64.c index 2c9da74acc..fd4bfe8982 100644 --- a/FactoryKernels/GB_aop__rdiv_fc64.c +++ b/FactoryKernels/GB_aop__rdiv_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_fp32.c b/FactoryKernels/GB_aop__rdiv_fp32.c index 592af80669..349cb6c885 100644 --- a/FactoryKernels/GB_aop__rdiv_fp32.c +++ b/FactoryKernels/GB_aop__rdiv_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_fp64.c b/FactoryKernels/GB_aop__rdiv_fp64.c index 7c13922a88..a0d2d73d18 100644 --- a/FactoryKernels/GB_aop__rdiv_fp64.c +++ b/FactoryKernels/GB_aop__rdiv_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_int16.c b/FactoryKernels/GB_aop__rdiv_int16.c index 382d4f9bf1..4f3f1c630a 100644 --- a/FactoryKernels/GB_aop__rdiv_int16.c +++ b/FactoryKernels/GB_aop__rdiv_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_int32.c b/FactoryKernels/GB_aop__rdiv_int32.c index d473bf5d38..1dd65ea9e8 100644 --- a/FactoryKernels/GB_aop__rdiv_int32.c +++ b/FactoryKernels/GB_aop__rdiv_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_int64.c b/FactoryKernels/GB_aop__rdiv_int64.c index f5dda58cd3..c42425832c 100644 --- a/FactoryKernels/GB_aop__rdiv_int64.c +++ b/FactoryKernels/GB_aop__rdiv_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_int8.c b/FactoryKernels/GB_aop__rdiv_int8.c index afe36f4d5e..9d5f2a2b02 100644 --- a/FactoryKernels/GB_aop__rdiv_int8.c +++ b/FactoryKernels/GB_aop__rdiv_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_uint16.c b/FactoryKernels/GB_aop__rdiv_uint16.c index aa8c5311af..0eede503b1 100644 --- a/FactoryKernels/GB_aop__rdiv_uint16.c +++ b/FactoryKernels/GB_aop__rdiv_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_uint32.c b/FactoryKernels/GB_aop__rdiv_uint32.c index 2377cbb882..3334924beb 100644 --- a/FactoryKernels/GB_aop__rdiv_uint32.c +++ b/FactoryKernels/GB_aop__rdiv_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_uint64.c b/FactoryKernels/GB_aop__rdiv_uint64.c index 30cacba726..920a0d8c3b 100644 --- a/FactoryKernels/GB_aop__rdiv_uint64.c +++ b/FactoryKernels/GB_aop__rdiv_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rdiv_uint8.c b/FactoryKernels/GB_aop__rdiv_uint8.c index 010cf6f1fc..7a02e345ca 100644 --- a/FactoryKernels/GB_aop__rdiv_uint8.c +++ b/FactoryKernels/GB_aop__rdiv_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rdiv_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rdiv_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rdiv_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rdiv_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__remainder_fp32.c b/FactoryKernels/GB_aop__remainder_fp32.c index 785e5f7a1b..b978fa53e8 100644 --- a/FactoryKernels/GB_aop__remainder_fp32.c +++ b/FactoryKernels/GB_aop__remainder_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__remainder_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__remainder_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__remainder_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__remainder_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__remainder_fp64.c b/FactoryKernels/GB_aop__remainder_fp64.c index d72cdb2fc3..dc472854de 100644 --- a/FactoryKernels/GB_aop__remainder_fp64.c +++ b/FactoryKernels/GB_aop__remainder_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__remainder_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__remainder_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__remainder_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__remainder_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_fc32.c b/FactoryKernels/GB_aop__rminus_fc32.c index bef8ea30e8..57f917a97c 100644 --- a/FactoryKernels/GB_aop__rminus_fc32.c +++ b/FactoryKernels/GB_aop__rminus_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_fc64.c b/FactoryKernels/GB_aop__rminus_fc64.c index e6ef6dbdd9..55b6822eb3 100644 --- a/FactoryKernels/GB_aop__rminus_fc64.c +++ b/FactoryKernels/GB_aop__rminus_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_fp32.c b/FactoryKernels/GB_aop__rminus_fp32.c index 5c5bd8bb6d..caff1e9ddb 100644 --- a/FactoryKernels/GB_aop__rminus_fp32.c +++ b/FactoryKernels/GB_aop__rminus_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_fp64.c b/FactoryKernels/GB_aop__rminus_fp64.c index 0f3907be27..ef5dbc2971 100644 --- a/FactoryKernels/GB_aop__rminus_fp64.c +++ b/FactoryKernels/GB_aop__rminus_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_int16.c b/FactoryKernels/GB_aop__rminus_int16.c index 44a8fd0430..a8df1a66de 100644 --- a/FactoryKernels/GB_aop__rminus_int16.c +++ b/FactoryKernels/GB_aop__rminus_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_int32.c b/FactoryKernels/GB_aop__rminus_int32.c index b966e37701..26634aecac 100644 --- a/FactoryKernels/GB_aop__rminus_int32.c +++ b/FactoryKernels/GB_aop__rminus_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_int64.c b/FactoryKernels/GB_aop__rminus_int64.c index de796c8f33..af4cb85b8a 100644 --- a/FactoryKernels/GB_aop__rminus_int64.c +++ b/FactoryKernels/GB_aop__rminus_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_int8.c b/FactoryKernels/GB_aop__rminus_int8.c index ae3f4b6b46..33e31444d0 100644 --- a/FactoryKernels/GB_aop__rminus_int8.c +++ b/FactoryKernels/GB_aop__rminus_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_uint16.c b/FactoryKernels/GB_aop__rminus_uint16.c index 6ecd51db90..77a72d5255 100644 --- a/FactoryKernels/GB_aop__rminus_uint16.c +++ b/FactoryKernels/GB_aop__rminus_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_uint32.c b/FactoryKernels/GB_aop__rminus_uint32.c index b637ef0bcd..8c5c0b66c7 100644 --- a/FactoryKernels/GB_aop__rminus_uint32.c +++ b/FactoryKernels/GB_aop__rminus_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_uint64.c b/FactoryKernels/GB_aop__rminus_uint64.c index f82f160f8f..0b0e49901a 100644 --- a/FactoryKernels/GB_aop__rminus_uint64.c +++ b/FactoryKernels/GB_aop__rminus_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__rminus_uint8.c b/FactoryKernels/GB_aop__rminus_uint8.c index 26a5131766..9758f3c351 100644 --- a/FactoryKernels/GB_aop__rminus_uint8.c +++ b/FactoryKernels/GB_aop__rminus_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__rminus_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__rminus_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__rminus_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__rminus_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_bool.c b/FactoryKernels/GB_aop__second_bool.c index a9270182a6..3e367a247c 100644 --- a/FactoryKernels/GB_aop__second_bool.c +++ b/FactoryKernels/GB_aop__second_bool.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_bool) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_bool) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_bool) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_fc32.c b/FactoryKernels/GB_aop__second_fc32.c index a66dd93e8e..bd85d668c5 100644 --- a/FactoryKernels/GB_aop__second_fc32.c +++ b/FactoryKernels/GB_aop__second_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_fc64.c b/FactoryKernels/GB_aop__second_fc64.c index 8c235cf410..976ee20de9 100644 --- a/FactoryKernels/GB_aop__second_fc64.c +++ b/FactoryKernels/GB_aop__second_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_fp32.c b/FactoryKernels/GB_aop__second_fp32.c index 534027c3e6..41e39e5f3e 100644 --- a/FactoryKernels/GB_aop__second_fp32.c +++ b/FactoryKernels/GB_aop__second_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_fp64.c b/FactoryKernels/GB_aop__second_fp64.c index b71fbc4019..541156cd9f 100644 --- a/FactoryKernels/GB_aop__second_fp64.c +++ b/FactoryKernels/GB_aop__second_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_int16.c b/FactoryKernels/GB_aop__second_int16.c index fa871805cf..47ebf7f477 100644 --- a/FactoryKernels/GB_aop__second_int16.c +++ b/FactoryKernels/GB_aop__second_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_int32.c b/FactoryKernels/GB_aop__second_int32.c index e174913923..d5553de97e 100644 --- a/FactoryKernels/GB_aop__second_int32.c +++ b/FactoryKernels/GB_aop__second_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_int64.c b/FactoryKernels/GB_aop__second_int64.c index a326a2a626..ea96d784f3 100644 --- a/FactoryKernels/GB_aop__second_int64.c +++ b/FactoryKernels/GB_aop__second_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_int8.c b/FactoryKernels/GB_aop__second_int8.c index 1b943c23ec..e113dccbe6 100644 --- a/FactoryKernels/GB_aop__second_int8.c +++ b/FactoryKernels/GB_aop__second_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_uint16.c b/FactoryKernels/GB_aop__second_uint16.c index 622055546a..2e71aa3677 100644 --- a/FactoryKernels/GB_aop__second_uint16.c +++ b/FactoryKernels/GB_aop__second_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_uint32.c b/FactoryKernels/GB_aop__second_uint32.c index a0c8cf6421..bbbc48cf39 100644 --- a/FactoryKernels/GB_aop__second_uint32.c +++ b/FactoryKernels/GB_aop__second_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_uint64.c b/FactoryKernels/GB_aop__second_uint64.c index 62d14827fd..0fc66ccb05 100644 --- a/FactoryKernels/GB_aop__second_uint64.c +++ b/FactoryKernels/GB_aop__second_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__second_uint8.c b/FactoryKernels/GB_aop__second_uint8.c index a1eac69771..717e570554 100644 --- a/FactoryKernels/GB_aop__second_uint8.c +++ b/FactoryKernels/GB_aop__second_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__second_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__second_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__second_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__second_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_fc32.c b/FactoryKernels/GB_aop__times_fc32.c index c3adf30a55..5faf5f9507 100644 --- a/FactoryKernels/GB_aop__times_fc32.c +++ b/FactoryKernels/GB_aop__times_fc32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_fc32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_fc32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_fc32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_fc64.c b/FactoryKernels/GB_aop__times_fc64.c index 4a2dfe2de6..17730d158d 100644 --- a/FactoryKernels/GB_aop__times_fc64.c +++ b/FactoryKernels/GB_aop__times_fc64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_fc64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_fc64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_fc64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_fp32.c b/FactoryKernels/GB_aop__times_fp32.c index 6b0c667d78..a4ec556499 100644 --- a/FactoryKernels/GB_aop__times_fp32.c +++ b/FactoryKernels/GB_aop__times_fp32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_fp32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_fp32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_fp32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_fp64.c b/FactoryKernels/GB_aop__times_fp64.c index 8894cd3e9e..1dc72a7a17 100644 --- a/FactoryKernels/GB_aop__times_fp64.c +++ b/FactoryKernels/GB_aop__times_fp64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_fp64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_fp64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_fp64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_int16.c b/FactoryKernels/GB_aop__times_int16.c index 2cb93cab6b..c9407d047e 100644 --- a/FactoryKernels/GB_aop__times_int16.c +++ b/FactoryKernels/GB_aop__times_int16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_int16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_int16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_int16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_int32.c b/FactoryKernels/GB_aop__times_int32.c index 3f5a00e335..861296db0d 100644 --- a/FactoryKernels/GB_aop__times_int32.c +++ b/FactoryKernels/GB_aop__times_int32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_int32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_int32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_int32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_int64.c b/FactoryKernels/GB_aop__times_int64.c index 46d50d6873..6996695555 100644 --- a/FactoryKernels/GB_aop__times_int64.c +++ b/FactoryKernels/GB_aop__times_int64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_int64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_int64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_int64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_int8.c b/FactoryKernels/GB_aop__times_int8.c index d00951c106..633f130410 100644 --- a/FactoryKernels/GB_aop__times_int8.c +++ b/FactoryKernels/GB_aop__times_int8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_int8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_int8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_int8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_uint16.c b/FactoryKernels/GB_aop__times_uint16.c index 43b2ae8b31..fc4e75fb33 100644 --- a/FactoryKernels/GB_aop__times_uint16.c +++ b/FactoryKernels/GB_aop__times_uint16.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_uint16) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_uint16) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_uint16) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_uint32.c b/FactoryKernels/GB_aop__times_uint32.c index b63f18071f..ad449b9d24 100644 --- a/FactoryKernels/GB_aop__times_uint32.c +++ b/FactoryKernels/GB_aop__times_uint32.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_uint32) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_uint32) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_uint32) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_uint64.c b/FactoryKernels/GB_aop__times_uint64.c index dffbb2adb5..c9c4893112 100644 --- a/FactoryKernels/GB_aop__times_uint64.c +++ b/FactoryKernels/GB_aop__times_uint64.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_uint64) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_uint64) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_uint64) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_aop__times_uint8.c b/FactoryKernels/GB_aop__times_uint8.c index 6e5479422c..d339cd4b86 100644 --- a/FactoryKernels/GB_aop__times_uint8.c +++ b/FactoryKernels/GB_aop__times_uint8.c @@ -9,8 +9,15 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -27,26 +34,26 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -62,6 +69,9 @@ // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23__times_uint8) ( GrB_Matrix C, @@ -83,6 +93,9 @@ GrB_Info GB (_subassign_23__times_uint8) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22__times_uint8) ( GrB_Matrix C, @@ -101,3 +114,5 @@ GrB_Info GB (_subassign_22__times_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_as__bool.c b/FactoryKernels/GB_as__bool.c index 29ba123d8a..a97917991f 100644 --- a/FactoryKernels/GB_as__bool.c +++ b/FactoryKernels/GB_as__bool.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE bool #define GB_DECLAREC(cwork) bool cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__bool) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__bool) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__bool) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__bool) #endif } +#endif + diff --git a/FactoryKernels/GB_as__fc32.c b/FactoryKernels/GB_as__fc32.c index 1f3b97ca2f..66f2e79c78 100644 --- a/FactoryKernels/GB_as__fc32.c +++ b/FactoryKernels/GB_as__fc32.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE GxB_FC32_t #define GB_DECLAREC(cwork) GxB_FC32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC32_t)) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__fc32) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__fc32) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__fc32) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_as__fc64.c b/FactoryKernels/GB_as__fc64.c index 4e6be9e908..efb03dba80 100644 --- a/FactoryKernels/GB_as__fc64.c +++ b/FactoryKernels/GB_as__fc64.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE GxB_FC64_t #define GB_DECLAREC(cwork) GxB_FC64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, sizeof (GxB_FC64_t)) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__fc64) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__fc64) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__fc64) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_as__fp32.c b/FactoryKernels/GB_as__fp32.c index 7c65bc7918..47b8351ad2 100644 --- a/FactoryKernels/GB_as__fp32.c +++ b/FactoryKernels/GB_as__fp32.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE float #define GB_DECLAREC(cwork) float cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__fp32) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__fp32) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__fp32) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_as__fp64.c b/FactoryKernels/GB_as__fp64.c index 01c9215625..aa1ea1f494 100644 --- a/FactoryKernels/GB_as__fp64.c +++ b/FactoryKernels/GB_as__fp64.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE double #define GB_DECLAREC(cwork) double cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__fp64) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__fp64) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__fp64) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_as__int16.c b/FactoryKernels/GB_as__int16.c index 2bfbb2c87f..1e92522acb 100644 --- a/FactoryKernels/GB_as__int16.c +++ b/FactoryKernels/GB_as__int16.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE int16_t #define GB_DECLAREC(cwork) int16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__int16) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__int16) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__int16) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__int16) #endif } +#endif + diff --git a/FactoryKernels/GB_as__int32.c b/FactoryKernels/GB_as__int32.c index a204abedda..422c7f9e29 100644 --- a/FactoryKernels/GB_as__int32.c +++ b/FactoryKernels/GB_as__int32.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE int32_t #define GB_DECLAREC(cwork) int32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__int32) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__int32) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__int32) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__int32) #endif } +#endif + diff --git a/FactoryKernels/GB_as__int64.c b/FactoryKernels/GB_as__int64.c index c54c28265a..2cac543b04 100644 --- a/FactoryKernels/GB_as__int64.c +++ b/FactoryKernels/GB_as__int64.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE int64_t #define GB_DECLAREC(cwork) int64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__int64) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__int64) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__int64) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__int64) #endif } +#endif + diff --git a/FactoryKernels/GB_as__int8.c b/FactoryKernels/GB_as__int8.c index 8d54b62d35..481589e9ca 100644 --- a/FactoryKernels/GB_as__int8.c +++ b/FactoryKernels/GB_as__int8.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE int8_t #define GB_DECLAREC(cwork) int8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__int8) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__int8) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__int8) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__int8) #endif } +#endif + diff --git a/FactoryKernels/GB_as__uint16.c b/FactoryKernels/GB_as__uint16.c index eaf35ca618..27dec31847 100644 --- a/FactoryKernels/GB_as__uint16.c +++ b/FactoryKernels/GB_as__uint16.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE uint16_t #define GB_DECLAREC(cwork) uint16_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__uint16) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__uint16) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__uint16) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_as__uint32.c b/FactoryKernels/GB_as__uint32.c index 635af2766d..4b66316b65 100644 --- a/FactoryKernels/GB_as__uint32.c +++ b/FactoryKernels/GB_as__uint32.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE uint32_t #define GB_DECLAREC(cwork) uint32_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__uint32) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__uint32) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__uint32) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_as__uint64.c b/FactoryKernels/GB_as__uint64.c index 4b39ed0a42..a048f4b753 100644 --- a/FactoryKernels/GB_as__uint64.c +++ b/FactoryKernels/GB_as__uint64.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE uint64_t #define GB_DECLAREC(cwork) uint64_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__uint64) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__uint64) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__uint64) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_as__uint8.c b/FactoryKernels/GB_as__uint8.c index 91686e4726..231dcae4aa 100644 --- a/FactoryKernels/GB_as__uint8.c +++ b/FactoryKernels/GB_as__uint8.c @@ -9,8 +9,15 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -19,8 +26,8 @@ #define GB_C_TYPE uint8_t #define GB_DECLAREC(cwork) uint8_t cwork #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)] -#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA] -#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork +#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA] +#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork #define GB_AX_MASK(Ax,pA,asize) (Ax [pA] != 0) // disable this operator and use the generic case if these conditions hold @@ -36,12 +43,15 @@ // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d__uint8) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -60,6 +70,9 @@ GrB_Info GB (_subassign_05d__uint8) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d__uint8) ( GrB_Matrix C, @@ -102,3 +115,5 @@ GrB_Info GB (_subassign_25__uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_bool.c b/FactoryKernels/GB_bld__any_bool.c index 27aadacb10..a2006c2cbf 100644 --- a/FactoryKernels/GB_bld__any_bool.c +++ b/FactoryKernels/GB_bld__any_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE bool -#define GB_T_TYPE bool +#define GB_Sx_TYPE bool +#define GB_Tx_TYPE bool // operator types: z = dup (x,y) -#define GB_Z_TYPE bool -#define GB_X_TYPE bool -#define GB_Y_TYPE bool +#define GB_Z_TYPE bool +#define GB_X_TYPE bool +#define GB_Y_TYPE bool // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_BOOL) || defined(GxB_NO_ANY_BOOL)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_bool) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_fc32.c b/FactoryKernels/GB_bld__any_fc32.c index 588de1e6d4..440fea2258 100644 --- a/FactoryKernels/GB_bld__any_fc32.c +++ b/FactoryKernels/GB_bld__any_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC32_t -#define GB_T_TYPE GxB_FC32_t +#define GB_Sx_TYPE GxB_FC32_t +#define GB_Tx_TYPE GxB_FC32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t +#define GB_Z_TYPE GxB_FC32_t +#define GB_X_TYPE GxB_FC32_t +#define GB_Y_TYPE GxB_FC32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_FC32) || defined(GxB_NO_ANY_FC32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_fc32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_fc64.c b/FactoryKernels/GB_bld__any_fc64.c index d70e227fb0..f8ff8ba967 100644 --- a/FactoryKernels/GB_bld__any_fc64.c +++ b/FactoryKernels/GB_bld__any_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC64_t -#define GB_T_TYPE GxB_FC64_t +#define GB_Sx_TYPE GxB_FC64_t +#define GB_Tx_TYPE GxB_FC64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t +#define GB_Z_TYPE GxB_FC64_t +#define GB_X_TYPE GxB_FC64_t +#define GB_Y_TYPE GxB_FC64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_FC64) || defined(GxB_NO_ANY_FC64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_fc64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_fp32.c b/FactoryKernels/GB_bld__any_fp32.c index b0de6bbf34..7b1abdb413 100644 --- a/FactoryKernels/GB_bld__any_fp32.c +++ b/FactoryKernels/GB_bld__any_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE float -#define GB_T_TYPE float +#define GB_Sx_TYPE float +#define GB_Tx_TYPE float // operator types: z = dup (x,y) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float +#define GB_Z_TYPE float +#define GB_X_TYPE float +#define GB_Y_TYPE float // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_FP32) || defined(GxB_NO_ANY_FP32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_fp32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_fp64.c b/FactoryKernels/GB_bld__any_fp64.c index 6274fea6be..779f4e8919 100644 --- a/FactoryKernels/GB_bld__any_fp64.c +++ b/FactoryKernels/GB_bld__any_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE double -#define GB_T_TYPE double +#define GB_Sx_TYPE double +#define GB_Tx_TYPE double // operator types: z = dup (x,y) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double +#define GB_Z_TYPE double +#define GB_X_TYPE double +#define GB_Y_TYPE double // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_FP64) || defined(GxB_NO_ANY_FP64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_fp64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_int16.c b/FactoryKernels/GB_bld__any_int16.c index eef41c433c..99d47be179 100644 --- a/FactoryKernels/GB_bld__any_int16.c +++ b/FactoryKernels/GB_bld__any_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int16_t -#define GB_T_TYPE int16_t +#define GB_Sx_TYPE int16_t +#define GB_Tx_TYPE int16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t +#define GB_Z_TYPE int16_t +#define GB_X_TYPE int16_t +#define GB_Y_TYPE int16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_INT16) || defined(GxB_NO_ANY_INT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_int16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_int32.c b/FactoryKernels/GB_bld__any_int32.c index 61f8d50179..dcab321f77 100644 --- a/FactoryKernels/GB_bld__any_int32.c +++ b/FactoryKernels/GB_bld__any_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int32_t -#define GB_T_TYPE int32_t +#define GB_Sx_TYPE int32_t +#define GB_Tx_TYPE int32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t +#define GB_Z_TYPE int32_t +#define GB_X_TYPE int32_t +#define GB_Y_TYPE int32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_INT32) || defined(GxB_NO_ANY_INT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_int32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_int64.c b/FactoryKernels/GB_bld__any_int64.c index affe55da2a..a972e046d0 100644 --- a/FactoryKernels/GB_bld__any_int64.c +++ b/FactoryKernels/GB_bld__any_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int64_t -#define GB_T_TYPE int64_t +#define GB_Sx_TYPE int64_t +#define GB_Tx_TYPE int64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t +#define GB_Z_TYPE int64_t +#define GB_X_TYPE int64_t +#define GB_Y_TYPE int64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_INT64) || defined(GxB_NO_ANY_INT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_int64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_int8.c b/FactoryKernels/GB_bld__any_int8.c index 8c7d347b0e..c4c27a7239 100644 --- a/FactoryKernels/GB_bld__any_int8.c +++ b/FactoryKernels/GB_bld__any_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int8_t -#define GB_T_TYPE int8_t +#define GB_Sx_TYPE int8_t +#define GB_Tx_TYPE int8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t +#define GB_Z_TYPE int8_t +#define GB_X_TYPE int8_t +#define GB_Y_TYPE int8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_INT8) || defined(GxB_NO_ANY_INT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_int8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_uint16.c b/FactoryKernels/GB_bld__any_uint16.c index 35624aaa4d..8cf4b02353 100644 --- a/FactoryKernels/GB_bld__any_uint16.c +++ b/FactoryKernels/GB_bld__any_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint16_t -#define GB_T_TYPE uint16_t +#define GB_Sx_TYPE uint16_t +#define GB_Tx_TYPE uint16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t +#define GB_Z_TYPE uint16_t +#define GB_X_TYPE uint16_t +#define GB_Y_TYPE uint16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_UINT16) || defined(GxB_NO_ANY_UINT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_uint16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_uint32.c b/FactoryKernels/GB_bld__any_uint32.c index c15f89e3d7..8e60dddefc 100644 --- a/FactoryKernels/GB_bld__any_uint32.c +++ b/FactoryKernels/GB_bld__any_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint32_t -#define GB_T_TYPE uint32_t +#define GB_Sx_TYPE uint32_t +#define GB_Tx_TYPE uint32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t +#define GB_Z_TYPE uint32_t +#define GB_X_TYPE uint32_t +#define GB_Y_TYPE uint32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_UINT32) || defined(GxB_NO_ANY_UINT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_uint32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_uint64.c b/FactoryKernels/GB_bld__any_uint64.c index 95d157ffd4..42847ac552 100644 --- a/FactoryKernels/GB_bld__any_uint64.c +++ b/FactoryKernels/GB_bld__any_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint64_t -#define GB_T_TYPE uint64_t +#define GB_Sx_TYPE uint64_t +#define GB_Tx_TYPE uint64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t +#define GB_Z_TYPE uint64_t +#define GB_X_TYPE uint64_t +#define GB_Y_TYPE uint64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_UINT64) || defined(GxB_NO_ANY_UINT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_uint64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__any_uint8.c b/FactoryKernels/GB_bld__any_uint8.c index 96bc5df34a..94dde5aa9c 100644 --- a/FactoryKernels/GB_bld__any_uint8.c +++ b/FactoryKernels/GB_bld__any_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint8_t -#define GB_T_TYPE uint8_t +#define GB_Sx_TYPE uint8_t +#define GB_Tx_TYPE uint8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t +#define GB_Z_TYPE uint8_t +#define GB_X_TYPE uint8_t +#define GB_Y_TYPE uint8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_ANY) || defined(GxB_NO_UINT8) || defined(GxB_NO_ANY_UINT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__any_uint8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__any_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__eq_bool.c b/FactoryKernels/GB_bld__eq_bool.c index 46040366c8..8159df01cd 100644 --- a/FactoryKernels/GB_bld__eq_bool.c +++ b/FactoryKernels/GB_bld__eq_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE bool -#define GB_T_TYPE bool +#define GB_Sx_TYPE bool +#define GB_Tx_TYPE bool // operator types: z = dup (x,y) -#define GB_Z_TYPE bool -#define GB_X_TYPE bool -#define GB_Y_TYPE bool +#define GB_Z_TYPE bool +#define GB_X_TYPE bool +#define GB_Y_TYPE bool // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_EQ) || defined(GxB_NO_BOOL) || defined(GxB_NO_EQ_BOOL)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__eq_bool) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__eq_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_bool.c b/FactoryKernels/GB_bld__first_bool.c index 67d0e03aaf..6165fb06ea 100644 --- a/FactoryKernels/GB_bld__first_bool.c +++ b/FactoryKernels/GB_bld__first_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE bool -#define GB_T_TYPE bool +#define GB_Sx_TYPE bool +#define GB_Tx_TYPE bool // operator types: z = dup (x,y) -#define GB_Z_TYPE bool -#define GB_X_TYPE bool -#define GB_Y_TYPE bool +#define GB_Z_TYPE bool +#define GB_X_TYPE bool +#define GB_Y_TYPE bool // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_BOOL) || defined(GxB_NO_FIRST_BOOL)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_bool) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_fc32.c b/FactoryKernels/GB_bld__first_fc32.c index 28b0d428d7..e8b862ce15 100644 --- a/FactoryKernels/GB_bld__first_fc32.c +++ b/FactoryKernels/GB_bld__first_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC32_t -#define GB_T_TYPE GxB_FC32_t +#define GB_Sx_TYPE GxB_FC32_t +#define GB_Tx_TYPE GxB_FC32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t +#define GB_Z_TYPE GxB_FC32_t +#define GB_X_TYPE GxB_FC32_t +#define GB_Y_TYPE GxB_FC32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_FC32) || defined(GxB_NO_FIRST_FC32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_fc32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_fc64.c b/FactoryKernels/GB_bld__first_fc64.c index 81c84bcd51..024cae3c5c 100644 --- a/FactoryKernels/GB_bld__first_fc64.c +++ b/FactoryKernels/GB_bld__first_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC64_t -#define GB_T_TYPE GxB_FC64_t +#define GB_Sx_TYPE GxB_FC64_t +#define GB_Tx_TYPE GxB_FC64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t +#define GB_Z_TYPE GxB_FC64_t +#define GB_X_TYPE GxB_FC64_t +#define GB_Y_TYPE GxB_FC64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_FC64) || defined(GxB_NO_FIRST_FC64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_fc64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_fp32.c b/FactoryKernels/GB_bld__first_fp32.c index 34f028866b..b58b967155 100644 --- a/FactoryKernels/GB_bld__first_fp32.c +++ b/FactoryKernels/GB_bld__first_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE float -#define GB_T_TYPE float +#define GB_Sx_TYPE float +#define GB_Tx_TYPE float // operator types: z = dup (x,y) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float +#define GB_Z_TYPE float +#define GB_X_TYPE float +#define GB_Y_TYPE float // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_FP32) || defined(GxB_NO_FIRST_FP32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_fp32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_fp64.c b/FactoryKernels/GB_bld__first_fp64.c index 514319d4cf..417c07200f 100644 --- a/FactoryKernels/GB_bld__first_fp64.c +++ b/FactoryKernels/GB_bld__first_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE double -#define GB_T_TYPE double +#define GB_Sx_TYPE double +#define GB_Tx_TYPE double // operator types: z = dup (x,y) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double +#define GB_Z_TYPE double +#define GB_X_TYPE double +#define GB_Y_TYPE double // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_FP64) || defined(GxB_NO_FIRST_FP64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_fp64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_int16.c b/FactoryKernels/GB_bld__first_int16.c index 1ea30e25bb..cde3254c89 100644 --- a/FactoryKernels/GB_bld__first_int16.c +++ b/FactoryKernels/GB_bld__first_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int16_t -#define GB_T_TYPE int16_t +#define GB_Sx_TYPE int16_t +#define GB_Tx_TYPE int16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t +#define GB_Z_TYPE int16_t +#define GB_X_TYPE int16_t +#define GB_Y_TYPE int16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_INT16) || defined(GxB_NO_FIRST_INT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_int16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_int32.c b/FactoryKernels/GB_bld__first_int32.c index 4951816ceb..26f53208f6 100644 --- a/FactoryKernels/GB_bld__first_int32.c +++ b/FactoryKernels/GB_bld__first_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int32_t -#define GB_T_TYPE int32_t +#define GB_Sx_TYPE int32_t +#define GB_Tx_TYPE int32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t +#define GB_Z_TYPE int32_t +#define GB_X_TYPE int32_t +#define GB_Y_TYPE int32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_INT32) || defined(GxB_NO_FIRST_INT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_int32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_int64.c b/FactoryKernels/GB_bld__first_int64.c index 75235d0db4..36c45240ae 100644 --- a/FactoryKernels/GB_bld__first_int64.c +++ b/FactoryKernels/GB_bld__first_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int64_t -#define GB_T_TYPE int64_t +#define GB_Sx_TYPE int64_t +#define GB_Tx_TYPE int64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t +#define GB_Z_TYPE int64_t +#define GB_X_TYPE int64_t +#define GB_Y_TYPE int64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_INT64) || defined(GxB_NO_FIRST_INT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_int64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_int8.c b/FactoryKernels/GB_bld__first_int8.c index 04c48c6730..7d801a928d 100644 --- a/FactoryKernels/GB_bld__first_int8.c +++ b/FactoryKernels/GB_bld__first_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int8_t -#define GB_T_TYPE int8_t +#define GB_Sx_TYPE int8_t +#define GB_Tx_TYPE int8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t +#define GB_Z_TYPE int8_t +#define GB_X_TYPE int8_t +#define GB_Y_TYPE int8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_INT8) || defined(GxB_NO_FIRST_INT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_int8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_uint16.c b/FactoryKernels/GB_bld__first_uint16.c index 8dce273850..70c96a71bf 100644 --- a/FactoryKernels/GB_bld__first_uint16.c +++ b/FactoryKernels/GB_bld__first_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint16_t -#define GB_T_TYPE uint16_t +#define GB_Sx_TYPE uint16_t +#define GB_Tx_TYPE uint16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t +#define GB_Z_TYPE uint16_t +#define GB_X_TYPE uint16_t +#define GB_Y_TYPE uint16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_UINT16) || defined(GxB_NO_FIRST_UINT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_uint16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_uint32.c b/FactoryKernels/GB_bld__first_uint32.c index a74dd76653..e70ae44b50 100644 --- a/FactoryKernels/GB_bld__first_uint32.c +++ b/FactoryKernels/GB_bld__first_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint32_t -#define GB_T_TYPE uint32_t +#define GB_Sx_TYPE uint32_t +#define GB_Tx_TYPE uint32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t +#define GB_Z_TYPE uint32_t +#define GB_X_TYPE uint32_t +#define GB_Y_TYPE uint32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_UINT32) || defined(GxB_NO_FIRST_UINT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_uint32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_uint64.c b/FactoryKernels/GB_bld__first_uint64.c index b92af03200..b5edcb81df 100644 --- a/FactoryKernels/GB_bld__first_uint64.c +++ b/FactoryKernels/GB_bld__first_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint64_t -#define GB_T_TYPE uint64_t +#define GB_Sx_TYPE uint64_t +#define GB_Tx_TYPE uint64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t +#define GB_Z_TYPE uint64_t +#define GB_X_TYPE uint64_t +#define GB_Y_TYPE uint64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_UINT64) || defined(GxB_NO_FIRST_UINT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_uint64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__first_uint8.c b/FactoryKernels/GB_bld__first_uint8.c index a13a38cabd..b78e94fbf7 100644 --- a/FactoryKernels/GB_bld__first_uint8.c +++ b/FactoryKernels/GB_bld__first_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint8_t -#define GB_T_TYPE uint8_t +#define GB_Sx_TYPE uint8_t +#define GB_Tx_TYPE uint8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t +#define GB_Z_TYPE uint8_t +#define GB_X_TYPE uint8_t +#define GB_Y_TYPE uint8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_FIRST) || defined(GxB_NO_UINT8) || defined(GxB_NO_FIRST_UINT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__first_uint8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__first_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__land_bool.c b/FactoryKernels/GB_bld__land_bool.c index d16e295d13..32b960f89e 100644 --- a/FactoryKernels/GB_bld__land_bool.c +++ b/FactoryKernels/GB_bld__land_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE bool -#define GB_T_TYPE bool +#define GB_Sx_TYPE bool +#define GB_Tx_TYPE bool // operator types: z = dup (x,y) -#define GB_Z_TYPE bool -#define GB_X_TYPE bool -#define GB_Y_TYPE bool +#define GB_Z_TYPE bool +#define GB_X_TYPE bool +#define GB_Y_TYPE bool // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LAND) || defined(GxB_NO_BOOL) || defined(GxB_NO_LAND_BOOL)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__land_bool) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__land_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__lor_bool.c b/FactoryKernels/GB_bld__lor_bool.c index c12348e233..cc4f535dfe 100644 --- a/FactoryKernels/GB_bld__lor_bool.c +++ b/FactoryKernels/GB_bld__lor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE bool -#define GB_T_TYPE bool +#define GB_Sx_TYPE bool +#define GB_Tx_TYPE bool // operator types: z = dup (x,y) -#define GB_Z_TYPE bool -#define GB_X_TYPE bool -#define GB_Y_TYPE bool +#define GB_Z_TYPE bool +#define GB_X_TYPE bool +#define GB_Y_TYPE bool // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LOR) || defined(GxB_NO_BOOL) || defined(GxB_NO_LOR_BOOL)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__lor_bool) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__lor_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__lxor_bool.c b/FactoryKernels/GB_bld__lxor_bool.c index 22b497acd3..fe494bc456 100644 --- a/FactoryKernels/GB_bld__lxor_bool.c +++ b/FactoryKernels/GB_bld__lxor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE bool -#define GB_T_TYPE bool +#define GB_Sx_TYPE bool +#define GB_Tx_TYPE bool // operator types: z = dup (x,y) -#define GB_Z_TYPE bool -#define GB_X_TYPE bool -#define GB_Y_TYPE bool +#define GB_Z_TYPE bool +#define GB_X_TYPE bool +#define GB_Y_TYPE bool // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_LXOR) || defined(GxB_NO_BOOL) || defined(GxB_NO_LXOR_BOOL)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__lxor_bool) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__lxor_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_fp32.c b/FactoryKernels/GB_bld__max_fp32.c index 3634bd547f..20688d68b5 100644 --- a/FactoryKernels/GB_bld__max_fp32.c +++ b/FactoryKernels/GB_bld__max_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE float -#define GB_T_TYPE float +#define GB_Sx_TYPE float +#define GB_Tx_TYPE float // operator types: z = dup (x,y) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float +#define GB_Z_TYPE float +#define GB_X_TYPE float +#define GB_Y_TYPE float // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_FP32) || defined(GxB_NO_MAX_FP32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_fp32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_fp64.c b/FactoryKernels/GB_bld__max_fp64.c index 318bfbea94..2a9f620fb1 100644 --- a/FactoryKernels/GB_bld__max_fp64.c +++ b/FactoryKernels/GB_bld__max_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE double -#define GB_T_TYPE double +#define GB_Sx_TYPE double +#define GB_Tx_TYPE double // operator types: z = dup (x,y) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double +#define GB_Z_TYPE double +#define GB_X_TYPE double +#define GB_Y_TYPE double // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_FP64) || defined(GxB_NO_MAX_FP64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_fp64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_int16.c b/FactoryKernels/GB_bld__max_int16.c index 16643cf128..4222745dd6 100644 --- a/FactoryKernels/GB_bld__max_int16.c +++ b/FactoryKernels/GB_bld__max_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int16_t -#define GB_T_TYPE int16_t +#define GB_Sx_TYPE int16_t +#define GB_Tx_TYPE int16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t +#define GB_Z_TYPE int16_t +#define GB_X_TYPE int16_t +#define GB_Y_TYPE int16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_INT16) || defined(GxB_NO_MAX_INT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_int16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_int32.c b/FactoryKernels/GB_bld__max_int32.c index 8a7d7b6460..95c593848d 100644 --- a/FactoryKernels/GB_bld__max_int32.c +++ b/FactoryKernels/GB_bld__max_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int32_t -#define GB_T_TYPE int32_t +#define GB_Sx_TYPE int32_t +#define GB_Tx_TYPE int32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t +#define GB_Z_TYPE int32_t +#define GB_X_TYPE int32_t +#define GB_Y_TYPE int32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_INT32) || defined(GxB_NO_MAX_INT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_int32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_int64.c b/FactoryKernels/GB_bld__max_int64.c index 7f647e5059..d630a7d8c5 100644 --- a/FactoryKernels/GB_bld__max_int64.c +++ b/FactoryKernels/GB_bld__max_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int64_t -#define GB_T_TYPE int64_t +#define GB_Sx_TYPE int64_t +#define GB_Tx_TYPE int64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t +#define GB_Z_TYPE int64_t +#define GB_X_TYPE int64_t +#define GB_Y_TYPE int64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_INT64) || defined(GxB_NO_MAX_INT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_int64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_int8.c b/FactoryKernels/GB_bld__max_int8.c index 7e39534691..bda0622de0 100644 --- a/FactoryKernels/GB_bld__max_int8.c +++ b/FactoryKernels/GB_bld__max_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int8_t -#define GB_T_TYPE int8_t +#define GB_Sx_TYPE int8_t +#define GB_Tx_TYPE int8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t +#define GB_Z_TYPE int8_t +#define GB_X_TYPE int8_t +#define GB_Y_TYPE int8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_INT8) || defined(GxB_NO_MAX_INT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_int8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_uint16.c b/FactoryKernels/GB_bld__max_uint16.c index 12fde29417..46d7549f47 100644 --- a/FactoryKernels/GB_bld__max_uint16.c +++ b/FactoryKernels/GB_bld__max_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint16_t -#define GB_T_TYPE uint16_t +#define GB_Sx_TYPE uint16_t +#define GB_Tx_TYPE uint16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t +#define GB_Z_TYPE uint16_t +#define GB_X_TYPE uint16_t +#define GB_Y_TYPE uint16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_UINT16) || defined(GxB_NO_MAX_UINT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_uint16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_uint32.c b/FactoryKernels/GB_bld__max_uint32.c index 3dbe7b9386..2cfe546211 100644 --- a/FactoryKernels/GB_bld__max_uint32.c +++ b/FactoryKernels/GB_bld__max_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint32_t -#define GB_T_TYPE uint32_t +#define GB_Sx_TYPE uint32_t +#define GB_Tx_TYPE uint32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t +#define GB_Z_TYPE uint32_t +#define GB_X_TYPE uint32_t +#define GB_Y_TYPE uint32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_UINT32) || defined(GxB_NO_MAX_UINT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_uint32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_uint64.c b/FactoryKernels/GB_bld__max_uint64.c index 5c056a61da..537fd1fa5c 100644 --- a/FactoryKernels/GB_bld__max_uint64.c +++ b/FactoryKernels/GB_bld__max_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint64_t -#define GB_T_TYPE uint64_t +#define GB_Sx_TYPE uint64_t +#define GB_Tx_TYPE uint64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t +#define GB_Z_TYPE uint64_t +#define GB_X_TYPE uint64_t +#define GB_Y_TYPE uint64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_UINT64) || defined(GxB_NO_MAX_UINT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_uint64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__max_uint8.c b/FactoryKernels/GB_bld__max_uint8.c index 9bb892717d..ace9c24282 100644 --- a/FactoryKernels/GB_bld__max_uint8.c +++ b/FactoryKernels/GB_bld__max_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint8_t -#define GB_T_TYPE uint8_t +#define GB_Sx_TYPE uint8_t +#define GB_Tx_TYPE uint8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t +#define GB_Z_TYPE uint8_t +#define GB_X_TYPE uint8_t +#define GB_Y_TYPE uint8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MAX) || defined(GxB_NO_UINT8) || defined(GxB_NO_MAX_UINT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__max_uint8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__max_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_fp32.c b/FactoryKernels/GB_bld__min_fp32.c index 8ba8a593eb..3cdebe22f5 100644 --- a/FactoryKernels/GB_bld__min_fp32.c +++ b/FactoryKernels/GB_bld__min_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE float -#define GB_T_TYPE float +#define GB_Sx_TYPE float +#define GB_Tx_TYPE float // operator types: z = dup (x,y) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float +#define GB_Z_TYPE float +#define GB_X_TYPE float +#define GB_Y_TYPE float // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_FP32) || defined(GxB_NO_MIN_FP32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_fp32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_fp64.c b/FactoryKernels/GB_bld__min_fp64.c index cb19e51619..8b46721849 100644 --- a/FactoryKernels/GB_bld__min_fp64.c +++ b/FactoryKernels/GB_bld__min_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE double -#define GB_T_TYPE double +#define GB_Sx_TYPE double +#define GB_Tx_TYPE double // operator types: z = dup (x,y) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double +#define GB_Z_TYPE double +#define GB_X_TYPE double +#define GB_Y_TYPE double // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_FP64) || defined(GxB_NO_MIN_FP64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_fp64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_int16.c b/FactoryKernels/GB_bld__min_int16.c index ec06b69c22..443fbbc360 100644 --- a/FactoryKernels/GB_bld__min_int16.c +++ b/FactoryKernels/GB_bld__min_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int16_t -#define GB_T_TYPE int16_t +#define GB_Sx_TYPE int16_t +#define GB_Tx_TYPE int16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t +#define GB_Z_TYPE int16_t +#define GB_X_TYPE int16_t +#define GB_Y_TYPE int16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_INT16) || defined(GxB_NO_MIN_INT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_int16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_int32.c b/FactoryKernels/GB_bld__min_int32.c index 1f0ebf312d..1f856870ee 100644 --- a/FactoryKernels/GB_bld__min_int32.c +++ b/FactoryKernels/GB_bld__min_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int32_t -#define GB_T_TYPE int32_t +#define GB_Sx_TYPE int32_t +#define GB_Tx_TYPE int32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t +#define GB_Z_TYPE int32_t +#define GB_X_TYPE int32_t +#define GB_Y_TYPE int32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_INT32) || defined(GxB_NO_MIN_INT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_int32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_int64.c b/FactoryKernels/GB_bld__min_int64.c index c9220f2b3d..a39102337e 100644 --- a/FactoryKernels/GB_bld__min_int64.c +++ b/FactoryKernels/GB_bld__min_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int64_t -#define GB_T_TYPE int64_t +#define GB_Sx_TYPE int64_t +#define GB_Tx_TYPE int64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t +#define GB_Z_TYPE int64_t +#define GB_X_TYPE int64_t +#define GB_Y_TYPE int64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_INT64) || defined(GxB_NO_MIN_INT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_int64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_int8.c b/FactoryKernels/GB_bld__min_int8.c index 4034493a41..349c4f1125 100644 --- a/FactoryKernels/GB_bld__min_int8.c +++ b/FactoryKernels/GB_bld__min_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int8_t -#define GB_T_TYPE int8_t +#define GB_Sx_TYPE int8_t +#define GB_Tx_TYPE int8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t +#define GB_Z_TYPE int8_t +#define GB_X_TYPE int8_t +#define GB_Y_TYPE int8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_INT8) || defined(GxB_NO_MIN_INT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_int8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_uint16.c b/FactoryKernels/GB_bld__min_uint16.c index 88319d6233..525d01d471 100644 --- a/FactoryKernels/GB_bld__min_uint16.c +++ b/FactoryKernels/GB_bld__min_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint16_t -#define GB_T_TYPE uint16_t +#define GB_Sx_TYPE uint16_t +#define GB_Tx_TYPE uint16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t +#define GB_Z_TYPE uint16_t +#define GB_X_TYPE uint16_t +#define GB_Y_TYPE uint16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_UINT16) || defined(GxB_NO_MIN_UINT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_uint16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_uint32.c b/FactoryKernels/GB_bld__min_uint32.c index b86a8e59c1..fdc5a61b92 100644 --- a/FactoryKernels/GB_bld__min_uint32.c +++ b/FactoryKernels/GB_bld__min_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint32_t -#define GB_T_TYPE uint32_t +#define GB_Sx_TYPE uint32_t +#define GB_Tx_TYPE uint32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t +#define GB_Z_TYPE uint32_t +#define GB_X_TYPE uint32_t +#define GB_Y_TYPE uint32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_UINT32) || defined(GxB_NO_MIN_UINT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_uint32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_uint64.c b/FactoryKernels/GB_bld__min_uint64.c index 948e82363e..e72d593481 100644 --- a/FactoryKernels/GB_bld__min_uint64.c +++ b/FactoryKernels/GB_bld__min_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint64_t -#define GB_T_TYPE uint64_t +#define GB_Sx_TYPE uint64_t +#define GB_Tx_TYPE uint64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t +#define GB_Z_TYPE uint64_t +#define GB_X_TYPE uint64_t +#define GB_Y_TYPE uint64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_UINT64) || defined(GxB_NO_MIN_UINT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_uint64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__min_uint8.c b/FactoryKernels/GB_bld__min_uint8.c index 8638aafa98..4e674fd8a8 100644 --- a/FactoryKernels/GB_bld__min_uint8.c +++ b/FactoryKernels/GB_bld__min_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint8_t -#define GB_T_TYPE uint8_t +#define GB_Sx_TYPE uint8_t +#define GB_Tx_TYPE uint8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t +#define GB_Z_TYPE uint8_t +#define GB_X_TYPE uint8_t +#define GB_Y_TYPE uint8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_MIN) || defined(GxB_NO_UINT8) || defined(GxB_NO_MIN_UINT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__min_uint8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__min_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_fc32.c b/FactoryKernels/GB_bld__plus_fc32.c index 8158f26820..b06d3db9c8 100644 --- a/FactoryKernels/GB_bld__plus_fc32.c +++ b/FactoryKernels/GB_bld__plus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC32_t -#define GB_T_TYPE GxB_FC32_t +#define GB_Sx_TYPE GxB_FC32_t +#define GB_Tx_TYPE GxB_FC32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t +#define GB_Z_TYPE GxB_FC32_t +#define GB_X_TYPE GxB_FC32_t +#define GB_Y_TYPE GxB_FC32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_FC32) || defined(GxB_NO_PLUS_FC32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_fc32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_fc64.c b/FactoryKernels/GB_bld__plus_fc64.c index 67aad8873a..984fced4ee 100644 --- a/FactoryKernels/GB_bld__plus_fc64.c +++ b/FactoryKernels/GB_bld__plus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC64_t -#define GB_T_TYPE GxB_FC64_t +#define GB_Sx_TYPE GxB_FC64_t +#define GB_Tx_TYPE GxB_FC64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t +#define GB_Z_TYPE GxB_FC64_t +#define GB_X_TYPE GxB_FC64_t +#define GB_Y_TYPE GxB_FC64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_FC64) || defined(GxB_NO_PLUS_FC64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_fc64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_fp32.c b/FactoryKernels/GB_bld__plus_fp32.c index 5de0ae2704..ddd9f3837a 100644 --- a/FactoryKernels/GB_bld__plus_fp32.c +++ b/FactoryKernels/GB_bld__plus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE float -#define GB_T_TYPE float +#define GB_Sx_TYPE float +#define GB_Tx_TYPE float // operator types: z = dup (x,y) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float +#define GB_Z_TYPE float +#define GB_X_TYPE float +#define GB_Y_TYPE float // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_FP32) || defined(GxB_NO_PLUS_FP32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_fp32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_fp64.c b/FactoryKernels/GB_bld__plus_fp64.c index 42507fe843..b78d80cdca 100644 --- a/FactoryKernels/GB_bld__plus_fp64.c +++ b/FactoryKernels/GB_bld__plus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE double -#define GB_T_TYPE double +#define GB_Sx_TYPE double +#define GB_Tx_TYPE double // operator types: z = dup (x,y) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double +#define GB_Z_TYPE double +#define GB_X_TYPE double +#define GB_Y_TYPE double // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_FP64) || defined(GxB_NO_PLUS_FP64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_fp64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_int16.c b/FactoryKernels/GB_bld__plus_int16.c index fdc62d86a4..78f16cf864 100644 --- a/FactoryKernels/GB_bld__plus_int16.c +++ b/FactoryKernels/GB_bld__plus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int16_t -#define GB_T_TYPE int16_t +#define GB_Sx_TYPE int16_t +#define GB_Tx_TYPE int16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t +#define GB_Z_TYPE int16_t +#define GB_X_TYPE int16_t +#define GB_Y_TYPE int16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_INT16) || defined(GxB_NO_PLUS_INT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_int16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_int32.c b/FactoryKernels/GB_bld__plus_int32.c index 556200cd96..fdde5b55ac 100644 --- a/FactoryKernels/GB_bld__plus_int32.c +++ b/FactoryKernels/GB_bld__plus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int32_t -#define GB_T_TYPE int32_t +#define GB_Sx_TYPE int32_t +#define GB_Tx_TYPE int32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t +#define GB_Z_TYPE int32_t +#define GB_X_TYPE int32_t +#define GB_Y_TYPE int32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_INT32) || defined(GxB_NO_PLUS_INT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_int32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_int64.c b/FactoryKernels/GB_bld__plus_int64.c index b8fb5c44bb..017e9f55ce 100644 --- a/FactoryKernels/GB_bld__plus_int64.c +++ b/FactoryKernels/GB_bld__plus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int64_t -#define GB_T_TYPE int64_t +#define GB_Sx_TYPE int64_t +#define GB_Tx_TYPE int64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t +#define GB_Z_TYPE int64_t +#define GB_X_TYPE int64_t +#define GB_Y_TYPE int64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_INT64) || defined(GxB_NO_PLUS_INT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_int64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_int8.c b/FactoryKernels/GB_bld__plus_int8.c index cb7251c18e..8cb361fdd2 100644 --- a/FactoryKernels/GB_bld__plus_int8.c +++ b/FactoryKernels/GB_bld__plus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int8_t -#define GB_T_TYPE int8_t +#define GB_Sx_TYPE int8_t +#define GB_Tx_TYPE int8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t +#define GB_Z_TYPE int8_t +#define GB_X_TYPE int8_t +#define GB_Y_TYPE int8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_INT8) || defined(GxB_NO_PLUS_INT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_int8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_uint16.c b/FactoryKernels/GB_bld__plus_uint16.c index 1756e330ea..cf1f6b43b3 100644 --- a/FactoryKernels/GB_bld__plus_uint16.c +++ b/FactoryKernels/GB_bld__plus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint16_t -#define GB_T_TYPE uint16_t +#define GB_Sx_TYPE uint16_t +#define GB_Tx_TYPE uint16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t +#define GB_Z_TYPE uint16_t +#define GB_X_TYPE uint16_t +#define GB_Y_TYPE uint16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_UINT16) || defined(GxB_NO_PLUS_UINT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_uint16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_uint32.c b/FactoryKernels/GB_bld__plus_uint32.c index e8ae26e355..0ab078161d 100644 --- a/FactoryKernels/GB_bld__plus_uint32.c +++ b/FactoryKernels/GB_bld__plus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint32_t -#define GB_T_TYPE uint32_t +#define GB_Sx_TYPE uint32_t +#define GB_Tx_TYPE uint32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t +#define GB_Z_TYPE uint32_t +#define GB_X_TYPE uint32_t +#define GB_Y_TYPE uint32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_UINT32) || defined(GxB_NO_PLUS_UINT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_uint32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_uint64.c b/FactoryKernels/GB_bld__plus_uint64.c index 4b79c1b66d..1d2490bc6c 100644 --- a/FactoryKernels/GB_bld__plus_uint64.c +++ b/FactoryKernels/GB_bld__plus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint64_t -#define GB_T_TYPE uint64_t +#define GB_Sx_TYPE uint64_t +#define GB_Tx_TYPE uint64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t +#define GB_Z_TYPE uint64_t +#define GB_X_TYPE uint64_t +#define GB_Y_TYPE uint64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_UINT64) || defined(GxB_NO_PLUS_UINT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_uint64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__plus_uint8.c b/FactoryKernels/GB_bld__plus_uint8.c index 002f78e561..95b8a28010 100644 --- a/FactoryKernels/GB_bld__plus_uint8.c +++ b/FactoryKernels/GB_bld__plus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint8_t -#define GB_T_TYPE uint8_t +#define GB_Sx_TYPE uint8_t +#define GB_Tx_TYPE uint8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t +#define GB_Z_TYPE uint8_t +#define GB_X_TYPE uint8_t +#define GB_Y_TYPE uint8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_PLUS) || defined(GxB_NO_UINT8) || defined(GxB_NO_PLUS_UINT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__plus_uint8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__plus_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_bool.c b/FactoryKernels/GB_bld__second_bool.c index 8556ce60a5..f557e75f56 100644 --- a/FactoryKernels/GB_bld__second_bool.c +++ b/FactoryKernels/GB_bld__second_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE bool -#define GB_T_TYPE bool +#define GB_Sx_TYPE bool +#define GB_Tx_TYPE bool // operator types: z = dup (x,y) -#define GB_Z_TYPE bool -#define GB_X_TYPE bool -#define GB_Y_TYPE bool +#define GB_Z_TYPE bool +#define GB_X_TYPE bool +#define GB_Y_TYPE bool // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_BOOL) || defined(GxB_NO_SECOND_BOOL)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_bool) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_fc32.c b/FactoryKernels/GB_bld__second_fc32.c index 901232fd34..9e6815d912 100644 --- a/FactoryKernels/GB_bld__second_fc32.c +++ b/FactoryKernels/GB_bld__second_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC32_t -#define GB_T_TYPE GxB_FC32_t +#define GB_Sx_TYPE GxB_FC32_t +#define GB_Tx_TYPE GxB_FC32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t +#define GB_Z_TYPE GxB_FC32_t +#define GB_X_TYPE GxB_FC32_t +#define GB_Y_TYPE GxB_FC32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_FC32) || defined(GxB_NO_SECOND_FC32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_fc32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_fc64.c b/FactoryKernels/GB_bld__second_fc64.c index e3d5712803..30db69e81e 100644 --- a/FactoryKernels/GB_bld__second_fc64.c +++ b/FactoryKernels/GB_bld__second_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC64_t -#define GB_T_TYPE GxB_FC64_t +#define GB_Sx_TYPE GxB_FC64_t +#define GB_Tx_TYPE GxB_FC64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t +#define GB_Z_TYPE GxB_FC64_t +#define GB_X_TYPE GxB_FC64_t +#define GB_Y_TYPE GxB_FC64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_FC64) || defined(GxB_NO_SECOND_FC64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_fc64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_fp32.c b/FactoryKernels/GB_bld__second_fp32.c index 4f3d3787f7..762750719f 100644 --- a/FactoryKernels/GB_bld__second_fp32.c +++ b/FactoryKernels/GB_bld__second_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE float -#define GB_T_TYPE float +#define GB_Sx_TYPE float +#define GB_Tx_TYPE float // operator types: z = dup (x,y) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float +#define GB_Z_TYPE float +#define GB_X_TYPE float +#define GB_Y_TYPE float // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_FP32) || defined(GxB_NO_SECOND_FP32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_fp32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_fp64.c b/FactoryKernels/GB_bld__second_fp64.c index e680502ded..2cade87535 100644 --- a/FactoryKernels/GB_bld__second_fp64.c +++ b/FactoryKernels/GB_bld__second_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE double -#define GB_T_TYPE double +#define GB_Sx_TYPE double +#define GB_Tx_TYPE double // operator types: z = dup (x,y) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double +#define GB_Z_TYPE double +#define GB_X_TYPE double +#define GB_Y_TYPE double // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_FP64) || defined(GxB_NO_SECOND_FP64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_fp64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_int16.c b/FactoryKernels/GB_bld__second_int16.c index a81c7472ff..ac1fb2495e 100644 --- a/FactoryKernels/GB_bld__second_int16.c +++ b/FactoryKernels/GB_bld__second_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int16_t -#define GB_T_TYPE int16_t +#define GB_Sx_TYPE int16_t +#define GB_Tx_TYPE int16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t +#define GB_Z_TYPE int16_t +#define GB_X_TYPE int16_t +#define GB_Y_TYPE int16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_INT16) || defined(GxB_NO_SECOND_INT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_int16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_int32.c b/FactoryKernels/GB_bld__second_int32.c index 7af5ced211..0c2804cb24 100644 --- a/FactoryKernels/GB_bld__second_int32.c +++ b/FactoryKernels/GB_bld__second_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int32_t -#define GB_T_TYPE int32_t +#define GB_Sx_TYPE int32_t +#define GB_Tx_TYPE int32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t +#define GB_Z_TYPE int32_t +#define GB_X_TYPE int32_t +#define GB_Y_TYPE int32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_INT32) || defined(GxB_NO_SECOND_INT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_int32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_int64.c b/FactoryKernels/GB_bld__second_int64.c index 718d7df653..e3580e63b3 100644 --- a/FactoryKernels/GB_bld__second_int64.c +++ b/FactoryKernels/GB_bld__second_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int64_t -#define GB_T_TYPE int64_t +#define GB_Sx_TYPE int64_t +#define GB_Tx_TYPE int64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t +#define GB_Z_TYPE int64_t +#define GB_X_TYPE int64_t +#define GB_Y_TYPE int64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_INT64) || defined(GxB_NO_SECOND_INT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_int64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_int8.c b/FactoryKernels/GB_bld__second_int8.c index 8692636e7a..8153efde08 100644 --- a/FactoryKernels/GB_bld__second_int8.c +++ b/FactoryKernels/GB_bld__second_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int8_t -#define GB_T_TYPE int8_t +#define GB_Sx_TYPE int8_t +#define GB_Tx_TYPE int8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t +#define GB_Z_TYPE int8_t +#define GB_X_TYPE int8_t +#define GB_Y_TYPE int8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_INT8) || defined(GxB_NO_SECOND_INT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_int8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_uint16.c b/FactoryKernels/GB_bld__second_uint16.c index ff98c08026..51ee8b4f87 100644 --- a/FactoryKernels/GB_bld__second_uint16.c +++ b/FactoryKernels/GB_bld__second_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint16_t -#define GB_T_TYPE uint16_t +#define GB_Sx_TYPE uint16_t +#define GB_Tx_TYPE uint16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t +#define GB_Z_TYPE uint16_t +#define GB_X_TYPE uint16_t +#define GB_Y_TYPE uint16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_UINT16) || defined(GxB_NO_SECOND_UINT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_uint16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_uint32.c b/FactoryKernels/GB_bld__second_uint32.c index 913b695f81..64acd1b0a8 100644 --- a/FactoryKernels/GB_bld__second_uint32.c +++ b/FactoryKernels/GB_bld__second_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint32_t -#define GB_T_TYPE uint32_t +#define GB_Sx_TYPE uint32_t +#define GB_Tx_TYPE uint32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t +#define GB_Z_TYPE uint32_t +#define GB_X_TYPE uint32_t +#define GB_Y_TYPE uint32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_UINT32) || defined(GxB_NO_SECOND_UINT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_uint32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_uint64.c b/FactoryKernels/GB_bld__second_uint64.c index f88269c059..415453b77a 100644 --- a/FactoryKernels/GB_bld__second_uint64.c +++ b/FactoryKernels/GB_bld__second_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint64_t -#define GB_T_TYPE uint64_t +#define GB_Sx_TYPE uint64_t +#define GB_Tx_TYPE uint64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t +#define GB_Z_TYPE uint64_t +#define GB_X_TYPE uint64_t +#define GB_Y_TYPE uint64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_UINT64) || defined(GxB_NO_SECOND_UINT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_uint64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__second_uint8.c b/FactoryKernels/GB_bld__second_uint8.c index 2436463299..f8901b4deb 100644 --- a/FactoryKernels/GB_bld__second_uint8.c +++ b/FactoryKernels/GB_bld__second_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint8_t -#define GB_T_TYPE uint8_t +#define GB_Sx_TYPE uint8_t +#define GB_Tx_TYPE uint8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t +#define GB_Z_TYPE uint8_t +#define GB_X_TYPE uint8_t +#define GB_Y_TYPE uint8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_SECOND) || defined(GxB_NO_UINT8) || defined(GxB_NO_SECOND_UINT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__second_uint8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__second_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_fc32.c b/FactoryKernels/GB_bld__times_fc32.c index e66b0e5ae4..3f0c82474f 100644 --- a/FactoryKernels/GB_bld__times_fc32.c +++ b/FactoryKernels/GB_bld__times_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC32_t -#define GB_T_TYPE GxB_FC32_t +#define GB_Sx_TYPE GxB_FC32_t +#define GB_Tx_TYPE GxB_FC32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t +#define GB_Z_TYPE GxB_FC32_t +#define GB_X_TYPE GxB_FC32_t +#define GB_Y_TYPE GxB_FC32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_FC32) || defined(GxB_NO_TIMES_FC32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_fc32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_fc64.c b/FactoryKernels/GB_bld__times_fc64.c index 803bf7dd0e..29cfc320f1 100644 --- a/FactoryKernels/GB_bld__times_fc64.c +++ b/FactoryKernels/GB_bld__times_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE GxB_FC64_t -#define GB_T_TYPE GxB_FC64_t +#define GB_Sx_TYPE GxB_FC64_t +#define GB_Tx_TYPE GxB_FC64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t +#define GB_Z_TYPE GxB_FC64_t +#define GB_X_TYPE GxB_FC64_t +#define GB_Y_TYPE GxB_FC64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_FC64) || defined(GxB_NO_TIMES_FC64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_fc64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_fp32.c b/FactoryKernels/GB_bld__times_fp32.c index fc05ce6101..daf2ba813a 100644 --- a/FactoryKernels/GB_bld__times_fp32.c +++ b/FactoryKernels/GB_bld__times_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE float -#define GB_T_TYPE float +#define GB_Sx_TYPE float +#define GB_Tx_TYPE float // operator types: z = dup (x,y) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float +#define GB_Z_TYPE float +#define GB_X_TYPE float +#define GB_Y_TYPE float // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_FP32) || defined(GxB_NO_TIMES_FP32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_fp32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_fp64.c b/FactoryKernels/GB_bld__times_fp64.c index 002653fd4e..5b713fbde4 100644 --- a/FactoryKernels/GB_bld__times_fp64.c +++ b/FactoryKernels/GB_bld__times_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE double -#define GB_T_TYPE double +#define GB_Sx_TYPE double +#define GB_Tx_TYPE double // operator types: z = dup (x,y) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double +#define GB_Z_TYPE double +#define GB_X_TYPE double +#define GB_Y_TYPE double // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_FP64) || defined(GxB_NO_TIMES_FP64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_fp64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_int16.c b/FactoryKernels/GB_bld__times_int16.c index b7095152e7..6c60073c06 100644 --- a/FactoryKernels/GB_bld__times_int16.c +++ b/FactoryKernels/GB_bld__times_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int16_t -#define GB_T_TYPE int16_t +#define GB_Sx_TYPE int16_t +#define GB_Tx_TYPE int16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t +#define GB_Z_TYPE int16_t +#define GB_X_TYPE int16_t +#define GB_Y_TYPE int16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_INT16) || defined(GxB_NO_TIMES_INT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_int16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_int32.c b/FactoryKernels/GB_bld__times_int32.c index 18ddf86dd9..fe07eb280c 100644 --- a/FactoryKernels/GB_bld__times_int32.c +++ b/FactoryKernels/GB_bld__times_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int32_t -#define GB_T_TYPE int32_t +#define GB_Sx_TYPE int32_t +#define GB_Tx_TYPE int32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t +#define GB_Z_TYPE int32_t +#define GB_X_TYPE int32_t +#define GB_Y_TYPE int32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_INT32) || defined(GxB_NO_TIMES_INT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_int32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_int64.c b/FactoryKernels/GB_bld__times_int64.c index 8b932a4c61..e72810d46c 100644 --- a/FactoryKernels/GB_bld__times_int64.c +++ b/FactoryKernels/GB_bld__times_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int64_t -#define GB_T_TYPE int64_t +#define GB_Sx_TYPE int64_t +#define GB_Tx_TYPE int64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t +#define GB_Z_TYPE int64_t +#define GB_X_TYPE int64_t +#define GB_Y_TYPE int64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_INT64) || defined(GxB_NO_TIMES_INT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_int64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_int8.c b/FactoryKernels/GB_bld__times_int8.c index ee4715f01a..ddb74574ab 100644 --- a/FactoryKernels/GB_bld__times_int8.c +++ b/FactoryKernels/GB_bld__times_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE int8_t -#define GB_T_TYPE int8_t +#define GB_Sx_TYPE int8_t +#define GB_Tx_TYPE int8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t +#define GB_Z_TYPE int8_t +#define GB_X_TYPE int8_t +#define GB_Y_TYPE int8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_INT8) || defined(GxB_NO_TIMES_INT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_int8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_uint16.c b/FactoryKernels/GB_bld__times_uint16.c index dcab28af67..af3cbdbcd8 100644 --- a/FactoryKernels/GB_bld__times_uint16.c +++ b/FactoryKernels/GB_bld__times_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint16_t -#define GB_T_TYPE uint16_t +#define GB_Sx_TYPE uint16_t +#define GB_Tx_TYPE uint16_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t +#define GB_Z_TYPE uint16_t +#define GB_X_TYPE uint16_t +#define GB_Y_TYPE uint16_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_UINT16) || defined(GxB_NO_TIMES_UINT16)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_uint16) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_uint32.c b/FactoryKernels/GB_bld__times_uint32.c index 53f1928efd..74a1f65afa 100644 --- a/FactoryKernels/GB_bld__times_uint32.c +++ b/FactoryKernels/GB_bld__times_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint32_t -#define GB_T_TYPE uint32_t +#define GB_Sx_TYPE uint32_t +#define GB_Tx_TYPE uint32_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t +#define GB_Z_TYPE uint32_t +#define GB_X_TYPE uint32_t +#define GB_Y_TYPE uint32_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_UINT32) || defined(GxB_NO_TIMES_UINT32)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_uint32) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_uint64.c b/FactoryKernels/GB_bld__times_uint64.c index 1ebeb999c5..8c3166d76c 100644 --- a/FactoryKernels/GB_bld__times_uint64.c +++ b/FactoryKernels/GB_bld__times_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint64_t -#define GB_T_TYPE uint64_t +#define GB_Sx_TYPE uint64_t +#define GB_Tx_TYPE uint64_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t +#define GB_Z_TYPE uint64_t +#define GB_X_TYPE uint64_t +#define GB_Y_TYPE uint64_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_UINT64) || defined(GxB_NO_TIMES_UINT64)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_uint64) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_bld__times_uint8.c b/FactoryKernels/GB_bld__times_uint8.c index b1ba114719..c30c28ec06 100644 --- a/FactoryKernels/GB_bld__times_uint8.c +++ b/FactoryKernels/GB_bld__times_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -16,13 +23,13 @@ #define GB_BLD_COPY(Tx,k,Sx,i) Tx [k] = Sx [i] // array types for S and T -#define GB_S_TYPE uint8_t -#define GB_T_TYPE uint8_t +#define GB_Sx_TYPE uint8_t +#define GB_Tx_TYPE uint8_t // operator types: z = dup (x,y) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t +#define GB_Z_TYPE uint8_t +#define GB_X_TYPE uint8_t +#define GB_Y_TYPE uint8_t // disable this operator and use the generic case if these conditions hold #if (defined(GxB_NO_TIMES) || defined(GxB_NO_UINT8) || defined(GxB_NO_TIMES_UINT8)) @@ -39,9 +46,9 @@ GrB_Info GB (_bld__times_uint8) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -59,3 +66,5 @@ GrB_Info GB (_bld__times_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__atan2_fp32.c b/FactoryKernels/GB_ew__atan2_fp32.c index 3fb221ca7f..016b068f7a 100644 --- a/FactoryKernels/GB_ew__atan2_fp32.c +++ b/FactoryKernels/GB_ew__atan2_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__atan2_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__atan2_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__atan2_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__atan2_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__atan2_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__atan2_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__atan2_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__atan2_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__atan2_fp32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__atan2_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__atan2_fp32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__atan2_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__atan2_fp64.c b/FactoryKernels/GB_ew__atan2_fp64.c index 6a1792790f..e2be7fe170 100644 --- a/FactoryKernels/GB_ew__atan2_fp64.c +++ b/FactoryKernels/GB_ew__atan2_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__atan2_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__atan2_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__atan2_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__atan2_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__atan2_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__atan2_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__atan2_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__atan2_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__atan2_fp64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__atan2_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__atan2_fp64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__atan2_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__band_int16.c b/FactoryKernels/GB_ew__band_int16.c index 6114d8465c..fa41a30de4 100644 --- a/FactoryKernels/GB_ew__band_int16.c +++ b/FactoryKernels/GB_ew__band_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__band_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__band_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__band_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__band_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__band_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__band_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__band_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__band_int16) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__band_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__band_int16) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__band_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__band_int32.c b/FactoryKernels/GB_ew__band_int32.c index dcd82e1434..6fafbec066 100644 --- a/FactoryKernels/GB_ew__band_int32.c +++ b/FactoryKernels/GB_ew__band_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__band_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__band_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__band_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__band_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__band_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__band_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__band_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__band_int32) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__band_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__band_int32) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__band_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__band_int64.c b/FactoryKernels/GB_ew__band_int64.c index 5e820733de..9209488c25 100644 --- a/FactoryKernels/GB_ew__band_int64.c +++ b/FactoryKernels/GB_ew__band_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__band_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__band_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__band_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__band_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__band_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__band_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__band_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__band_int64) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__band_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__band_int64) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__band_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__band_int8.c b/FactoryKernels/GB_ew__band_int8.c index 0df64520a7..215e38305a 100644 --- a/FactoryKernels/GB_ew__band_int8.c +++ b/FactoryKernels/GB_ew__band_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__band_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__band_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__band_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__band_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__band_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__band_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__band_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__band_int8) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__band_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__band_int8) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__band_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__band_uint16.c b/FactoryKernels/GB_ew__band_uint16.c index 063e13d527..fe3f922f7b 100644 --- a/FactoryKernels/GB_ew__band_uint16.c +++ b/FactoryKernels/GB_ew__band_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__band_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__band_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__band_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__band_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__band_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__band_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__band_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__band_uint16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__band_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__band_uint16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__band_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__band_uint32.c b/FactoryKernels/GB_ew__band_uint32.c index 4f9fe3926f..322ace7224 100644 --- a/FactoryKernels/GB_ew__band_uint32.c +++ b/FactoryKernels/GB_ew__band_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__band_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__band_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__band_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__band_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__band_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__band_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__band_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__band_uint32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__band_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__band_uint32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__band_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__band_uint64.c b/FactoryKernels/GB_ew__band_uint64.c index 95bd49e226..0d3aa83a16 100644 --- a/FactoryKernels/GB_ew__band_uint64.c +++ b/FactoryKernels/GB_ew__band_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__band_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__band_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__band_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__band_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__band_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__band_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__band_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__band_uint64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__band_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__band_uint64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__band_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__band_uint8.c b/FactoryKernels/GB_ew__band_uint8.c index f3877aa1ee..d7d6c248de 100644 --- a/FactoryKernels/GB_ew__band_uint8.c +++ b/FactoryKernels/GB_ew__band_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__band_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__band_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__band_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__band_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__band_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__band_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__band_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__band_uint8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__band_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__band_uint8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__band_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bclr_int16.c b/FactoryKernels/GB_ew__bclr_int16.c index 8e2d5b9a19..cc9021a8d7 100644 --- a/FactoryKernels/GB_ew__bclr_int16.c +++ b/FactoryKernels/GB_ew__bclr_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bclr_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bclr_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bclr_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bclr_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bclr_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bclr_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bclr_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bclr_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bclr_int16) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bclr_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bclr_int16) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bclr_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bclr_int32.c b/FactoryKernels/GB_ew__bclr_int32.c index 4670d7009d..ff667d63a4 100644 --- a/FactoryKernels/GB_ew__bclr_int32.c +++ b/FactoryKernels/GB_ew__bclr_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bclr_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bclr_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bclr_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bclr_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bclr_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bclr_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bclr_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bclr_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bclr_int32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bclr_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bclr_int32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bclr_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bclr_int64.c b/FactoryKernels/GB_ew__bclr_int64.c index 3cd3ece220..c5cb6a3b8c 100644 --- a/FactoryKernels/GB_ew__bclr_int64.c +++ b/FactoryKernels/GB_ew__bclr_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bclr_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bclr_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bclr_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bclr_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bclr_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bclr_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bclr_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bclr_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bclr_int64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bclr_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bclr_int64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bclr_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bclr_int8.c b/FactoryKernels/GB_ew__bclr_int8.c index 8092250ece..29c401aab4 100644 --- a/FactoryKernels/GB_ew__bclr_int8.c +++ b/FactoryKernels/GB_ew__bclr_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bclr_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bclr_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bclr_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bclr_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bclr_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bclr_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bclr_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bclr_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bclr_int8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bclr_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bclr_int8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bclr_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bclr_uint16.c b/FactoryKernels/GB_ew__bclr_uint16.c index c3a6369089..762bb5b85e 100644 --- a/FactoryKernels/GB_ew__bclr_uint16.c +++ b/FactoryKernels/GB_ew__bclr_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bclr_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bclr_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bclr_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bclr_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bclr_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bclr_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bclr_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bclr_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bclr_uint16) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bclr_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bclr_uint16) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bclr_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bclr_uint32.c b/FactoryKernels/GB_ew__bclr_uint32.c index e12e272e90..5a31738b83 100644 --- a/FactoryKernels/GB_ew__bclr_uint32.c +++ b/FactoryKernels/GB_ew__bclr_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bclr_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bclr_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bclr_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bclr_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bclr_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bclr_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bclr_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bclr_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bclr_uint32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bclr_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bclr_uint32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bclr_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bclr_uint64.c b/FactoryKernels/GB_ew__bclr_uint64.c index d16ff12f44..a08ab3dcca 100644 --- a/FactoryKernels/GB_ew__bclr_uint64.c +++ b/FactoryKernels/GB_ew__bclr_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bclr_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bclr_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bclr_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bclr_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bclr_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bclr_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bclr_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bclr_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bclr_uint64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bclr_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bclr_uint64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bclr_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bclr_uint8.c b/FactoryKernels/GB_ew__bclr_uint8.c index d545c003b1..5ac145f2c9 100644 --- a/FactoryKernels/GB_ew__bclr_uint8.c +++ b/FactoryKernels/GB_ew__bclr_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bclr_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bclr_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bclr_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bclr_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bclr_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bclr_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bclr_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bclr_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bclr_uint8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bclr_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bclr_uint8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bclr_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bget_int16.c b/FactoryKernels/GB_ew__bget_int16.c index c88a73df80..7ea2a8f0c9 100644 --- a/FactoryKernels/GB_ew__bget_int16.c +++ b/FactoryKernels/GB_ew__bget_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bget_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bget_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bget_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bget_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bget_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bget_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bget_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bget_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bget_int16) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bget_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bget_int16) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bget_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bget_int32.c b/FactoryKernels/GB_ew__bget_int32.c index 92c594093a..ac8b42a67a 100644 --- a/FactoryKernels/GB_ew__bget_int32.c +++ b/FactoryKernels/GB_ew__bget_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bget_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bget_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bget_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bget_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bget_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bget_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bget_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bget_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bget_int32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bget_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bget_int32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bget_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bget_int64.c b/FactoryKernels/GB_ew__bget_int64.c index 366a247be1..0aa61c0409 100644 --- a/FactoryKernels/GB_ew__bget_int64.c +++ b/FactoryKernels/GB_ew__bget_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bget_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bget_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bget_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bget_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bget_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bget_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bget_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bget_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bget_int64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bget_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bget_int64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bget_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bget_int8.c b/FactoryKernels/GB_ew__bget_int8.c index 92d8d977c3..06283a3e64 100644 --- a/FactoryKernels/GB_ew__bget_int8.c +++ b/FactoryKernels/GB_ew__bget_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bget_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bget_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bget_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bget_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bget_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bget_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bget_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bget_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bget_int8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bget_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bget_int8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bget_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bget_uint16.c b/FactoryKernels/GB_ew__bget_uint16.c index f3d1d053f3..57866b469b 100644 --- a/FactoryKernels/GB_ew__bget_uint16.c +++ b/FactoryKernels/GB_ew__bget_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bget_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bget_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bget_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bget_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bget_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bget_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bget_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bget_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bget_uint16) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bget_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bget_uint16) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bget_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bget_uint32.c b/FactoryKernels/GB_ew__bget_uint32.c index 653422c53f..c33c86d6e8 100644 --- a/FactoryKernels/GB_ew__bget_uint32.c +++ b/FactoryKernels/GB_ew__bget_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bget_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bget_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bget_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bget_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bget_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bget_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bget_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bget_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bget_uint32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bget_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bget_uint32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bget_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bget_uint64.c b/FactoryKernels/GB_ew__bget_uint64.c index 829db2f6e8..5a66c77381 100644 --- a/FactoryKernels/GB_ew__bget_uint64.c +++ b/FactoryKernels/GB_ew__bget_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bget_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bget_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bget_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bget_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bget_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bget_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bget_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bget_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bget_uint64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bget_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bget_uint64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bget_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bget_uint8.c b/FactoryKernels/GB_ew__bget_uint8.c index bb1e43d400..d2beec54ff 100644 --- a/FactoryKernels/GB_ew__bget_uint8.c +++ b/FactoryKernels/GB_ew__bget_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bget_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bget_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bget_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bget_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bget_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bget_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bget_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bget_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bget_uint8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bget_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bget_uint8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bget_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bor_int16.c b/FactoryKernels/GB_ew__bor_int16.c index 82cb42bf5a..d7cb501759 100644 --- a/FactoryKernels/GB_ew__bor_int16.c +++ b/FactoryKernels/GB_ew__bor_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bor_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bor_int16) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bor_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bor_int16) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bor_int32.c b/FactoryKernels/GB_ew__bor_int32.c index 485ebb117d..07d8d765f7 100644 --- a/FactoryKernels/GB_ew__bor_int32.c +++ b/FactoryKernels/GB_ew__bor_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bor_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bor_int32) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bor_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bor_int32) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bor_int64.c b/FactoryKernels/GB_ew__bor_int64.c index ea838e4e1f..bc777d8917 100644 --- a/FactoryKernels/GB_ew__bor_int64.c +++ b/FactoryKernels/GB_ew__bor_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bor_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bor_int64) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bor_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bor_int64) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bor_int8.c b/FactoryKernels/GB_ew__bor_int8.c index 1af7d983ce..e7b6bb251e 100644 --- a/FactoryKernels/GB_ew__bor_int8.c +++ b/FactoryKernels/GB_ew__bor_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bor_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bor_int8) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bor_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bor_int8) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bor_uint16.c b/FactoryKernels/GB_ew__bor_uint16.c index 0343737303..7559d9849f 100644 --- a/FactoryKernels/GB_ew__bor_uint16.c +++ b/FactoryKernels/GB_ew__bor_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bor_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bor_uint16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bor_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bor_uint16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bor_uint32.c b/FactoryKernels/GB_ew__bor_uint32.c index f2bedb7076..a243e7e6fd 100644 --- a/FactoryKernels/GB_ew__bor_uint32.c +++ b/FactoryKernels/GB_ew__bor_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bor_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bor_uint32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bor_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bor_uint32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bor_uint64.c b/FactoryKernels/GB_ew__bor_uint64.c index 19773c5de0..a75a95452d 100644 --- a/FactoryKernels/GB_ew__bor_uint64.c +++ b/FactoryKernels/GB_ew__bor_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bor_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bor_uint64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bor_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bor_uint64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bor_uint8.c b/FactoryKernels/GB_ew__bor_uint8.c index 6140048531..0b9cbc8d66 100644 --- a/FactoryKernels/GB_ew__bor_uint8.c +++ b/FactoryKernels/GB_ew__bor_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bor_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bor_uint8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bor_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bor_uint8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bset_int16.c b/FactoryKernels/GB_ew__bset_int16.c index cd12f5be05..6783e18213 100644 --- a/FactoryKernels/GB_ew__bset_int16.c +++ b/FactoryKernels/GB_ew__bset_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bset_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bset_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bset_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bset_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bset_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bset_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bset_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bset_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bset_int16) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bset_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bset_int16) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bset_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bset_int32.c b/FactoryKernels/GB_ew__bset_int32.c index 67911d7e48..77390aa2ee 100644 --- a/FactoryKernels/GB_ew__bset_int32.c +++ b/FactoryKernels/GB_ew__bset_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bset_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bset_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bset_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bset_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bset_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bset_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bset_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bset_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bset_int32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bset_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bset_int32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bset_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bset_int64.c b/FactoryKernels/GB_ew__bset_int64.c index 84d1d67198..7635bc9c83 100644 --- a/FactoryKernels/GB_ew__bset_int64.c +++ b/FactoryKernels/GB_ew__bset_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bset_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bset_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bset_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bset_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bset_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bset_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bset_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bset_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bset_int64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bset_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bset_int64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bset_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bset_int8.c b/FactoryKernels/GB_ew__bset_int8.c index 8cb89d3b81..eb90f5aabf 100644 --- a/FactoryKernels/GB_ew__bset_int8.c +++ b/FactoryKernels/GB_ew__bset_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bset_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bset_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bset_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bset_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bset_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bset_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bset_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bset_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bset_int8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bset_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bset_int8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bset_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bset_uint16.c b/FactoryKernels/GB_ew__bset_uint16.c index 16d8224b6e..522e6426ec 100644 --- a/FactoryKernels/GB_ew__bset_uint16.c +++ b/FactoryKernels/GB_ew__bset_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bset_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bset_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bset_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bset_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bset_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bset_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bset_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bset_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bset_uint16) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bset_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bset_uint16) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bset_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bset_uint32.c b/FactoryKernels/GB_ew__bset_uint32.c index fcd5e4ac47..140cbb50de 100644 --- a/FactoryKernels/GB_ew__bset_uint32.c +++ b/FactoryKernels/GB_ew__bset_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bset_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bset_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bset_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bset_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bset_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bset_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bset_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bset_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bset_uint32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bset_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bset_uint32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bset_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bset_uint64.c b/FactoryKernels/GB_ew__bset_uint64.c index 761fbbec72..0f85fa665f 100644 --- a/FactoryKernels/GB_ew__bset_uint64.c +++ b/FactoryKernels/GB_ew__bset_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bset_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bset_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bset_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bset_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bset_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bset_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bset_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bset_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bset_uint64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bset_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bset_uint64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bset_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bset_uint8.c b/FactoryKernels/GB_ew__bset_uint8.c index 0cdc899c33..88719b8c57 100644 --- a/FactoryKernels/GB_ew__bset_uint8.c +++ b/FactoryKernels/GB_ew__bset_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bset_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bset_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bset_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bset_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bset_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bset_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bset_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bset_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bset_uint8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bset_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bset_uint8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bset_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bshift_int16.c b/FactoryKernels/GB_ew__bshift_int16.c index f4d42b10d0..affbca1d65 100644 --- a/FactoryKernels/GB_ew__bshift_int16.c +++ b/FactoryKernels/GB_ew__bshift_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -100,7 +107,7 @@ GrB_Info GB (_AaddB__bshift_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -147,7 +154,7 @@ GrB_Info GB (_AunionB__bshift_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -175,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +208,7 @@ GrB_Info GB (_AemultB_02__bshift_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -227,7 +234,7 @@ GrB_Info GB (_AemultB_03__bshift_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -252,7 +259,7 @@ GrB_Info GB (_AemultB_04__bshift_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -278,7 +285,7 @@ GrB_Info GB (_AemultB_bitmap__bshift_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -333,11 +340,11 @@ GrB_Info GB (_bind2nd__bshift_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bshift_int16) @@ -368,11 +375,11 @@ GrB_Info GB (_bind1st_tran__bshift_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bshift_int16) @@ -395,3 +402,5 @@ GrB_Info GB (_bind2nd_tran__bshift_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bshift_int32.c b/FactoryKernels/GB_ew__bshift_int32.c index 978633e784..fd496e5eb2 100644 --- a/FactoryKernels/GB_ew__bshift_int32.c +++ b/FactoryKernels/GB_ew__bshift_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -100,7 +107,7 @@ GrB_Info GB (_AaddB__bshift_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -147,7 +154,7 @@ GrB_Info GB (_AunionB__bshift_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -175,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +208,7 @@ GrB_Info GB (_AemultB_02__bshift_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -227,7 +234,7 @@ GrB_Info GB (_AemultB_03__bshift_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -252,7 +259,7 @@ GrB_Info GB (_AemultB_04__bshift_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -278,7 +285,7 @@ GrB_Info GB (_AemultB_bitmap__bshift_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -333,11 +340,11 @@ GrB_Info GB (_bind2nd__bshift_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bshift_int32) @@ -368,11 +375,11 @@ GrB_Info GB (_bind1st_tran__bshift_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bshift_int32) @@ -395,3 +402,5 @@ GrB_Info GB (_bind2nd_tran__bshift_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bshift_int64.c b/FactoryKernels/GB_ew__bshift_int64.c index 8538684f9b..22e5831b9a 100644 --- a/FactoryKernels/GB_ew__bshift_int64.c +++ b/FactoryKernels/GB_ew__bshift_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -100,7 +107,7 @@ GrB_Info GB (_AaddB__bshift_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -147,7 +154,7 @@ GrB_Info GB (_AunionB__bshift_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -175,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +208,7 @@ GrB_Info GB (_AemultB_02__bshift_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -227,7 +234,7 @@ GrB_Info GB (_AemultB_03__bshift_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -252,7 +259,7 @@ GrB_Info GB (_AemultB_04__bshift_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -278,7 +285,7 @@ GrB_Info GB (_AemultB_bitmap__bshift_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -333,11 +340,11 @@ GrB_Info GB (_bind2nd__bshift_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bshift_int64) @@ -368,11 +375,11 @@ GrB_Info GB (_bind1st_tran__bshift_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bshift_int64) @@ -395,3 +402,5 @@ GrB_Info GB (_bind2nd_tran__bshift_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bshift_int8.c b/FactoryKernels/GB_ew__bshift_int8.c index 8953c1c626..accc437cb4 100644 --- a/FactoryKernels/GB_ew__bshift_int8.c +++ b/FactoryKernels/GB_ew__bshift_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bshift_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bshift_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bshift_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bshift_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__bshift_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__bshift_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__bshift_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__bshift_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bshift_int8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__bshift_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bshift_int8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__bshift_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bshift_uint16.c b/FactoryKernels/GB_ew__bshift_uint16.c index 5c14a08fc1..d3cf942b34 100644 --- a/FactoryKernels/GB_ew__bshift_uint16.c +++ b/FactoryKernels/GB_ew__bshift_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -100,7 +107,7 @@ GrB_Info GB (_AaddB__bshift_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -147,7 +154,7 @@ GrB_Info GB (_AunionB__bshift_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -175,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +208,7 @@ GrB_Info GB (_AemultB_02__bshift_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -227,7 +234,7 @@ GrB_Info GB (_AemultB_03__bshift_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -252,7 +259,7 @@ GrB_Info GB (_AemultB_04__bshift_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -278,7 +285,7 @@ GrB_Info GB (_AemultB_bitmap__bshift_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -333,11 +340,11 @@ GrB_Info GB (_bind2nd__bshift_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bshift_uint16) @@ -368,11 +375,11 @@ GrB_Info GB (_bind1st_tran__bshift_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bshift_uint16) @@ -395,3 +402,5 @@ GrB_Info GB (_bind2nd_tran__bshift_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bshift_uint32.c b/FactoryKernels/GB_ew__bshift_uint32.c index 454c004a86..79a901eab6 100644 --- a/FactoryKernels/GB_ew__bshift_uint32.c +++ b/FactoryKernels/GB_ew__bshift_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -100,7 +107,7 @@ GrB_Info GB (_AaddB__bshift_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -147,7 +154,7 @@ GrB_Info GB (_AunionB__bshift_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -175,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +208,7 @@ GrB_Info GB (_AemultB_02__bshift_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -227,7 +234,7 @@ GrB_Info GB (_AemultB_03__bshift_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -252,7 +259,7 @@ GrB_Info GB (_AemultB_04__bshift_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -278,7 +285,7 @@ GrB_Info GB (_AemultB_bitmap__bshift_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -333,11 +340,11 @@ GrB_Info GB (_bind2nd__bshift_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bshift_uint32) @@ -368,11 +375,11 @@ GrB_Info GB (_bind1st_tran__bshift_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bshift_uint32) @@ -395,3 +402,5 @@ GrB_Info GB (_bind2nd_tran__bshift_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bshift_uint64.c b/FactoryKernels/GB_ew__bshift_uint64.c index 0d27214a64..16b045ab72 100644 --- a/FactoryKernels/GB_ew__bshift_uint64.c +++ b/FactoryKernels/GB_ew__bshift_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -100,7 +107,7 @@ GrB_Info GB (_AaddB__bshift_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -147,7 +154,7 @@ GrB_Info GB (_AunionB__bshift_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -175,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +208,7 @@ GrB_Info GB (_AemultB_02__bshift_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -227,7 +234,7 @@ GrB_Info GB (_AemultB_03__bshift_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -252,7 +259,7 @@ GrB_Info GB (_AemultB_04__bshift_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -278,7 +285,7 @@ GrB_Info GB (_AemultB_bitmap__bshift_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -333,11 +340,11 @@ GrB_Info GB (_bind2nd__bshift_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bshift_uint64) @@ -368,11 +375,11 @@ GrB_Info GB (_bind1st_tran__bshift_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bshift_uint64) @@ -395,3 +402,5 @@ GrB_Info GB (_bind2nd_tran__bshift_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bshift_uint8.c b/FactoryKernels/GB_ew__bshift_uint8.c index 0dad045e83..693b612662 100644 --- a/FactoryKernels/GB_ew__bshift_uint8.c +++ b/FactoryKernels/GB_ew__bshift_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -100,7 +107,7 @@ GrB_Info GB (_AaddB__bshift_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -147,7 +154,7 @@ GrB_Info GB (_AunionB__bshift_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -175,7 +182,7 @@ GrB_Info GB (_AemultB_08__bshift_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -201,7 +208,7 @@ GrB_Info GB (_AemultB_02__bshift_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -227,7 +234,7 @@ GrB_Info GB (_AemultB_03__bshift_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -252,7 +259,7 @@ GrB_Info GB (_AemultB_04__bshift_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -278,7 +285,7 @@ GrB_Info GB (_AemultB_bitmap__bshift_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -333,11 +340,11 @@ GrB_Info GB (_bind2nd__bshift_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bshift_uint8) @@ -368,11 +375,11 @@ GrB_Info GB (_bind1st_tran__bshift_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bshift_uint8) @@ -395,3 +402,5 @@ GrB_Info GB (_bind2nd_tran__bshift_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxnor_int16.c b/FactoryKernels/GB_ew__bxnor_int16.c index 3ceb9b50e0..2f1a044250 100644 --- a/FactoryKernels/GB_ew__bxnor_int16.c +++ b/FactoryKernels/GB_ew__bxnor_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bxnor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bxnor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bxnor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bxnor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bxnor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bxnor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bxnor_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxnor_int16) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bxnor_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxnor_int16) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bxnor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxnor_int32.c b/FactoryKernels/GB_ew__bxnor_int32.c index 918e087469..c7931d8987 100644 --- a/FactoryKernels/GB_ew__bxnor_int32.c +++ b/FactoryKernels/GB_ew__bxnor_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bxnor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bxnor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bxnor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bxnor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bxnor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bxnor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bxnor_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxnor_int32) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bxnor_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxnor_int32) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bxnor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxnor_int64.c b/FactoryKernels/GB_ew__bxnor_int64.c index 5d19631631..b6348df1ce 100644 --- a/FactoryKernels/GB_ew__bxnor_int64.c +++ b/FactoryKernels/GB_ew__bxnor_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bxnor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bxnor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bxnor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bxnor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bxnor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bxnor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bxnor_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxnor_int64) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bxnor_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxnor_int64) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bxnor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxnor_int8.c b/FactoryKernels/GB_ew__bxnor_int8.c index 1403b448e7..4705e7559f 100644 --- a/FactoryKernels/GB_ew__bxnor_int8.c +++ b/FactoryKernels/GB_ew__bxnor_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bxnor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bxnor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bxnor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bxnor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bxnor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bxnor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bxnor_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxnor_int8) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bxnor_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxnor_int8) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bxnor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxnor_uint16.c b/FactoryKernels/GB_ew__bxnor_uint16.c index f3cac2a0c7..37dd39930d 100644 --- a/FactoryKernels/GB_ew__bxnor_uint16.c +++ b/FactoryKernels/GB_ew__bxnor_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bxnor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bxnor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bxnor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bxnor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bxnor_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxnor_uint16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bxnor_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxnor_uint16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxnor_uint32.c b/FactoryKernels/GB_ew__bxnor_uint32.c index 63689aec58..a8923d3214 100644 --- a/FactoryKernels/GB_ew__bxnor_uint32.c +++ b/FactoryKernels/GB_ew__bxnor_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bxnor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bxnor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bxnor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bxnor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bxnor_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxnor_uint32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bxnor_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxnor_uint32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxnor_uint64.c b/FactoryKernels/GB_ew__bxnor_uint64.c index a91cdd4fe3..a39a713c7d 100644 --- a/FactoryKernels/GB_ew__bxnor_uint64.c +++ b/FactoryKernels/GB_ew__bxnor_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bxnor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bxnor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bxnor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bxnor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bxnor_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxnor_uint64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bxnor_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxnor_uint64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxnor_uint8.c b/FactoryKernels/GB_ew__bxnor_uint8.c index 7b46d4bec4..ae6bbad6a7 100644 --- a/FactoryKernels/GB_ew__bxnor_uint8.c +++ b/FactoryKernels/GB_ew__bxnor_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bxnor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bxnor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bxnor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bxnor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bxnor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bxnor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bxnor_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxnor_uint8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bxnor_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxnor_uint8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bxnor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxor_int16.c b/FactoryKernels/GB_ew__bxor_int16.c index 465f7a1384..f9bcc7fd22 100644 --- a/FactoryKernels/GB_ew__bxor_int16.c +++ b/FactoryKernels/GB_ew__bxor_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bxor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bxor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bxor_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxor_int16) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bxor_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxor_int16) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bxor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxor_int32.c b/FactoryKernels/GB_ew__bxor_int32.c index 328cadce13..cff8959ae5 100644 --- a/FactoryKernels/GB_ew__bxor_int32.c +++ b/FactoryKernels/GB_ew__bxor_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bxor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bxor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bxor_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxor_int32) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bxor_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxor_int32) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bxor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxor_int64.c b/FactoryKernels/GB_ew__bxor_int64.c index af7b937531..88268e017d 100644 --- a/FactoryKernels/GB_ew__bxor_int64.c +++ b/FactoryKernels/GB_ew__bxor_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bxor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bxor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bxor_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxor_int64) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bxor_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxor_int64) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bxor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxor_int8.c b/FactoryKernels/GB_ew__bxor_int8.c index 3b6dd7529b..9d10c238e0 100644 --- a/FactoryKernels/GB_ew__bxor_int8.c +++ b/FactoryKernels/GB_ew__bxor_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__bxor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__bxor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__bxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__bxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__bxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__bxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__bxor_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxor_int8) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__bxor_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxor_int8) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__bxor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxor_uint16.c b/FactoryKernels/GB_ew__bxor_uint16.c index 1fe4ba7e85..f0ffa7a57e 100644 --- a/FactoryKernels/GB_ew__bxor_uint16.c +++ b/FactoryKernels/GB_ew__bxor_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bxor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bxor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bxor_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxor_uint16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bxor_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxor_uint16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bxor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxor_uint32.c b/FactoryKernels/GB_ew__bxor_uint32.c index 32c4e8319a..0283fc8773 100644 --- a/FactoryKernels/GB_ew__bxor_uint32.c +++ b/FactoryKernels/GB_ew__bxor_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bxor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bxor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bxor_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxor_uint32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bxor_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxor_uint32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bxor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxor_uint64.c b/FactoryKernels/GB_ew__bxor_uint64.c index 672b794072..9c05d30b7a 100644 --- a/FactoryKernels/GB_ew__bxor_uint64.c +++ b/FactoryKernels/GB_ew__bxor_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bxor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bxor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bxor_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxor_uint64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bxor_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxor_uint64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bxor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__bxor_uint8.c b/FactoryKernels/GB_ew__bxor_uint8.c index c13e709966..4c3ddb3fed 100644 --- a/FactoryKernels/GB_ew__bxor_uint8.c +++ b/FactoryKernels/GB_ew__bxor_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__bxor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__bxor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__bxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__bxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__bxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__bxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__bxor_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__bxor_uint8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__bxor_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__bxor_uint8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__bxor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__cmplx_fp32.c b/FactoryKernels/GB_ew__cmplx_fp32.c index 7a0835f8f7..7ab9714046 100644 --- a/FactoryKernels/GB_ew__cmplx_fp32.c +++ b/FactoryKernels/GB_ew__cmplx_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -102,7 +109,7 @@ GrB_Info GB (_AaddB__cmplx_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -149,7 +156,7 @@ GrB_Info GB (_AunionB__cmplx_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -177,7 +184,7 @@ GrB_Info GB (_AemultB_08__cmplx_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -203,7 +210,7 @@ GrB_Info GB (_AemultB_02__cmplx_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -229,7 +236,7 @@ GrB_Info GB (_AemultB_03__cmplx_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -254,7 +261,7 @@ GrB_Info GB (_AemultB_04__cmplx_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -280,7 +287,7 @@ GrB_Info GB (_AemultB_bitmap__cmplx_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -335,11 +342,11 @@ GrB_Info GB (_bind2nd__cmplx_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__cmplx_fp32) @@ -370,11 +377,11 @@ GrB_Info GB (_bind1st_tran__cmplx_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__cmplx_fp32) @@ -397,3 +404,5 @@ GrB_Info GB (_bind2nd_tran__cmplx_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__cmplx_fp64.c b/FactoryKernels/GB_ew__cmplx_fp64.c index 57a77a4e04..350ff178c4 100644 --- a/FactoryKernels/GB_ew__cmplx_fp64.c +++ b/FactoryKernels/GB_ew__cmplx_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -102,7 +109,7 @@ GrB_Info GB (_AaddB__cmplx_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -149,7 +156,7 @@ GrB_Info GB (_AunionB__cmplx_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -177,7 +184,7 @@ GrB_Info GB (_AemultB_08__cmplx_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -203,7 +210,7 @@ GrB_Info GB (_AemultB_02__cmplx_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -229,7 +236,7 @@ GrB_Info GB (_AemultB_03__cmplx_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -254,7 +261,7 @@ GrB_Info GB (_AemultB_04__cmplx_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -280,7 +287,7 @@ GrB_Info GB (_AemultB_bitmap__cmplx_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -335,11 +342,11 @@ GrB_Info GB (_bind2nd__cmplx_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__cmplx_fp64) @@ -370,11 +377,11 @@ GrB_Info GB (_bind1st_tran__cmplx_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__cmplx_fp64) @@ -397,3 +404,5 @@ GrB_Info GB (_bind2nd_tran__cmplx_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__copysign_fp32.c b/FactoryKernels/GB_ew__copysign_fp32.c index 990556e704..42371883a0 100644 --- a/FactoryKernels/GB_ew__copysign_fp32.c +++ b/FactoryKernels/GB_ew__copysign_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__copysign_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__copysign_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__copysign_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__copysign_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__copysign_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__copysign_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__copysign_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__copysign_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__copysign_fp32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__copysign_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__copysign_fp32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__copysign_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__copysign_fp64.c b/FactoryKernels/GB_ew__copysign_fp64.c index 9f3f908026..1aa9c1cf73 100644 --- a/FactoryKernels/GB_ew__copysign_fp64.c +++ b/FactoryKernels/GB_ew__copysign_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__copysign_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__copysign_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__copysign_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__copysign_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__copysign_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__copysign_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__copysign_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__copysign_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__copysign_fp64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__copysign_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__copysign_fp64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__copysign_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_fc32.c b/FactoryKernels/GB_ew__div_fc32.c index c900684f88..1be74c6cd6 100644 --- a/FactoryKernels/GB_ew__div_fc32.c +++ b/FactoryKernels/GB_ew__div_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_fc32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_fc32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_fc64.c b/FactoryKernels/GB_ew__div_fc64.c index f0060d636a..7f11bc1431 100644 --- a/FactoryKernels/GB_ew__div_fc64.c +++ b/FactoryKernels/GB_ew__div_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_fc64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_fc64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_fp32.c b/FactoryKernels/GB_ew__div_fp32.c index 66344b9acf..1a2de5c9b6 100644 --- a/FactoryKernels/GB_ew__div_fp32.c +++ b/FactoryKernels/GB_ew__div_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_fp32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_fp32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_fp64.c b/FactoryKernels/GB_ew__div_fp64.c index 9301edd76d..9658b579df 100644 --- a/FactoryKernels/GB_ew__div_fp64.c +++ b/FactoryKernels/GB_ew__div_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_fp64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_fp64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_int16.c b/FactoryKernels/GB_ew__div_int16.c index 4ba1927912..c39f95e28e 100644 --- a/FactoryKernels/GB_ew__div_int16.c +++ b/FactoryKernels/GB_ew__div_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_int16) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_int16) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_int32.c b/FactoryKernels/GB_ew__div_int32.c index 331e157e58..17e0819c32 100644 --- a/FactoryKernels/GB_ew__div_int32.c +++ b/FactoryKernels/GB_ew__div_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_int32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_int32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_int64.c b/FactoryKernels/GB_ew__div_int64.c index 58bbbb99e7..168df00cba 100644 --- a/FactoryKernels/GB_ew__div_int64.c +++ b/FactoryKernels/GB_ew__div_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_int64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_int64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_int8.c b/FactoryKernels/GB_ew__div_int8.c index 4a8798efe8..e6167f4a14 100644 --- a/FactoryKernels/GB_ew__div_int8.c +++ b/FactoryKernels/GB_ew__div_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_int8) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_int8) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_uint16.c b/FactoryKernels/GB_ew__div_uint16.c index 329bed90c0..5d18d6eea0 100644 --- a/FactoryKernels/GB_ew__div_uint16.c +++ b/FactoryKernels/GB_ew__div_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_uint16) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_uint16) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_uint32.c b/FactoryKernels/GB_ew__div_uint32.c index 80277dd97d..3c0ad8ad8c 100644 --- a/FactoryKernels/GB_ew__div_uint32.c +++ b/FactoryKernels/GB_ew__div_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_uint32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_uint32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_uint64.c b/FactoryKernels/GB_ew__div_uint64.c index 48489c7a1a..ef2684ce65 100644 --- a/FactoryKernels/GB_ew__div_uint64.c +++ b/FactoryKernels/GB_ew__div_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_uint64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_uint64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__div_uint8.c b/FactoryKernels/GB_ew__div_uint8.c index 9e1e0f8a70..a68e806fab 100644 --- a/FactoryKernels/GB_ew__div_uint8.c +++ b/FactoryKernels/GB_ew__div_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__div_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__div_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__div_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__div_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__div_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__div_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__div_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__div_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__div_uint8) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__div_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__div_uint8) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__div_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_bool.c b/FactoryKernels/GB_ew__eq_bool.c index 5f81afd507..1a5bf40654 100644 --- a/FactoryKernels/GB_ew__eq_bool.c +++ b/FactoryKernels/GB_ew__eq_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__eq_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__eq_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__eq_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__eq_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__eq_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__eq_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__eq_bool) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_bool) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__eq_bool) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_bool) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__eq_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_fc32.c b/FactoryKernels/GB_ew__eq_fc32.c index 8fb666937a..77754fda21 100644 --- a/FactoryKernels/GB_ew__eq_fc32.c +++ b/FactoryKernels/GB_ew__eq_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -102,7 +109,7 @@ GrB_Info GB (_AaddB__eq_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -149,7 +156,7 @@ GrB_Info GB (_AunionB__eq_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -177,7 +184,7 @@ GrB_Info GB (_AemultB_08__eq_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -203,7 +210,7 @@ GrB_Info GB (_AemultB_02__eq_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -228,7 +235,7 @@ GrB_Info GB (_AemultB_04__eq_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -254,7 +261,7 @@ GrB_Info GB (_AemultB_bitmap__eq_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -309,11 +316,11 @@ GrB_Info GB (_bind2nd__eq_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_fc32) @@ -344,11 +351,11 @@ GrB_Info GB (_bind1st_tran__eq_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_fc32) @@ -371,3 +378,5 @@ GrB_Info GB (_bind2nd_tran__eq_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_fc64.c b/FactoryKernels/GB_ew__eq_fc64.c index af4c511132..cd3af6187b 100644 --- a/FactoryKernels/GB_ew__eq_fc64.c +++ b/FactoryKernels/GB_ew__eq_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -102,7 +109,7 @@ GrB_Info GB (_AaddB__eq_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -149,7 +156,7 @@ GrB_Info GB (_AunionB__eq_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -177,7 +184,7 @@ GrB_Info GB (_AemultB_08__eq_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -203,7 +210,7 @@ GrB_Info GB (_AemultB_02__eq_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -228,7 +235,7 @@ GrB_Info GB (_AemultB_04__eq_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -254,7 +261,7 @@ GrB_Info GB (_AemultB_bitmap__eq_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -309,11 +316,11 @@ GrB_Info GB (_bind2nd__eq_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_fc64) @@ -344,11 +351,11 @@ GrB_Info GB (_bind1st_tran__eq_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_fc64) @@ -371,3 +378,5 @@ GrB_Info GB (_bind2nd_tran__eq_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_fp32.c b/FactoryKernels/GB_ew__eq_fp32.c index 3c034fe2b6..2cc4e60fce 100644 --- a/FactoryKernels/GB_ew__eq_fp32.c +++ b/FactoryKernels/GB_ew__eq_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_fp32) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_fp32) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_fp64.c b/FactoryKernels/GB_ew__eq_fp64.c index c04d751c10..8e4e1e4403 100644 --- a/FactoryKernels/GB_ew__eq_fp64.c +++ b/FactoryKernels/GB_ew__eq_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_fp64) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_fp64) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_int16.c b/FactoryKernels/GB_ew__eq_int16.c index 1f6ab537a2..d3ab5f7e8a 100644 --- a/FactoryKernels/GB_ew__eq_int16.c +++ b/FactoryKernels/GB_ew__eq_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_int16) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_int16) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_int32.c b/FactoryKernels/GB_ew__eq_int32.c index 166686548c..42f3574943 100644 --- a/FactoryKernels/GB_ew__eq_int32.c +++ b/FactoryKernels/GB_ew__eq_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_int32) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_int32) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_int64.c b/FactoryKernels/GB_ew__eq_int64.c index 442fa14916..412602c972 100644 --- a/FactoryKernels/GB_ew__eq_int64.c +++ b/FactoryKernels/GB_ew__eq_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_int64) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_int64) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_int8.c b/FactoryKernels/GB_ew__eq_int8.c index 6baa6ece37..755490272c 100644 --- a/FactoryKernels/GB_ew__eq_int8.c +++ b/FactoryKernels/GB_ew__eq_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_int8) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_int8) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_uint16.c b/FactoryKernels/GB_ew__eq_uint16.c index 8d7548721b..8476f39260 100644 --- a/FactoryKernels/GB_ew__eq_uint16.c +++ b/FactoryKernels/GB_ew__eq_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_uint16) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_uint16) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_uint32.c b/FactoryKernels/GB_ew__eq_uint32.c index 2dc9ecee70..054e52dc31 100644 --- a/FactoryKernels/GB_ew__eq_uint32.c +++ b/FactoryKernels/GB_ew__eq_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_uint32) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_uint32) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_uint64.c b/FactoryKernels/GB_ew__eq_uint64.c index 78c7856e0c..a3f287730e 100644 --- a/FactoryKernels/GB_ew__eq_uint64.c +++ b/FactoryKernels/GB_ew__eq_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_uint64) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_uint64) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__eq_uint8.c b/FactoryKernels/GB_ew__eq_uint8.c index 2ad61924bd..ac39fd9d30 100644 --- a/FactoryKernels/GB_ew__eq_uint8.c +++ b/FactoryKernels/GB_ew__eq_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__eq_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__eq_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__eq_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__eq_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__eq_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__eq_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__eq_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__eq_uint8) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__eq_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__eq_uint8) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__eq_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_bool.c b/FactoryKernels/GB_ew__first_bool.c index 7f239e033e..666d0616a0 100644 --- a/FactoryKernels/GB_ew__first_bool.c +++ b/FactoryKernels/GB_ew__first_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_fc32.c b/FactoryKernels/GB_ew__first_fc32.c index 05c05edab5..347fb2648b 100644 --- a/FactoryKernels/GB_ew__first_fc32.c +++ b/FactoryKernels/GB_ew__first_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_fc64.c b/FactoryKernels/GB_ew__first_fc64.c index 37cd4cd74b..d37464f8ee 100644 --- a/FactoryKernels/GB_ew__first_fc64.c +++ b/FactoryKernels/GB_ew__first_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_fp32.c b/FactoryKernels/GB_ew__first_fp32.c index 1e09e3e9e3..63c6177b28 100644 --- a/FactoryKernels/GB_ew__first_fp32.c +++ b/FactoryKernels/GB_ew__first_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_fp64.c b/FactoryKernels/GB_ew__first_fp64.c index d79ab84f54..f1fbb919ed 100644 --- a/FactoryKernels/GB_ew__first_fp64.c +++ b/FactoryKernels/GB_ew__first_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_int16.c b/FactoryKernels/GB_ew__first_int16.c index 23a9515294..7405ea59f3 100644 --- a/FactoryKernels/GB_ew__first_int16.c +++ b/FactoryKernels/GB_ew__first_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_int32.c b/FactoryKernels/GB_ew__first_int32.c index 057d83af0c..488b94bde8 100644 --- a/FactoryKernels/GB_ew__first_int32.c +++ b/FactoryKernels/GB_ew__first_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_int64.c b/FactoryKernels/GB_ew__first_int64.c index 48affc5f0d..8810c09e96 100644 --- a/FactoryKernels/GB_ew__first_int64.c +++ b/FactoryKernels/GB_ew__first_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_int8.c b/FactoryKernels/GB_ew__first_int8.c index 55b1a80c22..6e5961d92e 100644 --- a/FactoryKernels/GB_ew__first_int8.c +++ b/FactoryKernels/GB_ew__first_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_uint16.c b/FactoryKernels/GB_ew__first_uint16.c index 4bd786e382..ae02fa179d 100644 --- a/FactoryKernels/GB_ew__first_uint16.c +++ b/FactoryKernels/GB_ew__first_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_uint32.c b/FactoryKernels/GB_ew__first_uint32.c index 3ce81aa844..ff62927211 100644 --- a/FactoryKernels/GB_ew__first_uint32.c +++ b/FactoryKernels/GB_ew__first_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_uint64.c b/FactoryKernels/GB_ew__first_uint64.c index fbd3555bbf..744cc346b5 100644 --- a/FactoryKernels/GB_ew__first_uint64.c +++ b/FactoryKernels/GB_ew__first_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__first_uint8.c b/FactoryKernels/GB_ew__first_uint8.c index e3b70cdf48..c5caef2658 100644 --- a/FactoryKernels/GB_ew__first_uint8.c +++ b/FactoryKernels/GB_ew__first_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__first_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__first_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__first_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__first_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__first_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__first_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,8 +325,10 @@ GrB_Info GB (_AemultB_bitmap__first_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__fmod_fp32.c b/FactoryKernels/GB_ew__fmod_fp32.c index 580a0f468a..d42514dd79 100644 --- a/FactoryKernels/GB_ew__fmod_fp32.c +++ b/FactoryKernels/GB_ew__fmod_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__fmod_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__fmod_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__fmod_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__fmod_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__fmod_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__fmod_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__fmod_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__fmod_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__fmod_fp32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__fmod_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__fmod_fp32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__fmod_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__fmod_fp64.c b/FactoryKernels/GB_ew__fmod_fp64.c index 4fbf4e31db..fcd2971bc0 100644 --- a/FactoryKernels/GB_ew__fmod_fp64.c +++ b/FactoryKernels/GB_ew__fmod_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__fmod_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__fmod_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__fmod_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__fmod_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__fmod_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__fmod_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__fmod_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__fmod_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__fmod_fp64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__fmod_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__fmod_fp64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__fmod_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_bool.c b/FactoryKernels/GB_ew__ge_bool.c index 275bc53027..f61f7c2b7c 100644 --- a/FactoryKernels/GB_ew__ge_bool.c +++ b/FactoryKernels/GB_ew__ge_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__ge_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__ge_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__ge_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__ge_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__ge_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__ge_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,7 +325,7 @@ GrB_Info GB (_AemultB_bitmap__ge_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -373,11 +380,11 @@ GrB_Info GB (_bind2nd__ge_bool) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_bool) @@ -408,11 +415,11 @@ GrB_Info GB (_bind1st_tran__ge_bool) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_bool) @@ -435,3 +442,5 @@ GrB_Info GB (_bind2nd_tran__ge_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_fp32.c b/FactoryKernels/GB_ew__ge_fp32.c index 8f95f66f97..bfc7ae775e 100644 --- a/FactoryKernels/GB_ew__ge_fp32.c +++ b/FactoryKernels/GB_ew__ge_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_fp32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_fp32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_fp64.c b/FactoryKernels/GB_ew__ge_fp64.c index cc9ea588bc..e84cf95267 100644 --- a/FactoryKernels/GB_ew__ge_fp64.c +++ b/FactoryKernels/GB_ew__ge_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_fp64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_fp64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_int16.c b/FactoryKernels/GB_ew__ge_int16.c index 59fb4ccb64..3209d20172 100644 --- a/FactoryKernels/GB_ew__ge_int16.c +++ b/FactoryKernels/GB_ew__ge_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_int16) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_int16) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_int32.c b/FactoryKernels/GB_ew__ge_int32.c index 231b108643..4cc7a8b3ce 100644 --- a/FactoryKernels/GB_ew__ge_int32.c +++ b/FactoryKernels/GB_ew__ge_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_int32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_int32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_int64.c b/FactoryKernels/GB_ew__ge_int64.c index c2e1b2dc7c..ab54f6873c 100644 --- a/FactoryKernels/GB_ew__ge_int64.c +++ b/FactoryKernels/GB_ew__ge_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_int64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_int64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_int8.c b/FactoryKernels/GB_ew__ge_int8.c index 0832155558..305f251e28 100644 --- a/FactoryKernels/GB_ew__ge_int8.c +++ b/FactoryKernels/GB_ew__ge_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_int8) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_int8) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_uint16.c b/FactoryKernels/GB_ew__ge_uint16.c index 15fda25c22..fd8cfeeb1f 100644 --- a/FactoryKernels/GB_ew__ge_uint16.c +++ b/FactoryKernels/GB_ew__ge_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_uint16) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_uint16) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_uint32.c b/FactoryKernels/GB_ew__ge_uint32.c index 983cf2608b..064d710837 100644 --- a/FactoryKernels/GB_ew__ge_uint32.c +++ b/FactoryKernels/GB_ew__ge_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_uint32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_uint32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_uint64.c b/FactoryKernels/GB_ew__ge_uint64.c index 8f8c277788..ce83e7f128 100644 --- a/FactoryKernels/GB_ew__ge_uint64.c +++ b/FactoryKernels/GB_ew__ge_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_uint64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_uint64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ge_uint8.c b/FactoryKernels/GB_ew__ge_uint8.c index f41e66a94f..43d2c827ff 100644 --- a/FactoryKernels/GB_ew__ge_uint8.c +++ b/FactoryKernels/GB_ew__ge_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ge_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ge_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ge_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ge_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__ge_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__ge_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__ge_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__ge_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ge_uint8) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__ge_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ge_uint8) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__ge_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_bool.c b/FactoryKernels/GB_ew__gt_bool.c index d416d03543..c6c19fc110 100644 --- a/FactoryKernels/GB_ew__gt_bool.c +++ b/FactoryKernels/GB_ew__gt_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__gt_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__gt_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__gt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__gt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__gt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__gt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,7 +325,7 @@ GrB_Info GB (_AemultB_bitmap__gt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -373,11 +380,11 @@ GrB_Info GB (_bind2nd__gt_bool) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_bool) @@ -408,11 +415,11 @@ GrB_Info GB (_bind1st_tran__gt_bool) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_bool) @@ -435,3 +442,5 @@ GrB_Info GB (_bind2nd_tran__gt_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_fp32.c b/FactoryKernels/GB_ew__gt_fp32.c index 52db825690..fb1d7d7a9c 100644 --- a/FactoryKernels/GB_ew__gt_fp32.c +++ b/FactoryKernels/GB_ew__gt_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_fp32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_fp32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_fp64.c b/FactoryKernels/GB_ew__gt_fp64.c index 9486191382..aecc41bd03 100644 --- a/FactoryKernels/GB_ew__gt_fp64.c +++ b/FactoryKernels/GB_ew__gt_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_fp64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_fp64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_int16.c b/FactoryKernels/GB_ew__gt_int16.c index cbf5fd936f..214cd288e0 100644 --- a/FactoryKernels/GB_ew__gt_int16.c +++ b/FactoryKernels/GB_ew__gt_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_int16) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_int16) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_int32.c b/FactoryKernels/GB_ew__gt_int32.c index cddaaab76b..c8eb114bd7 100644 --- a/FactoryKernels/GB_ew__gt_int32.c +++ b/FactoryKernels/GB_ew__gt_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_int32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_int32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_int64.c b/FactoryKernels/GB_ew__gt_int64.c index 1f00760969..dc9f69b401 100644 --- a/FactoryKernels/GB_ew__gt_int64.c +++ b/FactoryKernels/GB_ew__gt_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_int64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_int64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_int8.c b/FactoryKernels/GB_ew__gt_int8.c index 56dabd3eaa..6b6f6b19a7 100644 --- a/FactoryKernels/GB_ew__gt_int8.c +++ b/FactoryKernels/GB_ew__gt_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_int8) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_int8) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_uint16.c b/FactoryKernels/GB_ew__gt_uint16.c index 4e03304ab5..3d20ff9859 100644 --- a/FactoryKernels/GB_ew__gt_uint16.c +++ b/FactoryKernels/GB_ew__gt_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_uint16) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_uint16) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_uint32.c b/FactoryKernels/GB_ew__gt_uint32.c index c7a5b4a49d..cfcad54165 100644 --- a/FactoryKernels/GB_ew__gt_uint32.c +++ b/FactoryKernels/GB_ew__gt_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_uint32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_uint32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_uint64.c b/FactoryKernels/GB_ew__gt_uint64.c index aa16b86b8f..6bfc1fda34 100644 --- a/FactoryKernels/GB_ew__gt_uint64.c +++ b/FactoryKernels/GB_ew__gt_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_uint64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_uint64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__gt_uint8.c b/FactoryKernels/GB_ew__gt_uint8.c index 20ef5537fb..7e598be14f 100644 --- a/FactoryKernels/GB_ew__gt_uint8.c +++ b/FactoryKernels/GB_ew__gt_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__gt_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__gt_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__gt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__gt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__gt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__gt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__gt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__gt_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__gt_uint8) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__gt_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__gt_uint8) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__gt_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__hypot_fp32.c b/FactoryKernels/GB_ew__hypot_fp32.c index da4a831d61..835c368eb4 100644 --- a/FactoryKernels/GB_ew__hypot_fp32.c +++ b/FactoryKernels/GB_ew__hypot_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__hypot_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__hypot_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__hypot_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__hypot_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__hypot_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__hypot_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__hypot_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__hypot_fp32) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__hypot_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__hypot_fp32) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__hypot_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__hypot_fp64.c b/FactoryKernels/GB_ew__hypot_fp64.c index dbe3d76c3c..e4ba3fd085 100644 --- a/FactoryKernels/GB_ew__hypot_fp64.c +++ b/FactoryKernels/GB_ew__hypot_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__hypot_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__hypot_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__hypot_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__hypot_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -224,7 +231,7 @@ GrB_Info GB (_AemultB_04__hypot_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_bitmap__hypot_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -305,11 +312,11 @@ GrB_Info GB (_bind2nd__hypot_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__hypot_fp64) @@ -340,11 +347,11 @@ GrB_Info GB (_bind1st_tran__hypot_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__hypot_fp64) @@ -367,3 +374,5 @@ GrB_Info GB (_bind2nd_tran__hypot_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__include.h b/FactoryKernels/GB_ew__include.h index 5d24256283..459559edbc 100644 --- a/FactoryKernels/GB_ew__include.h +++ b/FactoryKernels/GB_ew__include.h @@ -22633,12142 +22633,6 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc64) ) ; -GrB_Info GB (_Cewise_fulln__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_int8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_int8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_int16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_int16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_int32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_int32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_int64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_int64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_uint8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_uint8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_uint16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_uint16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_uint32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_uint32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_uint64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_uint64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_fp32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_fp32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_fp64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_fp64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_fc32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_fc32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_fc32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_fc32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_fc32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AaddB__iseq_fc64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__iseq_fc64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__iseq_fc64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__iseq_fc64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__iseq_fc64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_int8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_int8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_int16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_int16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_int32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_int32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_int64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_int64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_uint8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_uint8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_uint16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_uint16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_uint32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_uint32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_uint64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_uint64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_fp32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_fp32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isne_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_fp64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_fp64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AaddB__isne_fc32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_fc32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_fc32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_fc32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_fc32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AaddB__isne_fc64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isne_fc64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_04__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isne_fc64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isne_fc64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isne_fc64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_int8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_int8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_int16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_int16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_int32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_int32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_int64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_int64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_uint8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_uint8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_uint16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_uint16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_uint32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_uint32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_uint64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_uint64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_fp32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_fp32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isgt_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isgt_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isgt_fp64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isgt_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isgt_fp64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_int8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_int8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_int16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_int16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_int32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_int32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_int64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_int64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_uint8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_uint8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_uint16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_uint16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_uint32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_uint32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_uint64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_uint64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_fp32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_fp32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__islt_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__islt_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__islt_fp64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__islt_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__islt_fp64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_int8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_int8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_int16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_int16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_int32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_int32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_int64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_int64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_uint8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_uint8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_uint16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_uint16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_uint32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_uint32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_uint64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_uint64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_fp32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_fp32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isge_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isge_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isge_fp64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isge_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isge_fp64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_int8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_int8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_int16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_int16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_int32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_int32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_int64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_int64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_uint8) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_uint8) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_uint16) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_uint16) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_uint32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_uint32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_uint64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_uint64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_fp32) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_fp32) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - -GrB_Info GB (_Cewise_fulln__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) ; - -GrB_Info GB (_AxD__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_DxB__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) ; - -GrB_Info GB (_AaddB__isle_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AunionB__isle_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) ; - -GrB_Info GB (_AemultB_08__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) ; - -GrB_Info GB (_AemultB_02__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) ; - -GrB_Info GB (_AemultB_03__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) ; - -GrB_Info GB (_AemultB_04__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) ; - -GrB_Info GB (_AemultB_bitmap__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) ; - -GrB_Info GB (_bind1st__isle_fp64) -( - GB_void *Cx_output, - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) ; - -GrB_Info GB (_bind1st_tran__isle_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - -GrB_Info GB (_bind2nd__isle_fp64) -( - GB_void *Cx_output, - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) ; - -GrB_Info GB (_bind2nd_tran__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) ; - - GrB_Info GB (_Cewise_fulln__eq_bool) ( GrB_Matrix C, diff --git a/FactoryKernels/GB_ew__iseq_fc32.c b/FactoryKernels/GB_ew__iseq_fc32.c deleted file mode 100644 index 3e1e1f6739..0000000000 --- a/FactoryKernels/GB_ew__iseq_fc32.c +++ /dev/null @@ -1,369 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = GB_FC32_iseq (x, y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t - -// A matrix: -#define GB_A_TYPE GxB_FC32_t -#define GB_A2TYPE GxB_FC32_t -#define GB_DECLAREA(aij) GxB_FC32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE GxB_FC32_t -#define GB_B2TYPE GxB_FC32_t -#define GB_DECLAREB(bij) GxB_FC32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE GxB_FC32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_FC32) || defined(GxB_NO_ISEQ_FC32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_fc32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_fc32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_fc32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_fc32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_fc32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_fc64.c b/FactoryKernels/GB_ew__iseq_fc64.c deleted file mode 100644 index db46484890..0000000000 --- a/FactoryKernels/GB_ew__iseq_fc64.c +++ /dev/null @@ -1,369 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = GB_FC64_iseq (x, y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t - -// A matrix: -#define GB_A_TYPE GxB_FC64_t -#define GB_A2TYPE GxB_FC64_t -#define GB_DECLAREA(aij) GxB_FC64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE GxB_FC64_t -#define GB_B2TYPE GxB_FC64_t -#define GB_DECLAREB(bij) GxB_FC64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE GxB_FC64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_FC64) || defined(GxB_NO_ISEQ_FC64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_fc64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_fc64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_fc64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_fc64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_fc64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_fp32.c b/FactoryKernels/GB_ew__iseq_fp32.c deleted file mode 100644 index cc6c9123f3..0000000000 --- a/FactoryKernels/GB_ew__iseq_fp32.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float - -// A matrix: -#define GB_A_TYPE float -#define GB_A2TYPE float -#define GB_DECLAREA(aij) float aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE float -#define GB_B2TYPE float -#define GB_DECLAREB(bij) float bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE float - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_FP32) || defined(GxB_NO_ISEQ_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_fp32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_fp32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_fp64.c b/FactoryKernels/GB_ew__iseq_fp64.c deleted file mode 100644 index d4dc2cfb32..0000000000 --- a/FactoryKernels/GB_ew__iseq_fp64.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double - -// A matrix: -#define GB_A_TYPE double -#define GB_A2TYPE double -#define GB_DECLAREA(aij) double aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE double -#define GB_B2TYPE double -#define GB_DECLAREB(bij) double bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE double - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_FP64) || defined(GxB_NO_ISEQ_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_fp64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_fp64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_int16.c b/FactoryKernels/GB_ew__iseq_int16.c deleted file mode 100644 index 01aec022cb..0000000000 --- a/FactoryKernels/GB_ew__iseq_int16.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t - -// A matrix: -#define GB_A_TYPE int16_t -#define GB_A2TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int16_t -#define GB_B2TYPE int16_t -#define GB_DECLAREB(bij) int16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_INT16) || defined(GxB_NO_ISEQ_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_int16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_int16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_int32.c b/FactoryKernels/GB_ew__iseq_int32.c deleted file mode 100644 index 62fc530f60..0000000000 --- a/FactoryKernels/GB_ew__iseq_int32.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t - -// A matrix: -#define GB_A_TYPE int32_t -#define GB_A2TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int32_t -#define GB_B2TYPE int32_t -#define GB_DECLAREB(bij) int32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_INT32) || defined(GxB_NO_ISEQ_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_int32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_int32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_int64.c b/FactoryKernels/GB_ew__iseq_int64.c deleted file mode 100644 index 964dabbef3..0000000000 --- a/FactoryKernels/GB_ew__iseq_int64.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t - -// A matrix: -#define GB_A_TYPE int64_t -#define GB_A2TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int64_t -#define GB_B2TYPE int64_t -#define GB_DECLAREB(bij) int64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_INT64) || defined(GxB_NO_ISEQ_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_int64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_int64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_int8.c b/FactoryKernels/GB_ew__iseq_int8.c deleted file mode 100644 index a0c57d39b1..0000000000 --- a/FactoryKernels/GB_ew__iseq_int8.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t - -// A matrix: -#define GB_A_TYPE int8_t -#define GB_A2TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int8_t -#define GB_B2TYPE int8_t -#define GB_DECLAREB(bij) int8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_INT8) || defined(GxB_NO_ISEQ_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_int8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_int8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_uint16.c b/FactoryKernels/GB_ew__iseq_uint16.c deleted file mode 100644 index 352e43d0e9..0000000000 --- a/FactoryKernels/GB_ew__iseq_uint16.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t - -// A matrix: -#define GB_A_TYPE uint16_t -#define GB_A2TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint16_t -#define GB_B2TYPE uint16_t -#define GB_DECLAREB(bij) uint16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISEQ_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_uint16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_uint16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_uint32.c b/FactoryKernels/GB_ew__iseq_uint32.c deleted file mode 100644 index f0cee1cd55..0000000000 --- a/FactoryKernels/GB_ew__iseq_uint32.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t - -// A matrix: -#define GB_A_TYPE uint32_t -#define GB_A2TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint32_t -#define GB_B2TYPE uint32_t -#define GB_DECLAREB(bij) uint32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISEQ_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_uint32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_uint32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_uint64.c b/FactoryKernels/GB_ew__iseq_uint64.c deleted file mode 100644 index 8e7661fbec..0000000000 --- a/FactoryKernels/GB_ew__iseq_uint64.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t - -// A matrix: -#define GB_A_TYPE uint64_t -#define GB_A2TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint64_t -#define GB_B2TYPE uint64_t -#define GB_DECLAREB(bij) uint64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISEQ_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_uint64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_uint64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__iseq_uint8.c b/FactoryKernels/GB_ew__iseq_uint8.c deleted file mode 100644 index 6e89f16184..0000000000 --- a/FactoryKernels/GB_ew__iseq_uint8.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) == (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t - -// A matrix: -#define GB_A_TYPE uint8_t -#define GB_A2TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint8_t -#define GB_B2TYPE uint8_t -#define GB_DECLAREB(bij) uint8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISEQ) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISEQ_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__iseq_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__iseq_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__iseq_uint8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__iseq_uint8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__iseq_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__iseq_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_fp32.c b/FactoryKernels/GB_ew__isge_fp32.c deleted file mode 100644 index 67d3334d8d..0000000000 --- a/FactoryKernels/GB_ew__isge_fp32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float - -// A matrix: -#define GB_A_TYPE float -#define GB_A2TYPE float -#define GB_DECLAREA(aij) float aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE float -#define GB_B2TYPE float -#define GB_DECLAREB(bij) float bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE float - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_FP32) || defined(GxB_NO_ISGE_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_fp32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_fp32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_fp64.c b/FactoryKernels/GB_ew__isge_fp64.c deleted file mode 100644 index 87030c84bb..0000000000 --- a/FactoryKernels/GB_ew__isge_fp64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double - -// A matrix: -#define GB_A_TYPE double -#define GB_A2TYPE double -#define GB_DECLAREA(aij) double aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE double -#define GB_B2TYPE double -#define GB_DECLAREB(bij) double bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE double - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_FP64) || defined(GxB_NO_ISGE_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_fp64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_fp64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_int16.c b/FactoryKernels/GB_ew__isge_int16.c deleted file mode 100644 index 641bea91b7..0000000000 --- a/FactoryKernels/GB_ew__isge_int16.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t - -// A matrix: -#define GB_A_TYPE int16_t -#define GB_A2TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int16_t -#define GB_B2TYPE int16_t -#define GB_DECLAREB(bij) int16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_INT16) || defined(GxB_NO_ISGE_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_int16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_int16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_int32.c b/FactoryKernels/GB_ew__isge_int32.c deleted file mode 100644 index 195c01ffa6..0000000000 --- a/FactoryKernels/GB_ew__isge_int32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t - -// A matrix: -#define GB_A_TYPE int32_t -#define GB_A2TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int32_t -#define GB_B2TYPE int32_t -#define GB_DECLAREB(bij) int32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_INT32) || defined(GxB_NO_ISGE_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_int32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_int32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_int64.c b/FactoryKernels/GB_ew__isge_int64.c deleted file mode 100644 index d3463cfe2a..0000000000 --- a/FactoryKernels/GB_ew__isge_int64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t - -// A matrix: -#define GB_A_TYPE int64_t -#define GB_A2TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int64_t -#define GB_B2TYPE int64_t -#define GB_DECLAREB(bij) int64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_INT64) || defined(GxB_NO_ISGE_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_int64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_int64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_int8.c b/FactoryKernels/GB_ew__isge_int8.c deleted file mode 100644 index 96d59aa139..0000000000 --- a/FactoryKernels/GB_ew__isge_int8.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t - -// A matrix: -#define GB_A_TYPE int8_t -#define GB_A2TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int8_t -#define GB_B2TYPE int8_t -#define GB_DECLAREB(bij) int8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_INT8) || defined(GxB_NO_ISGE_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_int8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_int8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_uint16.c b/FactoryKernels/GB_ew__isge_uint16.c deleted file mode 100644 index f057c4ba1f..0000000000 --- a/FactoryKernels/GB_ew__isge_uint16.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t - -// A matrix: -#define GB_A_TYPE uint16_t -#define GB_A2TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint16_t -#define GB_B2TYPE uint16_t -#define GB_DECLAREB(bij) uint16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISGE_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_uint16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_uint16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_uint32.c b/FactoryKernels/GB_ew__isge_uint32.c deleted file mode 100644 index 19a1746a60..0000000000 --- a/FactoryKernels/GB_ew__isge_uint32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t - -// A matrix: -#define GB_A_TYPE uint32_t -#define GB_A2TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint32_t -#define GB_B2TYPE uint32_t -#define GB_DECLAREB(bij) uint32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISGE_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_uint32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_uint32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_uint64.c b/FactoryKernels/GB_ew__isge_uint64.c deleted file mode 100644 index bcdd646010..0000000000 --- a/FactoryKernels/GB_ew__isge_uint64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t - -// A matrix: -#define GB_A_TYPE uint64_t -#define GB_A2TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint64_t -#define GB_B2TYPE uint64_t -#define GB_DECLAREB(bij) uint64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISGE_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_uint64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_uint64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isge_uint8.c b/FactoryKernels/GB_ew__isge_uint8.c deleted file mode 100644 index f70258549d..0000000000 --- a/FactoryKernels/GB_ew__isge_uint8.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) >= (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t - -// A matrix: -#define GB_A_TYPE uint8_t -#define GB_A2TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint8_t -#define GB_B2TYPE uint8_t -#define GB_DECLAREB(bij) uint8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGE) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISGE_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isge_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isge_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isge_uint8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isge_uint8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isge_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isge_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_fp32.c b/FactoryKernels/GB_ew__isgt_fp32.c deleted file mode 100644 index 6cbb20b6ae..0000000000 --- a/FactoryKernels/GB_ew__isgt_fp32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float - -// A matrix: -#define GB_A_TYPE float -#define GB_A2TYPE float -#define GB_DECLAREA(aij) float aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE float -#define GB_B2TYPE float -#define GB_DECLAREB(bij) float bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE float - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_FP32) || defined(GxB_NO_ISGT_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_fp32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_fp32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_fp64.c b/FactoryKernels/GB_ew__isgt_fp64.c deleted file mode 100644 index 8bca3f618a..0000000000 --- a/FactoryKernels/GB_ew__isgt_fp64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double - -// A matrix: -#define GB_A_TYPE double -#define GB_A2TYPE double -#define GB_DECLAREA(aij) double aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE double -#define GB_B2TYPE double -#define GB_DECLAREB(bij) double bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE double - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_FP64) || defined(GxB_NO_ISGT_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_fp64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_fp64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_int16.c b/FactoryKernels/GB_ew__isgt_int16.c deleted file mode 100644 index 60ff2d0bde..0000000000 --- a/FactoryKernels/GB_ew__isgt_int16.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t - -// A matrix: -#define GB_A_TYPE int16_t -#define GB_A2TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int16_t -#define GB_B2TYPE int16_t -#define GB_DECLAREB(bij) int16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_INT16) || defined(GxB_NO_ISGT_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_int16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_int16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_int32.c b/FactoryKernels/GB_ew__isgt_int32.c deleted file mode 100644 index d46f672b40..0000000000 --- a/FactoryKernels/GB_ew__isgt_int32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t - -// A matrix: -#define GB_A_TYPE int32_t -#define GB_A2TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int32_t -#define GB_B2TYPE int32_t -#define GB_DECLAREB(bij) int32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_INT32) || defined(GxB_NO_ISGT_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_int32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_int32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_int64.c b/FactoryKernels/GB_ew__isgt_int64.c deleted file mode 100644 index 47b13c7d5c..0000000000 --- a/FactoryKernels/GB_ew__isgt_int64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t - -// A matrix: -#define GB_A_TYPE int64_t -#define GB_A2TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int64_t -#define GB_B2TYPE int64_t -#define GB_DECLAREB(bij) int64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_INT64) || defined(GxB_NO_ISGT_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_int64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_int64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_int8.c b/FactoryKernels/GB_ew__isgt_int8.c deleted file mode 100644 index 33ccd8be77..0000000000 --- a/FactoryKernels/GB_ew__isgt_int8.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t - -// A matrix: -#define GB_A_TYPE int8_t -#define GB_A2TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int8_t -#define GB_B2TYPE int8_t -#define GB_DECLAREB(bij) int8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_INT8) || defined(GxB_NO_ISGT_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_int8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_int8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_uint16.c b/FactoryKernels/GB_ew__isgt_uint16.c deleted file mode 100644 index 4f868fd43e..0000000000 --- a/FactoryKernels/GB_ew__isgt_uint16.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t - -// A matrix: -#define GB_A_TYPE uint16_t -#define GB_A2TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint16_t -#define GB_B2TYPE uint16_t -#define GB_DECLAREB(bij) uint16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISGT_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_uint16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_uint16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_uint32.c b/FactoryKernels/GB_ew__isgt_uint32.c deleted file mode 100644 index 60f5c7e2c0..0000000000 --- a/FactoryKernels/GB_ew__isgt_uint32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t - -// A matrix: -#define GB_A_TYPE uint32_t -#define GB_A2TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint32_t -#define GB_B2TYPE uint32_t -#define GB_DECLAREB(bij) uint32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISGT_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_uint32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_uint32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_uint64.c b/FactoryKernels/GB_ew__isgt_uint64.c deleted file mode 100644 index f82daf85fd..0000000000 --- a/FactoryKernels/GB_ew__isgt_uint64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t - -// A matrix: -#define GB_A_TYPE uint64_t -#define GB_A2TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint64_t -#define GB_B2TYPE uint64_t -#define GB_DECLAREB(bij) uint64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISGT_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_uint64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_uint64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isgt_uint8.c b/FactoryKernels/GB_ew__isgt_uint8.c deleted file mode 100644 index c7452d6647..0000000000 --- a/FactoryKernels/GB_ew__isgt_uint8.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) > (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t - -// A matrix: -#define GB_A_TYPE uint8_t -#define GB_A2TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint8_t -#define GB_B2TYPE uint8_t -#define GB_DECLAREB(bij) uint8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISGT) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISGT_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isgt_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isgt_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isgt_uint8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isgt_uint8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isgt_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isgt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_fp32.c b/FactoryKernels/GB_ew__isle_fp32.c deleted file mode 100644 index 5487903eda..0000000000 --- a/FactoryKernels/GB_ew__isle_fp32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float - -// A matrix: -#define GB_A_TYPE float -#define GB_A2TYPE float -#define GB_DECLAREA(aij) float aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE float -#define GB_B2TYPE float -#define GB_DECLAREB(bij) float bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE float - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_FP32) || defined(GxB_NO_ISLE_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_fp32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_fp32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_fp64.c b/FactoryKernels/GB_ew__isle_fp64.c deleted file mode 100644 index ee5c1ab311..0000000000 --- a/FactoryKernels/GB_ew__isle_fp64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double - -// A matrix: -#define GB_A_TYPE double -#define GB_A2TYPE double -#define GB_DECLAREA(aij) double aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE double -#define GB_B2TYPE double -#define GB_DECLAREB(bij) double bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE double - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_FP64) || defined(GxB_NO_ISLE_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_fp64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_fp64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_int16.c b/FactoryKernels/GB_ew__isle_int16.c deleted file mode 100644 index 67b15a3220..0000000000 --- a/FactoryKernels/GB_ew__isle_int16.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t - -// A matrix: -#define GB_A_TYPE int16_t -#define GB_A2TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int16_t -#define GB_B2TYPE int16_t -#define GB_DECLAREB(bij) int16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_INT16) || defined(GxB_NO_ISLE_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_int16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_int16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_int32.c b/FactoryKernels/GB_ew__isle_int32.c deleted file mode 100644 index a98acd1444..0000000000 --- a/FactoryKernels/GB_ew__isle_int32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t - -// A matrix: -#define GB_A_TYPE int32_t -#define GB_A2TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int32_t -#define GB_B2TYPE int32_t -#define GB_DECLAREB(bij) int32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_INT32) || defined(GxB_NO_ISLE_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_int32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_int32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_int64.c b/FactoryKernels/GB_ew__isle_int64.c deleted file mode 100644 index 99d3f35cf5..0000000000 --- a/FactoryKernels/GB_ew__isle_int64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t - -// A matrix: -#define GB_A_TYPE int64_t -#define GB_A2TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int64_t -#define GB_B2TYPE int64_t -#define GB_DECLAREB(bij) int64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_INT64) || defined(GxB_NO_ISLE_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_int64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_int64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_int8.c b/FactoryKernels/GB_ew__isle_int8.c deleted file mode 100644 index 7aed4782db..0000000000 --- a/FactoryKernels/GB_ew__isle_int8.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t - -// A matrix: -#define GB_A_TYPE int8_t -#define GB_A2TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int8_t -#define GB_B2TYPE int8_t -#define GB_DECLAREB(bij) int8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_INT8) || defined(GxB_NO_ISLE_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_int8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_int8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_uint16.c b/FactoryKernels/GB_ew__isle_uint16.c deleted file mode 100644 index 74875ace28..0000000000 --- a/FactoryKernels/GB_ew__isle_uint16.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t - -// A matrix: -#define GB_A_TYPE uint16_t -#define GB_A2TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint16_t -#define GB_B2TYPE uint16_t -#define GB_DECLAREB(bij) uint16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISLE_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_uint16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_uint16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_uint32.c b/FactoryKernels/GB_ew__isle_uint32.c deleted file mode 100644 index 955bc7f227..0000000000 --- a/FactoryKernels/GB_ew__isle_uint32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t - -// A matrix: -#define GB_A_TYPE uint32_t -#define GB_A2TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint32_t -#define GB_B2TYPE uint32_t -#define GB_DECLAREB(bij) uint32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISLE_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_uint32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_uint32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_uint64.c b/FactoryKernels/GB_ew__isle_uint64.c deleted file mode 100644 index 082b514a51..0000000000 --- a/FactoryKernels/GB_ew__isle_uint64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t - -// A matrix: -#define GB_A_TYPE uint64_t -#define GB_A2TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint64_t -#define GB_B2TYPE uint64_t -#define GB_DECLAREB(bij) uint64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISLE_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_uint64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_uint64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isle_uint8.c b/FactoryKernels/GB_ew__isle_uint8.c deleted file mode 100644 index d43ded6729..0000000000 --- a/FactoryKernels/GB_ew__isle_uint8.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) <= (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t - -// A matrix: -#define GB_A_TYPE uint8_t -#define GB_A2TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint8_t -#define GB_B2TYPE uint8_t -#define GB_DECLAREB(bij) uint8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLE) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISLE_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isle_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isle_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isle_uint8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isle_uint8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isle_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isle_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_fp32.c b/FactoryKernels/GB_ew__islt_fp32.c deleted file mode 100644 index d4929d57c0..0000000000 --- a/FactoryKernels/GB_ew__islt_fp32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float - -// A matrix: -#define GB_A_TYPE float -#define GB_A2TYPE float -#define GB_DECLAREA(aij) float aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE float -#define GB_B2TYPE float -#define GB_DECLAREB(bij) float bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE float - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_FP32) || defined(GxB_NO_ISLT_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_fp32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_fp32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_fp64.c b/FactoryKernels/GB_ew__islt_fp64.c deleted file mode 100644 index 44149adae5..0000000000 --- a/FactoryKernels/GB_ew__islt_fp64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double - -// A matrix: -#define GB_A_TYPE double -#define GB_A2TYPE double -#define GB_DECLAREA(aij) double aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE double -#define GB_B2TYPE double -#define GB_DECLAREB(bij) double bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE double - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_FP64) || defined(GxB_NO_ISLT_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_fp64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_fp64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_int16.c b/FactoryKernels/GB_ew__islt_int16.c deleted file mode 100644 index accd2a089c..0000000000 --- a/FactoryKernels/GB_ew__islt_int16.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t - -// A matrix: -#define GB_A_TYPE int16_t -#define GB_A2TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int16_t -#define GB_B2TYPE int16_t -#define GB_DECLAREB(bij) int16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_INT16) || defined(GxB_NO_ISLT_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_int16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_int16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_int32.c b/FactoryKernels/GB_ew__islt_int32.c deleted file mode 100644 index f5eadc6930..0000000000 --- a/FactoryKernels/GB_ew__islt_int32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t - -// A matrix: -#define GB_A_TYPE int32_t -#define GB_A2TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int32_t -#define GB_B2TYPE int32_t -#define GB_DECLAREB(bij) int32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_INT32) || defined(GxB_NO_ISLT_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_int32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_int32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_int64.c b/FactoryKernels/GB_ew__islt_int64.c deleted file mode 100644 index bc697bfd71..0000000000 --- a/FactoryKernels/GB_ew__islt_int64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t - -// A matrix: -#define GB_A_TYPE int64_t -#define GB_A2TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int64_t -#define GB_B2TYPE int64_t -#define GB_DECLAREB(bij) int64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_INT64) || defined(GxB_NO_ISLT_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_int64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_int64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_int8.c b/FactoryKernels/GB_ew__islt_int8.c deleted file mode 100644 index e6635d7352..0000000000 --- a/FactoryKernels/GB_ew__islt_int8.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t - -// A matrix: -#define GB_A_TYPE int8_t -#define GB_A2TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int8_t -#define GB_B2TYPE int8_t -#define GB_DECLAREB(bij) int8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_INT8) || defined(GxB_NO_ISLT_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_int8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_int8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_uint16.c b/FactoryKernels/GB_ew__islt_uint16.c deleted file mode 100644 index 60216a3ea7..0000000000 --- a/FactoryKernels/GB_ew__islt_uint16.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t - -// A matrix: -#define GB_A_TYPE uint16_t -#define GB_A2TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint16_t -#define GB_B2TYPE uint16_t -#define GB_DECLAREB(bij) uint16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISLT_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_uint16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_uint16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_uint32.c b/FactoryKernels/GB_ew__islt_uint32.c deleted file mode 100644 index 7835aadc7d..0000000000 --- a/FactoryKernels/GB_ew__islt_uint32.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t - -// A matrix: -#define GB_A_TYPE uint32_t -#define GB_A2TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint32_t -#define GB_B2TYPE uint32_t -#define GB_DECLAREB(bij) uint32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISLT_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_uint32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_uint32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_uint64.c b/FactoryKernels/GB_ew__islt_uint64.c deleted file mode 100644 index 86fcd14807..0000000000 --- a/FactoryKernels/GB_ew__islt_uint64.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t - -// A matrix: -#define GB_A_TYPE uint64_t -#define GB_A2TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint64_t -#define GB_B2TYPE uint64_t -#define GB_DECLAREB(bij) uint64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISLT_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_uint64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_uint64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__islt_uint8.c b/FactoryKernels/GB_ew__islt_uint8.c deleted file mode 100644 index f235d40d73..0000000000 --- a/FactoryKernels/GB_ew__islt_uint8.c +++ /dev/null @@ -1,437 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) < (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t - -// A matrix: -#define GB_A_TYPE uint8_t -#define GB_A2TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint8_t -#define GB_B2TYPE uint8_t -#define GB_DECLAREB(bij) uint8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISLT) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISLT_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__islt_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__islt_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is bitmap/full and B is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_03__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *B_ek_slicing, - const int B_ntasks, - const int B_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_03_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__islt_uint8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__islt_uint8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__islt_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__islt_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_fc32.c b/FactoryKernels/GB_ew__isne_fc32.c deleted file mode 100644 index a4fc36ed39..0000000000 --- a/FactoryKernels/GB_ew__isne_fc32.c +++ /dev/null @@ -1,369 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = GB_FC32_isne (x, y) -#define GB_Z_TYPE GxB_FC32_t -#define GB_X_TYPE GxB_FC32_t -#define GB_Y_TYPE GxB_FC32_t - -// A matrix: -#define GB_A_TYPE GxB_FC32_t -#define GB_A2TYPE GxB_FC32_t -#define GB_DECLAREA(aij) GxB_FC32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE GxB_FC32_t -#define GB_B2TYPE GxB_FC32_t -#define GB_DECLAREB(bij) GxB_FC32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE GxB_FC32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_FC32) || defined(GxB_NO_ISNE_FC32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_fc32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_fc32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_fc32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_fc32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_fc32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_fc32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_fc64.c b/FactoryKernels/GB_ew__isne_fc64.c deleted file mode 100644 index 27eb21e175..0000000000 --- a/FactoryKernels/GB_ew__isne_fc64.c +++ /dev/null @@ -1,369 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = GB_FC64_isne (x, y) -#define GB_Z_TYPE GxB_FC64_t -#define GB_X_TYPE GxB_FC64_t -#define GB_Y_TYPE GxB_FC64_t - -// A matrix: -#define GB_A_TYPE GxB_FC64_t -#define GB_A2TYPE GxB_FC64_t -#define GB_DECLAREA(aij) GxB_FC64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE GxB_FC64_t -#define GB_B2TYPE GxB_FC64_t -#define GB_DECLAREB(bij) GxB_FC64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE GxB_FC64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_FC64) || defined(GxB_NO_ISNE_FC64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_fc64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_fc64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_fc64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_fc64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_fc64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_fc64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_fp32.c b/FactoryKernels/GB_ew__isne_fp32.c deleted file mode 100644 index 16e65573bf..0000000000 --- a/FactoryKernels/GB_ew__isne_fp32.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE float -#define GB_X_TYPE float -#define GB_Y_TYPE float - -// A matrix: -#define GB_A_TYPE float -#define GB_A2TYPE float -#define GB_DECLAREA(aij) float aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE float -#define GB_B2TYPE float -#define GB_DECLAREB(bij) float bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE float - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_FP32) || defined(GxB_NO_ISNE_FP32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_fp32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_fp32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_fp32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_fp32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_fp32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_fp64.c b/FactoryKernels/GB_ew__isne_fp64.c deleted file mode 100644 index 302548b548..0000000000 --- a/FactoryKernels/GB_ew__isne_fp64.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE double -#define GB_X_TYPE double -#define GB_Y_TYPE double - -// A matrix: -#define GB_A_TYPE double -#define GB_A2TYPE double -#define GB_DECLAREA(aij) double aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE double -#define GB_B2TYPE double -#define GB_DECLAREB(bij) double bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE double - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_FP64) || defined(GxB_NO_ISNE_FP64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_fp64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_fp64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_fp64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_fp64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_fp64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_int16.c b/FactoryKernels/GB_ew__isne_int16.c deleted file mode 100644 index fc193ea449..0000000000 --- a/FactoryKernels/GB_ew__isne_int16.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE int16_t -#define GB_X_TYPE int16_t -#define GB_Y_TYPE int16_t - -// A matrix: -#define GB_A_TYPE int16_t -#define GB_A2TYPE int16_t -#define GB_DECLAREA(aij) int16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int16_t -#define GB_B2TYPE int16_t -#define GB_DECLAREB(bij) int16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_INT16) || defined(GxB_NO_ISNE_INT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_int16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_int16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_int16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_int16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_int16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_int32.c b/FactoryKernels/GB_ew__isne_int32.c deleted file mode 100644 index 71e1873ca6..0000000000 --- a/FactoryKernels/GB_ew__isne_int32.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE int32_t -#define GB_X_TYPE int32_t -#define GB_Y_TYPE int32_t - -// A matrix: -#define GB_A_TYPE int32_t -#define GB_A2TYPE int32_t -#define GB_DECLAREA(aij) int32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int32_t -#define GB_B2TYPE int32_t -#define GB_DECLAREB(bij) int32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_INT32) || defined(GxB_NO_ISNE_INT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_int32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_int32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_int32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_int32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_int32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_int64.c b/FactoryKernels/GB_ew__isne_int64.c deleted file mode 100644 index e9f80660da..0000000000 --- a/FactoryKernels/GB_ew__isne_int64.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE int64_t -#define GB_X_TYPE int64_t -#define GB_Y_TYPE int64_t - -// A matrix: -#define GB_A_TYPE int64_t -#define GB_A2TYPE int64_t -#define GB_DECLAREA(aij) int64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int64_t -#define GB_B2TYPE int64_t -#define GB_DECLAREB(bij) int64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_INT64) || defined(GxB_NO_ISNE_INT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_int64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_int64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_int64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_int64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_int64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_int8.c b/FactoryKernels/GB_ew__isne_int8.c deleted file mode 100644 index d2fc258e01..0000000000 --- a/FactoryKernels/GB_ew__isne_int8.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE int8_t -#define GB_X_TYPE int8_t -#define GB_Y_TYPE int8_t - -// A matrix: -#define GB_A_TYPE int8_t -#define GB_A2TYPE int8_t -#define GB_DECLAREA(aij) int8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE int8_t -#define GB_B2TYPE int8_t -#define GB_DECLAREB(bij) int8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE int8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_INT8) || defined(GxB_NO_ISNE_INT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_int8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_int8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_int8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_int8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_int8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_uint16.c b/FactoryKernels/GB_ew__isne_uint16.c deleted file mode 100644 index d401f4945c..0000000000 --- a/FactoryKernels/GB_ew__isne_uint16.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE uint16_t -#define GB_X_TYPE uint16_t -#define GB_Y_TYPE uint16_t - -// A matrix: -#define GB_A_TYPE uint16_t -#define GB_A2TYPE uint16_t -#define GB_DECLAREA(aij) uint16_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint16_t -#define GB_B2TYPE uint16_t -#define GB_DECLAREB(bij) uint16_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint16_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_UINT16) || defined(GxB_NO_ISNE_UINT16)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_uint16) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_uint16) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_uint16) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_uint16) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_uint16) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_uint32.c b/FactoryKernels/GB_ew__isne_uint32.c deleted file mode 100644 index 0e72ac253a..0000000000 --- a/FactoryKernels/GB_ew__isne_uint32.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE uint32_t -#define GB_X_TYPE uint32_t -#define GB_Y_TYPE uint32_t - -// A matrix: -#define GB_A_TYPE uint32_t -#define GB_A2TYPE uint32_t -#define GB_DECLAREA(aij) uint32_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint32_t -#define GB_B2TYPE uint32_t -#define GB_DECLAREB(bij) uint32_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint32_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_UINT32) || defined(GxB_NO_ISNE_UINT32)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_uint32) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_uint32) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_uint32) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_uint32) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_uint32) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_uint64.c b/FactoryKernels/GB_ew__isne_uint64.c deleted file mode 100644 index 0f0fb0acc0..0000000000 --- a/FactoryKernels/GB_ew__isne_uint64.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE uint64_t -#define GB_X_TYPE uint64_t -#define GB_Y_TYPE uint64_t - -// A matrix: -#define GB_A_TYPE uint64_t -#define GB_A2TYPE uint64_t -#define GB_DECLAREA(aij) uint64_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint64_t -#define GB_B2TYPE uint64_t -#define GB_DECLAREB(bij) uint64_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint64_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_UINT64) || defined(GxB_NO_ISNE_UINT64)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_uint64) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_uint64) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_uint64) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_uint64) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_uint64) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__isne_uint8.c b/FactoryKernels/GB_ew__isne_uint8.c deleted file mode 100644 index ce1959819d..0000000000 --- a/FactoryKernels/GB_ew__isne_uint8.c +++ /dev/null @@ -1,411 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ew: ewise kernels for each built-in binary operator -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "GB_control.h" -#include "ewise/GB_emult.h" -#include "slice/GB_ek_slice.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "FactoryKernels/GB_ew__include.h" - -// operator: -#define GB_BINOP(z,x,y,i,j) z = ((x) != (y)) -#define GB_Z_TYPE uint8_t -#define GB_X_TYPE uint8_t -#define GB_Y_TYPE uint8_t - -// A matrix: -#define GB_A_TYPE uint8_t -#define GB_A2TYPE uint8_t -#define GB_DECLAREA(aij) uint8_t aij -#define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [(A_iso) ? 0 : (pA)] - -// B matrix: -#define GB_B_TYPE uint8_t -#define GB_B2TYPE uint8_t -#define GB_DECLAREB(bij) uint8_t bij -#define GB_GETB(bij,Bx,pB,B_iso) bij = Bx [(B_iso) ? 0 : (pB)] - -// C matrix: -#define GB_C_TYPE uint8_t - -// disable this operator and use the generic case if these conditions hold -#if (defined(GxB_NO_ISNE) || defined(GxB_NO_UINT8) || defined(GxB_NO_ISNE_UINT8)) -#define GB_DISABLE 1 -#else -#define GB_DISABLE 0 -#endif - -#include "ewise/include/GB_ewise_shared_definitions.h" - -//------------------------------------------------------------------------------ -// C = A+B, all 3 matrices dense -//------------------------------------------------------------------------------ - -GrB_Info GB (_Cewise_fulln__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix B, - const int nthreads -) -{ - #include "ewise/template/GB_ewise_fulln_template.c" - return (GrB_SUCCESS) ; -} - -//------------------------------------------------------------------------------ -// C = A*D, column scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_AxD__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GrB_Matrix D, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_colscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = D*B, row scale with diagonal D matrix -//------------------------------------------------------------------------------ - -GrB_Info GB (_DxB__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix D, - const GrB_Matrix B, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "mxm/template/GB_rowscale_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseAdd: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AaddB__isne_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #define GB_IS_EWISEUNION 0 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseUnion: C=A+B, C=A+B, C=A+B -//------------------------------------------------------------------------------ - -GrB_Info GB (_AunionB__isne_uint8) -( - GrB_Matrix C, - const int C_sparsity, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const GB_void *alpha_scalar_in, - const GB_void *beta_scalar_in, - const bool Ch_is_Mh, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_ek_slicing, - const int A_nthreads, - const int A_ntasks, - const int64_t *restrict B_ek_slicing, - const int B_nthreads, - const int B_ntasks -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE alpha_scalar = (*((GB_X_TYPE *) alpha_scalar_in)) ; - GB_Y_TYPE beta_scalar = (*((GB_Y_TYPE *) beta_scalar_in )) ; - #define GB_IS_EWISEUNION 1 - // for the "easy mask" condition: - bool M_is_A = GB_all_aliased (M, A) ; - bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, or C=A.*B where C is sparse/hyper -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_08__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict C_to_M, - const int64_t *restrict C_to_A, - const int64_t *restrict C_to_B, - const GB_task_struct *restrict TaskList, - const int C_ntasks, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_08_meta.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C<#> = A.*B when A is sparse/hyper and B is bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_02__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *A_ek_slicing, - const int A_ntasks, - const int A_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_02_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C = A.*B, M sparse/hyper, A and B bitmap/full -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_04__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *restrict Cp_kfirst, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_04_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// eWiseMult: C=A.*B, C=A.*B, C=A.*B where C is bitmap -//------------------------------------------------------------------------------ - -GrB_Info GB (_AemultB_bitmap__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix M, - const bool Mask_struct, - const bool Mask_comp, - const GrB_Matrix A, - const GrB_Matrix B, - const int64_t *M_ek_slicing, - const int M_ntasks, - const int M_nthreads, - const int C_nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "ewise/template/GB_emult_bitmap_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (x,Bx): apply a binary operator to a matrix with scalar bind1st -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind1st__isne_uint8) -( - GB_void *Cx_output, // Cx and Bx may be aliased - const GB_void *x_input, - const GB_void *Bx_input, - const int8_t *restrict Bb, - int64_t bnz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind1st_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// Cx = op (Ax,y): apply a binary operator to a matrix with scalar bind2nd -//------------------------------------------------------------------------------ - -GrB_Info GB (_bind2nd__isne_uint8) -( - GB_void *Cx_output, // Cx and Ax may be aliased - const GB_void *Ax_input, - const GB_void *y_input, - const int8_t *restrict Ab, - int64_t anz, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - #include "apply/template/GB_apply_bind2nd_template.c" - return (GrB_SUCCESS) ; - #endif -} - -//------------------------------------------------------------------------------ -// C = op (x, A'): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (x, aij) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ -} - -GrB_Info GB (_bind1st_tran__isne_uint8) -( - GrB_Matrix C, - const GB_void *x_input, - const GrB_Matrix A, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #define GB_BIND_1ST - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_X_TYPE x = (*((const GB_X_TYPE *) x_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif - #undef GB_BIND_1ST -} - -//------------------------------------------------------------------------------ -// C = op (A', y): transpose and apply a binary operator -//------------------------------------------------------------------------------ - -// cij = op (aij, y) -#undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ -} - -GrB_Info GB (_bind2nd_tran__isne_uint8) -( - GrB_Matrix C, - const GrB_Matrix A, - const GB_void *y_input, - int64_t *restrict *Workspaces, - const int64_t *restrict A_slice, - int nworkspaces, - int nthreads -) -{ - #if GB_DISABLE - return (GrB_NO_VALUE) ; - #else - GB_Y_TYPE y = (*((const GB_Y_TYPE *) y_input)) ; - #include "transpose/template/GB_transpose_template.c" - return (GrB_SUCCESS) ; - #endif -} - diff --git a/FactoryKernels/GB_ew__land_bool.c b/FactoryKernels/GB_ew__land_bool.c index 0458e9460e..e9b302066e 100644 --- a/FactoryKernels/GB_ew__land_bool.c +++ b/FactoryKernels/GB_ew__land_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_bool) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_bool) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_bool) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_bool) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_fp32.c b/FactoryKernels/GB_ew__land_fp32.c index c7e0c8d79e..e5da632c7a 100644 --- a/FactoryKernels/GB_ew__land_fp32.c +++ b/FactoryKernels/GB_ew__land_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_fp32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_fp32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_fp64.c b/FactoryKernels/GB_ew__land_fp64.c index dc53821f52..6e1f2908db 100644 --- a/FactoryKernels/GB_ew__land_fp64.c +++ b/FactoryKernels/GB_ew__land_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_fp64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_fp64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_int16.c b/FactoryKernels/GB_ew__land_int16.c index e04bc07f58..a25a084f9a 100644 --- a/FactoryKernels/GB_ew__land_int16.c +++ b/FactoryKernels/GB_ew__land_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_int16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_int16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_int32.c b/FactoryKernels/GB_ew__land_int32.c index 99e237ddb5..b711a2bf36 100644 --- a/FactoryKernels/GB_ew__land_int32.c +++ b/FactoryKernels/GB_ew__land_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_int32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_int32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_int64.c b/FactoryKernels/GB_ew__land_int64.c index 123b886ceb..505617f2b9 100644 --- a/FactoryKernels/GB_ew__land_int64.c +++ b/FactoryKernels/GB_ew__land_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_int64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_int64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_int8.c b/FactoryKernels/GB_ew__land_int8.c index 059c87045b..56e896463d 100644 --- a/FactoryKernels/GB_ew__land_int8.c +++ b/FactoryKernels/GB_ew__land_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_int8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_int8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_uint16.c b/FactoryKernels/GB_ew__land_uint16.c index be300ac94e..df80e60763 100644 --- a/FactoryKernels/GB_ew__land_uint16.c +++ b/FactoryKernels/GB_ew__land_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_uint16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_uint16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_uint32.c b/FactoryKernels/GB_ew__land_uint32.c index 37b7c36049..c9eb188f60 100644 --- a/FactoryKernels/GB_ew__land_uint32.c +++ b/FactoryKernels/GB_ew__land_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_uint32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_uint32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_uint64.c b/FactoryKernels/GB_ew__land_uint64.c index 98b425c47e..c33424440f 100644 --- a/FactoryKernels/GB_ew__land_uint64.c +++ b/FactoryKernels/GB_ew__land_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_uint64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_uint64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__land_uint8.c b/FactoryKernels/GB_ew__land_uint8.c index e7146ab78e..0a94570e06 100644 --- a/FactoryKernels/GB_ew__land_uint8.c +++ b/FactoryKernels/GB_ew__land_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__land_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__land_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__land_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__land_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__land_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__land_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__land_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__land_uint8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__land_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__land_uint8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__land_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ldexp_fp32.c b/FactoryKernels/GB_ew__ldexp_fp32.c index 1299b81dad..94bb3f5f32 100644 --- a/FactoryKernels/GB_ew__ldexp_fp32.c +++ b/FactoryKernels/GB_ew__ldexp_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__ldexp_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__ldexp_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__ldexp_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__ldexp_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__ldexp_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__ldexp_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__ldexp_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__ldexp_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ldexp_fp32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__ldexp_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ldexp_fp32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__ldexp_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ldexp_fp64.c b/FactoryKernels/GB_ew__ldexp_fp64.c index 9e72e70adc..0a65c7f966 100644 --- a/FactoryKernels/GB_ew__ldexp_fp64.c +++ b/FactoryKernels/GB_ew__ldexp_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__ldexp_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__ldexp_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__ldexp_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__ldexp_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__ldexp_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__ldexp_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__ldexp_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__ldexp_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ldexp_fp64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__ldexp_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ldexp_fp64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__ldexp_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_bool.c b/FactoryKernels/GB_ew__le_bool.c index 67eada093a..8c6c38994e 100644 --- a/FactoryKernels/GB_ew__le_bool.c +++ b/FactoryKernels/GB_ew__le_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__le_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__le_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__le_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__le_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__le_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__le_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,7 +325,7 @@ GrB_Info GB (_AemultB_bitmap__le_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -373,11 +380,11 @@ GrB_Info GB (_bind2nd__le_bool) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_bool) @@ -408,11 +415,11 @@ GrB_Info GB (_bind1st_tran__le_bool) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_bool) @@ -435,3 +442,5 @@ GrB_Info GB (_bind2nd_tran__le_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_fp32.c b/FactoryKernels/GB_ew__le_fp32.c index 3ccec71082..74a6771734 100644 --- a/FactoryKernels/GB_ew__le_fp32.c +++ b/FactoryKernels/GB_ew__le_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_fp32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_fp32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_fp64.c b/FactoryKernels/GB_ew__le_fp64.c index fe3f2e3047..8d8081a45d 100644 --- a/FactoryKernels/GB_ew__le_fp64.c +++ b/FactoryKernels/GB_ew__le_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_fp64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_fp64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_int16.c b/FactoryKernels/GB_ew__le_int16.c index a242e3560c..0fdda64108 100644 --- a/FactoryKernels/GB_ew__le_int16.c +++ b/FactoryKernels/GB_ew__le_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_int16) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_int16) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_int32.c b/FactoryKernels/GB_ew__le_int32.c index 138a0efd9a..9aa74dade3 100644 --- a/FactoryKernels/GB_ew__le_int32.c +++ b/FactoryKernels/GB_ew__le_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_int32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_int32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_int64.c b/FactoryKernels/GB_ew__le_int64.c index 7e098157c0..6a76b1c61c 100644 --- a/FactoryKernels/GB_ew__le_int64.c +++ b/FactoryKernels/GB_ew__le_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_int64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_int64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_int8.c b/FactoryKernels/GB_ew__le_int8.c index fd2022d4a2..7871509d4d 100644 --- a/FactoryKernels/GB_ew__le_int8.c +++ b/FactoryKernels/GB_ew__le_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_int8) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_int8) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_uint16.c b/FactoryKernels/GB_ew__le_uint16.c index 43049f096d..1335d1c6e6 100644 --- a/FactoryKernels/GB_ew__le_uint16.c +++ b/FactoryKernels/GB_ew__le_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_uint16) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_uint16) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_uint32.c b/FactoryKernels/GB_ew__le_uint32.c index 48456f5406..50ba6c2044 100644 --- a/FactoryKernels/GB_ew__le_uint32.c +++ b/FactoryKernels/GB_ew__le_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_uint32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_uint32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_uint64.c b/FactoryKernels/GB_ew__le_uint64.c index 62e69b78e9..2c8654306c 100644 --- a/FactoryKernels/GB_ew__le_uint64.c +++ b/FactoryKernels/GB_ew__le_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_uint64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_uint64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__le_uint8.c b/FactoryKernels/GB_ew__le_uint8.c index 6e365e4c1b..df6431fced 100644 --- a/FactoryKernels/GB_ew__le_uint8.c +++ b/FactoryKernels/GB_ew__le_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__le_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__le_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__le_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__le_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__le_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__le_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__le_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__le_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__le_uint8) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__le_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__le_uint8) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__le_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_bool.c b/FactoryKernels/GB_ew__lor_bool.c index 4c6ff9d4af..1ecea612d3 100644 --- a/FactoryKernels/GB_ew__lor_bool.c +++ b/FactoryKernels/GB_ew__lor_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_bool) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_bool) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_bool) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_bool) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_fp32.c b/FactoryKernels/GB_ew__lor_fp32.c index fbbbb37574..09c6bc6554 100644 --- a/FactoryKernels/GB_ew__lor_fp32.c +++ b/FactoryKernels/GB_ew__lor_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_fp32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_fp32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_fp64.c b/FactoryKernels/GB_ew__lor_fp64.c index c347f10d9f..e042c289e8 100644 --- a/FactoryKernels/GB_ew__lor_fp64.c +++ b/FactoryKernels/GB_ew__lor_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_fp64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_fp64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_int16.c b/FactoryKernels/GB_ew__lor_int16.c index 043d5c0e63..84bcbe1f23 100644 --- a/FactoryKernels/GB_ew__lor_int16.c +++ b/FactoryKernels/GB_ew__lor_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_int16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_int16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_int32.c b/FactoryKernels/GB_ew__lor_int32.c index b3a70ecf85..b93d5962d9 100644 --- a/FactoryKernels/GB_ew__lor_int32.c +++ b/FactoryKernels/GB_ew__lor_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_int32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_int32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_int64.c b/FactoryKernels/GB_ew__lor_int64.c index 26084efb92..ae3db5c954 100644 --- a/FactoryKernels/GB_ew__lor_int64.c +++ b/FactoryKernels/GB_ew__lor_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_int64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_int64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_int8.c b/FactoryKernels/GB_ew__lor_int8.c index 85a2b0e035..2909f3ab03 100644 --- a/FactoryKernels/GB_ew__lor_int8.c +++ b/FactoryKernels/GB_ew__lor_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_int8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_int8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_uint16.c b/FactoryKernels/GB_ew__lor_uint16.c index 01129bf85a..fac0c8f217 100644 --- a/FactoryKernels/GB_ew__lor_uint16.c +++ b/FactoryKernels/GB_ew__lor_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_uint16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_uint16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_uint32.c b/FactoryKernels/GB_ew__lor_uint32.c index b3beafe422..8f50715989 100644 --- a/FactoryKernels/GB_ew__lor_uint32.c +++ b/FactoryKernels/GB_ew__lor_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_uint32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_uint32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_uint64.c b/FactoryKernels/GB_ew__lor_uint64.c index 24e3ac754f..151bf6848b 100644 --- a/FactoryKernels/GB_ew__lor_uint64.c +++ b/FactoryKernels/GB_ew__lor_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_uint64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_uint64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lor_uint8.c b/FactoryKernels/GB_ew__lor_uint8.c index 67ce9e5b07..8f7850a4ee 100644 --- a/FactoryKernels/GB_ew__lor_uint8.c +++ b/FactoryKernels/GB_ew__lor_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lor_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lor_uint8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lor_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lor_uint8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_bool.c b/FactoryKernels/GB_ew__lt_bool.c index 8879059cde..021d1b6a99 100644 --- a/FactoryKernels/GB_ew__lt_bool.c +++ b/FactoryKernels/GB_ew__lt_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lt_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lt_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -267,7 +274,7 @@ GrB_Info GB (_AemultB_03__lt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_04__lt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -318,7 +325,7 @@ GrB_Info GB (_AemultB_bitmap__lt_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -373,11 +380,11 @@ GrB_Info GB (_bind2nd__lt_bool) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_bool) @@ -408,11 +415,11 @@ GrB_Info GB (_bind1st_tran__lt_bool) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_bool) @@ -435,3 +442,5 @@ GrB_Info GB (_bind2nd_tran__lt_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_fp32.c b/FactoryKernels/GB_ew__lt_fp32.c index 9540f6b066..0af17da183 100644 --- a/FactoryKernels/GB_ew__lt_fp32.c +++ b/FactoryKernels/GB_ew__lt_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_fp32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_fp32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_fp64.c b/FactoryKernels/GB_ew__lt_fp64.c index ef397a9744..a2d6351e7f 100644 --- a/FactoryKernels/GB_ew__lt_fp64.c +++ b/FactoryKernels/GB_ew__lt_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_fp64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_fp64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_int16.c b/FactoryKernels/GB_ew__lt_int16.c index 40e5733731..cd0464d266 100644 --- a/FactoryKernels/GB_ew__lt_int16.c +++ b/FactoryKernels/GB_ew__lt_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_int16) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_int16) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_int32.c b/FactoryKernels/GB_ew__lt_int32.c index ee5793403d..a69f662096 100644 --- a/FactoryKernels/GB_ew__lt_int32.c +++ b/FactoryKernels/GB_ew__lt_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_int32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_int32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_int64.c b/FactoryKernels/GB_ew__lt_int64.c index 839f814ebf..ee8427ad01 100644 --- a/FactoryKernels/GB_ew__lt_int64.c +++ b/FactoryKernels/GB_ew__lt_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_int64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_int64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_int8.c b/FactoryKernels/GB_ew__lt_int8.c index 59ac2367ca..2cc972ef79 100644 --- a/FactoryKernels/GB_ew__lt_int8.c +++ b/FactoryKernels/GB_ew__lt_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_int8) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_int8) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_uint16.c b/FactoryKernels/GB_ew__lt_uint16.c index 743095709d..dadc4ec616 100644 --- a/FactoryKernels/GB_ew__lt_uint16.c +++ b/FactoryKernels/GB_ew__lt_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_uint16) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_uint16) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_uint32.c b/FactoryKernels/GB_ew__lt_uint32.c index 57fd276caf..b3e0b2b9ee 100644 --- a/FactoryKernels/GB_ew__lt_uint32.c +++ b/FactoryKernels/GB_ew__lt_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_uint32) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_uint32) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_uint64.c b/FactoryKernels/GB_ew__lt_uint64.c index 3a094fa2dd..c13868fb89 100644 --- a/FactoryKernels/GB_ew__lt_uint64.c +++ b/FactoryKernels/GB_ew__lt_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_uint64) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_uint64) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lt_uint8.c b/FactoryKernels/GB_ew__lt_uint8.c index 02e4d77ed9..fc41a59318 100644 --- a/FactoryKernels/GB_ew__lt_uint8.c +++ b/FactoryKernels/GB_ew__lt_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__lt_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__lt_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__lt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__lt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -270,7 +277,7 @@ GrB_Info GB (_AemultB_03__lt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_04__lt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -321,7 +328,7 @@ GrB_Info GB (_AemultB_bitmap__lt_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -376,11 +383,11 @@ GrB_Info GB (_bind2nd__lt_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lt_uint8) @@ -411,11 +418,11 @@ GrB_Info GB (_bind1st_tran__lt_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lt_uint8) @@ -438,3 +445,5 @@ GrB_Info GB (_bind2nd_tran__lt_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_bool.c b/FactoryKernels/GB_ew__lxor_bool.c index 47b9b905bb..4d59537a0f 100644 --- a/FactoryKernels/GB_ew__lxor_bool.c +++ b/FactoryKernels/GB_ew__lxor_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_bool) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_bool) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_bool) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_bool) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_fp32.c b/FactoryKernels/GB_ew__lxor_fp32.c index 46dfd4bbdc..56ebcab9fe 100644 --- a/FactoryKernels/GB_ew__lxor_fp32.c +++ b/FactoryKernels/GB_ew__lxor_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_fp32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_fp32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_fp64.c b/FactoryKernels/GB_ew__lxor_fp64.c index b0f31f8d1e..7acc184e9e 100644 --- a/FactoryKernels/GB_ew__lxor_fp64.c +++ b/FactoryKernels/GB_ew__lxor_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_fp64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_fp64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_int16.c b/FactoryKernels/GB_ew__lxor_int16.c index 564df8ab12..dbee985210 100644 --- a/FactoryKernels/GB_ew__lxor_int16.c +++ b/FactoryKernels/GB_ew__lxor_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_int16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_int16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_int32.c b/FactoryKernels/GB_ew__lxor_int32.c index 6f959d0900..954bb2263a 100644 --- a/FactoryKernels/GB_ew__lxor_int32.c +++ b/FactoryKernels/GB_ew__lxor_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_int32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_int32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_int64.c b/FactoryKernels/GB_ew__lxor_int64.c index d1ddb95baf..c49eec7a62 100644 --- a/FactoryKernels/GB_ew__lxor_int64.c +++ b/FactoryKernels/GB_ew__lxor_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_int64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_int64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_int8.c b/FactoryKernels/GB_ew__lxor_int8.c index 9e029b7647..0c868518f7 100644 --- a/FactoryKernels/GB_ew__lxor_int8.c +++ b/FactoryKernels/GB_ew__lxor_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_int8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_int8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_uint16.c b/FactoryKernels/GB_ew__lxor_uint16.c index 57c3dcc3ba..69463db3a2 100644 --- a/FactoryKernels/GB_ew__lxor_uint16.c +++ b/FactoryKernels/GB_ew__lxor_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_uint16) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_uint16) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_uint32.c b/FactoryKernels/GB_ew__lxor_uint32.c index a67038f630..9020b6b5df 100644 --- a/FactoryKernels/GB_ew__lxor_uint32.c +++ b/FactoryKernels/GB_ew__lxor_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_uint32) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_uint32) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_uint64.c b/FactoryKernels/GB_ew__lxor_uint64.c index 16ca8160a3..27bf2a6160 100644 --- a/FactoryKernels/GB_ew__lxor_uint64.c +++ b/FactoryKernels/GB_ew__lxor_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_uint64) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_uint64) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__lxor_uint8.c b/FactoryKernels/GB_ew__lxor_uint8.c index b5a50f8658..80fe2e9a56 100644 --- a/FactoryKernels/GB_ew__lxor_uint8.c +++ b/FactoryKernels/GB_ew__lxor_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -140,7 +147,7 @@ GrB_Info GB (_AaddB__lxor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -187,7 +194,7 @@ GrB_Info GB (_AunionB__lxor_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -215,7 +222,7 @@ GrB_Info GB (_AemultB_08__lxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -241,7 +248,7 @@ GrB_Info GB (_AemultB_02__lxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +273,7 @@ GrB_Info GB (_AemultB_04__lxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -292,7 +299,7 @@ GrB_Info GB (_AemultB_bitmap__lxor_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -347,11 +354,11 @@ GrB_Info GB (_bind2nd__lxor_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__lxor_uint8) @@ -382,11 +389,11 @@ GrB_Info GB (_bind1st_tran__lxor_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__lxor_uint8) @@ -409,3 +416,5 @@ GrB_Info GB (_bind2nd_tran__lxor_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_fp32.c b/FactoryKernels/GB_ew__max_fp32.c index 91dd4c715c..2ff172b6a6 100644 --- a/FactoryKernels/GB_ew__max_fp32.c +++ b/FactoryKernels/GB_ew__max_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_fp32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_fp32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_fp64.c b/FactoryKernels/GB_ew__max_fp64.c index 46e972fb7c..103e51c153 100644 --- a/FactoryKernels/GB_ew__max_fp64.c +++ b/FactoryKernels/GB_ew__max_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_fp64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_fp64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_int16.c b/FactoryKernels/GB_ew__max_int16.c index 0675234bde..2b7f501a1f 100644 --- a/FactoryKernels/GB_ew__max_int16.c +++ b/FactoryKernels/GB_ew__max_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_int16) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_int16) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_int32.c b/FactoryKernels/GB_ew__max_int32.c index f49bbb9f78..2d796c54db 100644 --- a/FactoryKernels/GB_ew__max_int32.c +++ b/FactoryKernels/GB_ew__max_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_int32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_int32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_int64.c b/FactoryKernels/GB_ew__max_int64.c index 01444c9fd5..34d42e6016 100644 --- a/FactoryKernels/GB_ew__max_int64.c +++ b/FactoryKernels/GB_ew__max_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_int64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_int64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_int8.c b/FactoryKernels/GB_ew__max_int8.c index 64e817d846..49faecab1b 100644 --- a/FactoryKernels/GB_ew__max_int8.c +++ b/FactoryKernels/GB_ew__max_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_int8) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_int8) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_uint16.c b/FactoryKernels/GB_ew__max_uint16.c index d3a77eaf15..5dce9f3e8d 100644 --- a/FactoryKernels/GB_ew__max_uint16.c +++ b/FactoryKernels/GB_ew__max_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_uint16) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_uint16) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_uint32.c b/FactoryKernels/GB_ew__max_uint32.c index 70245a6f3e..7a092c9533 100644 --- a/FactoryKernels/GB_ew__max_uint32.c +++ b/FactoryKernels/GB_ew__max_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_uint32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_uint32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_uint64.c b/FactoryKernels/GB_ew__max_uint64.c index 52253a12a9..b918d20f00 100644 --- a/FactoryKernels/GB_ew__max_uint64.c +++ b/FactoryKernels/GB_ew__max_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_uint64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_uint64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__max_uint8.c b/FactoryKernels/GB_ew__max_uint8.c index 6e0c2d05cb..beb8090eb5 100644 --- a/FactoryKernels/GB_ew__max_uint8.c +++ b/FactoryKernels/GB_ew__max_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__max_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__max_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__max_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__max_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__max_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__max_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__max_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__max_uint8) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__max_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__max_uint8) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__max_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_fp32.c b/FactoryKernels/GB_ew__min_fp32.c index 2ce82b5edc..9c4ddd8448 100644 --- a/FactoryKernels/GB_ew__min_fp32.c +++ b/FactoryKernels/GB_ew__min_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_fp32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_fp32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_fp64.c b/FactoryKernels/GB_ew__min_fp64.c index ff0741ce1d..da061bbb13 100644 --- a/FactoryKernels/GB_ew__min_fp64.c +++ b/FactoryKernels/GB_ew__min_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_fp64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_fp64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_int16.c b/FactoryKernels/GB_ew__min_int16.c index de2c4a51e0..8b3f692e12 100644 --- a/FactoryKernels/GB_ew__min_int16.c +++ b/FactoryKernels/GB_ew__min_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_int16) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_int16) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_int32.c b/FactoryKernels/GB_ew__min_int32.c index a215ea2bfb..cd7eb6e64f 100644 --- a/FactoryKernels/GB_ew__min_int32.c +++ b/FactoryKernels/GB_ew__min_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_int32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_int32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_int64.c b/FactoryKernels/GB_ew__min_int64.c index 88bce293af..0e05370f33 100644 --- a/FactoryKernels/GB_ew__min_int64.c +++ b/FactoryKernels/GB_ew__min_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_int64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_int64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_int8.c b/FactoryKernels/GB_ew__min_int8.c index 0bfc2af232..fade4a488d 100644 --- a/FactoryKernels/GB_ew__min_int8.c +++ b/FactoryKernels/GB_ew__min_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_int8) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_int8) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_uint16.c b/FactoryKernels/GB_ew__min_uint16.c index 12af390e81..309db8e00d 100644 --- a/FactoryKernels/GB_ew__min_uint16.c +++ b/FactoryKernels/GB_ew__min_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_uint16) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_uint16) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_uint32.c b/FactoryKernels/GB_ew__min_uint32.c index ec1f4c25fa..410abdf1ff 100644 --- a/FactoryKernels/GB_ew__min_uint32.c +++ b/FactoryKernels/GB_ew__min_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_uint32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_uint32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_uint64.c b/FactoryKernels/GB_ew__min_uint64.c index e883817e3d..90c739f634 100644 --- a/FactoryKernels/GB_ew__min_uint64.c +++ b/FactoryKernels/GB_ew__min_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_uint64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_uint64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__min_uint8.c b/FactoryKernels/GB_ew__min_uint8.c index 0502d1b9a4..3849cf2201 100644 --- a/FactoryKernels/GB_ew__min_uint8.c +++ b/FactoryKernels/GB_ew__min_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__min_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__min_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__min_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__min_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__min_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__min_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__min_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__min_uint8) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__min_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__min_uint8) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__min_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_fc32.c b/FactoryKernels/GB_ew__minus_fc32.c index 1cfadfee3e..15d49f8ae1 100644 --- a/FactoryKernels/GB_ew__minus_fc32.c +++ b/FactoryKernels/GB_ew__minus_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_fc32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_fc32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_fc64.c b/FactoryKernels/GB_ew__minus_fc64.c index efcf4e48c3..fc0d7691ab 100644 --- a/FactoryKernels/GB_ew__minus_fc64.c +++ b/FactoryKernels/GB_ew__minus_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_fc64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_fc64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_fp32.c b/FactoryKernels/GB_ew__minus_fp32.c index ee04b7dca9..98ed119300 100644 --- a/FactoryKernels/GB_ew__minus_fp32.c +++ b/FactoryKernels/GB_ew__minus_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_fp32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_fp32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_fp64.c b/FactoryKernels/GB_ew__minus_fp64.c index 6ec5c1b146..c9243f3630 100644 --- a/FactoryKernels/GB_ew__minus_fp64.c +++ b/FactoryKernels/GB_ew__minus_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_fp64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_fp64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_int16.c b/FactoryKernels/GB_ew__minus_int16.c index a1413f17b3..e54ae0d1bc 100644 --- a/FactoryKernels/GB_ew__minus_int16.c +++ b/FactoryKernels/GB_ew__minus_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_int16) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_int16) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_int32.c b/FactoryKernels/GB_ew__minus_int32.c index c4e7e72b1f..18f67c9069 100644 --- a/FactoryKernels/GB_ew__minus_int32.c +++ b/FactoryKernels/GB_ew__minus_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_int32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_int32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_int64.c b/FactoryKernels/GB_ew__minus_int64.c index 50b34cf886..6a13a33053 100644 --- a/FactoryKernels/GB_ew__minus_int64.c +++ b/FactoryKernels/GB_ew__minus_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_int64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_int64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_int8.c b/FactoryKernels/GB_ew__minus_int8.c index 673e6c33e7..bd6d7e36a7 100644 --- a/FactoryKernels/GB_ew__minus_int8.c +++ b/FactoryKernels/GB_ew__minus_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_int8) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_int8) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_uint16.c b/FactoryKernels/GB_ew__minus_uint16.c index d4ac997c98..fa612c682d 100644 --- a/FactoryKernels/GB_ew__minus_uint16.c +++ b/FactoryKernels/GB_ew__minus_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_uint16) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_uint16) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_uint32.c b/FactoryKernels/GB_ew__minus_uint32.c index b1f44a7e5f..b1e0950398 100644 --- a/FactoryKernels/GB_ew__minus_uint32.c +++ b/FactoryKernels/GB_ew__minus_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_uint32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_uint32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_uint64.c b/FactoryKernels/GB_ew__minus_uint64.c index afb956264c..c0fec09765 100644 --- a/FactoryKernels/GB_ew__minus_uint64.c +++ b/FactoryKernels/GB_ew__minus_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_uint64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_uint64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__minus_uint8.c b/FactoryKernels/GB_ew__minus_uint8.c index 52e5e2ac8e..904e44b00a 100644 --- a/FactoryKernels/GB_ew__minus_uint8.c +++ b/FactoryKernels/GB_ew__minus_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__minus_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__minus_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__minus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__minus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__minus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__minus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__minus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__minus_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__minus_uint8) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__minus_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__minus_uint8) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__minus_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_fc32.c b/FactoryKernels/GB_ew__ne_fc32.c index d4643b0eb0..a5c5029a31 100644 --- a/FactoryKernels/GB_ew__ne_fc32.c +++ b/FactoryKernels/GB_ew__ne_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -102,7 +109,7 @@ GrB_Info GB (_AaddB__ne_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -149,7 +156,7 @@ GrB_Info GB (_AunionB__ne_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -177,7 +184,7 @@ GrB_Info GB (_AemultB_08__ne_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -203,7 +210,7 @@ GrB_Info GB (_AemultB_02__ne_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -228,7 +235,7 @@ GrB_Info GB (_AemultB_04__ne_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -254,7 +261,7 @@ GrB_Info GB (_AemultB_bitmap__ne_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -309,11 +316,11 @@ GrB_Info GB (_bind2nd__ne_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_fc32) @@ -344,11 +351,11 @@ GrB_Info GB (_bind1st_tran__ne_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_fc32) @@ -371,3 +378,5 @@ GrB_Info GB (_bind2nd_tran__ne_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_fc64.c b/FactoryKernels/GB_ew__ne_fc64.c index 3614a0e701..c7aacbee3f 100644 --- a/FactoryKernels/GB_ew__ne_fc64.c +++ b/FactoryKernels/GB_ew__ne_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -102,7 +109,7 @@ GrB_Info GB (_AaddB__ne_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -149,7 +156,7 @@ GrB_Info GB (_AunionB__ne_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -177,7 +184,7 @@ GrB_Info GB (_AemultB_08__ne_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -203,7 +210,7 @@ GrB_Info GB (_AemultB_02__ne_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -228,7 +235,7 @@ GrB_Info GB (_AemultB_04__ne_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -254,7 +261,7 @@ GrB_Info GB (_AemultB_bitmap__ne_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -309,11 +316,11 @@ GrB_Info GB (_bind2nd__ne_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_fc64) @@ -344,11 +351,11 @@ GrB_Info GB (_bind1st_tran__ne_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_fc64) @@ -371,3 +378,5 @@ GrB_Info GB (_bind2nd_tran__ne_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_fp32.c b/FactoryKernels/GB_ew__ne_fp32.c index ab3d23e055..c4c4a82eae 100644 --- a/FactoryKernels/GB_ew__ne_fp32.c +++ b/FactoryKernels/GB_ew__ne_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_fp32) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_fp32) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_fp64.c b/FactoryKernels/GB_ew__ne_fp64.c index 26c637a01f..553e81f4a2 100644 --- a/FactoryKernels/GB_ew__ne_fp64.c +++ b/FactoryKernels/GB_ew__ne_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_fp64) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_fp64) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_int16.c b/FactoryKernels/GB_ew__ne_int16.c index 81b7591d8d..72806b313c 100644 --- a/FactoryKernels/GB_ew__ne_int16.c +++ b/FactoryKernels/GB_ew__ne_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_int16) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_int16) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_int32.c b/FactoryKernels/GB_ew__ne_int32.c index 6ecc8fe6e9..84265d7849 100644 --- a/FactoryKernels/GB_ew__ne_int32.c +++ b/FactoryKernels/GB_ew__ne_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_int32) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_int32) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_int64.c b/FactoryKernels/GB_ew__ne_int64.c index df6f7ce339..8d4dea0278 100644 --- a/FactoryKernels/GB_ew__ne_int64.c +++ b/FactoryKernels/GB_ew__ne_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_int64) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_int64) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_int8.c b/FactoryKernels/GB_ew__ne_int8.c index 76a50b000c..3009af41ad 100644 --- a/FactoryKernels/GB_ew__ne_int8.c +++ b/FactoryKernels/GB_ew__ne_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_int8) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_int8) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_uint16.c b/FactoryKernels/GB_ew__ne_uint16.c index dfe66cc560..6c065f5eaf 100644 --- a/FactoryKernels/GB_ew__ne_uint16.c +++ b/FactoryKernels/GB_ew__ne_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_uint16) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_uint16) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_uint32.c b/FactoryKernels/GB_ew__ne_uint32.c index 683f7b2e03..c71596b226 100644 --- a/FactoryKernels/GB_ew__ne_uint32.c +++ b/FactoryKernels/GB_ew__ne_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_uint32) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_uint32) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_uint64.c b/FactoryKernels/GB_ew__ne_uint64.c index 9ddabaf29d..f90250a8b8 100644 --- a/FactoryKernels/GB_ew__ne_uint64.c +++ b/FactoryKernels/GB_ew__ne_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_uint64) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_uint64) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__ne_uint8.c b/FactoryKernels/GB_ew__ne_uint8.c index 7f2a0ec4ce..6cb2ba2eab 100644 --- a/FactoryKernels/GB_ew__ne_uint8.c +++ b/FactoryKernels/GB_ew__ne_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -143,7 +150,7 @@ GrB_Info GB (_AaddB__ne_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -190,7 +197,7 @@ GrB_Info GB (_AunionB__ne_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -218,7 +225,7 @@ GrB_Info GB (_AemultB_08__ne_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -244,7 +251,7 @@ GrB_Info GB (_AemultB_02__ne_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -269,7 +276,7 @@ GrB_Info GB (_AemultB_04__ne_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -295,7 +302,7 @@ GrB_Info GB (_AemultB_bitmap__ne_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -350,11 +357,11 @@ GrB_Info GB (_bind2nd__ne_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__ne_uint8) @@ -385,11 +392,11 @@ GrB_Info GB (_bind1st_tran__ne_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__ne_uint8) @@ -412,3 +419,5 @@ GrB_Info GB (_bind2nd_tran__ne_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pair_bool.c b/FactoryKernels/GB_ew__pair_bool.c index 508544158c..ac1de284dc 100644 --- a/FactoryKernels/GB_ew__pair_bool.c +++ b/FactoryKernels/GB_ew__pair_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_bool) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_fc32.c b/FactoryKernels/GB_ew__pair_fc32.c index 754cff5b13..c5ecdcc294 100644 --- a/FactoryKernels/GB_ew__pair_fc32.c +++ b/FactoryKernels/GB_ew__pair_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_fc32) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_fc64.c b/FactoryKernels/GB_ew__pair_fc64.c index 2cfbc416f6..ff826791c0 100644 --- a/FactoryKernels/GB_ew__pair_fc64.c +++ b/FactoryKernels/GB_ew__pair_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_fc64) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_fp32.c b/FactoryKernels/GB_ew__pair_fp32.c index cfc56cdf6a..fce880a5c1 100644 --- a/FactoryKernels/GB_ew__pair_fp32.c +++ b/FactoryKernels/GB_ew__pair_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_fp32) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_fp64.c b/FactoryKernels/GB_ew__pair_fp64.c index e2522fdabb..be64057ba1 100644 --- a/FactoryKernels/GB_ew__pair_fp64.c +++ b/FactoryKernels/GB_ew__pair_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_fp64) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_int16.c b/FactoryKernels/GB_ew__pair_int16.c index 0181f2ab65..a2f6b3c442 100644 --- a/FactoryKernels/GB_ew__pair_int16.c +++ b/FactoryKernels/GB_ew__pair_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_int16) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_int32.c b/FactoryKernels/GB_ew__pair_int32.c index 8d4723ec8e..f30b2ef309 100644 --- a/FactoryKernels/GB_ew__pair_int32.c +++ b/FactoryKernels/GB_ew__pair_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_int32) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_int64.c b/FactoryKernels/GB_ew__pair_int64.c index 2e0b62ae8f..3eb3d7ed41 100644 --- a/FactoryKernels/GB_ew__pair_int64.c +++ b/FactoryKernels/GB_ew__pair_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_int64) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_int8.c b/FactoryKernels/GB_ew__pair_int8.c index 3398d38a01..bd505dcdf9 100644 --- a/FactoryKernels/GB_ew__pair_int8.c +++ b/FactoryKernels/GB_ew__pair_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_int8) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_uint16.c b/FactoryKernels/GB_ew__pair_uint16.c index 934edc5c17..f376dbf297 100644 --- a/FactoryKernels/GB_ew__pair_uint16.c +++ b/FactoryKernels/GB_ew__pair_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_uint16) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_uint32.c b/FactoryKernels/GB_ew__pair_uint32.c index e7d6f85aef..c96e099f18 100644 --- a/FactoryKernels/GB_ew__pair_uint32.c +++ b/FactoryKernels/GB_ew__pair_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_uint32) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_uint64.c b/FactoryKernels/GB_ew__pair_uint64.c index 6d07f208db..2f6bbebdd6 100644 --- a/FactoryKernels/GB_ew__pair_uint64.c +++ b/FactoryKernels/GB_ew__pair_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_uint64) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__pair_uint8.c b/FactoryKernels/GB_ew__pair_uint8.c index 6a331271d7..a47a12b3c6 100644 --- a/FactoryKernels/GB_ew__pair_uint8.c +++ b/FactoryKernels/GB_ew__pair_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pair_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -107,3 +114,5 @@ GrB_Info GB (_AaddB__pair_uint8) // eWiseUnion: C=A+B, C=A+B, C=A+B //------------------------------------------------------------------------------ +#endif + diff --git a/FactoryKernels/GB_ew__plus_fc32.c b/FactoryKernels/GB_ew__plus_fc32.c index 392fdc983e..7db4d22892 100644 --- a/FactoryKernels/GB_ew__plus_fc32.c +++ b/FactoryKernels/GB_ew__plus_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_fc32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_fc32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_fc64.c b/FactoryKernels/GB_ew__plus_fc64.c index 994092db75..3dfb66bf88 100644 --- a/FactoryKernels/GB_ew__plus_fc64.c +++ b/FactoryKernels/GB_ew__plus_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_fc64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_fc64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_fp32.c b/FactoryKernels/GB_ew__plus_fp32.c index 1019f4a036..869020d722 100644 --- a/FactoryKernels/GB_ew__plus_fp32.c +++ b/FactoryKernels/GB_ew__plus_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_fp32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_fp32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_fp64.c b/FactoryKernels/GB_ew__plus_fp64.c index d34b674f82..16d21d1f46 100644 --- a/FactoryKernels/GB_ew__plus_fp64.c +++ b/FactoryKernels/GB_ew__plus_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_fp64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_fp64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_int16.c b/FactoryKernels/GB_ew__plus_int16.c index b729ea7764..6c19d808a2 100644 --- a/FactoryKernels/GB_ew__plus_int16.c +++ b/FactoryKernels/GB_ew__plus_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_int16) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_int16) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_int32.c b/FactoryKernels/GB_ew__plus_int32.c index 4f637c657c..3c382de53d 100644 --- a/FactoryKernels/GB_ew__plus_int32.c +++ b/FactoryKernels/GB_ew__plus_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_int32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_int32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_int64.c b/FactoryKernels/GB_ew__plus_int64.c index f101db5b74..546920109b 100644 --- a/FactoryKernels/GB_ew__plus_int64.c +++ b/FactoryKernels/GB_ew__plus_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_int64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_int64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_int8.c b/FactoryKernels/GB_ew__plus_int8.c index 87424c25b5..c17db371b2 100644 --- a/FactoryKernels/GB_ew__plus_int8.c +++ b/FactoryKernels/GB_ew__plus_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_int8) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_int8) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_uint16.c b/FactoryKernels/GB_ew__plus_uint16.c index 1a68a7e019..2011ba0cd5 100644 --- a/FactoryKernels/GB_ew__plus_uint16.c +++ b/FactoryKernels/GB_ew__plus_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_uint16) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_uint16) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_uint32.c b/FactoryKernels/GB_ew__plus_uint32.c index 89c795f91e..3dca91b1d5 100644 --- a/FactoryKernels/GB_ew__plus_uint32.c +++ b/FactoryKernels/GB_ew__plus_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_uint32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_uint32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_uint64.c b/FactoryKernels/GB_ew__plus_uint64.c index c9c0f0fb81..f9dc55ef5e 100644 --- a/FactoryKernels/GB_ew__plus_uint64.c +++ b/FactoryKernels/GB_ew__plus_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_uint64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_uint64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__plus_uint8.c b/FactoryKernels/GB_ew__plus_uint8.c index c7cbbddda4..73c4d67f40 100644 --- a/FactoryKernels/GB_ew__plus_uint8.c +++ b/FactoryKernels/GB_ew__plus_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__plus_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__plus_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__plus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__plus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__plus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__plus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__plus_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__plus_uint8) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__plus_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__plus_uint8) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__plus_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_fc32.c b/FactoryKernels/GB_ew__pow_fc32.c index 594b61704b..e75a594249 100644 --- a/FactoryKernels/GB_ew__pow_fc32.c +++ b/FactoryKernels/GB_ew__pow_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_fc32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_fc32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_fc64.c b/FactoryKernels/GB_ew__pow_fc64.c index 03ad8465d4..4f9c56de5f 100644 --- a/FactoryKernels/GB_ew__pow_fc64.c +++ b/FactoryKernels/GB_ew__pow_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_fc64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_fc64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_fp32.c b/FactoryKernels/GB_ew__pow_fp32.c index 97fee78874..fae64f6b87 100644 --- a/FactoryKernels/GB_ew__pow_fp32.c +++ b/FactoryKernels/GB_ew__pow_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_fp32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_fp32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_fp64.c b/FactoryKernels/GB_ew__pow_fp64.c index da01e0b8ab..0c483ef4c0 100644 --- a/FactoryKernels/GB_ew__pow_fp64.c +++ b/FactoryKernels/GB_ew__pow_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_fp64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_fp64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_int16.c b/FactoryKernels/GB_ew__pow_int16.c index ea9ef7b09b..0136dd0344 100644 --- a/FactoryKernels/GB_ew__pow_int16.c +++ b/FactoryKernels/GB_ew__pow_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_int16) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_int16) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_int32.c b/FactoryKernels/GB_ew__pow_int32.c index b33f1e33f9..d82b7f7665 100644 --- a/FactoryKernels/GB_ew__pow_int32.c +++ b/FactoryKernels/GB_ew__pow_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_int32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_int32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_int64.c b/FactoryKernels/GB_ew__pow_int64.c index 081f22316e..385e3a507c 100644 --- a/FactoryKernels/GB_ew__pow_int64.c +++ b/FactoryKernels/GB_ew__pow_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_int64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_int64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_int8.c b/FactoryKernels/GB_ew__pow_int8.c index b258a86572..e27a37d43a 100644 --- a/FactoryKernels/GB_ew__pow_int8.c +++ b/FactoryKernels/GB_ew__pow_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_int8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_int8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_uint16.c b/FactoryKernels/GB_ew__pow_uint16.c index 3db538d00a..0a5820fab2 100644 --- a/FactoryKernels/GB_ew__pow_uint16.c +++ b/FactoryKernels/GB_ew__pow_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_uint16) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_uint16) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_uint32.c b/FactoryKernels/GB_ew__pow_uint32.c index 4a573d0d68..2d3a8981f3 100644 --- a/FactoryKernels/GB_ew__pow_uint32.c +++ b/FactoryKernels/GB_ew__pow_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_uint32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_uint32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_uint64.c b/FactoryKernels/GB_ew__pow_uint64.c index f5c0254750..02638d59d2 100644 --- a/FactoryKernels/GB_ew__pow_uint64.c +++ b/FactoryKernels/GB_ew__pow_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_uint64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_uint64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__pow_uint8.c b/FactoryKernels/GB_ew__pow_uint8.c index 702d623a49..ee63e0c4ce 100644 --- a/FactoryKernels/GB_ew__pow_uint8.c +++ b/FactoryKernels/GB_ew__pow_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__pow_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__pow_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__pow_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__pow_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__pow_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__pow_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__pow_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__pow_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__pow_uint8) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__pow_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__pow_uint8) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__pow_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_fc32.c b/FactoryKernels/GB_ew__rdiv_fc32.c index 12797658b7..15c9a4404c 100644 --- a/FactoryKernels/GB_ew__rdiv_fc32.c +++ b/FactoryKernels/GB_ew__rdiv_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_fc32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_fc32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_fc64.c b/FactoryKernels/GB_ew__rdiv_fc64.c index 251abd2d59..eb9ac11ffe 100644 --- a/FactoryKernels/GB_ew__rdiv_fc64.c +++ b/FactoryKernels/GB_ew__rdiv_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_fc64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_fc64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_fp32.c b/FactoryKernels/GB_ew__rdiv_fp32.c index 61bad7802e..3c402b18cc 100644 --- a/FactoryKernels/GB_ew__rdiv_fp32.c +++ b/FactoryKernels/GB_ew__rdiv_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_fp32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_fp32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_fp64.c b/FactoryKernels/GB_ew__rdiv_fp64.c index b22f306b35..b27b1e72b4 100644 --- a/FactoryKernels/GB_ew__rdiv_fp64.c +++ b/FactoryKernels/GB_ew__rdiv_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_fp64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_fp64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_int16.c b/FactoryKernels/GB_ew__rdiv_int16.c index 2bb2ee6309..ef8b4cd4a4 100644 --- a/FactoryKernels/GB_ew__rdiv_int16.c +++ b/FactoryKernels/GB_ew__rdiv_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_int16) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_int16) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_int32.c b/FactoryKernels/GB_ew__rdiv_int32.c index 12e6317962..d8d6e99981 100644 --- a/FactoryKernels/GB_ew__rdiv_int32.c +++ b/FactoryKernels/GB_ew__rdiv_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_int32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_int32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_int64.c b/FactoryKernels/GB_ew__rdiv_int64.c index 245e8885d8..4d974a5d4b 100644 --- a/FactoryKernels/GB_ew__rdiv_int64.c +++ b/FactoryKernels/GB_ew__rdiv_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_int64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_int64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_int8.c b/FactoryKernels/GB_ew__rdiv_int8.c index 88a876c5d7..8fb4ce5e2f 100644 --- a/FactoryKernels/GB_ew__rdiv_int8.c +++ b/FactoryKernels/GB_ew__rdiv_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_int8) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_int8) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_uint16.c b/FactoryKernels/GB_ew__rdiv_uint16.c index 510bf980e0..abb554ee90 100644 --- a/FactoryKernels/GB_ew__rdiv_uint16.c +++ b/FactoryKernels/GB_ew__rdiv_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_uint16) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_uint16) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_uint32.c b/FactoryKernels/GB_ew__rdiv_uint32.c index 8519cd0e6e..55d9f34302 100644 --- a/FactoryKernels/GB_ew__rdiv_uint32.c +++ b/FactoryKernels/GB_ew__rdiv_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_uint32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_uint32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_uint64.c b/FactoryKernels/GB_ew__rdiv_uint64.c index 621d7b7d0d..3f9f0ad2d2 100644 --- a/FactoryKernels/GB_ew__rdiv_uint64.c +++ b/FactoryKernels/GB_ew__rdiv_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_uint64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_uint64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rdiv_uint8.c b/FactoryKernels/GB_ew__rdiv_uint8.c index 80f4723db6..35bfca3b14 100644 --- a/FactoryKernels/GB_ew__rdiv_uint8.c +++ b/FactoryKernels/GB_ew__rdiv_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rdiv_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rdiv_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rdiv_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rdiv_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rdiv_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rdiv_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rdiv_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rdiv_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rdiv_uint8) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rdiv_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rdiv_uint8) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rdiv_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__remainder_fp32.c b/FactoryKernels/GB_ew__remainder_fp32.c index 13e761ff28..ed7b75c2c5 100644 --- a/FactoryKernels/GB_ew__remainder_fp32.c +++ b/FactoryKernels/GB_ew__remainder_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__remainder_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__remainder_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__remainder_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__remainder_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__remainder_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__remainder_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__remainder_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__remainder_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__remainder_fp32) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__remainder_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__remainder_fp32) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__remainder_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__remainder_fp64.c b/FactoryKernels/GB_ew__remainder_fp64.c index 033356efd5..86a4ac6db4 100644 --- a/FactoryKernels/GB_ew__remainder_fp64.c +++ b/FactoryKernels/GB_ew__remainder_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -98,7 +105,7 @@ GrB_Info GB (_AaddB__remainder_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -145,7 +152,7 @@ GrB_Info GB (_AunionB__remainder_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -173,7 +180,7 @@ GrB_Info GB (_AemultB_08__remainder_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -199,7 +206,7 @@ GrB_Info GB (_AemultB_02__remainder_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -225,7 +232,7 @@ GrB_Info GB (_AemultB_03__remainder_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -250,7 +257,7 @@ GrB_Info GB (_AemultB_04__remainder_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -276,7 +283,7 @@ GrB_Info GB (_AemultB_bitmap__remainder_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -331,11 +338,11 @@ GrB_Info GB (_bind2nd__remainder_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__remainder_fp64) @@ -366,11 +373,11 @@ GrB_Info GB (_bind1st_tran__remainder_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__remainder_fp64) @@ -393,3 +400,5 @@ GrB_Info GB (_bind2nd_tran__remainder_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_fc32.c b/FactoryKernels/GB_ew__rminus_fc32.c index a7450607dd..671a571377 100644 --- a/FactoryKernels/GB_ew__rminus_fc32.c +++ b/FactoryKernels/GB_ew__rminus_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_fc32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_fc32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_fc64.c b/FactoryKernels/GB_ew__rminus_fc64.c index 06825aa953..ad9ea9fe1d 100644 --- a/FactoryKernels/GB_ew__rminus_fc64.c +++ b/FactoryKernels/GB_ew__rminus_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_fc64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_fc64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_fp32.c b/FactoryKernels/GB_ew__rminus_fp32.c index d8b606e1c4..218521615e 100644 --- a/FactoryKernels/GB_ew__rminus_fp32.c +++ b/FactoryKernels/GB_ew__rminus_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_fp32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_fp32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_fp64.c b/FactoryKernels/GB_ew__rminus_fp64.c index a94d5f6f85..4137a9e147 100644 --- a/FactoryKernels/GB_ew__rminus_fp64.c +++ b/FactoryKernels/GB_ew__rminus_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_fp64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_fp64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_int16.c b/FactoryKernels/GB_ew__rminus_int16.c index 653de0d2a7..9e30a452b8 100644 --- a/FactoryKernels/GB_ew__rminus_int16.c +++ b/FactoryKernels/GB_ew__rminus_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_int16) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_int16) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_int32.c b/FactoryKernels/GB_ew__rminus_int32.c index a2f0778982..5e310df533 100644 --- a/FactoryKernels/GB_ew__rminus_int32.c +++ b/FactoryKernels/GB_ew__rminus_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_int32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_int32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_int64.c b/FactoryKernels/GB_ew__rminus_int64.c index ed4de041ca..995455f25f 100644 --- a/FactoryKernels/GB_ew__rminus_int64.c +++ b/FactoryKernels/GB_ew__rminus_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_int64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_int64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_int8.c b/FactoryKernels/GB_ew__rminus_int8.c index 3ff87f65bf..311da8339f 100644 --- a/FactoryKernels/GB_ew__rminus_int8.c +++ b/FactoryKernels/GB_ew__rminus_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_int8) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_int8) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_uint16.c b/FactoryKernels/GB_ew__rminus_uint16.c index cf241981f0..847ce570f6 100644 --- a/FactoryKernels/GB_ew__rminus_uint16.c +++ b/FactoryKernels/GB_ew__rminus_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_uint16) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_uint16) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_uint32.c b/FactoryKernels/GB_ew__rminus_uint32.c index fdf1db5c1a..ed422d9226 100644 --- a/FactoryKernels/GB_ew__rminus_uint32.c +++ b/FactoryKernels/GB_ew__rminus_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_uint32) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_uint32) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_uint64.c b/FactoryKernels/GB_ew__rminus_uint64.c index f5ce079021..b614e0fe5a 100644 --- a/FactoryKernels/GB_ew__rminus_uint64.c +++ b/FactoryKernels/GB_ew__rminus_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_uint64) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_uint64) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__rminus_uint8.c b/FactoryKernels/GB_ew__rminus_uint8.c index 4b7cb0dc0f..b819a5be8d 100644 --- a/FactoryKernels/GB_ew__rminus_uint8.c +++ b/FactoryKernels/GB_ew__rminus_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__rminus_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__rminus_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__rminus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__rminus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -286,7 +293,7 @@ GrB_Info GB (_AemultB_03__rminus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_04__rminus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -337,7 +344,7 @@ GrB_Info GB (_AemultB_bitmap__rminus_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -392,11 +399,11 @@ GrB_Info GB (_bind2nd__rminus_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__rminus_uint8) @@ -427,11 +434,11 @@ GrB_Info GB (_bind1st_tran__rminus_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__rminus_uint8) @@ -454,3 +461,5 @@ GrB_Info GB (_bind2nd_tran__rminus_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_bool.c b/FactoryKernels/GB_ew__second_bool.c index fe4d7c7a22..499b56f513 100644 --- a/FactoryKernels/GB_ew__second_bool.c +++ b/FactoryKernels/GB_ew__second_bool.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_bool) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_bool) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_fc32.c b/FactoryKernels/GB_ew__second_fc32.c index 2b8113e520..45560fa7a2 100644 --- a/FactoryKernels/GB_ew__second_fc32.c +++ b/FactoryKernels/GB_ew__second_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_fc64.c b/FactoryKernels/GB_ew__second_fc64.c index ccab979506..9ea97e108b 100644 --- a/FactoryKernels/GB_ew__second_fc64.c +++ b/FactoryKernels/GB_ew__second_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_fp32.c b/FactoryKernels/GB_ew__second_fp32.c index 1b7db399aa..09a30462c6 100644 --- a/FactoryKernels/GB_ew__second_fp32.c +++ b/FactoryKernels/GB_ew__second_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_fp64.c b/FactoryKernels/GB_ew__second_fp64.c index 6d900b8db6..7b9b6aadbf 100644 --- a/FactoryKernels/GB_ew__second_fp64.c +++ b/FactoryKernels/GB_ew__second_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_int16.c b/FactoryKernels/GB_ew__second_int16.c index 58c56e4971..7d9511f10b 100644 --- a/FactoryKernels/GB_ew__second_int16.c +++ b/FactoryKernels/GB_ew__second_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_int32.c b/FactoryKernels/GB_ew__second_int32.c index 93f6284059..45426ac128 100644 --- a/FactoryKernels/GB_ew__second_int32.c +++ b/FactoryKernels/GB_ew__second_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_int64.c b/FactoryKernels/GB_ew__second_int64.c index b3a266d271..b0748f85db 100644 --- a/FactoryKernels/GB_ew__second_int64.c +++ b/FactoryKernels/GB_ew__second_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_int8.c b/FactoryKernels/GB_ew__second_int8.c index ca3ef399d6..28fc9875b4 100644 --- a/FactoryKernels/GB_ew__second_int8.c +++ b/FactoryKernels/GB_ew__second_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_uint16.c b/FactoryKernels/GB_ew__second_uint16.c index 186bcb608b..67cf83f245 100644 --- a/FactoryKernels/GB_ew__second_uint16.c +++ b/FactoryKernels/GB_ew__second_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_uint32.c b/FactoryKernels/GB_ew__second_uint32.c index 66e83f744a..85b667cc15 100644 --- a/FactoryKernels/GB_ew__second_uint32.c +++ b/FactoryKernels/GB_ew__second_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_uint64.c b/FactoryKernels/GB_ew__second_uint64.c index 69b1ff6ef6..bfe0c8fdf9 100644 --- a/FactoryKernels/GB_ew__second_uint64.c +++ b/FactoryKernels/GB_ew__second_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__second_uint8.c b/FactoryKernels/GB_ew__second_uint8.c index 9af19421f6..ce33996f12 100644 --- a/FactoryKernels/GB_ew__second_uint8.c +++ b/FactoryKernels/GB_ew__second_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -141,7 +148,7 @@ GrB_Info GB (_AaddB__second_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -188,7 +195,7 @@ GrB_Info GB (_AunionB__second_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -216,7 +223,7 @@ GrB_Info GB (_AemultB_08__second_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -242,7 +249,7 @@ GrB_Info GB (_AemultB_02__second_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -268,7 +275,7 @@ GrB_Info GB (_AemultB_03__second_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +300,7 @@ GrB_Info GB (_AemultB_04__second_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,8 +326,10 @@ GrB_Info GB (_AemultB_bitmap__second_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_fc32.c b/FactoryKernels/GB_ew__times_fc32.c index c63f899584..54b5483855 100644 --- a/FactoryKernels/GB_ew__times_fc32.c +++ b/FactoryKernels/GB_ew__times_fc32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_fc32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_fc32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_fc32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_fc32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_fc32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_fc32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_fc64.c b/FactoryKernels/GB_ew__times_fc64.c index a00ee2083f..01d6c3aae3 100644 --- a/FactoryKernels/GB_ew__times_fc64.c +++ b/FactoryKernels/GB_ew__times_fc64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_fc64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_fc64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_fc64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_fc64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_fc64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_fc64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_fp32.c b/FactoryKernels/GB_ew__times_fp32.c index 05129d2bb2..faaee9bbde 100644 --- a/FactoryKernels/GB_ew__times_fp32.c +++ b/FactoryKernels/GB_ew__times_fp32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_fp32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_fp32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_fp32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_fp32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_fp32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_fp32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_fp64.c b/FactoryKernels/GB_ew__times_fp64.c index 64e6848147..daea39745e 100644 --- a/FactoryKernels/GB_ew__times_fp64.c +++ b/FactoryKernels/GB_ew__times_fp64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_fp64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_fp64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_fp64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_fp64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_fp64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_fp64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_int16.c b/FactoryKernels/GB_ew__times_int16.c index 8464eb522d..715ad9f177 100644 --- a/FactoryKernels/GB_ew__times_int16.c +++ b/FactoryKernels/GB_ew__times_int16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_int16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_int16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_int16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_int16) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_int16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_int16) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_int32.c b/FactoryKernels/GB_ew__times_int32.c index f46691a6f2..211b31675f 100644 --- a/FactoryKernels/GB_ew__times_int32.c +++ b/FactoryKernels/GB_ew__times_int32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_int32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_int32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_int32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_int32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_int32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_int32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_int64.c b/FactoryKernels/GB_ew__times_int64.c index 628987cba7..2072a7aca6 100644 --- a/FactoryKernels/GB_ew__times_int64.c +++ b/FactoryKernels/GB_ew__times_int64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_int64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_int64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_int64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_int64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_int64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_int64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_int8.c b/FactoryKernels/GB_ew__times_int8.c index 561121037c..60faa0eabe 100644 --- a/FactoryKernels/GB_ew__times_int8.c +++ b/FactoryKernels/GB_ew__times_int8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_int8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_int8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_int8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_int8) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_int8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_int8) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_uint16.c b/FactoryKernels/GB_ew__times_uint16.c index 798b50fd65..86107bbfd7 100644 --- a/FactoryKernels/GB_ew__times_uint16.c +++ b/FactoryKernels/GB_ew__times_uint16.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_uint16) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_uint16) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_uint16) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_uint16) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_uint16) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_uint16) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_uint32.c b/FactoryKernels/GB_ew__times_uint32.c index ebb591c059..d38c314618 100644 --- a/FactoryKernels/GB_ew__times_uint32.c +++ b/FactoryKernels/GB_ew__times_uint32.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_uint32) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_uint32) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_uint32) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_uint32) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_uint32) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_uint32) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_uint64.c b/FactoryKernels/GB_ew__times_uint64.c index edc3b76dc6..5e342b527d 100644 --- a/FactoryKernels/GB_ew__times_uint64.c +++ b/FactoryKernels/GB_ew__times_uint64.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_uint64) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_uint64) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_uint64) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_uint64) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_uint64) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_uint64) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_ew__times_uint8.c b/FactoryKernels/GB_ew__times_uint8.c index 35fb46ea7d..368867770e 100644 --- a/FactoryKernels/GB_ew__times_uint8.c +++ b/FactoryKernels/GB_ew__times_uint8.c @@ -7,9 +7,16 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -159,7 +166,7 @@ GrB_Info GB (_AaddB__times_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -206,7 +213,7 @@ GrB_Info GB (_AunionB__times_uint8) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -234,7 +241,7 @@ GrB_Info GB (_AemultB_08__times_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -260,7 +267,7 @@ GrB_Info GB (_AemultB_02__times_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -285,7 +292,7 @@ GrB_Info GB (_AemultB_04__times_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -311,7 +318,7 @@ GrB_Info GB (_AemultB_bitmap__times_uint8) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -366,11 +373,11 @@ GrB_Info GB (_bind2nd__times_uint8) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran__times_uint8) @@ -401,11 +408,11 @@ GrB_Info GB (_bind1st_tran__times_uint8) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran__times_uint8) @@ -428,3 +435,5 @@ GrB_Info GB (_bind2nd_tran__times_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_bool.c b/FactoryKernels/GB_red__any_bool.c index 0bb03e8b4d..060e2ad614 100644 --- a/FactoryKernels/GB_red__any_bool.c +++ b/FactoryKernels/GB_red__any_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE bool +#define GB_A_TYPE bool #define GB_DECLAREA(aij) bool aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE bool +#define GB_Z_TYPE bool #define GB_DECLARE_IDENTITY(z) bool z = false #define GB_DECLARE_IDENTITY_CONST(z) const bool z = false #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_fc32.c b/FactoryKernels/GB_red__any_fc32.c index fcf4057ce0..96b05600a1 100644 --- a/FactoryKernels/GB_red__any_fc32.c +++ b/FactoryKernels/GB_red__any_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE GxB_FC32_t +#define GB_A_TYPE GxB_FC32_t #define GB_DECLAREA(aij) GxB_FC32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE GxB_FC32_t +#define GB_Z_TYPE GxB_FC32_t #define GB_DECLARE_IDENTITY(z) GxB_FC32_t z = GxB_CMPLXF(0,0) #define GB_DECLARE_IDENTITY_CONST(z) const GxB_FC32_t z = GxB_CMPLXF(0,0) #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_fc64.c b/FactoryKernels/GB_red__any_fc64.c index a4028df2e6..9d6d6a783f 100644 --- a/FactoryKernels/GB_red__any_fc64.c +++ b/FactoryKernels/GB_red__any_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE GxB_FC64_t +#define GB_A_TYPE GxB_FC64_t #define GB_DECLAREA(aij) GxB_FC64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE GxB_FC64_t +#define GB_Z_TYPE GxB_FC64_t #define GB_DECLARE_IDENTITY(z) GxB_FC64_t z = GxB_CMPLX(0,0) #define GB_DECLARE_IDENTITY_CONST(z) const GxB_FC64_t z = GxB_CMPLX(0,0) #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_fp32.c b/FactoryKernels/GB_red__any_fp32.c index 7750821dee..c346ecfa0d 100644 --- a/FactoryKernels/GB_red__any_fp32.c +++ b/FactoryKernels/GB_red__any_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE float +#define GB_A_TYPE float #define GB_DECLAREA(aij) float aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE float +#define GB_Z_TYPE float #define GB_DECLARE_IDENTITY(z) float z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const float z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_fp64.c b/FactoryKernels/GB_red__any_fp64.c index c8106d1716..a4e58307c7 100644 --- a/FactoryKernels/GB_red__any_fp64.c +++ b/FactoryKernels/GB_red__any_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE double +#define GB_A_TYPE double #define GB_DECLAREA(aij) double aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE double +#define GB_Z_TYPE double #define GB_DECLARE_IDENTITY(z) double z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const double z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_int16.c b/FactoryKernels/GB_red__any_int16.c index 0a1fff127d..4ba66b63a6 100644 --- a/FactoryKernels/GB_red__any_int16.c +++ b/FactoryKernels/GB_red__any_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int16_t +#define GB_A_TYPE int16_t #define GB_DECLAREA(aij) int16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int16_t +#define GB_Z_TYPE int16_t #define GB_DECLARE_IDENTITY(z) int16_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const int16_t z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_int32.c b/FactoryKernels/GB_red__any_int32.c index 73c3b81110..83907db9df 100644 --- a/FactoryKernels/GB_red__any_int32.c +++ b/FactoryKernels/GB_red__any_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int32_t +#define GB_A_TYPE int32_t #define GB_DECLAREA(aij) int32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int32_t +#define GB_Z_TYPE int32_t #define GB_DECLARE_IDENTITY(z) int32_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const int32_t z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_int64.c b/FactoryKernels/GB_red__any_int64.c index 26525c5df0..8e20b70be4 100644 --- a/FactoryKernels/GB_red__any_int64.c +++ b/FactoryKernels/GB_red__any_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int64_t +#define GB_A_TYPE int64_t #define GB_DECLAREA(aij) int64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int64_t +#define GB_Z_TYPE int64_t #define GB_DECLARE_IDENTITY(z) int64_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const int64_t z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_int8.c b/FactoryKernels/GB_red__any_int8.c index ada4947b69..18843d1ef0 100644 --- a/FactoryKernels/GB_red__any_int8.c +++ b/FactoryKernels/GB_red__any_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int8_t +#define GB_A_TYPE int8_t #define GB_DECLAREA(aij) int8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int8_t +#define GB_Z_TYPE int8_t #define GB_DECLARE_IDENTITY(z) int8_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const int8_t z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_uint16.c b/FactoryKernels/GB_red__any_uint16.c index 30be696c9d..9388cee9ea 100644 --- a/FactoryKernels/GB_red__any_uint16.c +++ b/FactoryKernels/GB_red__any_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint16_t +#define GB_A_TYPE uint16_t #define GB_DECLAREA(aij) uint16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint16_t +#define GB_Z_TYPE uint16_t #define GB_DECLARE_IDENTITY(z) uint16_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint16_t z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_uint32.c b/FactoryKernels/GB_red__any_uint32.c index 1f8586135b..30b1225be7 100644 --- a/FactoryKernels/GB_red__any_uint32.c +++ b/FactoryKernels/GB_red__any_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint32_t +#define GB_A_TYPE uint32_t #define GB_DECLAREA(aij) uint32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint32_t +#define GB_Z_TYPE uint32_t #define GB_DECLARE_IDENTITY(z) uint32_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint32_t z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_uint64.c b/FactoryKernels/GB_red__any_uint64.c index b4fc6041da..6c7296b5b1 100644 --- a/FactoryKernels/GB_red__any_uint64.c +++ b/FactoryKernels/GB_red__any_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint64_t +#define GB_A_TYPE uint64_t #define GB_DECLAREA(aij) uint64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint64_t +#define GB_Z_TYPE uint64_t #define GB_DECLARE_IDENTITY(z) uint64_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint64_t z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__any_uint8.c b/FactoryKernels/GB_red__any_uint8.c index 0b7bd1ed50..444b3d1f5f 100644 --- a/FactoryKernels/GB_red__any_uint8.c +++ b/FactoryKernels/GB_red__any_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint8_t +#define GB_A_TYPE uint8_t #define GB_DECLAREA(aij) uint8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint8_t +#define GB_Z_TYPE uint8_t #define GB_DECLARE_IDENTITY(z) uint8_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint8_t z = 0 #define GB_IS_ANY_MONOID 1 @@ -71,3 +78,5 @@ GrB_Info GB (_red__any_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__eq_bool.c b/FactoryKernels/GB_red__eq_bool.c index 8c65c9b109..d648441d99 100644 --- a/FactoryKernels/GB_red__eq_bool.c +++ b/FactoryKernels/GB_red__eq_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = (z == Ax [p]) // A matrix (no typecasting to Z type here) -#define GB_A_TYPE bool +#define GB_A_TYPE bool #define GB_DECLAREA(aij) bool aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE bool +#define GB_Z_TYPE bool #define GB_DECLARE_IDENTITY(z) bool z = true #define GB_DECLARE_IDENTITY_CONST(z) const bool z = true @@ -70,3 +77,5 @@ GrB_Info GB (_red__eq_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_red__land_bool.c b/FactoryKernels/GB_red__land_bool.c index 3c14d987da..a85d118ca8 100644 --- a/FactoryKernels/GB_red__land_bool.c +++ b/FactoryKernels/GB_red__land_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = (z && Ax [p]) // A matrix (no typecasting to Z type here) -#define GB_A_TYPE bool +#define GB_A_TYPE bool #define GB_DECLAREA(aij) bool aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE bool +#define GB_Z_TYPE bool #define GB_DECLARE_IDENTITY(z) bool z = true #define GB_DECLARE_IDENTITY_CONST(z) const bool z = true @@ -75,3 +82,5 @@ GrB_Info GB (_red__land_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_red__lor_bool.c b/FactoryKernels/GB_red__lor_bool.c index f998792b9b..5b99eaf8df 100644 --- a/FactoryKernels/GB_red__lor_bool.c +++ b/FactoryKernels/GB_red__lor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = (z || Ax [p]) // A matrix (no typecasting to Z type here) -#define GB_A_TYPE bool +#define GB_A_TYPE bool #define GB_DECLAREA(aij) bool aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE bool +#define GB_Z_TYPE bool #define GB_DECLARE_IDENTITY(z) bool z = false #define GB_DECLARE_IDENTITY_CONST(z) const bool z = false @@ -75,3 +82,5 @@ GrB_Info GB (_red__lor_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_red__lxor_bool.c b/FactoryKernels/GB_red__lxor_bool.c index aa7f5b56a5..7cc6c08246 100644 --- a/FactoryKernels/GB_red__lxor_bool.c +++ b/FactoryKernels/GB_red__lxor_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = (z != Ax [p]) // A matrix (no typecasting to Z type here) -#define GB_A_TYPE bool +#define GB_A_TYPE bool #define GB_DECLAREA(aij) bool aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE bool +#define GB_Z_TYPE bool #define GB_DECLARE_IDENTITY(z) bool z = false #define GB_DECLARE_IDENTITY_CONST(z) const bool z = false @@ -70,3 +77,5 @@ GrB_Info GB (_red__lxor_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_fp32.c b/FactoryKernels/GB_red__max_fp32.c index b45d8ecdf8..01d98aa06a 100644 --- a/FactoryKernels/GB_red__max_fp32.c +++ b/FactoryKernels/GB_red__max_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if ((Ax [p] > z) || (z != z)) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE float +#define GB_A_TYPE float #define GB_DECLAREA(aij) float aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE float +#define GB_Z_TYPE float #define GB_DECLARE_IDENTITY(z) float z = (-INFINITY) #define GB_DECLARE_IDENTITY_CONST(z) const float z = (-INFINITY) @@ -70,3 +77,5 @@ GrB_Info GB (_red__max_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_fp64.c b/FactoryKernels/GB_red__max_fp64.c index 3e3257a145..9c9222d65e 100644 --- a/FactoryKernels/GB_red__max_fp64.c +++ b/FactoryKernels/GB_red__max_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if ((Ax [p] > z) || (z != z)) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE double +#define GB_A_TYPE double #define GB_DECLAREA(aij) double aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE double +#define GB_Z_TYPE double #define GB_DECLARE_IDENTITY(z) double z = ((double) -INFINITY) #define GB_DECLARE_IDENTITY_CONST(z) const double z = ((double) -INFINITY) @@ -70,3 +77,5 @@ GrB_Info GB (_red__max_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_int16.c b/FactoryKernels/GB_red__max_int16.c index 966f6ff40b..2bde283ec0 100644 --- a/FactoryKernels/GB_red__max_int16.c +++ b/FactoryKernels/GB_red__max_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] > z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int16_t +#define GB_A_TYPE int16_t #define GB_DECLAREA(aij) int16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int16_t +#define GB_Z_TYPE int16_t #define GB_DECLARE_IDENTITY(z) int16_t z = INT16_MIN #define GB_DECLARE_IDENTITY_CONST(z) const int16_t z = INT16_MIN @@ -75,3 +82,5 @@ GrB_Info GB (_red__max_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_int32.c b/FactoryKernels/GB_red__max_int32.c index 1a7c9768c1..d4ad01150b 100644 --- a/FactoryKernels/GB_red__max_int32.c +++ b/FactoryKernels/GB_red__max_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] > z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int32_t +#define GB_A_TYPE int32_t #define GB_DECLAREA(aij) int32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int32_t +#define GB_Z_TYPE int32_t #define GB_DECLARE_IDENTITY(z) int32_t z = INT32_MIN #define GB_DECLARE_IDENTITY_CONST(z) const int32_t z = INT32_MIN @@ -75,3 +82,5 @@ GrB_Info GB (_red__max_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_int64.c b/FactoryKernels/GB_red__max_int64.c index caae74374f..1082b1708f 100644 --- a/FactoryKernels/GB_red__max_int64.c +++ b/FactoryKernels/GB_red__max_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] > z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int64_t +#define GB_A_TYPE int64_t #define GB_DECLAREA(aij) int64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int64_t +#define GB_Z_TYPE int64_t #define GB_DECLARE_IDENTITY(z) int64_t z = INT64_MIN #define GB_DECLARE_IDENTITY_CONST(z) const int64_t z = INT64_MIN @@ -75,3 +82,5 @@ GrB_Info GB (_red__max_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_int8.c b/FactoryKernels/GB_red__max_int8.c index 5fa0e1291d..bdb6350046 100644 --- a/FactoryKernels/GB_red__max_int8.c +++ b/FactoryKernels/GB_red__max_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] > z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int8_t +#define GB_A_TYPE int8_t #define GB_DECLAREA(aij) int8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int8_t +#define GB_Z_TYPE int8_t #define GB_DECLARE_IDENTITY(z) int8_t z = INT8_MIN #define GB_DECLARE_IDENTITY_CONST(z) const int8_t z = INT8_MIN @@ -75,3 +82,5 @@ GrB_Info GB (_red__max_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_uint16.c b/FactoryKernels/GB_red__max_uint16.c index 3d59a748b3..a610407e53 100644 --- a/FactoryKernels/GB_red__max_uint16.c +++ b/FactoryKernels/GB_red__max_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] > z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint16_t +#define GB_A_TYPE uint16_t #define GB_DECLAREA(aij) uint16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint16_t +#define GB_Z_TYPE uint16_t #define GB_DECLARE_IDENTITY(z) uint16_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint16_t z = 0 @@ -75,3 +82,5 @@ GrB_Info GB (_red__max_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_uint32.c b/FactoryKernels/GB_red__max_uint32.c index be96c26084..65020e9949 100644 --- a/FactoryKernels/GB_red__max_uint32.c +++ b/FactoryKernels/GB_red__max_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] > z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint32_t +#define GB_A_TYPE uint32_t #define GB_DECLAREA(aij) uint32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint32_t +#define GB_Z_TYPE uint32_t #define GB_DECLARE_IDENTITY(z) uint32_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint32_t z = 0 @@ -75,3 +82,5 @@ GrB_Info GB (_red__max_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_uint64.c b/FactoryKernels/GB_red__max_uint64.c index f3df8b96c3..8f40be4a82 100644 --- a/FactoryKernels/GB_red__max_uint64.c +++ b/FactoryKernels/GB_red__max_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] > z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint64_t +#define GB_A_TYPE uint64_t #define GB_DECLAREA(aij) uint64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint64_t +#define GB_Z_TYPE uint64_t #define GB_DECLARE_IDENTITY(z) uint64_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint64_t z = 0 @@ -75,3 +82,5 @@ GrB_Info GB (_red__max_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__max_uint8.c b/FactoryKernels/GB_red__max_uint8.c index b41e2f0661..803bd30cee 100644 --- a/FactoryKernels/GB_red__max_uint8.c +++ b/FactoryKernels/GB_red__max_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] > z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint8_t +#define GB_A_TYPE uint8_t #define GB_DECLAREA(aij) uint8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint8_t +#define GB_Z_TYPE uint8_t #define GB_DECLARE_IDENTITY(z) uint8_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint8_t z = 0 @@ -75,3 +82,5 @@ GrB_Info GB (_red__max_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_fp32.c b/FactoryKernels/GB_red__min_fp32.c index d9dc3406c6..75b035f3cc 100644 --- a/FactoryKernels/GB_red__min_fp32.c +++ b/FactoryKernels/GB_red__min_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if ((Ax [p] < z) || (z != z)) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE float +#define GB_A_TYPE float #define GB_DECLAREA(aij) float aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE float +#define GB_Z_TYPE float #define GB_DECLARE_IDENTITY(z) float z = INFINITY #define GB_DECLARE_IDENTITY_CONST(z) const float z = INFINITY @@ -70,3 +77,5 @@ GrB_Info GB (_red__min_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_fp64.c b/FactoryKernels/GB_red__min_fp64.c index 801691b11d..d475059327 100644 --- a/FactoryKernels/GB_red__min_fp64.c +++ b/FactoryKernels/GB_red__min_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if ((Ax [p] < z) || (z != z)) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE double +#define GB_A_TYPE double #define GB_DECLAREA(aij) double aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE double +#define GB_Z_TYPE double #define GB_DECLARE_IDENTITY(z) double z = ((double) INFINITY) #define GB_DECLARE_IDENTITY_CONST(z) const double z = ((double) INFINITY) @@ -70,3 +77,5 @@ GrB_Info GB (_red__min_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_int16.c b/FactoryKernels/GB_red__min_int16.c index 18dbf14bcd..75cbaaa237 100644 --- a/FactoryKernels/GB_red__min_int16.c +++ b/FactoryKernels/GB_red__min_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] < z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int16_t +#define GB_A_TYPE int16_t #define GB_DECLAREA(aij) int16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int16_t +#define GB_Z_TYPE int16_t #define GB_DECLARE_IDENTITY(z) int16_t z = INT16_MAX #define GB_DECLARE_IDENTITY_CONST(z) const int16_t z = INT16_MAX @@ -75,3 +82,5 @@ GrB_Info GB (_red__min_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_int32.c b/FactoryKernels/GB_red__min_int32.c index 3465e9428e..8dfdd8f851 100644 --- a/FactoryKernels/GB_red__min_int32.c +++ b/FactoryKernels/GB_red__min_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] < z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int32_t +#define GB_A_TYPE int32_t #define GB_DECLAREA(aij) int32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int32_t +#define GB_Z_TYPE int32_t #define GB_DECLARE_IDENTITY(z) int32_t z = INT32_MAX #define GB_DECLARE_IDENTITY_CONST(z) const int32_t z = INT32_MAX @@ -75,3 +82,5 @@ GrB_Info GB (_red__min_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_int64.c b/FactoryKernels/GB_red__min_int64.c index fe4921e9f0..1b0e89cb24 100644 --- a/FactoryKernels/GB_red__min_int64.c +++ b/FactoryKernels/GB_red__min_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] < z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int64_t +#define GB_A_TYPE int64_t #define GB_DECLAREA(aij) int64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int64_t +#define GB_Z_TYPE int64_t #define GB_DECLARE_IDENTITY(z) int64_t z = INT64_MAX #define GB_DECLARE_IDENTITY_CONST(z) const int64_t z = INT64_MAX @@ -75,3 +82,5 @@ GrB_Info GB (_red__min_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_int8.c b/FactoryKernels/GB_red__min_int8.c index bb5f152d27..cd5e150b7d 100644 --- a/FactoryKernels/GB_red__min_int8.c +++ b/FactoryKernels/GB_red__min_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] < z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int8_t +#define GB_A_TYPE int8_t #define GB_DECLAREA(aij) int8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int8_t +#define GB_Z_TYPE int8_t #define GB_DECLARE_IDENTITY(z) int8_t z = INT8_MAX #define GB_DECLARE_IDENTITY_CONST(z) const int8_t z = INT8_MAX @@ -75,3 +82,5 @@ GrB_Info GB (_red__min_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_uint16.c b/FactoryKernels/GB_red__min_uint16.c index f024db5589..244f96a01e 100644 --- a/FactoryKernels/GB_red__min_uint16.c +++ b/FactoryKernels/GB_red__min_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] < z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint16_t +#define GB_A_TYPE uint16_t #define GB_DECLAREA(aij) uint16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint16_t +#define GB_Z_TYPE uint16_t #define GB_DECLARE_IDENTITY(z) uint16_t z = UINT16_MAX #define GB_DECLARE_IDENTITY_CONST(z) const uint16_t z = UINT16_MAX @@ -75,3 +82,5 @@ GrB_Info GB (_red__min_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_uint32.c b/FactoryKernels/GB_red__min_uint32.c index 5098c3f5b5..5dabf1dc4f 100644 --- a/FactoryKernels/GB_red__min_uint32.c +++ b/FactoryKernels/GB_red__min_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] < z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint32_t +#define GB_A_TYPE uint32_t #define GB_DECLAREA(aij) uint32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint32_t +#define GB_Z_TYPE uint32_t #define GB_DECLARE_IDENTITY(z) uint32_t z = UINT32_MAX #define GB_DECLARE_IDENTITY_CONST(z) const uint32_t z = UINT32_MAX @@ -75,3 +82,5 @@ GrB_Info GB (_red__min_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_uint64.c b/FactoryKernels/GB_red__min_uint64.c index f5deee39ec..b6dff01981 100644 --- a/FactoryKernels/GB_red__min_uint64.c +++ b/FactoryKernels/GB_red__min_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] < z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint64_t +#define GB_A_TYPE uint64_t #define GB_DECLAREA(aij) uint64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint64_t +#define GB_Z_TYPE uint64_t #define GB_DECLARE_IDENTITY(z) uint64_t z = UINT64_MAX #define GB_DECLARE_IDENTITY_CONST(z) const uint64_t z = UINT64_MAX @@ -75,3 +82,5 @@ GrB_Info GB (_red__min_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__min_uint8.c b/FactoryKernels/GB_red__min_uint8.c index 3fc7e85953..b5171ce372 100644 --- a/FactoryKernels/GB_red__min_uint8.c +++ b/FactoryKernels/GB_red__min_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) if (Ax [p] < z) { z = Ax [p] ; } // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint8_t +#define GB_A_TYPE uint8_t #define GB_DECLAREA(aij) uint8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint8_t +#define GB_Z_TYPE uint8_t #define GB_DECLARE_IDENTITY(z) uint8_t z = UINT8_MAX #define GB_DECLARE_IDENTITY_CONST(z) const uint8_t z = UINT8_MAX @@ -75,3 +82,5 @@ GrB_Info GB (_red__min_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_fc32.c b/FactoryKernels/GB_red__plus_fc32.c index c1a3e67953..7752a8d9ec 100644 --- a/FactoryKernels/GB_red__plus_fc32.c +++ b/FactoryKernels/GB_red__plus_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = GB_FC32_add (z, Ax [p]) // A matrix (no typecasting to Z type here) -#define GB_A_TYPE GxB_FC32_t +#define GB_A_TYPE GxB_FC32_t #define GB_DECLAREA(aij) GxB_FC32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE GxB_FC32_t +#define GB_Z_TYPE GxB_FC32_t #define GB_DECLARE_IDENTITY(z) GxB_FC32_t z = GxB_CMPLXF(0,0) #define GB_DECLARE_IDENTITY_CONST(z) const GxB_FC32_t z = GxB_CMPLXF(0,0) @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_fc64.c b/FactoryKernels/GB_red__plus_fc64.c index b38556ec48..c74f8e447d 100644 --- a/FactoryKernels/GB_red__plus_fc64.c +++ b/FactoryKernels/GB_red__plus_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = GB_FC64_add (z, Ax [p]) // A matrix (no typecasting to Z type here) -#define GB_A_TYPE GxB_FC64_t +#define GB_A_TYPE GxB_FC64_t #define GB_DECLAREA(aij) GxB_FC64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE GxB_FC64_t +#define GB_Z_TYPE GxB_FC64_t #define GB_DECLARE_IDENTITY(z) GxB_FC64_t z = GxB_CMPLX(0,0) #define GB_DECLARE_IDENTITY_CONST(z) const GxB_FC64_t z = GxB_CMPLX(0,0) @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_fp32.c b/FactoryKernels/GB_red__plus_fp32.c index d8adcbe94d..2728393d4a 100644 --- a/FactoryKernels/GB_red__plus_fp32.c +++ b/FactoryKernels/GB_red__plus_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE float +#define GB_A_TYPE float #define GB_DECLAREA(aij) float aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE float +#define GB_Z_TYPE float #define GB_DECLARE_IDENTITY(z) float z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const float z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_fp64.c b/FactoryKernels/GB_red__plus_fp64.c index e3e4546ac3..a0f4b49c16 100644 --- a/FactoryKernels/GB_red__plus_fp64.c +++ b/FactoryKernels/GB_red__plus_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE double +#define GB_A_TYPE double #define GB_DECLAREA(aij) double aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE double +#define GB_Z_TYPE double #define GB_DECLARE_IDENTITY(z) double z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const double z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_int16.c b/FactoryKernels/GB_red__plus_int16.c index c6c2b6ebef..6ee98e8d24 100644 --- a/FactoryKernels/GB_red__plus_int16.c +++ b/FactoryKernels/GB_red__plus_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int16_t +#define GB_A_TYPE int16_t #define GB_DECLAREA(aij) int16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int16_t +#define GB_Z_TYPE int16_t #define GB_DECLARE_IDENTITY(z) int16_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const int16_t z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_int32.c b/FactoryKernels/GB_red__plus_int32.c index 50202e0278..f1308119e2 100644 --- a/FactoryKernels/GB_red__plus_int32.c +++ b/FactoryKernels/GB_red__plus_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int32_t +#define GB_A_TYPE int32_t #define GB_DECLAREA(aij) int32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int32_t +#define GB_Z_TYPE int32_t #define GB_DECLARE_IDENTITY(z) int32_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const int32_t z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_int64.c b/FactoryKernels/GB_red__plus_int64.c index 4a619e9db2..35c3b98fb2 100644 --- a/FactoryKernels/GB_red__plus_int64.c +++ b/FactoryKernels/GB_red__plus_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int64_t +#define GB_A_TYPE int64_t #define GB_DECLAREA(aij) int64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int64_t +#define GB_Z_TYPE int64_t #define GB_DECLARE_IDENTITY(z) int64_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const int64_t z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_int8.c b/FactoryKernels/GB_red__plus_int8.c index 99e0eecdbe..ddb6e9f4af 100644 --- a/FactoryKernels/GB_red__plus_int8.c +++ b/FactoryKernels/GB_red__plus_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int8_t +#define GB_A_TYPE int8_t #define GB_DECLAREA(aij) int8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int8_t +#define GB_Z_TYPE int8_t #define GB_DECLARE_IDENTITY(z) int8_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const int8_t z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_uint16.c b/FactoryKernels/GB_red__plus_uint16.c index a9a539f679..cf48b5b1fd 100644 --- a/FactoryKernels/GB_red__plus_uint16.c +++ b/FactoryKernels/GB_red__plus_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint16_t +#define GB_A_TYPE uint16_t #define GB_DECLAREA(aij) uint16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint16_t +#define GB_Z_TYPE uint16_t #define GB_DECLARE_IDENTITY(z) uint16_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint16_t z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_uint32.c b/FactoryKernels/GB_red__plus_uint32.c index 77cdb6f768..1d49feac08 100644 --- a/FactoryKernels/GB_red__plus_uint32.c +++ b/FactoryKernels/GB_red__plus_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint32_t +#define GB_A_TYPE uint32_t #define GB_DECLAREA(aij) uint32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint32_t +#define GB_Z_TYPE uint32_t #define GB_DECLARE_IDENTITY(z) uint32_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint32_t z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_uint64.c b/FactoryKernels/GB_red__plus_uint64.c index 4db081b7c5..cf1d15e3c0 100644 --- a/FactoryKernels/GB_red__plus_uint64.c +++ b/FactoryKernels/GB_red__plus_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint64_t +#define GB_A_TYPE uint64_t #define GB_DECLAREA(aij) uint64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint64_t +#define GB_Z_TYPE uint64_t #define GB_DECLARE_IDENTITY(z) uint64_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint64_t z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__plus_uint8.c b/FactoryKernels/GB_red__plus_uint8.c index 7ab5464a7a..f677b5b0b4 100644 --- a/FactoryKernels/GB_red__plus_uint8.c +++ b/FactoryKernels/GB_red__plus_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z += Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint8_t +#define GB_A_TYPE uint8_t #define GB_DECLAREA(aij) uint8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint8_t +#define GB_Z_TYPE uint8_t #define GB_DECLARE_IDENTITY(z) uint8_t z = 0 #define GB_DECLARE_IDENTITY_CONST(z) const uint8_t z = 0 @@ -70,3 +77,5 @@ GrB_Info GB (_red__plus_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_fc32.c b/FactoryKernels/GB_red__times_fc32.c index c2cc4da5fa..085eea7692 100644 --- a/FactoryKernels/GB_red__times_fc32.c +++ b/FactoryKernels/GB_red__times_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = GB_FC32_mul (z, Ax [p]) // A matrix (no typecasting to Z type here) -#define GB_A_TYPE GxB_FC32_t +#define GB_A_TYPE GxB_FC32_t #define GB_DECLAREA(aij) GxB_FC32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE GxB_FC32_t +#define GB_Z_TYPE GxB_FC32_t #define GB_DECLARE_IDENTITY(z) GxB_FC32_t z = GxB_CMPLXF(1,0) #define GB_DECLARE_IDENTITY_CONST(z) const GxB_FC32_t z = GxB_CMPLXF(1,0) @@ -70,3 +77,5 @@ GrB_Info GB (_red__times_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_fc64.c b/FactoryKernels/GB_red__times_fc64.c index dd108920e1..6ef5d0742c 100644 --- a/FactoryKernels/GB_red__times_fc64.c +++ b/FactoryKernels/GB_red__times_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z = GB_FC64_mul (z, Ax [p]) // A matrix (no typecasting to Z type here) -#define GB_A_TYPE GxB_FC64_t +#define GB_A_TYPE GxB_FC64_t #define GB_DECLAREA(aij) GxB_FC64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE GxB_FC64_t +#define GB_Z_TYPE GxB_FC64_t #define GB_DECLARE_IDENTITY(z) GxB_FC64_t z = GxB_CMPLX(1,0) #define GB_DECLARE_IDENTITY_CONST(z) const GxB_FC64_t z = GxB_CMPLX(1,0) @@ -70,3 +77,5 @@ GrB_Info GB (_red__times_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_fp32.c b/FactoryKernels/GB_red__times_fp32.c index 4f933e247d..de331ace2a 100644 --- a/FactoryKernels/GB_red__times_fp32.c +++ b/FactoryKernels/GB_red__times_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE float +#define GB_A_TYPE float #define GB_DECLAREA(aij) float aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE float +#define GB_Z_TYPE float #define GB_DECLARE_IDENTITY(z) float z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const float z = 1 @@ -70,3 +77,5 @@ GrB_Info GB (_red__times_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_fp64.c b/FactoryKernels/GB_red__times_fp64.c index b5df94f8c1..d063698bd5 100644 --- a/FactoryKernels/GB_red__times_fp64.c +++ b/FactoryKernels/GB_red__times_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE double +#define GB_A_TYPE double #define GB_DECLAREA(aij) double aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE double +#define GB_Z_TYPE double #define GB_DECLARE_IDENTITY(z) double z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const double z = 1 @@ -70,3 +77,5 @@ GrB_Info GB (_red__times_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_int16.c b/FactoryKernels/GB_red__times_int16.c index 86d8e3eb21..ffba5e1b80 100644 --- a/FactoryKernels/GB_red__times_int16.c +++ b/FactoryKernels/GB_red__times_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int16_t +#define GB_A_TYPE int16_t #define GB_DECLAREA(aij) int16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int16_t +#define GB_Z_TYPE int16_t #define GB_DECLARE_IDENTITY(z) int16_t z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const int16_t z = 1 @@ -75,3 +82,5 @@ GrB_Info GB (_red__times_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_int32.c b/FactoryKernels/GB_red__times_int32.c index 07269dc2be..236eade760 100644 --- a/FactoryKernels/GB_red__times_int32.c +++ b/FactoryKernels/GB_red__times_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int32_t +#define GB_A_TYPE int32_t #define GB_DECLAREA(aij) int32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int32_t +#define GB_Z_TYPE int32_t #define GB_DECLARE_IDENTITY(z) int32_t z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const int32_t z = 1 @@ -75,3 +82,5 @@ GrB_Info GB (_red__times_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_int64.c b/FactoryKernels/GB_red__times_int64.c index 103cf3cdcd..b4ba930ce2 100644 --- a/FactoryKernels/GB_red__times_int64.c +++ b/FactoryKernels/GB_red__times_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int64_t +#define GB_A_TYPE int64_t #define GB_DECLAREA(aij) int64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int64_t +#define GB_Z_TYPE int64_t #define GB_DECLARE_IDENTITY(z) int64_t z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const int64_t z = 1 @@ -75,3 +82,5 @@ GrB_Info GB (_red__times_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_int8.c b/FactoryKernels/GB_red__times_int8.c index b088eccf78..ba0dc6faf8 100644 --- a/FactoryKernels/GB_red__times_int8.c +++ b/FactoryKernels/GB_red__times_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE int8_t +#define GB_A_TYPE int8_t #define GB_DECLAREA(aij) int8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE int8_t +#define GB_Z_TYPE int8_t #define GB_DECLARE_IDENTITY(z) int8_t z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const int8_t z = 1 @@ -75,3 +82,5 @@ GrB_Info GB (_red__times_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_uint16.c b/FactoryKernels/GB_red__times_uint16.c index 1f2261fee6..ee674f9d72 100644 --- a/FactoryKernels/GB_red__times_uint16.c +++ b/FactoryKernels/GB_red__times_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint16_t +#define GB_A_TYPE uint16_t #define GB_DECLAREA(aij) uint16_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint16_t +#define GB_Z_TYPE uint16_t #define GB_DECLARE_IDENTITY(z) uint16_t z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const uint16_t z = 1 @@ -75,3 +82,5 @@ GrB_Info GB (_red__times_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_uint32.c b/FactoryKernels/GB_red__times_uint32.c index 5e5252857d..52e0d3b1e3 100644 --- a/FactoryKernels/GB_red__times_uint32.c +++ b/FactoryKernels/GB_red__times_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint32_t +#define GB_A_TYPE uint32_t #define GB_DECLAREA(aij) uint32_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint32_t +#define GB_Z_TYPE uint32_t #define GB_DECLARE_IDENTITY(z) uint32_t z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const uint32_t z = 1 @@ -75,3 +82,5 @@ GrB_Info GB (_red__times_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_uint64.c b/FactoryKernels/GB_red__times_uint64.c index 8e57ce67ca..22a5800d4a 100644 --- a/FactoryKernels/GB_red__times_uint64.c +++ b/FactoryKernels/GB_red__times_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint64_t +#define GB_A_TYPE uint64_t #define GB_DECLAREA(aij) uint64_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint64_t +#define GB_Z_TYPE uint64_t #define GB_DECLARE_IDENTITY(z) uint64_t z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const uint64_t z = 1 @@ -75,3 +82,5 @@ GrB_Info GB (_red__times_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_red__times_uint8.c b/FactoryKernels/GB_red__times_uint8.c index cb77803ff0..ce91b4a223 100644 --- a/FactoryKernels/GB_red__times_uint8.c +++ b/FactoryKernels/GB_red__times_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -17,12 +24,12 @@ #define GB_GETA_AND_UPDATE(z,Ax,p) z *= Ax [p] // A matrix (no typecasting to Z type here) -#define GB_A_TYPE uint8_t +#define GB_A_TYPE uint8_t #define GB_DECLAREA(aij) uint8_t aij #define GB_GETA(aij,Ax,pA,A_iso) aij = Ax [pA] // monoid properties: -#define GB_Z_TYPE uint8_t +#define GB_Z_TYPE uint8_t #define GB_DECLARE_IDENTITY(z) uint8_t z = 1 #define GB_DECLARE_IDENTITY_CONST(z) const uint8_t z = 1 @@ -75,3 +82,5 @@ GrB_Info GB (_red__times_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_sel__eq_thunk_bool.c b/FactoryKernels/GB_sel__eq_thunk_bool.c index a30e536e3b..4f95a75f6b 100644 --- a/FactoryKernels/GB_sel__eq_thunk_bool.c +++ b/FactoryKernels/GB_sel__eq_thunk_bool.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_bool) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_fc32.c b/FactoryKernels/GB_sel__eq_thunk_fc32.c index a15c76078a..760148cfc3 100644 --- a/FactoryKernels/GB_sel__eq_thunk_fc32.c +++ b/FactoryKernels/GB_sel__eq_thunk_fc32.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_fc32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_fc64.c b/FactoryKernels/GB_sel__eq_thunk_fc64.c index c0055fc337..bf7ead8103 100644 --- a/FactoryKernels/GB_sel__eq_thunk_fc64.c +++ b/FactoryKernels/GB_sel__eq_thunk_fc64.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_fc64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_fp32.c b/FactoryKernels/GB_sel__eq_thunk_fp32.c index 787173df77..58d4830ffc 100644 --- a/FactoryKernels/GB_sel__eq_thunk_fp32.c +++ b/FactoryKernels/GB_sel__eq_thunk_fp32.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_fp32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_fp64.c b/FactoryKernels/GB_sel__eq_thunk_fp64.c index 5353b04718..6730057e8e 100644 --- a/FactoryKernels/GB_sel__eq_thunk_fp64.c +++ b/FactoryKernels/GB_sel__eq_thunk_fp64.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_fp64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_int16.c b/FactoryKernels/GB_sel__eq_thunk_int16.c index b696ce81c2..01afb7fedc 100644 --- a/FactoryKernels/GB_sel__eq_thunk_int16.c +++ b/FactoryKernels/GB_sel__eq_thunk_int16.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_int16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_int32.c b/FactoryKernels/GB_sel__eq_thunk_int32.c index 823c2ac0ed..8695beb722 100644 --- a/FactoryKernels/GB_sel__eq_thunk_int32.c +++ b/FactoryKernels/GB_sel__eq_thunk_int32.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_int32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_int64.c b/FactoryKernels/GB_sel__eq_thunk_int64.c index a861212ef7..f6a5693e90 100644 --- a/FactoryKernels/GB_sel__eq_thunk_int64.c +++ b/FactoryKernels/GB_sel__eq_thunk_int64.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_int64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_int8.c b/FactoryKernels/GB_sel__eq_thunk_int8.c index 0b28262821..3ba5c0b001 100644 --- a/FactoryKernels/GB_sel__eq_thunk_int8.c +++ b/FactoryKernels/GB_sel__eq_thunk_int8.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_int8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_uint16.c b/FactoryKernels/GB_sel__eq_thunk_uint16.c index 6299acab0d..60c5354ffc 100644 --- a/FactoryKernels/GB_sel__eq_thunk_uint16.c +++ b/FactoryKernels/GB_sel__eq_thunk_uint16.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_uint32.c b/FactoryKernels/GB_sel__eq_thunk_uint32.c index f668ada330..adf2708cf5 100644 --- a/FactoryKernels/GB_sel__eq_thunk_uint32.c +++ b/FactoryKernels/GB_sel__eq_thunk_uint32.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_uint64.c b/FactoryKernels/GB_sel__eq_thunk_uint64.c index 6c59557e13..2bdb22c33d 100644 --- a/FactoryKernels/GB_sel__eq_thunk_uint64.c +++ b/FactoryKernels/GB_sel__eq_thunk_uint64.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__eq_thunk_uint8.c b/FactoryKernels/GB_sel__eq_thunk_uint8.c index c8f46a50f1..803dcc4a1b 100644 --- a/FactoryKernels/GB_sel__eq_thunk_uint8.c +++ b/FactoryKernels/GB_sel__eq_thunk_uint8.c @@ -60,7 +60,7 @@ GrB_Info GB (_sel_phase2__eq_thunk_uint8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_fp32.c b/FactoryKernels/GB_sel__ge_thunk_fp32.c index 8114a910e4..637725a0bb 100644 --- a/FactoryKernels/GB_sel__ge_thunk_fp32.c +++ b/FactoryKernels/GB_sel__ge_thunk_fp32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_fp32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_fp64.c b/FactoryKernels/GB_sel__ge_thunk_fp64.c index e36770d377..d6d2f75b01 100644 --- a/FactoryKernels/GB_sel__ge_thunk_fp64.c +++ b/FactoryKernels/GB_sel__ge_thunk_fp64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_fp64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_int16.c b/FactoryKernels/GB_sel__ge_thunk_int16.c index cf7caf30e1..11fb34ffd0 100644 --- a/FactoryKernels/GB_sel__ge_thunk_int16.c +++ b/FactoryKernels/GB_sel__ge_thunk_int16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_int16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_int32.c b/FactoryKernels/GB_sel__ge_thunk_int32.c index 4328dbe8b4..1e8514472b 100644 --- a/FactoryKernels/GB_sel__ge_thunk_int32.c +++ b/FactoryKernels/GB_sel__ge_thunk_int32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_int32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_int64.c b/FactoryKernels/GB_sel__ge_thunk_int64.c index 1de5138de5..282609e12e 100644 --- a/FactoryKernels/GB_sel__ge_thunk_int64.c +++ b/FactoryKernels/GB_sel__ge_thunk_int64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_int64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_int8.c b/FactoryKernels/GB_sel__ge_thunk_int8.c index a369f6a562..29a3eaa1d5 100644 --- a/FactoryKernels/GB_sel__ge_thunk_int8.c +++ b/FactoryKernels/GB_sel__ge_thunk_int8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_int8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_uint16.c b/FactoryKernels/GB_sel__ge_thunk_uint16.c index de6d8f9164..c324c1bbc8 100644 --- a/FactoryKernels/GB_sel__ge_thunk_uint16.c +++ b/FactoryKernels/GB_sel__ge_thunk_uint16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_uint32.c b/FactoryKernels/GB_sel__ge_thunk_uint32.c index e2b6e6aa2d..939c9622d8 100644 --- a/FactoryKernels/GB_sel__ge_thunk_uint32.c +++ b/FactoryKernels/GB_sel__ge_thunk_uint32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_uint64.c b/FactoryKernels/GB_sel__ge_thunk_uint64.c index 5b8c00ef4d..4abdf37c28 100644 --- a/FactoryKernels/GB_sel__ge_thunk_uint64.c +++ b/FactoryKernels/GB_sel__ge_thunk_uint64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ge_thunk_uint8.c b/FactoryKernels/GB_sel__ge_thunk_uint8.c index 0efdb9bcff..8d9db3e3bd 100644 --- a/FactoryKernels/GB_sel__ge_thunk_uint8.c +++ b/FactoryKernels/GB_sel__ge_thunk_uint8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ge_thunk_uint8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_fp32.c b/FactoryKernels/GB_sel__gt_thunk_fp32.c index 0cf2076990..f457dd00ad 100644 --- a/FactoryKernels/GB_sel__gt_thunk_fp32.c +++ b/FactoryKernels/GB_sel__gt_thunk_fp32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_fp32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_fp64.c b/FactoryKernels/GB_sel__gt_thunk_fp64.c index c24d9e35c0..95c934677b 100644 --- a/FactoryKernels/GB_sel__gt_thunk_fp64.c +++ b/FactoryKernels/GB_sel__gt_thunk_fp64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_fp64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_int16.c b/FactoryKernels/GB_sel__gt_thunk_int16.c index 7289ef3617..7b620b71e2 100644 --- a/FactoryKernels/GB_sel__gt_thunk_int16.c +++ b/FactoryKernels/GB_sel__gt_thunk_int16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_int16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_int32.c b/FactoryKernels/GB_sel__gt_thunk_int32.c index 35dec7242f..0e6575670d 100644 --- a/FactoryKernels/GB_sel__gt_thunk_int32.c +++ b/FactoryKernels/GB_sel__gt_thunk_int32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_int32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_int64.c b/FactoryKernels/GB_sel__gt_thunk_int64.c index 82c8cd1d6b..261cefc666 100644 --- a/FactoryKernels/GB_sel__gt_thunk_int64.c +++ b/FactoryKernels/GB_sel__gt_thunk_int64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_int64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_int8.c b/FactoryKernels/GB_sel__gt_thunk_int8.c index ddb2336ee4..e11ed6bd04 100644 --- a/FactoryKernels/GB_sel__gt_thunk_int8.c +++ b/FactoryKernels/GB_sel__gt_thunk_int8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_int8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_uint16.c b/FactoryKernels/GB_sel__gt_thunk_uint16.c index 896290ae5c..a84a809d59 100644 --- a/FactoryKernels/GB_sel__gt_thunk_uint16.c +++ b/FactoryKernels/GB_sel__gt_thunk_uint16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_uint32.c b/FactoryKernels/GB_sel__gt_thunk_uint32.c index 95c4545a70..1bf3f20aaa 100644 --- a/FactoryKernels/GB_sel__gt_thunk_uint32.c +++ b/FactoryKernels/GB_sel__gt_thunk_uint32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_uint64.c b/FactoryKernels/GB_sel__gt_thunk_uint64.c index c9fc55e8b3..5efa681c74 100644 --- a/FactoryKernels/GB_sel__gt_thunk_uint64.c +++ b/FactoryKernels/GB_sel__gt_thunk_uint64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__gt_thunk_uint8.c b/FactoryKernels/GB_sel__gt_thunk_uint8.c index a5504d87fb..f1cb237819 100644 --- a/FactoryKernels/GB_sel__gt_thunk_uint8.c +++ b/FactoryKernels/GB_sel__gt_thunk_uint8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__gt_thunk_uint8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_fp32.c b/FactoryKernels/GB_sel__le_thunk_fp32.c index 498cab4d84..306f760b15 100644 --- a/FactoryKernels/GB_sel__le_thunk_fp32.c +++ b/FactoryKernels/GB_sel__le_thunk_fp32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_fp32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_fp64.c b/FactoryKernels/GB_sel__le_thunk_fp64.c index 40fc4fcdff..6efc255677 100644 --- a/FactoryKernels/GB_sel__le_thunk_fp64.c +++ b/FactoryKernels/GB_sel__le_thunk_fp64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_fp64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_int16.c b/FactoryKernels/GB_sel__le_thunk_int16.c index 9a7b3d6619..b037857b5c 100644 --- a/FactoryKernels/GB_sel__le_thunk_int16.c +++ b/FactoryKernels/GB_sel__le_thunk_int16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_int16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_int32.c b/FactoryKernels/GB_sel__le_thunk_int32.c index aa678b0b26..82d8163c52 100644 --- a/FactoryKernels/GB_sel__le_thunk_int32.c +++ b/FactoryKernels/GB_sel__le_thunk_int32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_int32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_int64.c b/FactoryKernels/GB_sel__le_thunk_int64.c index 38548c47da..b9a8b3a0bc 100644 --- a/FactoryKernels/GB_sel__le_thunk_int64.c +++ b/FactoryKernels/GB_sel__le_thunk_int64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_int64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_int8.c b/FactoryKernels/GB_sel__le_thunk_int8.c index a570f2c359..7cb928e75f 100644 --- a/FactoryKernels/GB_sel__le_thunk_int8.c +++ b/FactoryKernels/GB_sel__le_thunk_int8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_int8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_uint16.c b/FactoryKernels/GB_sel__le_thunk_uint16.c index d162a35a46..37ff221b25 100644 --- a/FactoryKernels/GB_sel__le_thunk_uint16.c +++ b/FactoryKernels/GB_sel__le_thunk_uint16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_uint16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_uint32.c b/FactoryKernels/GB_sel__le_thunk_uint32.c index 0c6d2f47ed..0980f15de0 100644 --- a/FactoryKernels/GB_sel__le_thunk_uint32.c +++ b/FactoryKernels/GB_sel__le_thunk_uint32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_uint32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_uint64.c b/FactoryKernels/GB_sel__le_thunk_uint64.c index a60e96e2ca..15f6f06b0d 100644 --- a/FactoryKernels/GB_sel__le_thunk_uint64.c +++ b/FactoryKernels/GB_sel__le_thunk_uint64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_uint64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__le_thunk_uint8.c b/FactoryKernels/GB_sel__le_thunk_uint8.c index baefa8f03b..f2587882e3 100644 --- a/FactoryKernels/GB_sel__le_thunk_uint8.c +++ b/FactoryKernels/GB_sel__le_thunk_uint8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__le_thunk_uint8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_fp32.c b/FactoryKernels/GB_sel__lt_thunk_fp32.c index 264d08bfe1..0e214a4700 100644 --- a/FactoryKernels/GB_sel__lt_thunk_fp32.c +++ b/FactoryKernels/GB_sel__lt_thunk_fp32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_fp32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_fp64.c b/FactoryKernels/GB_sel__lt_thunk_fp64.c index 807311ee9f..5cc0f6f2d5 100644 --- a/FactoryKernels/GB_sel__lt_thunk_fp64.c +++ b/FactoryKernels/GB_sel__lt_thunk_fp64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_fp64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_int16.c b/FactoryKernels/GB_sel__lt_thunk_int16.c index e10ff22a60..44ad6246fc 100644 --- a/FactoryKernels/GB_sel__lt_thunk_int16.c +++ b/FactoryKernels/GB_sel__lt_thunk_int16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_int16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_int32.c b/FactoryKernels/GB_sel__lt_thunk_int32.c index 91fa342629..4448acf37a 100644 --- a/FactoryKernels/GB_sel__lt_thunk_int32.c +++ b/FactoryKernels/GB_sel__lt_thunk_int32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_int32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_int64.c b/FactoryKernels/GB_sel__lt_thunk_int64.c index d5ab4fb370..c2d98ae2c1 100644 --- a/FactoryKernels/GB_sel__lt_thunk_int64.c +++ b/FactoryKernels/GB_sel__lt_thunk_int64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_int64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_int8.c b/FactoryKernels/GB_sel__lt_thunk_int8.c index 180d51c0cc..95fe4f2ab6 100644 --- a/FactoryKernels/GB_sel__lt_thunk_int8.c +++ b/FactoryKernels/GB_sel__lt_thunk_int8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_int8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_uint16.c b/FactoryKernels/GB_sel__lt_thunk_uint16.c index c5085ffbec..cbf78a370e 100644 --- a/FactoryKernels/GB_sel__lt_thunk_uint16.c +++ b/FactoryKernels/GB_sel__lt_thunk_uint16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_uint32.c b/FactoryKernels/GB_sel__lt_thunk_uint32.c index 560d530103..49b955a51e 100644 --- a/FactoryKernels/GB_sel__lt_thunk_uint32.c +++ b/FactoryKernels/GB_sel__lt_thunk_uint32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_uint64.c b/FactoryKernels/GB_sel__lt_thunk_uint64.c index d8a4707ee5..237a5c8b68 100644 --- a/FactoryKernels/GB_sel__lt_thunk_uint64.c +++ b/FactoryKernels/GB_sel__lt_thunk_uint64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__lt_thunk_uint8.c b/FactoryKernels/GB_sel__lt_thunk_uint8.c index ec35e6e2a3..a05ed53225 100644 --- a/FactoryKernels/GB_sel__lt_thunk_uint8.c +++ b/FactoryKernels/GB_sel__lt_thunk_uint8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__lt_thunk_uint8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_fc32.c b/FactoryKernels/GB_sel__ne_thunk_fc32.c index eb032b8da8..0a2e62d60e 100644 --- a/FactoryKernels/GB_sel__ne_thunk_fc32.c +++ b/FactoryKernels/GB_sel__ne_thunk_fc32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_fc32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_fc64.c b/FactoryKernels/GB_sel__ne_thunk_fc64.c index dd961b94ba..8d941cf004 100644 --- a/FactoryKernels/GB_sel__ne_thunk_fc64.c +++ b/FactoryKernels/GB_sel__ne_thunk_fc64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_fc64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_fp32.c b/FactoryKernels/GB_sel__ne_thunk_fp32.c index 27c81837cd..4c1b899f5f 100644 --- a/FactoryKernels/GB_sel__ne_thunk_fp32.c +++ b/FactoryKernels/GB_sel__ne_thunk_fp32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_fp32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_fp64.c b/FactoryKernels/GB_sel__ne_thunk_fp64.c index ab4dcc2395..0295f1ca73 100644 --- a/FactoryKernels/GB_sel__ne_thunk_fp64.c +++ b/FactoryKernels/GB_sel__ne_thunk_fp64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_fp64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_int16.c b/FactoryKernels/GB_sel__ne_thunk_int16.c index 5cf22d3209..6b8b082a44 100644 --- a/FactoryKernels/GB_sel__ne_thunk_int16.c +++ b/FactoryKernels/GB_sel__ne_thunk_int16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_int16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_int32.c b/FactoryKernels/GB_sel__ne_thunk_int32.c index 12dc282877..0277796e30 100644 --- a/FactoryKernels/GB_sel__ne_thunk_int32.c +++ b/FactoryKernels/GB_sel__ne_thunk_int32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_int32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_int64.c b/FactoryKernels/GB_sel__ne_thunk_int64.c index ee1a6c59a4..7f5d06f871 100644 --- a/FactoryKernels/GB_sel__ne_thunk_int64.c +++ b/FactoryKernels/GB_sel__ne_thunk_int64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_int64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_int8.c b/FactoryKernels/GB_sel__ne_thunk_int8.c index d295b6ff5f..82f5b78404 100644 --- a/FactoryKernels/GB_sel__ne_thunk_int8.c +++ b/FactoryKernels/GB_sel__ne_thunk_int8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_int8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_uint16.c b/FactoryKernels/GB_sel__ne_thunk_uint16.c index 6958363979..21e9226c81 100644 --- a/FactoryKernels/GB_sel__ne_thunk_uint16.c +++ b/FactoryKernels/GB_sel__ne_thunk_uint16.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_uint32.c b/FactoryKernels/GB_sel__ne_thunk_uint32.c index 93c830f3b3..eb56bbd07b 100644 --- a/FactoryKernels/GB_sel__ne_thunk_uint32.c +++ b/FactoryKernels/GB_sel__ne_thunk_uint32.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_uint64.c b/FactoryKernels/GB_sel__ne_thunk_uint64.c index 0f3f026e92..8502f5f702 100644 --- a/FactoryKernels/GB_sel__ne_thunk_uint64.c +++ b/FactoryKernels/GB_sel__ne_thunk_uint64.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__ne_thunk_uint8.c b/FactoryKernels/GB_sel__ne_thunk_uint8.c index 1db5e0d85a..8eefa03589 100644 --- a/FactoryKernels/GB_sel__ne_thunk_uint8.c +++ b/FactoryKernels/GB_sel__ne_thunk_uint8.c @@ -59,7 +59,7 @@ GrB_Info GB (_sel_phase2__ne_thunk_uint8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_bool.c b/FactoryKernels/GB_sel__nonzombie_bool.c index 53b5a7f215..00048051d7 100644 --- a/FactoryKernels/GB_sel__nonzombie_bool.c +++ b/FactoryKernels/GB_sel__nonzombie_bool.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_bool) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_fc32.c b/FactoryKernels/GB_sel__nonzombie_fc32.c index 46b170d1d4..94058c6ba4 100644 --- a/FactoryKernels/GB_sel__nonzombie_fc32.c +++ b/FactoryKernels/GB_sel__nonzombie_fc32.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_fc32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_fc64.c b/FactoryKernels/GB_sel__nonzombie_fc64.c index e0549a9074..596552a461 100644 --- a/FactoryKernels/GB_sel__nonzombie_fc64.c +++ b/FactoryKernels/GB_sel__nonzombie_fc64.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_fc64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_fp32.c b/FactoryKernels/GB_sel__nonzombie_fp32.c index 690aae29b2..38f0172fe2 100644 --- a/FactoryKernels/GB_sel__nonzombie_fp32.c +++ b/FactoryKernels/GB_sel__nonzombie_fp32.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_fp32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_fp64.c b/FactoryKernels/GB_sel__nonzombie_fp64.c index bd9b748367..cc1617d155 100644 --- a/FactoryKernels/GB_sel__nonzombie_fp64.c +++ b/FactoryKernels/GB_sel__nonzombie_fp64.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_fp64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_int16.c b/FactoryKernels/GB_sel__nonzombie_int16.c index 8c12dee73e..043a43bf15 100644 --- a/FactoryKernels/GB_sel__nonzombie_int16.c +++ b/FactoryKernels/GB_sel__nonzombie_int16.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_int16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_int32.c b/FactoryKernels/GB_sel__nonzombie_int32.c index b47d616627..ca2490c06b 100644 --- a/FactoryKernels/GB_sel__nonzombie_int32.c +++ b/FactoryKernels/GB_sel__nonzombie_int32.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_int32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_int64.c b/FactoryKernels/GB_sel__nonzombie_int64.c index bd23d0db36..6b0b34cb25 100644 --- a/FactoryKernels/GB_sel__nonzombie_int64.c +++ b/FactoryKernels/GB_sel__nonzombie_int64.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_int64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_int8.c b/FactoryKernels/GB_sel__nonzombie_int8.c index 3baaedc301..300bad912e 100644 --- a/FactoryKernels/GB_sel__nonzombie_int8.c +++ b/FactoryKernels/GB_sel__nonzombie_int8.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_int8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_uint16.c b/FactoryKernels/GB_sel__nonzombie_uint16.c index 7005b3ee5f..70237d3317 100644 --- a/FactoryKernels/GB_sel__nonzombie_uint16.c +++ b/FactoryKernels/GB_sel__nonzombie_uint16.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_uint16) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_uint32.c b/FactoryKernels/GB_sel__nonzombie_uint32.c index 4be80bd48a..fbe65bf9bc 100644 --- a/FactoryKernels/GB_sel__nonzombie_uint32.c +++ b/FactoryKernels/GB_sel__nonzombie_uint32.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_uint32) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_uint64.c b/FactoryKernels/GB_sel__nonzombie_uint64.c index 02c1f17380..fc673dc84a 100644 --- a/FactoryKernels/GB_sel__nonzombie_uint64.c +++ b/FactoryKernels/GB_sel__nonzombie_uint64.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_uint64) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_sel__nonzombie_uint8.c b/FactoryKernels/GB_sel__nonzombie_uint8.c index dcdfd2bda6..9de9671c81 100644 --- a/FactoryKernels/GB_sel__nonzombie_uint8.c +++ b/FactoryKernels/GB_sel__nonzombie_uint8.c @@ -38,7 +38,7 @@ GrB_Info GB (_sel_phase2__nonzombie_uint8) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/FactoryKernels/GB_uop__abs_bool_bool.c b/FactoryKernels/GB_uop__abs_bool_bool.c index 6427d04390..5bee5f6698 100644 --- a/FactoryKernels/GB_uop__abs_bool_bool.c +++ b/FactoryKernels/GB_uop__abs_bool_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_bool_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_fp32_fc32.c b/FactoryKernels/GB_uop__abs_fp32_fc32.c index 984e89d7fd..26fc26adb4 100644 --- a/FactoryKernels/GB_uop__abs_fp32_fc32.c +++ b/FactoryKernels/GB_uop__abs_fp32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_fp32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_fp32_fp32.c b/FactoryKernels/GB_uop__abs_fp32_fp32.c index f7953a1af5..5bdb1aa313 100644 --- a/FactoryKernels/GB_uop__abs_fp32_fp32.c +++ b/FactoryKernels/GB_uop__abs_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_fp64_fc64.c b/FactoryKernels/GB_uop__abs_fp64_fc64.c index 369329351d..b1a535654f 100644 --- a/FactoryKernels/GB_uop__abs_fp64_fc64.c +++ b/FactoryKernels/GB_uop__abs_fp64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_fp64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_fp64_fp64.c b/FactoryKernels/GB_uop__abs_fp64_fp64.c index 9103a630f0..c7758c7e09 100644 --- a/FactoryKernels/GB_uop__abs_fp64_fp64.c +++ b/FactoryKernels/GB_uop__abs_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_int16_int16.c b/FactoryKernels/GB_uop__abs_int16_int16.c index b6124b4e84..18be0cb6b1 100644 --- a/FactoryKernels/GB_uop__abs_int16_int16.c +++ b/FactoryKernels/GB_uop__abs_int16_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_int16_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_int32_int32.c b/FactoryKernels/GB_uop__abs_int32_int32.c index 07395e314d..7f8e6795ba 100644 --- a/FactoryKernels/GB_uop__abs_int32_int32.c +++ b/FactoryKernels/GB_uop__abs_int32_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_int32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_int64_int64.c b/FactoryKernels/GB_uop__abs_int64_int64.c index 98ea469b4a..c9b0b8fb68 100644 --- a/FactoryKernels/GB_uop__abs_int64_int64.c +++ b/FactoryKernels/GB_uop__abs_int64_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_int64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_int8_int8.c b/FactoryKernels/GB_uop__abs_int8_int8.c index c9d3b2e95f..b7f56dcdd5 100644 --- a/FactoryKernels/GB_uop__abs_int8_int8.c +++ b/FactoryKernels/GB_uop__abs_int8_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_int8_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_uint16_uint16.c b/FactoryKernels/GB_uop__abs_uint16_uint16.c index 9390168f5f..29abf09606 100644 --- a/FactoryKernels/GB_uop__abs_uint16_uint16.c +++ b/FactoryKernels/GB_uop__abs_uint16_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_uint16_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_uint32_uint32.c b/FactoryKernels/GB_uop__abs_uint32_uint32.c index 39424aa260..f68af92f2b 100644 --- a/FactoryKernels/GB_uop__abs_uint32_uint32.c +++ b/FactoryKernels/GB_uop__abs_uint32_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_uint32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_uint64_uint64.c b/FactoryKernels/GB_uop__abs_uint64_uint64.c index af9d16f9e5..a9e73122ad 100644 --- a/FactoryKernels/GB_uop__abs_uint64_uint64.c +++ b/FactoryKernels/GB_uop__abs_uint64_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_uint64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__abs_uint8_uint8.c b/FactoryKernels/GB_uop__abs_uint8_uint8.c index ea410f9e54..4bad0e16a2 100644 --- a/FactoryKernels/GB_uop__abs_uint8_uint8.c +++ b/FactoryKernels/GB_uop__abs_uint8_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__abs_uint8_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__acos_fc32_fc32.c b/FactoryKernels/GB_uop__acos_fc32_fc32.c index 365597aec9..3f4fbd76d2 100644 --- a/FactoryKernels/GB_uop__acos_fc32_fc32.c +++ b/FactoryKernels/GB_uop__acos_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__acos_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__acos_fc64_fc64.c b/FactoryKernels/GB_uop__acos_fc64_fc64.c index c60807a52f..cd499651c0 100644 --- a/FactoryKernels/GB_uop__acos_fc64_fc64.c +++ b/FactoryKernels/GB_uop__acos_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__acos_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__acos_fp32_fp32.c b/FactoryKernels/GB_uop__acos_fp32_fp32.c index 5c59eaa518..56ab8e8881 100644 --- a/FactoryKernels/GB_uop__acos_fp32_fp32.c +++ b/FactoryKernels/GB_uop__acos_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__acos_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__acos_fp64_fp64.c b/FactoryKernels/GB_uop__acos_fp64_fp64.c index 871a501e3c..3f29b6952b 100644 --- a/FactoryKernels/GB_uop__acos_fp64_fp64.c +++ b/FactoryKernels/GB_uop__acos_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__acos_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__acosh_fc32_fc32.c b/FactoryKernels/GB_uop__acosh_fc32_fc32.c index d02ecb7cb8..f0c0ea3907 100644 --- a/FactoryKernels/GB_uop__acosh_fc32_fc32.c +++ b/FactoryKernels/GB_uop__acosh_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__acosh_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__acosh_fc64_fc64.c b/FactoryKernels/GB_uop__acosh_fc64_fc64.c index aaa6216964..6b5a7b9483 100644 --- a/FactoryKernels/GB_uop__acosh_fc64_fc64.c +++ b/FactoryKernels/GB_uop__acosh_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__acosh_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__acosh_fp32_fp32.c b/FactoryKernels/GB_uop__acosh_fp32_fp32.c index f5d4ecf851..c2c9a07320 100644 --- a/FactoryKernels/GB_uop__acosh_fp32_fp32.c +++ b/FactoryKernels/GB_uop__acosh_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__acosh_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__acosh_fp64_fp64.c b/FactoryKernels/GB_uop__acosh_fp64_fp64.c index 72611b693b..b60eb60c67 100644 --- a/FactoryKernels/GB_uop__acosh_fp64_fp64.c +++ b/FactoryKernels/GB_uop__acosh_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__acosh_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_bool_bool.c b/FactoryKernels/GB_uop__ainv_bool_bool.c index bfe3da1a19..0ab4a07627 100644 --- a/FactoryKernels/GB_uop__ainv_bool_bool.c +++ b/FactoryKernels/GB_uop__ainv_bool_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_bool_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_fc32_fc32.c b/FactoryKernels/GB_uop__ainv_fc32_fc32.c index 45a04a6a74..7db40e40ce 100644 --- a/FactoryKernels/GB_uop__ainv_fc32_fc32.c +++ b/FactoryKernels/GB_uop__ainv_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_fc64_fc64.c b/FactoryKernels/GB_uop__ainv_fc64_fc64.c index 59c6488632..76bb676dbb 100644 --- a/FactoryKernels/GB_uop__ainv_fc64_fc64.c +++ b/FactoryKernels/GB_uop__ainv_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_fp32_fp32.c b/FactoryKernels/GB_uop__ainv_fp32_fp32.c index a8017e771b..cf8b6225b5 100644 --- a/FactoryKernels/GB_uop__ainv_fp32_fp32.c +++ b/FactoryKernels/GB_uop__ainv_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_fp64_fp64.c b/FactoryKernels/GB_uop__ainv_fp64_fp64.c index 2ece74f193..bf2cf614ce 100644 --- a/FactoryKernels/GB_uop__ainv_fp64_fp64.c +++ b/FactoryKernels/GB_uop__ainv_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_int16_int16.c b/FactoryKernels/GB_uop__ainv_int16_int16.c index 2ae8151d0b..a88afdafb7 100644 --- a/FactoryKernels/GB_uop__ainv_int16_int16.c +++ b/FactoryKernels/GB_uop__ainv_int16_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_int16_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_int32_int32.c b/FactoryKernels/GB_uop__ainv_int32_int32.c index 323bd7e3a8..ca3449c5f3 100644 --- a/FactoryKernels/GB_uop__ainv_int32_int32.c +++ b/FactoryKernels/GB_uop__ainv_int32_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_int32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_int64_int64.c b/FactoryKernels/GB_uop__ainv_int64_int64.c index 1bd6cde5fc..938b854d6e 100644 --- a/FactoryKernels/GB_uop__ainv_int64_int64.c +++ b/FactoryKernels/GB_uop__ainv_int64_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_int64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_int8_int8.c b/FactoryKernels/GB_uop__ainv_int8_int8.c index 7edc93dd17..30aa21f738 100644 --- a/FactoryKernels/GB_uop__ainv_int8_int8.c +++ b/FactoryKernels/GB_uop__ainv_int8_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_int8_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_uint16_uint16.c b/FactoryKernels/GB_uop__ainv_uint16_uint16.c index b9585687a8..efa9b36dd8 100644 --- a/FactoryKernels/GB_uop__ainv_uint16_uint16.c +++ b/FactoryKernels/GB_uop__ainv_uint16_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_uint16_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_uint32_uint32.c b/FactoryKernels/GB_uop__ainv_uint32_uint32.c index f58ee62954..b3461e123c 100644 --- a/FactoryKernels/GB_uop__ainv_uint32_uint32.c +++ b/FactoryKernels/GB_uop__ainv_uint32_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_uint32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_uint64_uint64.c b/FactoryKernels/GB_uop__ainv_uint64_uint64.c index 37ccf90fa2..9c67f8f26f 100644 --- a/FactoryKernels/GB_uop__ainv_uint64_uint64.c +++ b/FactoryKernels/GB_uop__ainv_uint64_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_uint64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ainv_uint8_uint8.c b/FactoryKernels/GB_uop__ainv_uint8_uint8.c index 95b65d3872..f71c5b7e87 100644 --- a/FactoryKernels/GB_uop__ainv_uint8_uint8.c +++ b/FactoryKernels/GB_uop__ainv_uint8_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ainv_uint8_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__asin_fc32_fc32.c b/FactoryKernels/GB_uop__asin_fc32_fc32.c index af7cc3abb9..e659ff4e93 100644 --- a/FactoryKernels/GB_uop__asin_fc32_fc32.c +++ b/FactoryKernels/GB_uop__asin_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__asin_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__asin_fc64_fc64.c b/FactoryKernels/GB_uop__asin_fc64_fc64.c index 1eb300dd35..353c971224 100644 --- a/FactoryKernels/GB_uop__asin_fc64_fc64.c +++ b/FactoryKernels/GB_uop__asin_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__asin_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__asin_fp32_fp32.c b/FactoryKernels/GB_uop__asin_fp32_fp32.c index 2cf6e2b315..593029d549 100644 --- a/FactoryKernels/GB_uop__asin_fp32_fp32.c +++ b/FactoryKernels/GB_uop__asin_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__asin_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__asin_fp64_fp64.c b/FactoryKernels/GB_uop__asin_fp64_fp64.c index 7bb66e6eef..ef0067c88b 100644 --- a/FactoryKernels/GB_uop__asin_fp64_fp64.c +++ b/FactoryKernels/GB_uop__asin_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__asin_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__asinh_fc32_fc32.c b/FactoryKernels/GB_uop__asinh_fc32_fc32.c index 1ef02cf208..d2f25ff3e7 100644 --- a/FactoryKernels/GB_uop__asinh_fc32_fc32.c +++ b/FactoryKernels/GB_uop__asinh_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__asinh_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__asinh_fc64_fc64.c b/FactoryKernels/GB_uop__asinh_fc64_fc64.c index c7ba30ad93..49bca9fbb9 100644 --- a/FactoryKernels/GB_uop__asinh_fc64_fc64.c +++ b/FactoryKernels/GB_uop__asinh_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__asinh_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__asinh_fp32_fp32.c b/FactoryKernels/GB_uop__asinh_fp32_fp32.c index 927d4aaab6..e832e02d40 100644 --- a/FactoryKernels/GB_uop__asinh_fp32_fp32.c +++ b/FactoryKernels/GB_uop__asinh_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__asinh_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__asinh_fp64_fp64.c b/FactoryKernels/GB_uop__asinh_fp64_fp64.c index 4f3e1fe1d6..df4a01a344 100644 --- a/FactoryKernels/GB_uop__asinh_fp64_fp64.c +++ b/FactoryKernels/GB_uop__asinh_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__asinh_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__atan_fc32_fc32.c b/FactoryKernels/GB_uop__atan_fc32_fc32.c index b06ed9131e..49ce5f8fa7 100644 --- a/FactoryKernels/GB_uop__atan_fc32_fc32.c +++ b/FactoryKernels/GB_uop__atan_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__atan_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__atan_fc64_fc64.c b/FactoryKernels/GB_uop__atan_fc64_fc64.c index 469a6b407e..a6251520fb 100644 --- a/FactoryKernels/GB_uop__atan_fc64_fc64.c +++ b/FactoryKernels/GB_uop__atan_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__atan_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__atan_fp32_fp32.c b/FactoryKernels/GB_uop__atan_fp32_fp32.c index 048f5277df..5065f15524 100644 --- a/FactoryKernels/GB_uop__atan_fp32_fp32.c +++ b/FactoryKernels/GB_uop__atan_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__atan_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__atan_fp64_fp64.c b/FactoryKernels/GB_uop__atan_fp64_fp64.c index 65c5f7063c..6ae05b659a 100644 --- a/FactoryKernels/GB_uop__atan_fp64_fp64.c +++ b/FactoryKernels/GB_uop__atan_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__atan_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__atanh_fc32_fc32.c b/FactoryKernels/GB_uop__atanh_fc32_fc32.c index 50d4dba6cc..d93132ff18 100644 --- a/FactoryKernels/GB_uop__atanh_fc32_fc32.c +++ b/FactoryKernels/GB_uop__atanh_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__atanh_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__atanh_fc64_fc64.c b/FactoryKernels/GB_uop__atanh_fc64_fc64.c index 6dc4788aea..acfa49f0e6 100644 --- a/FactoryKernels/GB_uop__atanh_fc64_fc64.c +++ b/FactoryKernels/GB_uop__atanh_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__atanh_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__atanh_fp32_fp32.c b/FactoryKernels/GB_uop__atanh_fp32_fp32.c index 2d9c92309e..a014227d7b 100644 --- a/FactoryKernels/GB_uop__atanh_fp32_fp32.c +++ b/FactoryKernels/GB_uop__atanh_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__atanh_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__atanh_fp64_fp64.c b/FactoryKernels/GB_uop__atanh_fp64_fp64.c index 1f97af7331..c4f9834bc5 100644 --- a/FactoryKernels/GB_uop__atanh_fp64_fp64.c +++ b/FactoryKernels/GB_uop__atanh_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__atanh_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__bnot_int16_int16.c b/FactoryKernels/GB_uop__bnot_int16_int16.c index 9cd07ca5cd..9e14bc85a0 100644 --- a/FactoryKernels/GB_uop__bnot_int16_int16.c +++ b/FactoryKernels/GB_uop__bnot_int16_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__bnot_int16_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__bnot_int32_int32.c b/FactoryKernels/GB_uop__bnot_int32_int32.c index 8e43bb1695..3534932f8c 100644 --- a/FactoryKernels/GB_uop__bnot_int32_int32.c +++ b/FactoryKernels/GB_uop__bnot_int32_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__bnot_int32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__bnot_int64_int64.c b/FactoryKernels/GB_uop__bnot_int64_int64.c index 1cf99ee29b..71af98e168 100644 --- a/FactoryKernels/GB_uop__bnot_int64_int64.c +++ b/FactoryKernels/GB_uop__bnot_int64_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__bnot_int64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__bnot_int8_int8.c b/FactoryKernels/GB_uop__bnot_int8_int8.c index e8ad0cf7e4..494ede6057 100644 --- a/FactoryKernels/GB_uop__bnot_int8_int8.c +++ b/FactoryKernels/GB_uop__bnot_int8_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__bnot_int8_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__bnot_uint16_uint16.c b/FactoryKernels/GB_uop__bnot_uint16_uint16.c index 624f64c468..460d53d4f3 100644 --- a/FactoryKernels/GB_uop__bnot_uint16_uint16.c +++ b/FactoryKernels/GB_uop__bnot_uint16_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__bnot_uint16_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__bnot_uint32_uint32.c b/FactoryKernels/GB_uop__bnot_uint32_uint32.c index 8fb669ce70..3de990ef36 100644 --- a/FactoryKernels/GB_uop__bnot_uint32_uint32.c +++ b/FactoryKernels/GB_uop__bnot_uint32_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__bnot_uint32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__bnot_uint64_uint64.c b/FactoryKernels/GB_uop__bnot_uint64_uint64.c index e6c08dfbec..35c913951a 100644 --- a/FactoryKernels/GB_uop__bnot_uint64_uint64.c +++ b/FactoryKernels/GB_uop__bnot_uint64_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__bnot_uint64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__bnot_uint8_uint8.c b/FactoryKernels/GB_uop__bnot_uint8_uint8.c index 8c8c201bd1..c20360a117 100644 --- a/FactoryKernels/GB_uop__bnot_uint8_uint8.c +++ b/FactoryKernels/GB_uop__bnot_uint8_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__bnot_uint8_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__carg_fp32_fc32.c b/FactoryKernels/GB_uop__carg_fp32_fc32.c index 302db10dff..9e2770a0ad 100644 --- a/FactoryKernels/GB_uop__carg_fp32_fc32.c +++ b/FactoryKernels/GB_uop__carg_fp32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__carg_fp32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__carg_fp64_fc64.c b/FactoryKernels/GB_uop__carg_fp64_fc64.c index 3825ee34dd..4056f098bf 100644 --- a/FactoryKernels/GB_uop__carg_fp64_fc64.c +++ b/FactoryKernels/GB_uop__carg_fp64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__carg_fp64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cbrt_fp32_fp32.c b/FactoryKernels/GB_uop__cbrt_fp32_fp32.c index ac9228eee6..e14d94ba45 100644 --- a/FactoryKernels/GB_uop__cbrt_fp32_fp32.c +++ b/FactoryKernels/GB_uop__cbrt_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cbrt_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cbrt_fp64_fp64.c b/FactoryKernels/GB_uop__cbrt_fp64_fp64.c index a94862b84f..39e5aba1e7 100644 --- a/FactoryKernels/GB_uop__cbrt_fp64_fp64.c +++ b/FactoryKernels/GB_uop__cbrt_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cbrt_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ceil_fc32_fc32.c b/FactoryKernels/GB_uop__ceil_fc32_fc32.c index 22ee325db4..5bebe99800 100644 --- a/FactoryKernels/GB_uop__ceil_fc32_fc32.c +++ b/FactoryKernels/GB_uop__ceil_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ceil_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ceil_fc64_fc64.c b/FactoryKernels/GB_uop__ceil_fc64_fc64.c index eeff39ff9f..2b560186a4 100644 --- a/FactoryKernels/GB_uop__ceil_fc64_fc64.c +++ b/FactoryKernels/GB_uop__ceil_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ceil_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ceil_fp32_fp32.c b/FactoryKernels/GB_uop__ceil_fp32_fp32.c index a3e5dc062b..0c87f67be9 100644 --- a/FactoryKernels/GB_uop__ceil_fp32_fp32.c +++ b/FactoryKernels/GB_uop__ceil_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ceil_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__ceil_fp64_fp64.c b/FactoryKernels/GB_uop__ceil_fp64_fp64.c index b83cfeeadc..750b30dd64 100644 --- a/FactoryKernels/GB_uop__ceil_fp64_fp64.c +++ b/FactoryKernels/GB_uop__ceil_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__ceil_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cimag_fp32_fc32.c b/FactoryKernels/GB_uop__cimag_fp32_fc32.c index 3560736991..5b341ae818 100644 --- a/FactoryKernels/GB_uop__cimag_fp32_fc32.c +++ b/FactoryKernels/GB_uop__cimag_fp32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cimag_fp32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cimag_fp64_fc64.c b/FactoryKernels/GB_uop__cimag_fp64_fc64.c index 069d222f60..c00496b0dc 100644 --- a/FactoryKernels/GB_uop__cimag_fp64_fc64.c +++ b/FactoryKernels/GB_uop__cimag_fp64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cimag_fp64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__conj_fc32_fc32.c b/FactoryKernels/GB_uop__conj_fc32_fc32.c index b3f03609c0..876cb44aee 100644 --- a/FactoryKernels/GB_uop__conj_fc32_fc32.c +++ b/FactoryKernels/GB_uop__conj_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__conj_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__conj_fc64_fc64.c b/FactoryKernels/GB_uop__conj_fc64_fc64.c index cc7b7515bc..fde9949f78 100644 --- a/FactoryKernels/GB_uop__conj_fc64_fc64.c +++ b/FactoryKernels/GB_uop__conj_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__conj_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cos_fc32_fc32.c b/FactoryKernels/GB_uop__cos_fc32_fc32.c index 1cafa32a10..323b9fba87 100644 --- a/FactoryKernels/GB_uop__cos_fc32_fc32.c +++ b/FactoryKernels/GB_uop__cos_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cos_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cos_fc64_fc64.c b/FactoryKernels/GB_uop__cos_fc64_fc64.c index 7de3e656c6..2ec9f032be 100644 --- a/FactoryKernels/GB_uop__cos_fc64_fc64.c +++ b/FactoryKernels/GB_uop__cos_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cos_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cos_fp32_fp32.c b/FactoryKernels/GB_uop__cos_fp32_fp32.c index 0b89b3aeae..259a241320 100644 --- a/FactoryKernels/GB_uop__cos_fp32_fp32.c +++ b/FactoryKernels/GB_uop__cos_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cos_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cos_fp64_fp64.c b/FactoryKernels/GB_uop__cos_fp64_fp64.c index b7aa7bddb6..0d413395dd 100644 --- a/FactoryKernels/GB_uop__cos_fp64_fp64.c +++ b/FactoryKernels/GB_uop__cos_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cos_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cosh_fc32_fc32.c b/FactoryKernels/GB_uop__cosh_fc32_fc32.c index cf92ea5f67..c57d7a1b80 100644 --- a/FactoryKernels/GB_uop__cosh_fc32_fc32.c +++ b/FactoryKernels/GB_uop__cosh_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cosh_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cosh_fc64_fc64.c b/FactoryKernels/GB_uop__cosh_fc64_fc64.c index 03160131d2..63d889041a 100644 --- a/FactoryKernels/GB_uop__cosh_fc64_fc64.c +++ b/FactoryKernels/GB_uop__cosh_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cosh_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cosh_fp32_fp32.c b/FactoryKernels/GB_uop__cosh_fp32_fp32.c index 3cca7399a1..f7f631a142 100644 --- a/FactoryKernels/GB_uop__cosh_fp32_fp32.c +++ b/FactoryKernels/GB_uop__cosh_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cosh_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__cosh_fp64_fp64.c b/FactoryKernels/GB_uop__cosh_fp64_fp64.c index 650d81e361..526a35dba3 100644 --- a/FactoryKernels/GB_uop__cosh_fp64_fp64.c +++ b/FactoryKernels/GB_uop__cosh_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__cosh_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__creal_fp32_fc32.c b/FactoryKernels/GB_uop__creal_fp32_fc32.c index 1f37ed7c4e..2fea8b6067 100644 --- a/FactoryKernels/GB_uop__creal_fp32_fc32.c +++ b/FactoryKernels/GB_uop__creal_fp32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__creal_fp32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__creal_fp64_fc64.c b/FactoryKernels/GB_uop__creal_fp64_fc64.c index f6dc29b4f7..673bcd5806 100644 --- a/FactoryKernels/GB_uop__creal_fp64_fc64.c +++ b/FactoryKernels/GB_uop__creal_fp64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__creal_fp64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__erf_fp32_fp32.c b/FactoryKernels/GB_uop__erf_fp32_fp32.c index 87e03c55e5..06cd176322 100644 --- a/FactoryKernels/GB_uop__erf_fp32_fp32.c +++ b/FactoryKernels/GB_uop__erf_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__erf_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__erf_fp64_fp64.c b/FactoryKernels/GB_uop__erf_fp64_fp64.c index a13c4e736a..c2ba605c3a 100644 --- a/FactoryKernels/GB_uop__erf_fp64_fp64.c +++ b/FactoryKernels/GB_uop__erf_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__erf_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__erfc_fp32_fp32.c b/FactoryKernels/GB_uop__erfc_fp32_fp32.c index e0a7fcb981..62d8d29819 100644 --- a/FactoryKernels/GB_uop__erfc_fp32_fp32.c +++ b/FactoryKernels/GB_uop__erfc_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__erfc_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__erfc_fp64_fp64.c b/FactoryKernels/GB_uop__erfc_fp64_fp64.c index 33dc237d48..37c22c6517 100644 --- a/FactoryKernels/GB_uop__erfc_fp64_fp64.c +++ b/FactoryKernels/GB_uop__erfc_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__erfc_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__exp2_fc32_fc32.c b/FactoryKernels/GB_uop__exp2_fc32_fc32.c index 4cda8e723d..a79e1e7ae9 100644 --- a/FactoryKernels/GB_uop__exp2_fc32_fc32.c +++ b/FactoryKernels/GB_uop__exp2_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__exp2_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__exp2_fc64_fc64.c b/FactoryKernels/GB_uop__exp2_fc64_fc64.c index c3db51bbb3..44418858c3 100644 --- a/FactoryKernels/GB_uop__exp2_fc64_fc64.c +++ b/FactoryKernels/GB_uop__exp2_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__exp2_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__exp2_fp32_fp32.c b/FactoryKernels/GB_uop__exp2_fp32_fp32.c index 8aa88e1f90..7fe73a627c 100644 --- a/FactoryKernels/GB_uop__exp2_fp32_fp32.c +++ b/FactoryKernels/GB_uop__exp2_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__exp2_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__exp2_fp64_fp64.c b/FactoryKernels/GB_uop__exp2_fp64_fp64.c index aeb7501be8..81aea7287d 100644 --- a/FactoryKernels/GB_uop__exp2_fp64_fp64.c +++ b/FactoryKernels/GB_uop__exp2_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__exp2_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__exp_fc32_fc32.c b/FactoryKernels/GB_uop__exp_fc32_fc32.c index ed1c33be23..4d50e636e2 100644 --- a/FactoryKernels/GB_uop__exp_fc32_fc32.c +++ b/FactoryKernels/GB_uop__exp_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__exp_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__exp_fc64_fc64.c b/FactoryKernels/GB_uop__exp_fc64_fc64.c index 0b1b7428db..9afd6a66e7 100644 --- a/FactoryKernels/GB_uop__exp_fc64_fc64.c +++ b/FactoryKernels/GB_uop__exp_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__exp_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__exp_fp32_fp32.c b/FactoryKernels/GB_uop__exp_fp32_fp32.c index 3fcbc3b8fd..a8ee4f16e6 100644 --- a/FactoryKernels/GB_uop__exp_fp32_fp32.c +++ b/FactoryKernels/GB_uop__exp_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__exp_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__exp_fp64_fp64.c b/FactoryKernels/GB_uop__exp_fp64_fp64.c index 22aac398e3..4ecf2a6ca7 100644 --- a/FactoryKernels/GB_uop__exp_fp64_fp64.c +++ b/FactoryKernels/GB_uop__exp_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__exp_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__expm1_fc32_fc32.c b/FactoryKernels/GB_uop__expm1_fc32_fc32.c index df3b1fbe68..3711af2009 100644 --- a/FactoryKernels/GB_uop__expm1_fc32_fc32.c +++ b/FactoryKernels/GB_uop__expm1_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__expm1_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__expm1_fc64_fc64.c b/FactoryKernels/GB_uop__expm1_fc64_fc64.c index 554e21a1a0..bd09610727 100644 --- a/FactoryKernels/GB_uop__expm1_fc64_fc64.c +++ b/FactoryKernels/GB_uop__expm1_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__expm1_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__expm1_fp32_fp32.c b/FactoryKernels/GB_uop__expm1_fp32_fp32.c index 3b9e5484ec..cf154322e2 100644 --- a/FactoryKernels/GB_uop__expm1_fp32_fp32.c +++ b/FactoryKernels/GB_uop__expm1_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__expm1_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__expm1_fp64_fp64.c b/FactoryKernels/GB_uop__expm1_fp64_fp64.c index ed552b2d5e..522b753169 100644 --- a/FactoryKernels/GB_uop__expm1_fp64_fp64.c +++ b/FactoryKernels/GB_uop__expm1_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__expm1_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__floor_fc32_fc32.c b/FactoryKernels/GB_uop__floor_fc32_fc32.c index 78851ee78d..078d464000 100644 --- a/FactoryKernels/GB_uop__floor_fc32_fc32.c +++ b/FactoryKernels/GB_uop__floor_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__floor_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__floor_fc64_fc64.c b/FactoryKernels/GB_uop__floor_fc64_fc64.c index b62f95c976..fc42750479 100644 --- a/FactoryKernels/GB_uop__floor_fc64_fc64.c +++ b/FactoryKernels/GB_uop__floor_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__floor_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__floor_fp32_fp32.c b/FactoryKernels/GB_uop__floor_fp32_fp32.c index 4ad0fcd2b5..3c4d38ad62 100644 --- a/FactoryKernels/GB_uop__floor_fp32_fp32.c +++ b/FactoryKernels/GB_uop__floor_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__floor_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__floor_fp64_fp64.c b/FactoryKernels/GB_uop__floor_fp64_fp64.c index 5a95536319..7abd978cb6 100644 --- a/FactoryKernels/GB_uop__floor_fp64_fp64.c +++ b/FactoryKernels/GB_uop__floor_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__floor_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__frexpe_fp32_fp32.c b/FactoryKernels/GB_uop__frexpe_fp32_fp32.c index 23e54c4d9e..dc0b3156b2 100644 --- a/FactoryKernels/GB_uop__frexpe_fp32_fp32.c +++ b/FactoryKernels/GB_uop__frexpe_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__frexpe_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__frexpe_fp64_fp64.c b/FactoryKernels/GB_uop__frexpe_fp64_fp64.c index 64f37f80ee..7d98a773a8 100644 --- a/FactoryKernels/GB_uop__frexpe_fp64_fp64.c +++ b/FactoryKernels/GB_uop__frexpe_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__frexpe_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__frexpx_fp32_fp32.c b/FactoryKernels/GB_uop__frexpx_fp32_fp32.c index 9b4cea915f..a5a8da913b 100644 --- a/FactoryKernels/GB_uop__frexpx_fp32_fp32.c +++ b/FactoryKernels/GB_uop__frexpx_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__frexpx_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__frexpx_fp64_fp64.c b/FactoryKernels/GB_uop__frexpx_fp64_fp64.c index cfd3910061..b1b1dac1b4 100644 --- a/FactoryKernels/GB_uop__frexpx_fp64_fp64.c +++ b/FactoryKernels/GB_uop__frexpx_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__frexpx_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_bool.c b/FactoryKernels/GB_uop__identity_bool_bool.c index 40bef7b64b..bdea7fcb77 100644 --- a/FactoryKernels/GB_uop__identity_bool_bool.c +++ b/FactoryKernels/GB_uop__identity_bool_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_bool_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_fc32.c b/FactoryKernels/GB_uop__identity_bool_fc32.c index d4b52763e1..5113d12566 100644 --- a/FactoryKernels/GB_uop__identity_bool_fc32.c +++ b/FactoryKernels/GB_uop__identity_bool_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_fc64.c b/FactoryKernels/GB_uop__identity_bool_fc64.c index d2421c7b39..30b4f95585 100644 --- a/FactoryKernels/GB_uop__identity_bool_fc64.c +++ b/FactoryKernels/GB_uop__identity_bool_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_fp32.c b/FactoryKernels/GB_uop__identity_bool_fp32.c index 5b82d47b0b..5c3321d388 100644 --- a/FactoryKernels/GB_uop__identity_bool_fp32.c +++ b/FactoryKernels/GB_uop__identity_bool_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_fp64.c b/FactoryKernels/GB_uop__identity_bool_fp64.c index 994806b9f4..75275da8e3 100644 --- a/FactoryKernels/GB_uop__identity_bool_fp64.c +++ b/FactoryKernels/GB_uop__identity_bool_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_int16.c b/FactoryKernels/GB_uop__identity_bool_int16.c index 281d023501..c22885ba7a 100644 --- a/FactoryKernels/GB_uop__identity_bool_int16.c +++ b/FactoryKernels/GB_uop__identity_bool_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_int32.c b/FactoryKernels/GB_uop__identity_bool_int32.c index 6207088abd..efc7e93871 100644 --- a/FactoryKernels/GB_uop__identity_bool_int32.c +++ b/FactoryKernels/GB_uop__identity_bool_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_int64.c b/FactoryKernels/GB_uop__identity_bool_int64.c index 03769be13a..d3f3a0f038 100644 --- a/FactoryKernels/GB_uop__identity_bool_int64.c +++ b/FactoryKernels/GB_uop__identity_bool_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_int8.c b/FactoryKernels/GB_uop__identity_bool_int8.c index 4864d10f89..26c52eb9d5 100644 --- a/FactoryKernels/GB_uop__identity_bool_int8.c +++ b/FactoryKernels/GB_uop__identity_bool_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_uint16.c b/FactoryKernels/GB_uop__identity_bool_uint16.c index 84c94834b1..bbc93be5a4 100644 --- a/FactoryKernels/GB_uop__identity_bool_uint16.c +++ b/FactoryKernels/GB_uop__identity_bool_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_uint32.c b/FactoryKernels/GB_uop__identity_bool_uint32.c index 3947ea4737..a86a5e62c2 100644 --- a/FactoryKernels/GB_uop__identity_bool_uint32.c +++ b/FactoryKernels/GB_uop__identity_bool_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_uint64.c b/FactoryKernels/GB_uop__identity_bool_uint64.c index 0c0aa9829f..6a04376765 100644 --- a/FactoryKernels/GB_uop__identity_bool_uint64.c +++ b/FactoryKernels/GB_uop__identity_bool_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_bool_uint8.c b/FactoryKernels/GB_uop__identity_bool_uint8.c index 1e98ce30aa..40ec6695af 100644 --- a/FactoryKernels/GB_uop__identity_bool_uint8.c +++ b/FactoryKernels/GB_uop__identity_bool_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_bool_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_bool.c b/FactoryKernels/GB_uop__identity_fc32_bool.c index 58168272ac..17895dee8d 100644 --- a/FactoryKernels/GB_uop__identity_fc32_bool.c +++ b/FactoryKernels/GB_uop__identity_fc32_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_fc32.c b/FactoryKernels/GB_uop__identity_fc32_fc32.c index e5cfa40f62..00453a4bc6 100644 --- a/FactoryKernels/GB_uop__identity_fc32_fc32.c +++ b/FactoryKernels/GB_uop__identity_fc32_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_fc64.c b/FactoryKernels/GB_uop__identity_fc32_fc64.c index d1236e592d..bd894af04a 100644 --- a/FactoryKernels/GB_uop__identity_fc32_fc64.c +++ b/FactoryKernels/GB_uop__identity_fc32_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_fp32.c b/FactoryKernels/GB_uop__identity_fc32_fp32.c index f855ce5c10..e563f2b99d 100644 --- a/FactoryKernels/GB_uop__identity_fc32_fp32.c +++ b/FactoryKernels/GB_uop__identity_fc32_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_fp64.c b/FactoryKernels/GB_uop__identity_fc32_fp64.c index 8c81348381..9c740910e7 100644 --- a/FactoryKernels/GB_uop__identity_fc32_fp64.c +++ b/FactoryKernels/GB_uop__identity_fc32_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_int16.c b/FactoryKernels/GB_uop__identity_fc32_int16.c index 539b76ae49..51d70b99b2 100644 --- a/FactoryKernels/GB_uop__identity_fc32_int16.c +++ b/FactoryKernels/GB_uop__identity_fc32_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_int32.c b/FactoryKernels/GB_uop__identity_fc32_int32.c index 05f7d645be..998375d47e 100644 --- a/FactoryKernels/GB_uop__identity_fc32_int32.c +++ b/FactoryKernels/GB_uop__identity_fc32_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_int64.c b/FactoryKernels/GB_uop__identity_fc32_int64.c index 5df186437b..eac4d8e368 100644 --- a/FactoryKernels/GB_uop__identity_fc32_int64.c +++ b/FactoryKernels/GB_uop__identity_fc32_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_int8.c b/FactoryKernels/GB_uop__identity_fc32_int8.c index ce25a99c8b..f1b818302e 100644 --- a/FactoryKernels/GB_uop__identity_fc32_int8.c +++ b/FactoryKernels/GB_uop__identity_fc32_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_uint16.c b/FactoryKernels/GB_uop__identity_fc32_uint16.c index 7c94c8c3e3..a83e2018d9 100644 --- a/FactoryKernels/GB_uop__identity_fc32_uint16.c +++ b/FactoryKernels/GB_uop__identity_fc32_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_uint32.c b/FactoryKernels/GB_uop__identity_fc32_uint32.c index f85ac87f84..0580b9982b 100644 --- a/FactoryKernels/GB_uop__identity_fc32_uint32.c +++ b/FactoryKernels/GB_uop__identity_fc32_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_uint64.c b/FactoryKernels/GB_uop__identity_fc32_uint64.c index 5d677f3fba..65e4387ff2 100644 --- a/FactoryKernels/GB_uop__identity_fc32_uint64.c +++ b/FactoryKernels/GB_uop__identity_fc32_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc32_uint8.c b/FactoryKernels/GB_uop__identity_fc32_uint8.c index 80867e1654..ed5a3e5169 100644 --- a/FactoryKernels/GB_uop__identity_fc32_uint8.c +++ b/FactoryKernels/GB_uop__identity_fc32_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc32_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_bool.c b/FactoryKernels/GB_uop__identity_fc64_bool.c index e2fa0a2375..4bc013f9fb 100644 --- a/FactoryKernels/GB_uop__identity_fc64_bool.c +++ b/FactoryKernels/GB_uop__identity_fc64_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_fc32.c b/FactoryKernels/GB_uop__identity_fc64_fc32.c index aa3e3c2fa3..a0a969427d 100644 --- a/FactoryKernels/GB_uop__identity_fc64_fc32.c +++ b/FactoryKernels/GB_uop__identity_fc64_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_fc64.c b/FactoryKernels/GB_uop__identity_fc64_fc64.c index 1045df6916..a69d02febc 100644 --- a/FactoryKernels/GB_uop__identity_fc64_fc64.c +++ b/FactoryKernels/GB_uop__identity_fc64_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_fp32.c b/FactoryKernels/GB_uop__identity_fc64_fp32.c index 5c1673919d..e81df8a45a 100644 --- a/FactoryKernels/GB_uop__identity_fc64_fp32.c +++ b/FactoryKernels/GB_uop__identity_fc64_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_fp64.c b/FactoryKernels/GB_uop__identity_fc64_fp64.c index 94961aaac2..8d338dffed 100644 --- a/FactoryKernels/GB_uop__identity_fc64_fp64.c +++ b/FactoryKernels/GB_uop__identity_fc64_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_int16.c b/FactoryKernels/GB_uop__identity_fc64_int16.c index 9b2433b660..e95fa6dffe 100644 --- a/FactoryKernels/GB_uop__identity_fc64_int16.c +++ b/FactoryKernels/GB_uop__identity_fc64_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_int32.c b/FactoryKernels/GB_uop__identity_fc64_int32.c index 44618de085..9ad76b0cc9 100644 --- a/FactoryKernels/GB_uop__identity_fc64_int32.c +++ b/FactoryKernels/GB_uop__identity_fc64_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_int64.c b/FactoryKernels/GB_uop__identity_fc64_int64.c index f3df0fa62c..e4fc7baba9 100644 --- a/FactoryKernels/GB_uop__identity_fc64_int64.c +++ b/FactoryKernels/GB_uop__identity_fc64_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_int8.c b/FactoryKernels/GB_uop__identity_fc64_int8.c index e2d3608928..010046580d 100644 --- a/FactoryKernels/GB_uop__identity_fc64_int8.c +++ b/FactoryKernels/GB_uop__identity_fc64_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_uint16.c b/FactoryKernels/GB_uop__identity_fc64_uint16.c index 2ab01b74d6..b1eba58571 100644 --- a/FactoryKernels/GB_uop__identity_fc64_uint16.c +++ b/FactoryKernels/GB_uop__identity_fc64_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_uint32.c b/FactoryKernels/GB_uop__identity_fc64_uint32.c index f58225ff84..e0d5870f8e 100644 --- a/FactoryKernels/GB_uop__identity_fc64_uint32.c +++ b/FactoryKernels/GB_uop__identity_fc64_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_uint64.c b/FactoryKernels/GB_uop__identity_fc64_uint64.c index bc7e9ffe7f..acd95e6a9b 100644 --- a/FactoryKernels/GB_uop__identity_fc64_uint64.c +++ b/FactoryKernels/GB_uop__identity_fc64_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fc64_uint8.c b/FactoryKernels/GB_uop__identity_fc64_uint8.c index d7d776f200..a168c889dc 100644 --- a/FactoryKernels/GB_uop__identity_fc64_uint8.c +++ b/FactoryKernels/GB_uop__identity_fc64_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fc64_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_bool.c b/FactoryKernels/GB_uop__identity_fp32_bool.c index 1d04d1e136..c92075e7d1 100644 --- a/FactoryKernels/GB_uop__identity_fp32_bool.c +++ b/FactoryKernels/GB_uop__identity_fp32_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_fc32.c b/FactoryKernels/GB_uop__identity_fp32_fc32.c index 0790e2bd27..87ca784bb3 100644 --- a/FactoryKernels/GB_uop__identity_fp32_fc32.c +++ b/FactoryKernels/GB_uop__identity_fp32_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_fc64.c b/FactoryKernels/GB_uop__identity_fp32_fc64.c index fddc1f4362..9d43cc19af 100644 --- a/FactoryKernels/GB_uop__identity_fp32_fc64.c +++ b/FactoryKernels/GB_uop__identity_fp32_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_fp32.c b/FactoryKernels/GB_uop__identity_fp32_fp32.c index 29b46a1597..e9c8bd0e13 100644 --- a/FactoryKernels/GB_uop__identity_fp32_fp32.c +++ b/FactoryKernels/GB_uop__identity_fp32_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_fp64.c b/FactoryKernels/GB_uop__identity_fp32_fp64.c index 9033e35df4..9c36791ff5 100644 --- a/FactoryKernels/GB_uop__identity_fp32_fp64.c +++ b/FactoryKernels/GB_uop__identity_fp32_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_int16.c b/FactoryKernels/GB_uop__identity_fp32_int16.c index 1435028440..d429fd9e3c 100644 --- a/FactoryKernels/GB_uop__identity_fp32_int16.c +++ b/FactoryKernels/GB_uop__identity_fp32_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_int32.c b/FactoryKernels/GB_uop__identity_fp32_int32.c index c521e68676..71211404a4 100644 --- a/FactoryKernels/GB_uop__identity_fp32_int32.c +++ b/FactoryKernels/GB_uop__identity_fp32_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_int64.c b/FactoryKernels/GB_uop__identity_fp32_int64.c index ff308de14d..a3fb88ee2d 100644 --- a/FactoryKernels/GB_uop__identity_fp32_int64.c +++ b/FactoryKernels/GB_uop__identity_fp32_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_int8.c b/FactoryKernels/GB_uop__identity_fp32_int8.c index 246112f961..a64006d62f 100644 --- a/FactoryKernels/GB_uop__identity_fp32_int8.c +++ b/FactoryKernels/GB_uop__identity_fp32_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_uint16.c b/FactoryKernels/GB_uop__identity_fp32_uint16.c index 5d75d6e77d..bb23cbf6e3 100644 --- a/FactoryKernels/GB_uop__identity_fp32_uint16.c +++ b/FactoryKernels/GB_uop__identity_fp32_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_uint32.c b/FactoryKernels/GB_uop__identity_fp32_uint32.c index d86644b824..9b41df496a 100644 --- a/FactoryKernels/GB_uop__identity_fp32_uint32.c +++ b/FactoryKernels/GB_uop__identity_fp32_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_uint64.c b/FactoryKernels/GB_uop__identity_fp32_uint64.c index f7dce03f03..705ad19d8c 100644 --- a/FactoryKernels/GB_uop__identity_fp32_uint64.c +++ b/FactoryKernels/GB_uop__identity_fp32_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp32_uint8.c b/FactoryKernels/GB_uop__identity_fp32_uint8.c index 3f15fa32bc..51b38ba163 100644 --- a/FactoryKernels/GB_uop__identity_fp32_uint8.c +++ b/FactoryKernels/GB_uop__identity_fp32_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp32_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_bool.c b/FactoryKernels/GB_uop__identity_fp64_bool.c index 368ef85dc4..817f855ce9 100644 --- a/FactoryKernels/GB_uop__identity_fp64_bool.c +++ b/FactoryKernels/GB_uop__identity_fp64_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_fc32.c b/FactoryKernels/GB_uop__identity_fp64_fc32.c index d09da36d8b..bf57979ff8 100644 --- a/FactoryKernels/GB_uop__identity_fp64_fc32.c +++ b/FactoryKernels/GB_uop__identity_fp64_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_fc64.c b/FactoryKernels/GB_uop__identity_fp64_fc64.c index 6c5241790c..e3ad4370ee 100644 --- a/FactoryKernels/GB_uop__identity_fp64_fc64.c +++ b/FactoryKernels/GB_uop__identity_fp64_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_fp32.c b/FactoryKernels/GB_uop__identity_fp64_fp32.c index c63a5e83a1..fc97e38c6c 100644 --- a/FactoryKernels/GB_uop__identity_fp64_fp32.c +++ b/FactoryKernels/GB_uop__identity_fp64_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_fp64.c b/FactoryKernels/GB_uop__identity_fp64_fp64.c index 6a924ec63d..6b80334ece 100644 --- a/FactoryKernels/GB_uop__identity_fp64_fp64.c +++ b/FactoryKernels/GB_uop__identity_fp64_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_int16.c b/FactoryKernels/GB_uop__identity_fp64_int16.c index f63bcda3e6..5b5fe34ef0 100644 --- a/FactoryKernels/GB_uop__identity_fp64_int16.c +++ b/FactoryKernels/GB_uop__identity_fp64_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_int32.c b/FactoryKernels/GB_uop__identity_fp64_int32.c index 136c1960e5..e321599bd7 100644 --- a/FactoryKernels/GB_uop__identity_fp64_int32.c +++ b/FactoryKernels/GB_uop__identity_fp64_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_int64.c b/FactoryKernels/GB_uop__identity_fp64_int64.c index 87220a6e89..ef204975da 100644 --- a/FactoryKernels/GB_uop__identity_fp64_int64.c +++ b/FactoryKernels/GB_uop__identity_fp64_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_int8.c b/FactoryKernels/GB_uop__identity_fp64_int8.c index c1660a20a5..031f124909 100644 --- a/FactoryKernels/GB_uop__identity_fp64_int8.c +++ b/FactoryKernels/GB_uop__identity_fp64_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_uint16.c b/FactoryKernels/GB_uop__identity_fp64_uint16.c index 8e3e9ab7c6..8d02eea6af 100644 --- a/FactoryKernels/GB_uop__identity_fp64_uint16.c +++ b/FactoryKernels/GB_uop__identity_fp64_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_uint32.c b/FactoryKernels/GB_uop__identity_fp64_uint32.c index 66ce54992e..c196c367f7 100644 --- a/FactoryKernels/GB_uop__identity_fp64_uint32.c +++ b/FactoryKernels/GB_uop__identity_fp64_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_uint64.c b/FactoryKernels/GB_uop__identity_fp64_uint64.c index 9e5eb791e0..aaa5ce7b72 100644 --- a/FactoryKernels/GB_uop__identity_fp64_uint64.c +++ b/FactoryKernels/GB_uop__identity_fp64_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_fp64_uint8.c b/FactoryKernels/GB_uop__identity_fp64_uint8.c index b958ef5199..22a7719bb9 100644 --- a/FactoryKernels/GB_uop__identity_fp64_uint8.c +++ b/FactoryKernels/GB_uop__identity_fp64_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_fp64_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_bool.c b/FactoryKernels/GB_uop__identity_int16_bool.c index d730387d9e..c9e32f88b7 100644 --- a/FactoryKernels/GB_uop__identity_int16_bool.c +++ b/FactoryKernels/GB_uop__identity_int16_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_fc32.c b/FactoryKernels/GB_uop__identity_int16_fc32.c index 08e3bf708b..c8986e7f69 100644 --- a/FactoryKernels/GB_uop__identity_int16_fc32.c +++ b/FactoryKernels/GB_uop__identity_int16_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_fc64.c b/FactoryKernels/GB_uop__identity_int16_fc64.c index 78eb60fad5..0f681ac923 100644 --- a/FactoryKernels/GB_uop__identity_int16_fc64.c +++ b/FactoryKernels/GB_uop__identity_int16_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_fp32.c b/FactoryKernels/GB_uop__identity_int16_fp32.c index 61bb82c93f..1d0f86b02b 100644 --- a/FactoryKernels/GB_uop__identity_int16_fp32.c +++ b/FactoryKernels/GB_uop__identity_int16_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_fp64.c b/FactoryKernels/GB_uop__identity_int16_fp64.c index 39a2908a8c..836c68968b 100644 --- a/FactoryKernels/GB_uop__identity_int16_fp64.c +++ b/FactoryKernels/GB_uop__identity_int16_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_int16.c b/FactoryKernels/GB_uop__identity_int16_int16.c index 891fd967e2..e829218e80 100644 --- a/FactoryKernels/GB_uop__identity_int16_int16.c +++ b/FactoryKernels/GB_uop__identity_int16_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_int16_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_int32.c b/FactoryKernels/GB_uop__identity_int16_int32.c index bfdc9aa3a0..ae5436d67a 100644 --- a/FactoryKernels/GB_uop__identity_int16_int32.c +++ b/FactoryKernels/GB_uop__identity_int16_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_int64.c b/FactoryKernels/GB_uop__identity_int16_int64.c index 4dfd1c2a1d..3efb662f98 100644 --- a/FactoryKernels/GB_uop__identity_int16_int64.c +++ b/FactoryKernels/GB_uop__identity_int16_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_int8.c b/FactoryKernels/GB_uop__identity_int16_int8.c index 125ca02036..6469bb6e30 100644 --- a/FactoryKernels/GB_uop__identity_int16_int8.c +++ b/FactoryKernels/GB_uop__identity_int16_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_uint16.c b/FactoryKernels/GB_uop__identity_int16_uint16.c index e72ba27fa0..6f353bcc90 100644 --- a/FactoryKernels/GB_uop__identity_int16_uint16.c +++ b/FactoryKernels/GB_uop__identity_int16_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_uint32.c b/FactoryKernels/GB_uop__identity_int16_uint32.c index 47f61bc2f0..a6b1f791bc 100644 --- a/FactoryKernels/GB_uop__identity_int16_uint32.c +++ b/FactoryKernels/GB_uop__identity_int16_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_uint64.c b/FactoryKernels/GB_uop__identity_int16_uint64.c index 459890b334..d21a272d40 100644 --- a/FactoryKernels/GB_uop__identity_int16_uint64.c +++ b/FactoryKernels/GB_uop__identity_int16_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int16_uint8.c b/FactoryKernels/GB_uop__identity_int16_uint8.c index f6151e29fb..53f68278b6 100644 --- a/FactoryKernels/GB_uop__identity_int16_uint8.c +++ b/FactoryKernels/GB_uop__identity_int16_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int16_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_bool.c b/FactoryKernels/GB_uop__identity_int32_bool.c index 9385785d89..8443947fd8 100644 --- a/FactoryKernels/GB_uop__identity_int32_bool.c +++ b/FactoryKernels/GB_uop__identity_int32_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_fc32.c b/FactoryKernels/GB_uop__identity_int32_fc32.c index cc888c927f..5919ab38f6 100644 --- a/FactoryKernels/GB_uop__identity_int32_fc32.c +++ b/FactoryKernels/GB_uop__identity_int32_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_fc64.c b/FactoryKernels/GB_uop__identity_int32_fc64.c index 61054fba8f..431a8edfbe 100644 --- a/FactoryKernels/GB_uop__identity_int32_fc64.c +++ b/FactoryKernels/GB_uop__identity_int32_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_fp32.c b/FactoryKernels/GB_uop__identity_int32_fp32.c index f6a74f11fc..fc5afc2ed1 100644 --- a/FactoryKernels/GB_uop__identity_int32_fp32.c +++ b/FactoryKernels/GB_uop__identity_int32_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_fp64.c b/FactoryKernels/GB_uop__identity_int32_fp64.c index baec4367c6..fa2a524fe5 100644 --- a/FactoryKernels/GB_uop__identity_int32_fp64.c +++ b/FactoryKernels/GB_uop__identity_int32_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_int16.c b/FactoryKernels/GB_uop__identity_int32_int16.c index f1292b83bc..7370b6ab4c 100644 --- a/FactoryKernels/GB_uop__identity_int32_int16.c +++ b/FactoryKernels/GB_uop__identity_int32_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_int32.c b/FactoryKernels/GB_uop__identity_int32_int32.c index aa4ca8e21b..c63bc3d42d 100644 --- a/FactoryKernels/GB_uop__identity_int32_int32.c +++ b/FactoryKernels/GB_uop__identity_int32_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_int32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_int64.c b/FactoryKernels/GB_uop__identity_int32_int64.c index d1fdb47887..11363f7bdd 100644 --- a/FactoryKernels/GB_uop__identity_int32_int64.c +++ b/FactoryKernels/GB_uop__identity_int32_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_int8.c b/FactoryKernels/GB_uop__identity_int32_int8.c index c1c201cfbf..155c4c6aec 100644 --- a/FactoryKernels/GB_uop__identity_int32_int8.c +++ b/FactoryKernels/GB_uop__identity_int32_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_uint16.c b/FactoryKernels/GB_uop__identity_int32_uint16.c index 065e4352ef..90b0eae678 100644 --- a/FactoryKernels/GB_uop__identity_int32_uint16.c +++ b/FactoryKernels/GB_uop__identity_int32_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_uint32.c b/FactoryKernels/GB_uop__identity_int32_uint32.c index e90d211443..01a2acda8d 100644 --- a/FactoryKernels/GB_uop__identity_int32_uint32.c +++ b/FactoryKernels/GB_uop__identity_int32_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_uint64.c b/FactoryKernels/GB_uop__identity_int32_uint64.c index 8c0ef0b187..e29ed504eb 100644 --- a/FactoryKernels/GB_uop__identity_int32_uint64.c +++ b/FactoryKernels/GB_uop__identity_int32_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int32_uint8.c b/FactoryKernels/GB_uop__identity_int32_uint8.c index 8f5f68fc0f..9a323b60ae 100644 --- a/FactoryKernels/GB_uop__identity_int32_uint8.c +++ b/FactoryKernels/GB_uop__identity_int32_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int32_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_bool.c b/FactoryKernels/GB_uop__identity_int64_bool.c index 117f9d2742..d5944af3c7 100644 --- a/FactoryKernels/GB_uop__identity_int64_bool.c +++ b/FactoryKernels/GB_uop__identity_int64_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_fc32.c b/FactoryKernels/GB_uop__identity_int64_fc32.c index 94381a4f91..b5aa20abc2 100644 --- a/FactoryKernels/GB_uop__identity_int64_fc32.c +++ b/FactoryKernels/GB_uop__identity_int64_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_fc64.c b/FactoryKernels/GB_uop__identity_int64_fc64.c index 6d93bb57cc..07d15f129a 100644 --- a/FactoryKernels/GB_uop__identity_int64_fc64.c +++ b/FactoryKernels/GB_uop__identity_int64_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_fp32.c b/FactoryKernels/GB_uop__identity_int64_fp32.c index 5240f24a32..4811e69da2 100644 --- a/FactoryKernels/GB_uop__identity_int64_fp32.c +++ b/FactoryKernels/GB_uop__identity_int64_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_fp64.c b/FactoryKernels/GB_uop__identity_int64_fp64.c index 68dc8eac02..9f49c47f8a 100644 --- a/FactoryKernels/GB_uop__identity_int64_fp64.c +++ b/FactoryKernels/GB_uop__identity_int64_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_int16.c b/FactoryKernels/GB_uop__identity_int64_int16.c index 6892b15a77..15fa0f1221 100644 --- a/FactoryKernels/GB_uop__identity_int64_int16.c +++ b/FactoryKernels/GB_uop__identity_int64_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_int32.c b/FactoryKernels/GB_uop__identity_int64_int32.c index b45835bde1..988a75fd38 100644 --- a/FactoryKernels/GB_uop__identity_int64_int32.c +++ b/FactoryKernels/GB_uop__identity_int64_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_int64.c b/FactoryKernels/GB_uop__identity_int64_int64.c index 7d7ba5ad13..1d903a6a98 100644 --- a/FactoryKernels/GB_uop__identity_int64_int64.c +++ b/FactoryKernels/GB_uop__identity_int64_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_int64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_int8.c b/FactoryKernels/GB_uop__identity_int64_int8.c index 5dd88d2902..289453af3f 100644 --- a/FactoryKernels/GB_uop__identity_int64_int8.c +++ b/FactoryKernels/GB_uop__identity_int64_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_uint16.c b/FactoryKernels/GB_uop__identity_int64_uint16.c index dc6beb5f46..39f0cc54f9 100644 --- a/FactoryKernels/GB_uop__identity_int64_uint16.c +++ b/FactoryKernels/GB_uop__identity_int64_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_uint32.c b/FactoryKernels/GB_uop__identity_int64_uint32.c index 6b93a6bb79..e120e21535 100644 --- a/FactoryKernels/GB_uop__identity_int64_uint32.c +++ b/FactoryKernels/GB_uop__identity_int64_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_uint64.c b/FactoryKernels/GB_uop__identity_int64_uint64.c index 7ddf90aa07..98a0706ffd 100644 --- a/FactoryKernels/GB_uop__identity_int64_uint64.c +++ b/FactoryKernels/GB_uop__identity_int64_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int64_uint8.c b/FactoryKernels/GB_uop__identity_int64_uint8.c index 5aa05149e2..2f53242337 100644 --- a/FactoryKernels/GB_uop__identity_int64_uint8.c +++ b/FactoryKernels/GB_uop__identity_int64_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int64_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_bool.c b/FactoryKernels/GB_uop__identity_int8_bool.c index ae9971bff8..e8190453e7 100644 --- a/FactoryKernels/GB_uop__identity_int8_bool.c +++ b/FactoryKernels/GB_uop__identity_int8_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_fc32.c b/FactoryKernels/GB_uop__identity_int8_fc32.c index 63630131d0..859968fddb 100644 --- a/FactoryKernels/GB_uop__identity_int8_fc32.c +++ b/FactoryKernels/GB_uop__identity_int8_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_fc64.c b/FactoryKernels/GB_uop__identity_int8_fc64.c index 8a678fc850..dc6825574e 100644 --- a/FactoryKernels/GB_uop__identity_int8_fc64.c +++ b/FactoryKernels/GB_uop__identity_int8_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_fp32.c b/FactoryKernels/GB_uop__identity_int8_fp32.c index 7b86c56f6f..dd5c4b9eeb 100644 --- a/FactoryKernels/GB_uop__identity_int8_fp32.c +++ b/FactoryKernels/GB_uop__identity_int8_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_fp64.c b/FactoryKernels/GB_uop__identity_int8_fp64.c index d4355c08ac..48938e579a 100644 --- a/FactoryKernels/GB_uop__identity_int8_fp64.c +++ b/FactoryKernels/GB_uop__identity_int8_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_int16.c b/FactoryKernels/GB_uop__identity_int8_int16.c index 4b7e75d82a..c279e042ea 100644 --- a/FactoryKernels/GB_uop__identity_int8_int16.c +++ b/FactoryKernels/GB_uop__identity_int8_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_int32.c b/FactoryKernels/GB_uop__identity_int8_int32.c index d776ab9bdb..dda7e65771 100644 --- a/FactoryKernels/GB_uop__identity_int8_int32.c +++ b/FactoryKernels/GB_uop__identity_int8_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_int64.c b/FactoryKernels/GB_uop__identity_int8_int64.c index 6125d0c54b..77ba4ebf14 100644 --- a/FactoryKernels/GB_uop__identity_int8_int64.c +++ b/FactoryKernels/GB_uop__identity_int8_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_int8.c b/FactoryKernels/GB_uop__identity_int8_int8.c index de1a823b6b..86cf401b75 100644 --- a/FactoryKernels/GB_uop__identity_int8_int8.c +++ b/FactoryKernels/GB_uop__identity_int8_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_int8_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_uint16.c b/FactoryKernels/GB_uop__identity_int8_uint16.c index 363be5c4eb..ee6ff12194 100644 --- a/FactoryKernels/GB_uop__identity_int8_uint16.c +++ b/FactoryKernels/GB_uop__identity_int8_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_uint32.c b/FactoryKernels/GB_uop__identity_int8_uint32.c index a7e6944f96..ceb90934eb 100644 --- a/FactoryKernels/GB_uop__identity_int8_uint32.c +++ b/FactoryKernels/GB_uop__identity_int8_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_uint64.c b/FactoryKernels/GB_uop__identity_int8_uint64.c index 4185b843cc..a18b2ca1d8 100644 --- a/FactoryKernels/GB_uop__identity_int8_uint64.c +++ b/FactoryKernels/GB_uop__identity_int8_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_int8_uint8.c b/FactoryKernels/GB_uop__identity_int8_uint8.c index 4df89ff5fd..f6265cb40e 100644 --- a/FactoryKernels/GB_uop__identity_int8_uint8.c +++ b/FactoryKernels/GB_uop__identity_int8_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_int8_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_bool.c b/FactoryKernels/GB_uop__identity_uint16_bool.c index cb5f01ae84..55a111ff6c 100644 --- a/FactoryKernels/GB_uop__identity_uint16_bool.c +++ b/FactoryKernels/GB_uop__identity_uint16_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_fc32.c b/FactoryKernels/GB_uop__identity_uint16_fc32.c index 3c52b6050f..eb624dd3d8 100644 --- a/FactoryKernels/GB_uop__identity_uint16_fc32.c +++ b/FactoryKernels/GB_uop__identity_uint16_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_fc64.c b/FactoryKernels/GB_uop__identity_uint16_fc64.c index 9304c16d04..6c63c931c2 100644 --- a/FactoryKernels/GB_uop__identity_uint16_fc64.c +++ b/FactoryKernels/GB_uop__identity_uint16_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_fp32.c b/FactoryKernels/GB_uop__identity_uint16_fp32.c index a55b73addd..39ac69b162 100644 --- a/FactoryKernels/GB_uop__identity_uint16_fp32.c +++ b/FactoryKernels/GB_uop__identity_uint16_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_fp64.c b/FactoryKernels/GB_uop__identity_uint16_fp64.c index 3986d19247..c492b251dc 100644 --- a/FactoryKernels/GB_uop__identity_uint16_fp64.c +++ b/FactoryKernels/GB_uop__identity_uint16_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_int16.c b/FactoryKernels/GB_uop__identity_uint16_int16.c index b1a028da6c..9e9d94f36f 100644 --- a/FactoryKernels/GB_uop__identity_uint16_int16.c +++ b/FactoryKernels/GB_uop__identity_uint16_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_int32.c b/FactoryKernels/GB_uop__identity_uint16_int32.c index 8c080aaf16..81a9afa03e 100644 --- a/FactoryKernels/GB_uop__identity_uint16_int32.c +++ b/FactoryKernels/GB_uop__identity_uint16_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_int64.c b/FactoryKernels/GB_uop__identity_uint16_int64.c index 54d2ea6a06..bc6203ffe0 100644 --- a/FactoryKernels/GB_uop__identity_uint16_int64.c +++ b/FactoryKernels/GB_uop__identity_uint16_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_int8.c b/FactoryKernels/GB_uop__identity_uint16_int8.c index 13a90a99d2..374aead75b 100644 --- a/FactoryKernels/GB_uop__identity_uint16_int8.c +++ b/FactoryKernels/GB_uop__identity_uint16_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_uint16.c b/FactoryKernels/GB_uop__identity_uint16_uint16.c index b93071b06f..3a3c50e0eb 100644 --- a/FactoryKernels/GB_uop__identity_uint16_uint16.c +++ b/FactoryKernels/GB_uop__identity_uint16_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_uint16_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_uint32.c b/FactoryKernels/GB_uop__identity_uint16_uint32.c index cca5137555..fff0fa3a40 100644 --- a/FactoryKernels/GB_uop__identity_uint16_uint32.c +++ b/FactoryKernels/GB_uop__identity_uint16_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_uint64.c b/FactoryKernels/GB_uop__identity_uint16_uint64.c index e6805b5e41..981395c664 100644 --- a/FactoryKernels/GB_uop__identity_uint16_uint64.c +++ b/FactoryKernels/GB_uop__identity_uint16_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint16_uint8.c b/FactoryKernels/GB_uop__identity_uint16_uint8.c index a9c36e77a9..42ee9b3b8f 100644 --- a/FactoryKernels/GB_uop__identity_uint16_uint8.c +++ b/FactoryKernels/GB_uop__identity_uint16_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint16_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_bool.c b/FactoryKernels/GB_uop__identity_uint32_bool.c index 0f282bb0e7..6d5fcdee52 100644 --- a/FactoryKernels/GB_uop__identity_uint32_bool.c +++ b/FactoryKernels/GB_uop__identity_uint32_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_fc32.c b/FactoryKernels/GB_uop__identity_uint32_fc32.c index bbbc706885..4655828a85 100644 --- a/FactoryKernels/GB_uop__identity_uint32_fc32.c +++ b/FactoryKernels/GB_uop__identity_uint32_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_fc64.c b/FactoryKernels/GB_uop__identity_uint32_fc64.c index 808a060361..c78bb742ba 100644 --- a/FactoryKernels/GB_uop__identity_uint32_fc64.c +++ b/FactoryKernels/GB_uop__identity_uint32_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_fp32.c b/FactoryKernels/GB_uop__identity_uint32_fp32.c index b363e1ec9e..369b6deba8 100644 --- a/FactoryKernels/GB_uop__identity_uint32_fp32.c +++ b/FactoryKernels/GB_uop__identity_uint32_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_fp64.c b/FactoryKernels/GB_uop__identity_uint32_fp64.c index f4b0c4effd..c928db5b1a 100644 --- a/FactoryKernels/GB_uop__identity_uint32_fp64.c +++ b/FactoryKernels/GB_uop__identity_uint32_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_int16.c b/FactoryKernels/GB_uop__identity_uint32_int16.c index 5a8da524a6..aba3a1a396 100644 --- a/FactoryKernels/GB_uop__identity_uint32_int16.c +++ b/FactoryKernels/GB_uop__identity_uint32_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_int32.c b/FactoryKernels/GB_uop__identity_uint32_int32.c index 65f6a1943a..6f4b1d43d1 100644 --- a/FactoryKernels/GB_uop__identity_uint32_int32.c +++ b/FactoryKernels/GB_uop__identity_uint32_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_int64.c b/FactoryKernels/GB_uop__identity_uint32_int64.c index 0eae1ba92a..8200856727 100644 --- a/FactoryKernels/GB_uop__identity_uint32_int64.c +++ b/FactoryKernels/GB_uop__identity_uint32_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_int8.c b/FactoryKernels/GB_uop__identity_uint32_int8.c index 320aa10726..c69768bc92 100644 --- a/FactoryKernels/GB_uop__identity_uint32_int8.c +++ b/FactoryKernels/GB_uop__identity_uint32_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_uint16.c b/FactoryKernels/GB_uop__identity_uint32_uint16.c index 4f9df03bc0..57b862719b 100644 --- a/FactoryKernels/GB_uop__identity_uint32_uint16.c +++ b/FactoryKernels/GB_uop__identity_uint32_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_uint32.c b/FactoryKernels/GB_uop__identity_uint32_uint32.c index f39550d4c4..b8f29836c9 100644 --- a/FactoryKernels/GB_uop__identity_uint32_uint32.c +++ b/FactoryKernels/GB_uop__identity_uint32_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_uint32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_uint64.c b/FactoryKernels/GB_uop__identity_uint32_uint64.c index 556015b6b1..db87322c5e 100644 --- a/FactoryKernels/GB_uop__identity_uint32_uint64.c +++ b/FactoryKernels/GB_uop__identity_uint32_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint32_uint8.c b/FactoryKernels/GB_uop__identity_uint32_uint8.c index 50cb8f0989..b1644e80dc 100644 --- a/FactoryKernels/GB_uop__identity_uint32_uint8.c +++ b/FactoryKernels/GB_uop__identity_uint32_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint32_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_bool.c b/FactoryKernels/GB_uop__identity_uint64_bool.c index a6dd8095f4..5257d49f74 100644 --- a/FactoryKernels/GB_uop__identity_uint64_bool.c +++ b/FactoryKernels/GB_uop__identity_uint64_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_fc32.c b/FactoryKernels/GB_uop__identity_uint64_fc32.c index b35756460a..a120d84c1b 100644 --- a/FactoryKernels/GB_uop__identity_uint64_fc32.c +++ b/FactoryKernels/GB_uop__identity_uint64_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_fc64.c b/FactoryKernels/GB_uop__identity_uint64_fc64.c index e07f7a605a..ae1a440c64 100644 --- a/FactoryKernels/GB_uop__identity_uint64_fc64.c +++ b/FactoryKernels/GB_uop__identity_uint64_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_fp32.c b/FactoryKernels/GB_uop__identity_uint64_fp32.c index b4ac31c629..6fa2b3635a 100644 --- a/FactoryKernels/GB_uop__identity_uint64_fp32.c +++ b/FactoryKernels/GB_uop__identity_uint64_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_fp64.c b/FactoryKernels/GB_uop__identity_uint64_fp64.c index 1d8543f200..5061442764 100644 --- a/FactoryKernels/GB_uop__identity_uint64_fp64.c +++ b/FactoryKernels/GB_uop__identity_uint64_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_int16.c b/FactoryKernels/GB_uop__identity_uint64_int16.c index 42bfdcd4c4..c02a725c47 100644 --- a/FactoryKernels/GB_uop__identity_uint64_int16.c +++ b/FactoryKernels/GB_uop__identity_uint64_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_int32.c b/FactoryKernels/GB_uop__identity_uint64_int32.c index bd3d82acd0..86997706ae 100644 --- a/FactoryKernels/GB_uop__identity_uint64_int32.c +++ b/FactoryKernels/GB_uop__identity_uint64_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_int64.c b/FactoryKernels/GB_uop__identity_uint64_int64.c index d4fa698678..64d8e6042d 100644 --- a/FactoryKernels/GB_uop__identity_uint64_int64.c +++ b/FactoryKernels/GB_uop__identity_uint64_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_int8.c b/FactoryKernels/GB_uop__identity_uint64_int8.c index 6807c4a8bb..8e1991e760 100644 --- a/FactoryKernels/GB_uop__identity_uint64_int8.c +++ b/FactoryKernels/GB_uop__identity_uint64_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_uint16.c b/FactoryKernels/GB_uop__identity_uint64_uint16.c index 91e7ec6a5c..a43f90e52a 100644 --- a/FactoryKernels/GB_uop__identity_uint64_uint16.c +++ b/FactoryKernels/GB_uop__identity_uint64_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_uint32.c b/FactoryKernels/GB_uop__identity_uint64_uint32.c index 93c0959a31..b497ded794 100644 --- a/FactoryKernels/GB_uop__identity_uint64_uint32.c +++ b/FactoryKernels/GB_uop__identity_uint64_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_uint64.c b/FactoryKernels/GB_uop__identity_uint64_uint64.c index cb3a276996..2d2ae6a585 100644 --- a/FactoryKernels/GB_uop__identity_uint64_uint64.c +++ b/FactoryKernels/GB_uop__identity_uint64_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_uint64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint64_uint8.c b/FactoryKernels/GB_uop__identity_uint64_uint8.c index c625011638..fdbfd60457 100644 --- a/FactoryKernels/GB_uop__identity_uint64_uint8.c +++ b/FactoryKernels/GB_uop__identity_uint64_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint64_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_bool.c b/FactoryKernels/GB_uop__identity_uint8_bool.c index 3eaa4eb12c..70173f6e56 100644 --- a/FactoryKernels/GB_uop__identity_uint8_bool.c +++ b/FactoryKernels/GB_uop__identity_uint8_bool.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_fc32.c b/FactoryKernels/GB_uop__identity_uint8_fc32.c index 636c7bb1a1..6e9cbcc469 100644 --- a/FactoryKernels/GB_uop__identity_uint8_fc32.c +++ b/FactoryKernels/GB_uop__identity_uint8_fc32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_fc64.c b/FactoryKernels/GB_uop__identity_uint8_fc64.c index 611846e842..fb664f7e0e 100644 --- a/FactoryKernels/GB_uop__identity_uint8_fc64.c +++ b/FactoryKernels/GB_uop__identity_uint8_fc64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_fp32.c b/FactoryKernels/GB_uop__identity_uint8_fp32.c index d34aed8439..48291aee68 100644 --- a/FactoryKernels/GB_uop__identity_uint8_fp32.c +++ b/FactoryKernels/GB_uop__identity_uint8_fp32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_fp64.c b/FactoryKernels/GB_uop__identity_uint8_fp64.c index 63a7c651ff..2aa1773058 100644 --- a/FactoryKernels/GB_uop__identity_uint8_fp64.c +++ b/FactoryKernels/GB_uop__identity_uint8_fp64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_int16.c b/FactoryKernels/GB_uop__identity_uint8_int16.c index 09e5fdd5c5..169f3bb1d0 100644 --- a/FactoryKernels/GB_uop__identity_uint8_int16.c +++ b/FactoryKernels/GB_uop__identity_uint8_int16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_int32.c b/FactoryKernels/GB_uop__identity_uint8_int32.c index ed05e47143..3086d25ea6 100644 --- a/FactoryKernels/GB_uop__identity_uint8_int32.c +++ b/FactoryKernels/GB_uop__identity_uint8_int32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_int64.c b/FactoryKernels/GB_uop__identity_uint8_int64.c index 9b5f3f7116..d2d6d1e131 100644 --- a/FactoryKernels/GB_uop__identity_uint8_int64.c +++ b/FactoryKernels/GB_uop__identity_uint8_int64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_int8.c b/FactoryKernels/GB_uop__identity_uint8_int8.c index 351196f229..0a4a3a4821 100644 --- a/FactoryKernels/GB_uop__identity_uint8_int8.c +++ b/FactoryKernels/GB_uop__identity_uint8_int8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_uint16.c b/FactoryKernels/GB_uop__identity_uint8_uint16.c index 3666992028..e19ae520c6 100644 --- a/FactoryKernels/GB_uop__identity_uint8_uint16.c +++ b/FactoryKernels/GB_uop__identity_uint8_uint16.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_uint32.c b/FactoryKernels/GB_uop__identity_uint8_uint32.c index 228e11520e..63815606f5 100644 --- a/FactoryKernels/GB_uop__identity_uint8_uint32.c +++ b/FactoryKernels/GB_uop__identity_uint8_uint32.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_uint64.c b/FactoryKernels/GB_uop__identity_uint8_uint64.c index ccbdeccb4b..6333a5a3e7 100644 --- a/FactoryKernels/GB_uop__identity_uint8_uint64.c +++ b/FactoryKernels/GB_uop__identity_uint8_uint64.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +88,5 @@ GrB_Info GB (_uop_tran__identity_uint8_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__identity_uint8_uint8.c b/FactoryKernels/GB_uop__identity_uint8_uint8.c index c4648839e6..ebebb29613 100644 --- a/FactoryKernels/GB_uop__identity_uint8_uint8.c +++ b/FactoryKernels/GB_uop__identity_uint8_uint8.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +32,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +43,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // C = op (cast (A')): transpose, typecast, and apply a unary operator @@ -65,3 +67,5 @@ GrB_Info GB (_uop_tran__identity_uint8_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isfinite_bool_fc32.c b/FactoryKernels/GB_uop__isfinite_bool_fc32.c index 718fc60bc2..728c077eb9 100644 --- a/FactoryKernels/GB_uop__isfinite_bool_fc32.c +++ b/FactoryKernels/GB_uop__isfinite_bool_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isfinite_bool_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isfinite_bool_fc64.c b/FactoryKernels/GB_uop__isfinite_bool_fc64.c index 1af1318a8e..466b300cb5 100644 --- a/FactoryKernels/GB_uop__isfinite_bool_fc64.c +++ b/FactoryKernels/GB_uop__isfinite_bool_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isfinite_bool_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isfinite_bool_fp32.c b/FactoryKernels/GB_uop__isfinite_bool_fp32.c index 0256e3745e..6bf21bf5d1 100644 --- a/FactoryKernels/GB_uop__isfinite_bool_fp32.c +++ b/FactoryKernels/GB_uop__isfinite_bool_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isfinite_bool_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isfinite_bool_fp64.c b/FactoryKernels/GB_uop__isfinite_bool_fp64.c index 777d673ba9..d515ecb9bb 100644 --- a/FactoryKernels/GB_uop__isfinite_bool_fp64.c +++ b/FactoryKernels/GB_uop__isfinite_bool_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isfinite_bool_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isinf_bool_fc32.c b/FactoryKernels/GB_uop__isinf_bool_fc32.c index 6b375066a6..3f4010501a 100644 --- a/FactoryKernels/GB_uop__isinf_bool_fc32.c +++ b/FactoryKernels/GB_uop__isinf_bool_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isinf_bool_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isinf_bool_fc64.c b/FactoryKernels/GB_uop__isinf_bool_fc64.c index 7dc6df2b96..3a05b7bc65 100644 --- a/FactoryKernels/GB_uop__isinf_bool_fc64.c +++ b/FactoryKernels/GB_uop__isinf_bool_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isinf_bool_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isinf_bool_fp32.c b/FactoryKernels/GB_uop__isinf_bool_fp32.c index cf4740cdcf..acad9c4f0c 100644 --- a/FactoryKernels/GB_uop__isinf_bool_fp32.c +++ b/FactoryKernels/GB_uop__isinf_bool_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isinf_bool_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isinf_bool_fp64.c b/FactoryKernels/GB_uop__isinf_bool_fp64.c index 4f548e67a9..eebed858d8 100644 --- a/FactoryKernels/GB_uop__isinf_bool_fp64.c +++ b/FactoryKernels/GB_uop__isinf_bool_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isinf_bool_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isnan_bool_fc32.c b/FactoryKernels/GB_uop__isnan_bool_fc32.c index 07fa6f116f..8a626316e4 100644 --- a/FactoryKernels/GB_uop__isnan_bool_fc32.c +++ b/FactoryKernels/GB_uop__isnan_bool_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isnan_bool_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isnan_bool_fc64.c b/FactoryKernels/GB_uop__isnan_bool_fc64.c index 4ef693970c..2a13b9d2cc 100644 --- a/FactoryKernels/GB_uop__isnan_bool_fc64.c +++ b/FactoryKernels/GB_uop__isnan_bool_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isnan_bool_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isnan_bool_fp32.c b/FactoryKernels/GB_uop__isnan_bool_fp32.c index f11b31b984..ee391141f4 100644 --- a/FactoryKernels/GB_uop__isnan_bool_fp32.c +++ b/FactoryKernels/GB_uop__isnan_bool_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isnan_bool_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__isnan_bool_fp64.c b/FactoryKernels/GB_uop__isnan_bool_fp64.c index db05b54103..dd3409cc86 100644 --- a/FactoryKernels/GB_uop__isnan_bool_fp64.c +++ b/FactoryKernels/GB_uop__isnan_bool_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__isnan_bool_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lgamma_fp32_fp32.c b/FactoryKernels/GB_uop__lgamma_fp32_fp32.c index 1fbac97dbf..f95d93cb2c 100644 --- a/FactoryKernels/GB_uop__lgamma_fp32_fp32.c +++ b/FactoryKernels/GB_uop__lgamma_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lgamma_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lgamma_fp64_fp64.c b/FactoryKernels/GB_uop__lgamma_fp64_fp64.c index 321e092624..0aaf8aa202 100644 --- a/FactoryKernels/GB_uop__lgamma_fp64_fp64.c +++ b/FactoryKernels/GB_uop__lgamma_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lgamma_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_bool_bool.c b/FactoryKernels/GB_uop__lnot_bool_bool.c index 3201755675..cd58a45527 100644 --- a/FactoryKernels/GB_uop__lnot_bool_bool.c +++ b/FactoryKernels/GB_uop__lnot_bool_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_bool_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_fp32_fp32.c b/FactoryKernels/GB_uop__lnot_fp32_fp32.c index b49a27fb8e..5b867f7fdd 100644 --- a/FactoryKernels/GB_uop__lnot_fp32_fp32.c +++ b/FactoryKernels/GB_uop__lnot_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_fp64_fp64.c b/FactoryKernels/GB_uop__lnot_fp64_fp64.c index f2cdb99be8..d2ae4053d2 100644 --- a/FactoryKernels/GB_uop__lnot_fp64_fp64.c +++ b/FactoryKernels/GB_uop__lnot_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_int16_int16.c b/FactoryKernels/GB_uop__lnot_int16_int16.c index 63f730a126..acc3644a07 100644 --- a/FactoryKernels/GB_uop__lnot_int16_int16.c +++ b/FactoryKernels/GB_uop__lnot_int16_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_int16_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_int32_int32.c b/FactoryKernels/GB_uop__lnot_int32_int32.c index 939027f42b..314786402a 100644 --- a/FactoryKernels/GB_uop__lnot_int32_int32.c +++ b/FactoryKernels/GB_uop__lnot_int32_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_int32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_int64_int64.c b/FactoryKernels/GB_uop__lnot_int64_int64.c index 7e4311529f..8d3188bd0f 100644 --- a/FactoryKernels/GB_uop__lnot_int64_int64.c +++ b/FactoryKernels/GB_uop__lnot_int64_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_int64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_int8_int8.c b/FactoryKernels/GB_uop__lnot_int8_int8.c index ef51ac02ee..1ae8ec03d4 100644 --- a/FactoryKernels/GB_uop__lnot_int8_int8.c +++ b/FactoryKernels/GB_uop__lnot_int8_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_int8_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_uint16_uint16.c b/FactoryKernels/GB_uop__lnot_uint16_uint16.c index ba66b5c5ed..75732cef21 100644 --- a/FactoryKernels/GB_uop__lnot_uint16_uint16.c +++ b/FactoryKernels/GB_uop__lnot_uint16_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_uint16_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_uint32_uint32.c b/FactoryKernels/GB_uop__lnot_uint32_uint32.c index 0130eb67c8..3cfa8c5a4d 100644 --- a/FactoryKernels/GB_uop__lnot_uint32_uint32.c +++ b/FactoryKernels/GB_uop__lnot_uint32_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_uint32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_uint64_uint64.c b/FactoryKernels/GB_uop__lnot_uint64_uint64.c index 856b40fc36..216b7c0313 100644 --- a/FactoryKernels/GB_uop__lnot_uint64_uint64.c +++ b/FactoryKernels/GB_uop__lnot_uint64_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_uint64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__lnot_uint8_uint8.c b/FactoryKernels/GB_uop__lnot_uint8_uint8.c index 50d65642a1..39675431e3 100644 --- a/FactoryKernels/GB_uop__lnot_uint8_uint8.c +++ b/FactoryKernels/GB_uop__lnot_uint8_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__lnot_uint8_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log10_fc32_fc32.c b/FactoryKernels/GB_uop__log10_fc32_fc32.c index e270a30869..7b7e76bee7 100644 --- a/FactoryKernels/GB_uop__log10_fc32_fc32.c +++ b/FactoryKernels/GB_uop__log10_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log10_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log10_fc64_fc64.c b/FactoryKernels/GB_uop__log10_fc64_fc64.c index 6040f2c7b4..fd49eb3a2c 100644 --- a/FactoryKernels/GB_uop__log10_fc64_fc64.c +++ b/FactoryKernels/GB_uop__log10_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log10_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log10_fp32_fp32.c b/FactoryKernels/GB_uop__log10_fp32_fp32.c index 584694efb1..9324adf035 100644 --- a/FactoryKernels/GB_uop__log10_fp32_fp32.c +++ b/FactoryKernels/GB_uop__log10_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log10_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log10_fp64_fp64.c b/FactoryKernels/GB_uop__log10_fp64_fp64.c index 35774fd72d..34fe814126 100644 --- a/FactoryKernels/GB_uop__log10_fp64_fp64.c +++ b/FactoryKernels/GB_uop__log10_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log10_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log1p_fc32_fc32.c b/FactoryKernels/GB_uop__log1p_fc32_fc32.c index 8d779e8070..3abb25e153 100644 --- a/FactoryKernels/GB_uop__log1p_fc32_fc32.c +++ b/FactoryKernels/GB_uop__log1p_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log1p_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log1p_fc64_fc64.c b/FactoryKernels/GB_uop__log1p_fc64_fc64.c index b401400b2e..f6e7aae23a 100644 --- a/FactoryKernels/GB_uop__log1p_fc64_fc64.c +++ b/FactoryKernels/GB_uop__log1p_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log1p_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log1p_fp32_fp32.c b/FactoryKernels/GB_uop__log1p_fp32_fp32.c index 4e78677fa0..12924f9984 100644 --- a/FactoryKernels/GB_uop__log1p_fp32_fp32.c +++ b/FactoryKernels/GB_uop__log1p_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log1p_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log1p_fp64_fp64.c b/FactoryKernels/GB_uop__log1p_fp64_fp64.c index 3349c58610..da6c7d4eea 100644 --- a/FactoryKernels/GB_uop__log1p_fp64_fp64.c +++ b/FactoryKernels/GB_uop__log1p_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log1p_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log2_fc32_fc32.c b/FactoryKernels/GB_uop__log2_fc32_fc32.c index 2cf2a1059d..0815f0480f 100644 --- a/FactoryKernels/GB_uop__log2_fc32_fc32.c +++ b/FactoryKernels/GB_uop__log2_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log2_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log2_fc64_fc64.c b/FactoryKernels/GB_uop__log2_fc64_fc64.c index 6632acbd16..7b88516514 100644 --- a/FactoryKernels/GB_uop__log2_fc64_fc64.c +++ b/FactoryKernels/GB_uop__log2_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log2_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log2_fp32_fp32.c b/FactoryKernels/GB_uop__log2_fp32_fp32.c index 62718854ac..36cb86f0a6 100644 --- a/FactoryKernels/GB_uop__log2_fp32_fp32.c +++ b/FactoryKernels/GB_uop__log2_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log2_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log2_fp64_fp64.c b/FactoryKernels/GB_uop__log2_fp64_fp64.c index fc63c1622f..968cd11809 100644 --- a/FactoryKernels/GB_uop__log2_fp64_fp64.c +++ b/FactoryKernels/GB_uop__log2_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log2_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log_fc32_fc32.c b/FactoryKernels/GB_uop__log_fc32_fc32.c index 55bc220427..8eced390b1 100644 --- a/FactoryKernels/GB_uop__log_fc32_fc32.c +++ b/FactoryKernels/GB_uop__log_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log_fc64_fc64.c b/FactoryKernels/GB_uop__log_fc64_fc64.c index d6d9d65c3a..cb5c4e331c 100644 --- a/FactoryKernels/GB_uop__log_fc64_fc64.c +++ b/FactoryKernels/GB_uop__log_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log_fp32_fp32.c b/FactoryKernels/GB_uop__log_fp32_fp32.c index 1b09763dae..e0293ef6e9 100644 --- a/FactoryKernels/GB_uop__log_fp32_fp32.c +++ b/FactoryKernels/GB_uop__log_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__log_fp64_fp64.c b/FactoryKernels/GB_uop__log_fp64_fp64.c index 6689ce85ec..27dfd92c97 100644 --- a/FactoryKernels/GB_uop__log_fp64_fp64.c +++ b/FactoryKernels/GB_uop__log_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__log_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_bool_bool.c b/FactoryKernels/GB_uop__minv_bool_bool.c index 1067fedcf0..d3e227121c 100644 --- a/FactoryKernels/GB_uop__minv_bool_bool.c +++ b/FactoryKernels/GB_uop__minv_bool_bool.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_BOOL) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_bool_bool) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_fc32_fc32.c b/FactoryKernels/GB_uop__minv_fc32_fc32.c index c1f28d3ee2..c26ab92f8b 100644 --- a/FactoryKernels/GB_uop__minv_fc32_fc32.c +++ b/FactoryKernels/GB_uop__minv_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_fc64_fc64.c b/FactoryKernels/GB_uop__minv_fc64_fc64.c index 7bcd758910..c3f6bcdfa7 100644 --- a/FactoryKernels/GB_uop__minv_fc64_fc64.c +++ b/FactoryKernels/GB_uop__minv_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_fp32_fp32.c b/FactoryKernels/GB_uop__minv_fp32_fp32.c index e734b85ac1..6436fb6082 100644 --- a/FactoryKernels/GB_uop__minv_fp32_fp32.c +++ b/FactoryKernels/GB_uop__minv_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_fp64_fp64.c b/FactoryKernels/GB_uop__minv_fp64_fp64.c index be354720eb..763a8f00af 100644 --- a/FactoryKernels/GB_uop__minv_fp64_fp64.c +++ b/FactoryKernels/GB_uop__minv_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_int16_int16.c b/FactoryKernels/GB_uop__minv_int16_int16.c index 63c3ebba3a..fecce60209 100644 --- a/FactoryKernels/GB_uop__minv_int16_int16.c +++ b/FactoryKernels/GB_uop__minv_int16_int16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_int16_int16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_int32_int32.c b/FactoryKernels/GB_uop__minv_int32_int32.c index c0c02c37a2..a8888328d3 100644 --- a/FactoryKernels/GB_uop__minv_int32_int32.c +++ b/FactoryKernels/GB_uop__minv_int32_int32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_int32_int32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_int64_int64.c b/FactoryKernels/GB_uop__minv_int64_int64.c index de31b158bf..2ceafede8e 100644 --- a/FactoryKernels/GB_uop__minv_int64_int64.c +++ b/FactoryKernels/GB_uop__minv_int64_int64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_int64_int64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_int8_int8.c b/FactoryKernels/GB_uop__minv_int8_int8.c index c910b37da2..542f5e0f17 100644 --- a/FactoryKernels/GB_uop__minv_int8_int8.c +++ b/FactoryKernels/GB_uop__minv_int8_int8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_INT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_int8_int8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_uint16_uint16.c b/FactoryKernels/GB_uop__minv_uint16_uint16.c index cc83669ce6..ee7af49aa5 100644 --- a/FactoryKernels/GB_uop__minv_uint16_uint16.c +++ b/FactoryKernels/GB_uop__minv_uint16_uint16.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT16) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_uint16_uint16) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_uint32_uint32.c b/FactoryKernels/GB_uop__minv_uint32_uint32.c index aa1f2b5f64..e1d2b80a97 100644 --- a/FactoryKernels/GB_uop__minv_uint32_uint32.c +++ b/FactoryKernels/GB_uop__minv_uint32_uint32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_uint32_uint32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_uint64_uint64.c b/FactoryKernels/GB_uop__minv_uint64_uint64.c index 4503a9ac88..517905fc38 100644 --- a/FactoryKernels/GB_uop__minv_uint64_uint64.c +++ b/FactoryKernels/GB_uop__minv_uint64_uint64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_uint64_uint64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__minv_uint8_uint8.c b/FactoryKernels/GB_uop__minv_uint8_uint8.c index 73271314dd..55da284f9e 100644 --- a/FactoryKernels/GB_uop__minv_uint8_uint8.c +++ b/FactoryKernels/GB_uop__minv_uint8_uint8.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_UINT8) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__minv_uint8_uint8) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__round_fc32_fc32.c b/FactoryKernels/GB_uop__round_fc32_fc32.c index fce65d448f..618f1495fe 100644 --- a/FactoryKernels/GB_uop__round_fc32_fc32.c +++ b/FactoryKernels/GB_uop__round_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__round_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__round_fc64_fc64.c b/FactoryKernels/GB_uop__round_fc64_fc64.c index e9793a89ec..682b956ef5 100644 --- a/FactoryKernels/GB_uop__round_fc64_fc64.c +++ b/FactoryKernels/GB_uop__round_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__round_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__round_fp32_fp32.c b/FactoryKernels/GB_uop__round_fp32_fp32.c index d883f1d8b7..6cd4e35c5d 100644 --- a/FactoryKernels/GB_uop__round_fp32_fp32.c +++ b/FactoryKernels/GB_uop__round_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__round_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__round_fp64_fp64.c b/FactoryKernels/GB_uop__round_fp64_fp64.c index 0fbb2d1ac3..6bbe86b3d7 100644 --- a/FactoryKernels/GB_uop__round_fp64_fp64.c +++ b/FactoryKernels/GB_uop__round_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__round_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__signum_fc32_fc32.c b/FactoryKernels/GB_uop__signum_fc32_fc32.c index 2b7af1990a..7bf3ee7966 100644 --- a/FactoryKernels/GB_uop__signum_fc32_fc32.c +++ b/FactoryKernels/GB_uop__signum_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__signum_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__signum_fc64_fc64.c b/FactoryKernels/GB_uop__signum_fc64_fc64.c index b3e1d9065c..29e12c9e15 100644 --- a/FactoryKernels/GB_uop__signum_fc64_fc64.c +++ b/FactoryKernels/GB_uop__signum_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__signum_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__signum_fp32_fp32.c b/FactoryKernels/GB_uop__signum_fp32_fp32.c index 75491b1c81..cacaf287af 100644 --- a/FactoryKernels/GB_uop__signum_fp32_fp32.c +++ b/FactoryKernels/GB_uop__signum_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__signum_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__signum_fp64_fp64.c b/FactoryKernels/GB_uop__signum_fp64_fp64.c index 11bc9ab205..54725147e7 100644 --- a/FactoryKernels/GB_uop__signum_fp64_fp64.c +++ b/FactoryKernels/GB_uop__signum_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__signum_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sin_fc32_fc32.c b/FactoryKernels/GB_uop__sin_fc32_fc32.c index 3caa5208c1..5f57456400 100644 --- a/FactoryKernels/GB_uop__sin_fc32_fc32.c +++ b/FactoryKernels/GB_uop__sin_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sin_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sin_fc64_fc64.c b/FactoryKernels/GB_uop__sin_fc64_fc64.c index 305c80f952..3e6e4f9742 100644 --- a/FactoryKernels/GB_uop__sin_fc64_fc64.c +++ b/FactoryKernels/GB_uop__sin_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sin_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sin_fp32_fp32.c b/FactoryKernels/GB_uop__sin_fp32_fp32.c index fcc96a97d8..1d3160ae94 100644 --- a/FactoryKernels/GB_uop__sin_fp32_fp32.c +++ b/FactoryKernels/GB_uop__sin_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sin_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sin_fp64_fp64.c b/FactoryKernels/GB_uop__sin_fp64_fp64.c index 23e655cd05..83520c1ac4 100644 --- a/FactoryKernels/GB_uop__sin_fp64_fp64.c +++ b/FactoryKernels/GB_uop__sin_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sin_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sinh_fc32_fc32.c b/FactoryKernels/GB_uop__sinh_fc32_fc32.c index ec79b60ca3..41d9eee32f 100644 --- a/FactoryKernels/GB_uop__sinh_fc32_fc32.c +++ b/FactoryKernels/GB_uop__sinh_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sinh_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sinh_fc64_fc64.c b/FactoryKernels/GB_uop__sinh_fc64_fc64.c index 03139bd931..2395a5d19b 100644 --- a/FactoryKernels/GB_uop__sinh_fc64_fc64.c +++ b/FactoryKernels/GB_uop__sinh_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sinh_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sinh_fp32_fp32.c b/FactoryKernels/GB_uop__sinh_fp32_fp32.c index a8b4deef5e..7d6b70af8f 100644 --- a/FactoryKernels/GB_uop__sinh_fp32_fp32.c +++ b/FactoryKernels/GB_uop__sinh_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sinh_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sinh_fp64_fp64.c b/FactoryKernels/GB_uop__sinh_fp64_fp64.c index 635c3992fd..753a0e1f09 100644 --- a/FactoryKernels/GB_uop__sinh_fp64_fp64.c +++ b/FactoryKernels/GB_uop__sinh_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sinh_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sqrt_fc32_fc32.c b/FactoryKernels/GB_uop__sqrt_fc32_fc32.c index b782021986..7b32ca1e63 100644 --- a/FactoryKernels/GB_uop__sqrt_fc32_fc32.c +++ b/FactoryKernels/GB_uop__sqrt_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sqrt_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sqrt_fc64_fc64.c b/FactoryKernels/GB_uop__sqrt_fc64_fc64.c index 2f7a5b61e0..ce82f043f7 100644 --- a/FactoryKernels/GB_uop__sqrt_fc64_fc64.c +++ b/FactoryKernels/GB_uop__sqrt_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sqrt_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sqrt_fp32_fp32.c b/FactoryKernels/GB_uop__sqrt_fp32_fp32.c index 21fefdab29..c35b128578 100644 --- a/FactoryKernels/GB_uop__sqrt_fp32_fp32.c +++ b/FactoryKernels/GB_uop__sqrt_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sqrt_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__sqrt_fp64_fp64.c b/FactoryKernels/GB_uop__sqrt_fp64_fp64.c index ba5271792b..00fd8edf26 100644 --- a/FactoryKernels/GB_uop__sqrt_fp64_fp64.c +++ b/FactoryKernels/GB_uop__sqrt_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__sqrt_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tan_fc32_fc32.c b/FactoryKernels/GB_uop__tan_fc32_fc32.c index 1e5ce41805..08cc11ea41 100644 --- a/FactoryKernels/GB_uop__tan_fc32_fc32.c +++ b/FactoryKernels/GB_uop__tan_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tan_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tan_fc64_fc64.c b/FactoryKernels/GB_uop__tan_fc64_fc64.c index 24d40f550c..f35b7ddeff 100644 --- a/FactoryKernels/GB_uop__tan_fc64_fc64.c +++ b/FactoryKernels/GB_uop__tan_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tan_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tan_fp32_fp32.c b/FactoryKernels/GB_uop__tan_fp32_fp32.c index f0e2a3a5c6..1668cfb27e 100644 --- a/FactoryKernels/GB_uop__tan_fp32_fp32.c +++ b/FactoryKernels/GB_uop__tan_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tan_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tan_fp64_fp64.c b/FactoryKernels/GB_uop__tan_fp64_fp64.c index 990e34fb8b..02acac0961 100644 --- a/FactoryKernels/GB_uop__tan_fp64_fp64.c +++ b/FactoryKernels/GB_uop__tan_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tan_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tanh_fc32_fc32.c b/FactoryKernels/GB_uop__tanh_fc32_fc32.c index 15c62ce07f..9feffb6838 100644 --- a/FactoryKernels/GB_uop__tanh_fc32_fc32.c +++ b/FactoryKernels/GB_uop__tanh_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tanh_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tanh_fc64_fc64.c b/FactoryKernels/GB_uop__tanh_fc64_fc64.c index d1cd246d7c..243d13fb99 100644 --- a/FactoryKernels/GB_uop__tanh_fc64_fc64.c +++ b/FactoryKernels/GB_uop__tanh_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tanh_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tanh_fp32_fp32.c b/FactoryKernels/GB_uop__tanh_fp32_fp32.c index 06c8c8f72e..842d622979 100644 --- a/FactoryKernels/GB_uop__tanh_fp32_fp32.c +++ b/FactoryKernels/GB_uop__tanh_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tanh_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tanh_fp64_fp64.c b/FactoryKernels/GB_uop__tanh_fp64_fp64.c index 87334278d7..35ff415a46 100644 --- a/FactoryKernels/GB_uop__tanh_fp64_fp64.c +++ b/FactoryKernels/GB_uop__tanh_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tanh_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tgamma_fp32_fp32.c b/FactoryKernels/GB_uop__tgamma_fp32_fp32.c index 53ad6c5ab7..726631aa53 100644 --- a/FactoryKernels/GB_uop__tgamma_fp32_fp32.c +++ b/FactoryKernels/GB_uop__tgamma_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tgamma_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__tgamma_fp64_fp64.c b/FactoryKernels/GB_uop__tgamma_fp64_fp64.c index 31dc9e0523..2dc1e996f8 100644 --- a/FactoryKernels/GB_uop__tgamma_fp64_fp64.c +++ b/FactoryKernels/GB_uop__tgamma_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__tgamma_fp64_fp64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__trunc_fc32_fc32.c b/FactoryKernels/GB_uop__trunc_fc32_fc32.c index 508c4fe12c..a7113b0f2c 100644 --- a/FactoryKernels/GB_uop__trunc_fc32_fc32.c +++ b/FactoryKernels/GB_uop__trunc_fc32_fc32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__trunc_fc32_fc32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__trunc_fc64_fc64.c b/FactoryKernels/GB_uop__trunc_fc64_fc64.c index eeb7bd93fb..092dd21c6a 100644 --- a/FactoryKernels/GB_uop__trunc_fc64_fc64.c +++ b/FactoryKernels/GB_uop__trunc_fc64_fc64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FC64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__trunc_fc64_fc64) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__trunc_fp32_fp32.c b/FactoryKernels/GB_uop__trunc_fp32_fp32.c index 42a63f0a5c..064fe395ce 100644 --- a/FactoryKernels/GB_uop__trunc_fp32_fp32.c +++ b/FactoryKernels/GB_uop__trunc_fp32_fp32.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP32) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__trunc_fp32_fp32) #endif } +#endif + diff --git a/FactoryKernels/GB_uop__trunc_fp64_fp64.c b/FactoryKernels/GB_uop__trunc_fp64_fp64.c index 09b50157f1..d296d51f7e 100644 --- a/FactoryKernels/GB_uop__trunc_fp64_fp64.c +++ b/FactoryKernels/GB_uop__trunc_fp64_fp64.c @@ -7,8 +7,15 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#if defined (GxB_NO_FP64) +#define GB_TYPE_ENABLED 0 +#else +#define GB_TYPE_ENABLED 1 +#endif + +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,7 +37,7 @@ /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } @@ -41,7 +48,7 @@ #define GB_DISABLE 0 #endif -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" //------------------------------------------------------------------------------ // Cx = op (cast (Ax)): apply a unary operator @@ -86,3 +93,5 @@ GrB_Info GB (_uop_tran__trunc_fp64_fp64) #endif } +#endif + diff --git a/GraphBLAS/@GrB/private/mexfunctions/gbargminmax.c b/GraphBLAS/@GrB/private/mexfunctions/gbargminmax.c index 7e3a261caf..a23161530b 100644 --- a/GraphBLAS/@GrB/private/mexfunctions/gbargminmax.c +++ b/GraphBLAS/@GrB/private/mexfunctions/gbargminmax.c @@ -2,7 +2,7 @@ // gbargminmax: argmin or argmax of a GraphBLAS matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -22,132 +22,2476 @@ #define USAGE "usage: [x,p] = gbargminmax (A, minmax, dim)" //------------------------------------------------------------------------------ -// gb_argminmax: compute argmin/max of each row/column of A +// tuple types //------------------------------------------------------------------------------ -static void gb_argminmax -( - // output - GrB_Matrix *x, // min/max value in each row/col of A - GrB_Matrix *p, // index of min/max value in each row/col of A - // input - GrB_Matrix A, - int dim, // dim=1: cols of A, dim=2: rows of A - GrB_Semiring minmax_first, // MIN_FIRST_type or MAX_FIRST_type semiring - GrB_Semiring any_equal // ANY_EQ semiring -) -{ +// The tuple_* types pair a row or column index (k) with a value v. + +typedef struct { int64_t k ; bool v ; } tuple_bool ; +typedef struct { int64_t k ; int8_t v ; } tuple_int8 ; +typedef struct { int64_t k ; int16_t v ; } tuple_int16 ; +typedef struct { int64_t k ; int32_t v ; } tuple_int32 ; +typedef struct { int64_t k ; int64_t v ; } tuple_int64 ; +typedef struct { int64_t k ; uint8_t v ; } tuple_uint8 ; +typedef struct { int64_t k ; uint16_t v ; } tuple_uint16 ; +typedef struct { int64_t k ; uint32_t v ; } tuple_uint32 ; +typedef struct { int64_t k ; uint64_t v ; } tuple_uint64 ; +typedef struct { int64_t k ; float v ; } tuple_fp32 ; +typedef struct { int64_t k ; double v ; } tuple_fp64 ; + +#define BOOL_K "typedef struct { int64_t k ; bool v ; } tuple_bool ;" +#define INT8_K "typedef struct { int64_t k ; int8_t v ; } tuple_int8 ;" +#define INT16_K "typedef struct { int64_t k ; int16_t v ; } tuple_int16 ;" +#define INT32_K "typedef struct { int64_t k ; int32_t v ; } tuple_int32 ;" +#define INT64_K "typedef struct { int64_t k ; int64_t v ; } tuple_int64 ;" +#define UINT8_K "typedef struct { int64_t k ; uint8_t v ; } tuple_uint8 ;" +#define UINT16_K "typedef struct { int64_t k ; uint16_t v ; } tuple_uint16 ;" +#define UINT32_K "typedef struct { int64_t k ; uint32_t v ; } tuple_uint32 ;" +#define UINT64_K "typedef struct { int64_t k ; uint64_t v ; } tuple_uint64 ;" +#define FP32_K "typedef struct { int64_t k ; float v ; } tuple_fp32 ;" +#define FP64_K "typedef struct { int64_t k ; double v ; } tuple_fp64 ;" + +// The tuple3_* types have both row and column indices, with a value v. + +typedef struct { int64_t i,j ; bool v ; } tuple3_bool ; +typedef struct { int64_t i,j ; int8_t v ; } tuple3_int8 ; +typedef struct { int64_t i,j ; int16_t v ; } tuple3_int16 ; +typedef struct { int64_t i,j ; int32_t v ; } tuple3_int32 ; +typedef struct { int64_t i,j ; int64_t v ; } tuple3_int64 ; +typedef struct { int64_t i,j ; uint8_t v ; } tuple3_uint8 ; +typedef struct { int64_t i,j ; uint16_t v ; } tuple3_uint16 ; +typedef struct { int64_t i,j ; uint32_t v ; } tuple3_uint32 ; +typedef struct { int64_t i,j ; uint64_t v ; } tuple3_uint64 ; +typedef struct { int64_t i,j ; float v ; } tuple3_fp32 ; +typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ; + +#define BOOL_IJ "typedef struct { int64_t i,j ; bool v ; } tuple3_bool ;" +#define INT8_IJ "typedef struct { int64_t i,j ; int8_t v ; } tuple3_int8 ;" +#define INT16_IJ "typedef struct { int64_t i,j ; int16_t v ; } tuple3_int16 ;" +#define INT32_IJ "typedef struct { int64_t i,j ; int32_t v ; } tuple3_int32 ;" +#define INT64_IJ "typedef struct { int64_t i,j ; int64_t v ; } tuple3_int64 ;" +#define UINT8_IJ "typedef struct { int64_t i,j ; uint8_t v ; } tuple3_uint8 ;" +#define UINT16_IJ "typedef struct { int64_t i,j ; uint16_t v ; } tuple3_uint16 ;" +#define UINT32_IJ "typedef struct { int64_t i,j ; uint32_t v ; } tuple3_uint32 ;" +#define UINT64_IJ "typedef struct { int64_t i,j ; uint64_t v ; } tuple3_uint64 ;" +#define FP32_IJ "typedef struct { int64_t i,j ; float v ; } tuple3_fp32 ;" +#define FP64_IJ "typedef struct { int64_t i,j ; double v ; } tuple3_fp64 ;" + +//------------------------------------------------------------------------------ +// make_* index binary functions +//------------------------------------------------------------------------------ + +// These functions take a value v from a matrix and combine it with its row/col +// index k to make a tuple (k,v). + + void make_bool (tuple_bool *z, + const bool *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_bool (tuple_bool *z, + const bool *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_BOOL \ + "void make_bool (tuple_bool *z, \n" \ + " const bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_int8 (tuple_int8 *z, + const int8_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_int8 (tuple_int8 *z, + const int8_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_INT8 \ + "void make_int8 (tuple_int8 *z, \n" \ + " const int8_t *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_int16 (tuple_int16 *z, + const int16_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_int16 (tuple_int16 *z, + const int16_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_INT16 \ + "void make_int16 (tuple_int16 *z, \n" \ + " const int16_t *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_int32 (tuple_int32 *z, + const int32_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_int32 (tuple_int32 *z, + const int32_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_INT32 \ + "void make_int32 (tuple_int32 *z, \n" \ + " const int32_t *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_int64 (tuple_int64 *z, + const int64_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_int64 (tuple_int64 *z, + const int64_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_INT64 \ + "void make_int64 (tuple_int64 *z, \n" \ + " const int64_t *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_uint8 (tuple_uint8 *z, + const uint8_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_uint8 (tuple_uint8 *z, + const uint8_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_UINT8 \ + "void make_uint8 (tuple_uint8 *z, \n" \ + " const uint8_t *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_uint16 (tuple_uint16 *z, + const uint16_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_uint16 (tuple_uint16 *z, + const uint16_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_UINT16 \ + "void make_uint16 (tuple_uint16 *z, \n" \ + " const uint16_t *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_uint32 (tuple_uint32 *z, + const uint32_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_uint32 (tuple_uint32 *z, + const uint32_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_UINT32 \ + "void make_uint32 (tuple_uint32 *z, \n" \ + " const uint32_t *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_uint64 (tuple_uint64 *z, + const uint64_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_uint64 (tuple_uint64 *z, + const uint64_t *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_UINT64 \ + "void make_uint64 (tuple_uint64 *z, \n" \ + " const uint64_t *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_fp32 (tuple_fp32 *z, + const float *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_fp32 (tuple_fp32 *z, + const float *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_FP32 \ + "void make_fp32 (tuple_fp32 *z, \n" \ + " const float *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + + void make_fp64 (tuple_fp64 *z, + const double *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; + void make_fp64 (tuple_fp64 *z, + const double *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; + } + +#define MAKE_FP64 \ + "void make_fp64 (tuple_fp64 *z, \n" \ + " const double *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y, GrB_Index iy, GrB_Index jy, \n" \ + " const void *theta) \n" \ + "{ \n" \ + " z->k = (int64_t) jx + 1 ; \n" \ + " z->v = (*x) ; \n" \ + "} \n" + +//------------------------------------------------------------------------------ +// make3a_* index unary functions +//------------------------------------------------------------------------------ + +// These unary functions take a 2-tuple (k,v) and combine it with another index +// index i to make a 3-tuple (i,k,v). It is only used for vectors or n-by-1 +// matrices, so jx is always zero. + + void make3a_bool (tuple3_bool *z, + const tuple_bool *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_bool (tuple3_bool *z, + const tuple_bool *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_BOOL \ + "void make3a_bool (tuple3_bool *z, \n" \ + " const tuple_bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_bool (tuple3_bool *z, \n" \ + " const tuple_bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_int8 (tuple3_int8 *z, + const tuple_int8 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_int8 (tuple3_int8 *z, + const tuple_int8 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_INT8 \ + "void make3a_int8 (tuple3_int8 *z, \n" \ + " const tuple_int8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_int8 (tuple3_int8 *z, \n" \ + " const tuple_int8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_int16 (tuple3_int16 *z, + const tuple_int16 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_int16 (tuple3_int16 *z, + const tuple_int16 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_INT16 \ + "void make3a_int16 (tuple3_int16 *z, \n" \ + " const tuple_int16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_int16 (tuple3_int16 *z, \n" \ + " const tuple_int16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_int32 (tuple3_int32 *z, + const tuple_int32 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_int32 (tuple3_int32 *z, + const tuple_int32 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_INT32 \ + "void make3a_int32 (tuple3_int32 *z, \n" \ + " const tuple_int32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_int32 (tuple3_int32 *z, \n" \ + " const tuple_int32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_int64 (tuple3_int64 *z, + const tuple_int64 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_int64 (tuple3_int64 *z, + const tuple_int64 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_INT64 \ + "void make3a_int64 (tuple3_int64 *z, \n" \ + " const tuple_int64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_int64 (tuple3_int64 *z, \n" \ + " const tuple_int64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_uint8 (tuple3_uint8 *z, + const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_uint8 (tuple3_uint8 *z, + const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_UINT8 \ + "void make3a_uint8 (tuple3_uint8 *z, \n" \ + " const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_uint8 (tuple3_uint8 *z, \n" \ + " const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_uint16 (tuple3_uint16 *z, + const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_uint16 (tuple3_uint16 *z, + const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_UINT16 \ + "void make3a_uint16 (tuple3_uint16 *z, \n" \ + " const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_uint16 (tuple3_uint16 *z, \n" \ + " const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_uint32 (tuple3_uint32 *z, + const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_uint32 (tuple3_uint32 *z, + const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_UINT32 \ + "void make3a_uint32 (tuple3_uint32 *z, \n" \ + " const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_uint32 (tuple3_uint32 *z, \n" \ + " const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_uint64 (tuple3_uint64 *z, + const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_uint64 (tuple3_uint64 *z, + const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_UINT64 \ + "void make3a_uint64 (tuple3_uint64 *z, \n" \ + " const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_uint64 (tuple3_uint64 *z, \n" \ + " const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_fp32 (tuple3_fp32 *z, + const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_fp32 (tuple3_fp32 *z, + const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_FP32 \ + "void make3a_fp32 (tuple3_fp32 *z, \n" \ + " const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_fp32 (tuple3_fp32 *z, \n" \ + " const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3a_fp64 (tuple3_fp64 *z, + const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3a_fp64 (tuple3_fp64 *z, + const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = (int64_t) ix + 1 ; + z->j = x->k ; + z->v = x->v ; + } + +#define MAKE3a_FP64 \ + "void make3a_fp64 (tuple3_fp64 *z, \n" \ + " const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3a_fp64 (tuple3_fp64 *z, \n" \ + " const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = (int64_t) ix + 1 ; \n" \ + " z->j = x->k ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + +//------------------------------------------------------------------------------ +// make3b_* index unary functions +//------------------------------------------------------------------------------ + +// These unary functions take a 2-tuple (k,v) and combine it with another index +// index i to make a 3-tuple (k,i,v). It is only used for vectors or n-by-1 +// matrices, so jx is always zero. + + void make3b_bool (tuple3_bool *z, + const tuple_bool *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_bool (tuple3_bool *z, + const tuple_bool *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_BOOL \ + "void make3b_bool (tuple3_bool *z, \n" \ + " const tuple_bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_bool (tuple3_bool *z, \n" \ + " const tuple_bool *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_int8 (tuple3_int8 *z, + const tuple_int8 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_int8 (tuple3_int8 *z, + const tuple_int8 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_INT8 \ + "void make3b_int8 (tuple3_int8 *z, \n" \ + " const tuple_int8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_int8 (tuple3_int8 *z, \n" \ + " const tuple_int8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_int16 (tuple3_int16 *z, + const tuple_int16 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_int16 (tuple3_int16 *z, + const tuple_int16 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_INT16 \ + "void make3b_int16 (tuple3_int16 *z, \n" \ + " const tuple_int16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_int16 (tuple3_int16 *z, \n" \ + " const tuple_int16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_int32 (tuple3_int32 *z, + const tuple_int32 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_int32 (tuple3_int32 *z, + const tuple_int32 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_INT32 \ + "void make3b_int32 (tuple3_int32 *z, \n" \ + " const tuple_int32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_int32 (tuple3_int32 *z, \n" \ + " const tuple_int32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_int64 (tuple3_int64 *z, + const tuple_int64 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_int64 (tuple3_int64 *z, + const tuple_int64 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_INT64 \ + "void make3b_int64 (tuple3_int64 *z, \n" \ + " const tuple_int64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_int64 (tuple3_int64 *z, \n" \ + " const tuple_int64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_uint8 (tuple3_uint8 *z, + const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_uint8 (tuple3_uint8 *z, + const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_UINT8 \ + "void make3b_uint8 (tuple3_uint8 *z, \n" \ + " const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_uint8 (tuple3_uint8 *z, \n" \ + " const tuple_uint8 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_uint16 (tuple3_uint16 *z, + const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_uint16 (tuple3_uint16 *z, + const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_UINT16 \ + "void make3b_uint16 (tuple3_uint16 *z, \n" \ + " const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_uint16 (tuple3_uint16 *z, \n" \ + " const tuple_uint16 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_uint32 (tuple3_uint32 *z, + const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_uint32 (tuple3_uint32 *z, + const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_UINT32 \ + "void make3b_uint32 (tuple3_uint32 *z, \n" \ + " const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_uint32 (tuple3_uint32 *z, \n" \ + " const tuple_uint32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_uint64 (tuple3_uint64 *z, + const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_uint64 (tuple3_uint64 *z, + const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_UINT64 \ + "void make3b_uint64 (tuple3_uint64 *z, \n" \ + " const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_uint64 (tuple3_uint64 *z, \n" \ + " const tuple_uint64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_fp32 (tuple3_fp32 *z, + const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_fp32 (tuple3_fp32 *z, + const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_FP32 \ + "void make3b_fp32 (tuple3_fp32 *z, \n" \ + " const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_fp32 (tuple3_fp32 *z, \n" \ + " const tuple_fp32 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + + void make3b_fp64 (tuple3_fp64 *z, + const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, + const void *y) ; + void make3b_fp64 (tuple3_fp64 *z, + const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, + const void *y) + { + z->i = x->k ; + z->j = (int64_t) ix + 1 ; + z->v = x->v ; + } + +#define MAKE3b_FP64 \ + "void make3b_fp64 (tuple3_fp64 *z, \n" \ + " const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) ; \n" \ + "void make3b_fp64 (tuple3_fp64 *z, \n" \ + " const tuple_fp64 *x, GrB_Index ix, GrB_Index jx, \n" \ + " const void *y) \n" \ + "{ \n" \ + " z->i = x->k ; \n" \ + " z->j = (int64_t) ix + 1 ; \n" \ + " z->v = x->v ; \n" \ + "} \n" \ + +//------------------------------------------------------------------------------ +// max_* functions: +//------------------------------------------------------------------------------ + +// These functions find the max of two 2-tuples. The tuple with the larger +// value v is selected. In case of ties, pick the one with the smaller index +// k. + + void max_bool (tuple_bool *z, const tuple_bool *x, const tuple_bool *y) ; + void max_bool (tuple_bool *z, const tuple_bool *x, const tuple_bool *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_BOOL \ + "void max_bool (tuple_bool *z, const tuple_bool *x, const tuple_bool *y)\n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y) ; + void max_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_INT8 \ + "void max_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y)\n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y); + void max_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_INT16 \ + "void max_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y)\n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y); + void max_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_INT32 \ + "void max_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y)\n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y); + void max_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_INT64 \ + "void max_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y)\n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y); + void max_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_UINT8 \ + "void max_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y)\n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) ; + void max_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_UINT16 \ + "void max_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k))\n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) ; + void max_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_UINT32 \ + "void max_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) ; + void max_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_UINT64 \ + "void max_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y) ; + void max_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_FP32 \ + "void max_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y)\n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) ; + void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) + { + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MAX_FP64 \ + "void max_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y)\n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + +//------------------------------------------------------------------------------ +// min_* functions: +//------------------------------------------------------------------------------ + +// These functions find the max of two 2-tuples. The tuple with the larger +// value v is selected. In case of ties, pick the one with the smaller index +// k. + + void min_bool (tuple_bool *z, const tuple_bool *x, const tuple_bool *y) ; + void min_bool (tuple_bool *z, const tuple_bool *x, const tuple_bool *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_BOOL \ + "void min_bool (tuple_bool *z, const tuple_bool *x, const tuple_bool *y)\n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y) ; + void min_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_INT8 \ + "void min_int8 (tuple_int8 *z, const tuple_int8 *x, const tuple_int8 *y)\n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y) ; + void min_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_INT16 \ + "void min_int16 (tuple_int16 *z, const tuple_int16 *x, const tuple_int16 *y)\n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y) ; + void min_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_INT32 \ + "void min_int32 (tuple_int32 *z, const tuple_int32 *x, const tuple_int32 *y)\n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y) ; + void min_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_INT64 \ + "void min_int64 (tuple_int64 *z, const tuple_int64 *x, const tuple_int64 *y)\n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y) ; + void min_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_UINT8 \ + "void min_uint8 (tuple_uint8 *z, const tuple_uint8 *x, const tuple_uint8 *y)\n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) ; + void min_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_UINT16 \ + "void min_uint16 (tuple_uint16 *z, const tuple_uint16 *x, const tuple_uint16 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) ; + void min_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_UINT32 \ + "void min_uint32 (tuple_uint32 *z, const tuple_uint32 *x, const tuple_uint32 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) ; + void min_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_UINT64 \ + "void min_uint64 (tuple_uint64 *z, const tuple_uint64 *x, const tuple_uint64 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y) ; + void min_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_FP32 \ + "void min_fp32 (tuple_fp32 *z, const tuple_fp32 *x, const tuple_fp32 *y)\n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) ; + void min_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y) + { + if (x->v < y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } + } + +#define MIN_FP64 \ + "void min_fp64 (tuple_fp64 *z, const tuple_fp64 *x, const tuple_fp64 *y)\n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && x->k < y->k)) \n" \ + " { \n" \ + " z->k = x->k ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->k = y->k ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + +//------------------------------------------------------------------------------ +// max3_* functions: +//------------------------------------------------------------------------------ + +// These functions find the max of two 3-tuples. The tuple with the larger +// value v is selected. In case of ties, pick the one with the smaller index +// i. If both the value and i tie, pick the one with the smaller j. + + void max3_bool (tuple3_bool *z, const tuple3_bool *x, const tuple3_bool *y) ; + void max3_bool (tuple3_bool *z, const tuple3_bool *x, const tuple3_bool *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_BOOL \ + "void max3_bool (tuple3_bool *z, const tuple3_bool *x, const tuple3_bool *y) ; \n" \ + "void max3_bool (tuple3_bool *z, const tuple3_bool *x, const tuple3_bool *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_int8 (tuple3_int8 *z, const tuple3_int8 *x, const tuple3_int8 *y) ; + void max3_int8 (tuple3_int8 *z, const tuple3_int8 *x, const tuple3_int8 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_INT8 \ + "void max3_int8 (tuple3_int8 *z, const tuple3_int8 *x, const tuple3_int8 *y) ; \n" \ + "void max3_int8 (tuple3_int8 *z, const tuple3_int8 *x, const tuple3_int8 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_int16 (tuple3_int16 *z, const tuple3_int16 *x, const tuple3_int16 *y) ; + void max3_int16 (tuple3_int16 *z, const tuple3_int16 *x, const tuple3_int16 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_INT16 \ + "void max3_int16 (tuple3_int16 *z, const tuple3_int16 *x, const tuple3_int16 *y) ; \n" \ + "void max3_int16 (tuple3_int16 *z, const tuple3_int16 *x, const tuple3_int16 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_int32 (tuple3_int32 *z, const tuple3_int32 *x, const tuple3_int32 *y) ; + void max3_int32 (tuple3_int32 *z, const tuple3_int32 *x, const tuple3_int32 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_INT32 \ + "void max3_int32 (tuple3_int32 *z, const tuple3_int32 *x, const tuple3_int32 *y) ; \n" \ + "void max3_int32 (tuple3_int32 *z, const tuple3_int32 *x, const tuple3_int32 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_int64 (tuple3_int64 *z, const tuple3_int64 *x, const tuple3_int64 *y) ; + void max3_int64 (tuple3_int64 *z, const tuple3_int64 *x, const tuple3_int64 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_INT64 \ + "void max3_int64 (tuple3_int64 *z, const tuple3_int64 *x, const tuple3_int64 *y) ; \n" \ + "void max3_int64 (tuple3_int64 *z, const tuple3_int64 *x, const tuple3_int64 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_uint8 (tuple3_uint8 *z, const tuple3_uint8 *x, const tuple3_uint8 *y) ; + void max3_uint8 (tuple3_uint8 *z, const tuple3_uint8 *x, const tuple3_uint8 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_UINT8 \ + "void max3_uint8 (tuple3_uint8 *z, const tuple3_uint8 *x, const tuple3_uint8 *y) ; \n" \ + "void max3_uint8 (tuple3_uint8 *z, const tuple3_uint8 *x, const tuple3_uint8 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_uint16 (tuple3_uint16 *z, const tuple3_uint16 *x, const tuple3_uint16 *y) ; + void max3_uint16 (tuple3_uint16 *z, const tuple3_uint16 *x, const tuple3_uint16 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_UINT16 \ + "void max3_uint16 (tuple3_uint16 *z, const tuple3_uint16 *x, const tuple3_uint16 *y) ; \n" \ + "void max3_uint16 (tuple3_uint16 *z, const tuple3_uint16 *x, const tuple3_uint16 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_uint32 (tuple3_uint32 *z, const tuple3_uint32 *x, const tuple3_uint32 *y) ; + void max3_uint32 (tuple3_uint32 *z, const tuple3_uint32 *x, const tuple3_uint32 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_UINT32 \ + "void max3_uint32 (tuple3_uint32 *z, const tuple3_uint32 *x, const tuple3_uint32 *y) ; \n" \ + "void max3_uint32 (tuple3_uint32 *z, const tuple3_uint32 *x, const tuple3_uint32 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_uint64 (tuple3_uint64 *z, const tuple3_uint64 *x, const tuple3_uint64 *y) ; + void max3_uint64 (tuple3_uint64 *z, const tuple3_uint64 *x, const tuple3_uint64 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_UINT64 \ + "void max3_uint64 (tuple3_uint64 *z, const tuple3_uint64 *x, const tuple3_uint64 *y) ; \n" \ + "void max3_uint64 (tuple3_uint64 *z, const tuple3_uint64 *x, const tuple3_uint64 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_fp32 (tuple3_fp32 *z, const tuple3_fp32 *x, const tuple3_fp32 *y) ; + void max3_fp32 (tuple3_fp32 *z, const tuple3_fp32 *x, const tuple3_fp32 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_FP32 \ + "void max3_fp32 (tuple3_fp32 *z, const tuple3_fp32 *x, const tuple3_fp32 *y) ; \n" \ + "void max3_fp32 (tuple3_fp32 *z, const tuple3_fp32 *x, const tuple3_fp32 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void max3_fp64 (tuple3_fp64 *z, const tuple3_fp64 *x, const tuple3_fp64 *y) ; + void max3_fp64 (tuple3_fp64 *z, const tuple3_fp64 *x, const tuple3_fp64 *y) + { + if (x->v > y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MAX3_FP64 \ + "void max3_fp64 (tuple3_fp64 *z, const tuple3_fp64 *x, const tuple3_fp64 *y) ; \n" \ + "void max3_fp64 (tuple3_fp64 *z, const tuple3_fp64 *x, const tuple3_fp64 *y) \n" \ + "{ \n" \ + " if (x->v > y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + +//------------------------------------------------------------------------------ +// min3_* functions: +//------------------------------------------------------------------------------ + +// These functions find the min of two 3-tuples. The tuple with the larger +// value v is selected. In case of ties, pick the one with the smaller index +// i. If both the value and i tie, pick the one with the smaller j. + + void min3_bool (tuple3_bool *z, const tuple3_bool *x, const tuple3_bool *y) ; + void min3_bool (tuple3_bool *z, const tuple3_bool *x, const tuple3_bool *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } - //-------------------------------------------------------------------------- - // get the size and type of A - //-------------------------------------------------------------------------- +#define MIN3_BOOL \ + "void min3_bool (tuple3_bool *z, const tuple3_bool *x, const tuple3_bool *y) ; \n" \ + "void min3_bool (tuple3_bool *z, const tuple3_bool *x, const tuple3_bool *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - (*x) = NULL ; - (*p) = NULL ; + void min3_int8 (tuple3_int8 *z, const tuple3_int8 *x, const tuple3_int8 *y) ; + void min3_int8 (tuple3_int8 *z, const tuple3_int8 *x, const tuple3_int8 *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } - GrB_Index nrows, ncols ; - OK (GrB_Matrix_nrows (&nrows, A)) ; - OK (GrB_Matrix_ncols (&ncols, A)) ; - GrB_Type type ; - OK (GxB_Matrix_type (&type, A)) ; +#define MIN3_INT8 \ + "void min3_int8 (tuple3_int8 *z, const tuple3_int8 *x, const tuple3_int8 *y) ; \n" \ + "void min3_int8 (tuple3_int8 *z, const tuple3_int8 *x, const tuple3_int8 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - //-------------------------------------------------------------------------- - // create outputs x and p, and the iso full vector y - //-------------------------------------------------------------------------- + void min3_int16 (tuple3_int16 *z, const tuple3_int16 *x, const tuple3_int16 *y) ; + void min3_int16 (tuple3_int16 *z, const tuple3_int16 *x, const tuple3_int16 *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } - GrB_Matrix y = NULL ; - GrB_Matrix G = NULL, D = NULL ; - GrB_Index n = (dim == 2) ? ncols : nrows ; - GrB_Index m = (dim == 2) ? nrows : ncols ; - GrB_Descriptor desc = (dim == 2) ? NULL : GrB_DESC_T0 ; - OK (GrB_Matrix_new (x, type, m, 1)) ; - OK (GrB_Matrix_new (&y, type, n, 1)) ; - OK (GrB_Matrix_new (p, GrB_INT64, m, 1)) ; +#define MIN3_INT16 \ + "void min3_int16 (tuple3_int16 *z, const tuple3_int16 *x, const tuple3_int16 *y) ; \n" \ + "void min3_int16 (tuple3_int16 *z, const tuple3_int16 *x, const tuple3_int16 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - // y (:) = 1, an iso full vector - OK (GrB_Matrix_assign_INT64 (y, NULL, NULL, 1, GrB_ALL, n, GrB_ALL, 1, - NULL)) ; + void min3_int32 (tuple3_int32 *z, const tuple3_int32 *x, const tuple3_int32 *y) ; + void min3_int32 (tuple3_int32 *z, const tuple3_int32 *x, const tuple3_int32 *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } - //-------------------------------------------------------------------------- - // compute x = min/max(A) - //-------------------------------------------------------------------------- +#define MIN3_INT32 \ + "void min3_int32 (tuple3_int32 *z, const tuple3_int32 *x, const tuple3_int32 *y) ; \n" \ + "void min3_int32 (tuple3_int32 *z, const tuple3_int32 *x, const tuple3_int32 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - // for dim=1: x = min/max (A) where x(j) = min/max (A (:,j)) - // for dim=2: x = min/max (A) where x(i) = min/max (A (i,:)) + void min3_int64 (tuple3_int64 *z, const tuple3_int64 *x, const tuple3_int64 *y) ; + void min3_int64 (tuple3_int64 *z, const tuple3_int64 *x, const tuple3_int64 *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } - OK (GrB_mxm (*x, NULL, NULL, minmax_first, A, y, desc)) ; +#define MIN3_INT64 \ + "void min3_int64 (tuple3_int64 *z, const tuple3_int64 *x, const tuple3_int64 *y) ; \n" \ + "void min3_int64 (tuple3_int64 *z, const tuple3_int64 *x, const tuple3_int64 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - //-------------------------------------------------------------------------- - // D = diag (x) - //-------------------------------------------------------------------------- + void min3_uint8 (tuple3_uint8 *z, const tuple3_uint8 *x, const tuple3_uint8 *y) ; + void min3_uint8 (tuple3_uint8 *z, const tuple3_uint8 *x, const tuple3_uint8 *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } - // note: typecasting from an m-by-1 GrB_Matrix to a GrB_Vector is - // not allowed by the GraphBLAS C API, but it can be done in SuiteSparse. - // A more portable method would construct x as a GrB_Vector, - // but using x as a GrB_Matrix simplifies the gb_export. +#define MIN3_UINT8 \ + "void min3_uint8 (tuple3_uint8 *z, const tuple3_uint8 *x, const tuple3_uint8 *y) ; \n" \ + "void min3_uint8 (tuple3_uint8 *z, const tuple3_uint8 *x, const tuple3_uint8 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - OK (GrB_Matrix_diag (&D, (GrB_Vector) *x, 0)) ; + void min3_uint16 (tuple3_uint16 *z, const tuple3_uint16 *x, const tuple3_uint16 *y) ; + void min3_uint16 (tuple3_uint16 *z, const tuple3_uint16 *x, const tuple3_uint16 *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } - //-------------------------------------------------------------------------- - // compute G, where G(i,j)=1 if A(i,j) is the min/max in its row/col - //-------------------------------------------------------------------------- +#define MIN3_UINT16 \ + "void min3_uint16 (tuple3_uint16 *z, const tuple3_uint16 *x, const tuple3_uint16 *y) ; \n" \ + "void min3_uint16 (tuple3_uint16 *z, const tuple3_uint16 *x, const tuple3_uint16 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - OK (GrB_Matrix_new (&G, GrB_BOOL, nrows, ncols)) ; - if (dim == 1) + void min3_uint32 (tuple3_uint32 *z, const tuple3_uint32 *x, const tuple3_uint32 *y) ; + void min3_uint32 (tuple3_uint32 *z, const tuple3_uint32 *x, const tuple3_uint32 *y) { - // G = A*D using the ANY_EQ_type semiring - OK (GrB_mxm (G, NULL, NULL, any_equal, A, D, NULL)) ; + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } } - else + +#define MIN3_UINT32 \ + "void min3_uint32 (tuple3_uint32 *z, const tuple3_uint32 *x, const tuple3_uint32 *y) ; \n" \ + "void min3_uint32 (tuple3_uint32 *z, const tuple3_uint32 *x, const tuple3_uint32 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min3_uint64 (tuple3_uint64 *z, const tuple3_uint64 *x, const tuple3_uint64 *y) ; + void min3_uint64 (tuple3_uint64 *z, const tuple3_uint64 *x, const tuple3_uint64 *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } + +#define MIN3_UINT64 \ + "void min3_uint64 (tuple3_uint64 *z, const tuple3_uint64 *x, const tuple3_uint64 *y) ; \n" \ + "void min3_uint64 (tuple3_uint64 *z, const tuple3_uint64 *x, const tuple3_uint64 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" + + void min3_fp32 (tuple3_fp32 *z, const tuple3_fp32 *x, const tuple3_fp32 *y) ; + void min3_fp32 (tuple3_fp32 *z, const tuple3_fp32 *x, const tuple3_fp32 *y) { - // G = D*A using the ANY_EQ_type semiring - OK (GrB_mxm (G, NULL, NULL, any_equal, D, A, NULL)) ; + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } } - // drop explicit zeros from G -// OK (GxB_Matrix_select (G, NULL, NULL, GxB_NONZERO, G, NULL, NULL)) ; - OK (GrB_Matrix_select_BOOL (G, NULL, NULL, GrB_VALUENE_BOOL, G, 0, NULL)) ; +#define MIN3_FP32 \ + "void min3_fp32 (tuple3_fp32 *z, const tuple3_fp32 *x, const tuple3_fp32 *y) ; \n" \ + "void min3_fp32 (tuple3_fp32 *z, const tuple3_fp32 *x, const tuple3_fp32 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - //-------------------------------------------------------------------------- - // extract the positions of the entries in G - //-------------------------------------------------------------------------- + void min3_fp64 (tuple3_fp64 *z, const tuple3_fp64 *x, const tuple3_fp64 *y) ; + void min3_fp64 (tuple3_fp64 *z, const tuple3_fp64 *x, const tuple3_fp64 *y) + { + if (x->v < y->v || (x->v == y->v && + (x->i < y->i || (x->i == y->i && x->j < y->j)))) + { + z->i = x->i ; + z->j = x->j ; + z->v = x->v ; + } + else + { + z->i = y->i ; + z->j = y->j ; + z->v = y->v ; + } + } - // for dim=1: find the position of the min/max entry in each column: - // p = G'*y, so that p(j) = i if x(j) = A(i,j) = min/max (A (:,j)). - - // for dim=2: find the position of the min/max entry in each row: - // p = G*y, so that p(i) = j if x(i) = A(i,j) = min/max (A (i,:)). - - // For both cases, use the SECONDI1 operator since built-in indexing is - // 1-based. The ANY monoid would be faster, but this uses MIN so that the - // result for the user is repeatable. - - #if 1 - // p = G*y or G'*y using the MIN_SECONDI semiring - // this is faster than the method below - OK (GrB_mxm (*p, NULL, NULL, GxB_MIN_SECONDI1_INT64, G, y, desc)) ; - #else - printf ("without 2ndi\n") ; - // H = rowindex1 (G) if dim is 1, or colindex1 (G) if dim is 2. - GrB_Matrix H = NULL ; - OK (GrB_Matrix_new (&H, GrB_INT64, nrows, ncols)) ; - OK (GrB_apply (H, NULL, NULL, - (dim == 1) ? GrB_ROWINDEX_INT64 : GrB_COLINDEX_INT64, G, - (int64_t) 1, NULL)) ; - // p = H*y or H'*y using the MIN_FIRST semiring - OK (GrB_mxm (*p, NULL, NULL, GrB_MIN_FIRST_SEMIRING_INT64, H, y, - desc)) ; - OK (GrB_Matrix_free (&H)) ; - #endif +#define MIN3_FP64 \ + "void min3_fp64 (tuple3_fp64 *z, const tuple3_fp64 *x, const tuple3_fp64 *y) ; \n" \ + "void min3_fp64 (tuple3_fp64 *z, const tuple3_fp64 *x, const tuple3_fp64 *y) \n" \ + "{ \n" \ + " if (x->v < y->v || (x->v == y->v && \n" \ + " (x->i < y->i || (x->i == y->i && x->j < y->j)))) \n" \ + " { \n" \ + " z->i = x->i ; \n" \ + " z->j = x->j ; \n" \ + " z->v = x->v ; \n" \ + " } \n" \ + " else \n" \ + " { \n" \ + " z->i = y->i ; \n" \ + " z->j = y->j ; \n" \ + " z->v = y->v ; \n" \ + " } \n" \ + "} \n" - //-------------------------------------------------------------------------- - // free workspace - //-------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// getv_* functions: +//------------------------------------------------------------------------------ - GrB_Matrix_free (&D) ; - GrB_Matrix_free (&G) ; - GrB_Matrix_free (&y) ; -} +// v = getv (tuple) extracts the value v from a 2-tuple. + +void getv_bool (bool *z, const tuple_bool *x) ; +void getv_int8 (int8_t *z, const tuple_int8 *x) ; +void getv_int16 (int16_t *z, const tuple_int16 *x) ; +void getv_int32 (int32_t *z, const tuple_int32 *x) ; +void getv_int64 (int64_t *z, const tuple_int64 *x) ; +void getv_uint8 (uint8_t *z, const tuple_uint8 *x) ; +void getv_uint16 (uint16_t *z, const tuple_uint16 *x) ; +void getv_uint32 (uint32_t *z, const tuple_uint32 *x) ; +void getv_uint64 (uint64_t *z, const tuple_uint64 *x) ; +void getv_fp32 (float *z, const tuple_fp32 *x) ; +void getv_fp64 (double *z, const tuple_fp64 *x) ; + +void getv_bool (bool *z, const tuple_bool *x) { (*z) = x->v ; } +void getv_int8 (int8_t *z, const tuple_int8 *x) { (*z) = x->v ; } +void getv_int16 (int16_t *z, const tuple_int16 *x) { (*z) = x->v ; } +void getv_int32 (int32_t *z, const tuple_int32 *x) { (*z) = x->v ; } +void getv_int64 (int64_t *z, const tuple_int64 *x) { (*z) = x->v ; } +void getv_uint8 (uint8_t *z, const tuple_uint8 *x) { (*z) = x->v ; } +void getv_uint16 (uint16_t *z, const tuple_uint16 *x) { (*z) = x->v ; } +void getv_uint32 (uint32_t *z, const tuple_uint32 *x) { (*z) = x->v ; } +void getv_uint64 (uint64_t *z, const tuple_uint64 *x) { (*z) = x->v ; } +void getv_fp32 (float *z, const tuple_fp32 *x) { (*z) = x->v ; } +void getv_fp64 (double *z, const tuple_fp64 *x) { (*z) = x->v ; } + +#define GETV_BOOL "void getv_bool (bool *z, const tuple_bool *x) { (*z) = x->v ; }" +#define GETV_INT8 "void getv_int8 (int8_t *z, const tuple_int8 *x) { (*z) = x->v ; }" +#define GETV_INT16 "void getv_int16 (int16_t *z, const tuple_int16 *x) { (*z) = x->v ; }" +#define GETV_INT32 "void getv_int32 (int32_t *z, const tuple_int32 *x) { (*z) = x->v ; }" +#define GETV_INT64 "void getv_int64 (int64_t *z, const tuple_int64 *x) { (*z) = x->v ; }" +#define GETV_UINT8 "void getv_uint8 (uint8_t *z, const tuple_uint8 *x) { (*z) = x->v ; }" +#define GETV_UINT16 "void getv_uint16 (uint16_t *z, const tuple_uint16 *x) { (*z) = x->v ; }" +#define GETV_UINT32 "void getv_uint32 (uint32_t *z, const tuple_uint32 *x) { (*z) = x->v ; }" +#define GETV_UINT64 "void getv_uint64 (uint64_t *z, const tuple_uint64 *x) { (*z) = x->v ; }" +#define GETV_FP32 "void getv_fp32 (float *z, const tuple_fp32 *x) { (*z) = x->v ; }" +#define GETV_FP64 "void getv_fp64 (double *z, const tuple_fp64 *x) { (*z) = x->v ; }" + +//------------------------------------------------------------------------------ +// getk_* functions: +//------------------------------------------------------------------------------ + +// k = getk (tuple) extracts the index k from a 2-tuple. + +void getk_bool (int64_t *z, const tuple_bool *x) ; +void getk_int8 (int64_t *z, const tuple_int8 *x) ; +void getk_int16 (int64_t *z, const tuple_int16 *x) ; +void getk_int32 (int64_t *z, const tuple_int32 *x) ; +void getk_int64 (int64_t *z, const tuple_int64 *x) ; +void getk_uint8 (int64_t *z, const tuple_uint8 *x) ; +void getk_uint16 (int64_t *z, const tuple_uint16 *x) ; +void getk_uint32 (int64_t *z, const tuple_uint32 *x) ; +void getk_uint64 (int64_t *z, const tuple_uint64 *x) ; +void getk_fp32 (int64_t *z, const tuple_fp32 *x) ; +void getk_fp64 (int64_t *z, const tuple_fp64 *x) ; + +void getk_bool (int64_t *z, const tuple_bool *x) { (*z) = x->k ; } +void getk_int8 (int64_t *z, const tuple_int8 *x) { (*z) = x->k ; } +void getk_int16 (int64_t *z, const tuple_int16 *x) { (*z) = x->k ; } +void getk_int32 (int64_t *z, const tuple_int32 *x) { (*z) = x->k ; } +void getk_int64 (int64_t *z, const tuple_int64 *x) { (*z) = x->k ; } +void getk_uint8 (int64_t *z, const tuple_uint8 *x) { (*z) = x->k ; } +void getk_uint16 (int64_t *z, const tuple_uint16 *x) { (*z) = x->k ; } +void getk_uint32 (int64_t *z, const tuple_uint32 *x) { (*z) = x->k ; } +void getk_uint64 (int64_t *z, const tuple_uint64 *x) { (*z) = x->k ; } +void getk_fp32 (int64_t *z, const tuple_fp32 *x) { (*z) = x->k ; } +void getk_fp64 (int64_t *z, const tuple_fp64 *x) { (*z) = x->k ; } + +#define GETK_BOOL "void getk_bool (int64_t *z, const tuple_bool *x) { (*z) = x->k ; }" +#define GETK_INT8 "void getk_int8 (int64_t *z, const tuple_int8 *x) { (*z) = x->k ; }" +#define GETK_INT16 "void getk_int16 (int64_t *z, const tuple_int16 *x) { (*z) = x->k ; }" +#define GETK_INT32 "void getk_int32 (int64_t *z, const tuple_int32 *x) { (*z) = x->k ; }" +#define GETK_INT64 "void getk_int64 (int64_t *z, const tuple_int64 *x) { (*z) = x->k ; }" +#define GETK_UINT8 "void getk_uint8 (int64_t *z, const tuple_uint8 *x) { (*z) = x->k ; }" +#define GETK_UINT16 "void getk_uint16 (int64_t *z, const tuple_uint16 *x) { (*z) = x->k ; }" +#define GETK_UINT32 "void getk_uint32 (int64_t *z, const tuple_uint32 *x) { (*z) = x->k ; }" +#define GETK_UINT64 "void getk_uint64 (int64_t *z, const tuple_uint64 *x) { (*z) = x->k ; }" +#define GETK_FP32 "void getk_fp32 (int64_t *z, const tuple_fp32 *x) { (*z) = x->k ; }" +#define GETK_FP64 "void getk_fp64 (int64_t *z, const tuple_fp64 *x) { (*z) = x->k ; }" //------------------------------------------------------------------------------ // gbargminmax: mexFunction to compute the argmin/max of each row/column of A @@ -173,222 +2517,1061 @@ void mexFunction CHECK_ERROR (dim < 0 || dim > 2, "invalid dim") ; //-------------------------------------------------------------------------- - // select the semirings + // get the matrix properties + //-------------------------------------------------------------------------- + + GrB_Index nrows, ncols, nvals ; + OK (GrB_Matrix_nrows (&nrows, A)) ; + OK (GrB_Matrix_ncols (&ncols, A)) ; + GrB_Type A_type ; + OK (GxB_Matrix_type (&A_type, A)) ; + GxB_Format_Value fmt ; + OK (GxB_Matrix_Option_get (A, GxB_FORMAT, &fmt)) ; + + //-------------------------------------------------------------------------- + // types, ops, and semirings for argmin and argmax //-------------------------------------------------------------------------- - GrB_Type type ; - OK (GxB_Matrix_type (&type, A)) ; - GrB_Semiring minmax_first, any_equal ; + GrB_Type Tuple = NULL, Tuple3 = NULL ; + GxB_IndexBinaryOp Iop = NULL ; + GrB_IndexUnaryOp Make3 = NULL ; + GrB_BinaryOp Bop = NULL, MonOp = NULL, Mon3Op = NULL ; + GrB_Monoid Monoid = NULL, Monoid3 = NULL ; + GrB_Semiring Semiring = NULL ; + GrB_Scalar Theta = NULL ; + GrB_UnaryOp Getv = NULL, Getk = NULL ; + GrB_Matrix x = NULL, p = NULL, c = NULL, y = NULL, z = NULL ; + GrB_Scalar s = NULL ; + + OK (GrB_Scalar_new (&Theta, GrB_BOOL)) ; + OK (GrB_Scalar_setElement_BOOL (Theta, 0)) ; - if (is_min) + if (A_type == GrB_BOOL) { //---------------------------------------------------------------------- - // semirings for argmin + // boolean //---------------------------------------------------------------------- - if (type == GrB_BOOL) + OK (GxB_Type_new (&Tuple, sizeof (tuple_bool), "tuple_bool", BOOL_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_bool, + Tuple, GrB_BOOL, GrB_BOOL, GrB_BOOL, "make_bool", MAKE_BOOL)) ; + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_bool id ; + memset (&id, 0, sizeof (tuple_bool)) ; + id.k = INT64_MAX ; + if (is_min) { - minmax_first = GxB_LAND_FIRST_BOOL ; - any_equal = GxB_ANY_EQ_BOOL ; + id.v = true ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_bool, + Tuple, Tuple, Tuple, "min_bool", MIN_BOOL)) ; } - else if (type == GrB_INT8) + else { - minmax_first = GrB_MIN_FIRST_SEMIRING_INT8 ; - any_equal = GxB_ANY_EQ_INT8 ; + id.v = false ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_bool, + Tuple, Tuple, Tuple, "max_bool", MAX_BOOL)) ; } - else if (type == GrB_INT16) + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) { - minmax_first = GrB_MIN_FIRST_SEMIRING_INT16 ; - any_equal = GxB_ANY_EQ_INT16 ; + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_bool), + "tuple3_bool", BOOL_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_bool, + Tuple3, Tuple, GrB_BOOL, "make3a_bool", MAKE3a_BOOL)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_bool, + Tuple3, Tuple, GrB_BOOL, "make3b_bool", MAKE3b_BOOL)) ; + } + tuple3_bool id3 ; + memset (&id3, 0, sizeof (tuple3_bool)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = true ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) min3_bool, + Tuple3, Tuple3, Tuple3, "min3_bool", MIN3_BOOL)) ; + } + else + { + id3.v = false ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) max3_bool, + Tuple3, Tuple3, Tuple3, "max3_bool", MAX3_BOOL)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; } - else if (type == GrB_INT32) + else { - minmax_first = GrB_MIN_FIRST_SEMIRING_INT32 ; - any_equal = GxB_ANY_EQ_INT32 ; + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_bool, + GrB_INT64, Tuple, "getk_bool", GETK_BOOL)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_bool, + GrB_BOOL, Tuple, "getv_bool", GETV_BOOL)) ; } - else if (type == GrB_INT64) + + } + else if (A_type == GrB_INT8) + { + + //---------------------------------------------------------------------- + // int8 + //---------------------------------------------------------------------- + + OK (GxB_Type_new (&Tuple, sizeof (tuple_int8), "tuple_int8", INT8_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_int8, + Tuple, GrB_INT8, GrB_BOOL, GrB_BOOL, "make_int8", MAKE_INT8)) ; + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_int8 id ; + memset (&id, 0, sizeof (tuple_int8)) ; + id.k = INT64_MAX ; + if (is_min) { - minmax_first = GrB_MIN_FIRST_SEMIRING_INT64 ; - any_equal = GxB_ANY_EQ_INT64 ; + id.v = INT8_MAX ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_int8, + Tuple, Tuple, Tuple, "min_int8", MIN_INT8)) ; } - else if (type == GrB_UINT8) + else { - minmax_first = GrB_MIN_FIRST_SEMIRING_UINT8 ; - any_equal = GxB_ANY_EQ_UINT8 ; + id.v = INT8_MIN ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_int8, + Tuple, Tuple, Tuple, "max_int8", MAX_INT8)) ; } - else if (type == GrB_UINT16) + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) { - minmax_first = GrB_MIN_FIRST_SEMIRING_UINT16 ; - any_equal = GxB_ANY_EQ_UINT16 ; + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_int8), + "tuple3_int8", INT8_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_int8, + Tuple3, Tuple, GrB_BOOL, "make3a_int8", MAKE3a_INT8)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_int8, + Tuple3, Tuple, GrB_BOOL, "make3b_int8", MAKE3b_INT8)) ; + } + tuple3_int8 id3 ; + memset (&id3, 0, sizeof (tuple3_int8)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = INT8_MAX ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) min3_int8, + Tuple3, Tuple3, Tuple3, "min3_int8", MIN3_INT8)) ; + } + else + { + id3.v = INT8_MIN ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) max3_int8, + Tuple3, Tuple3, Tuple3, "max3_int8", MAX3_INT8)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; } - else if (type == GrB_UINT32) + else { - minmax_first = GrB_MIN_FIRST_SEMIRING_UINT32 ; - any_equal = GxB_ANY_EQ_UINT32 ; + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_int8, + GrB_INT64, Tuple, "getk_int8", GETK_INT8)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_int8, + GrB_INT8, Tuple, "getv_int8", GETV_INT8)) ; } - else if (type == GrB_UINT64) + + } + else if (A_type == GrB_INT16) + { + + //---------------------------------------------------------------------- + // int16 + //---------------------------------------------------------------------- + + OK (GxB_Type_new (&Tuple, sizeof (tuple_int16), + "tuple_int16", INT16_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_int16, + Tuple, GrB_INT16, GrB_BOOL, GrB_BOOL, "make_int16", MAKE_INT16)) ; + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_int16 id ; + memset (&id, 0, sizeof (tuple_int16)) ; + id.k = INT64_MAX ; + if (is_min) { - minmax_first = GrB_MIN_FIRST_SEMIRING_UINT64 ; - any_equal = GxB_ANY_EQ_UINT64 ; + id.v = INT16_MAX ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_int16, + Tuple, Tuple, Tuple, "min_int16", MIN_INT16)) ; } - else if (type == GrB_FP32) + else { - minmax_first = GrB_MIN_FIRST_SEMIRING_FP32 ; - any_equal = GxB_ANY_EQ_FP32 ; + id.v = INT16_MIN ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_int16, + Tuple, Tuple, Tuple, "max_int16", MAX_INT16)) ; } - else if (type == GrB_FP64) + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) { - minmax_first = GrB_MIN_FIRST_SEMIRING_FP64 ; - any_equal = GxB_ANY_EQ_FP64 ; + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_int16), + "tuple3_int16", INT16_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_int16, + Tuple3, Tuple, GrB_BOOL, "make3a_int16", MAKE3a_INT16)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_int16, + Tuple3, Tuple, GrB_BOOL, "make3b_int16", MAKE3b_INT16)) ; + } + tuple3_int16 id3 ; + memset (&id3, 0, sizeof (tuple3_int16)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = INT16_MAX ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) min3_int16, + Tuple3, Tuple3, Tuple3, "min3_int16", MIN3_INT16)) ; + } + else + { + id3.v = INT16_MIN ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) max3_int16, + Tuple3, Tuple3, Tuple3, "max3_int16", MAX3_INT16)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; } else { - ERROR ("unsupported type") ; + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_int16, + GrB_INT64, Tuple, "getk_int16", GETK_INT16)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_int16, + GrB_INT16, Tuple, "getv_int16", GETV_INT16)) ; } } - else + else if (A_type == GrB_INT32) { //---------------------------------------------------------------------- - // semirings for argmax + // int32 //---------------------------------------------------------------------- - if (type == GrB_BOOL) + OK (GxB_Type_new (&Tuple, sizeof (tuple_int32), + "tuple_int32", INT32_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_int32, + Tuple, GrB_INT32, GrB_BOOL, GrB_BOOL, "make_int32", MAKE_INT32)) ; + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_int32 id ; + memset (&id, 0, sizeof (tuple_int32)) ; + id.k = INT64_MAX ; + if (is_min) { - minmax_first = GxB_LOR_FIRST_BOOL ; - any_equal = GxB_ANY_EQ_BOOL ; + id.v = INT32_MAX ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_int32, + Tuple, Tuple, Tuple, "min_int32", MIN_INT32)) ; } - else if (type == GrB_INT8) + else { - minmax_first = GrB_MAX_FIRST_SEMIRING_INT8 ; - any_equal = GxB_ANY_EQ_INT8 ; + id.v = INT32_MIN ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_int32, + Tuple, Tuple, Tuple, "max_int32", MAX_INT32)) ; } - else if (type == GrB_INT16) + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) { - minmax_first = GrB_MAX_FIRST_SEMIRING_INT16 ; - any_equal = GxB_ANY_EQ_INT16 ; + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_int32), + "tuple3_int32", INT32_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_int32, + Tuple3, Tuple, GrB_BOOL, "make3a_int32", MAKE3a_INT32)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_int32, + Tuple3, Tuple, GrB_BOOL, "make3b_int32", MAKE3b_INT32)) ; + } + tuple3_int32 id3 ; + memset (&id3, 0, sizeof (tuple3_int32)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = INT32_MAX ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) min3_int32, + Tuple3, Tuple3, Tuple3, "min3_int32", MIN3_INT32)) ; + } + else + { + id3.v = INT32_MIN ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) max3_int32, + Tuple3, Tuple3, Tuple3, "max3_int32", MAX3_INT32)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; } - else if (type == GrB_INT32) + else { - minmax_first = GrB_MAX_FIRST_SEMIRING_INT32 ; - any_equal = GxB_ANY_EQ_INT32 ; + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_int32, + GrB_INT64, Tuple, "getk_int32", GETK_INT32)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_int32, + GrB_INT32, Tuple, "getv_int32", GETV_INT32)) ; } - else if (type == GrB_INT64) + + } + else if (A_type == GrB_INT64) + { + + //---------------------------------------------------------------------- + // int64 + //---------------------------------------------------------------------- + + OK (GxB_Type_new (&Tuple, sizeof (tuple_int64), + "tuple_int64", INT64_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_int64, + Tuple, GrB_INT64, GrB_BOOL, GrB_BOOL, "make_int64", MAKE_INT64)) ; + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_int64 id ; + memset (&id, 0, sizeof (tuple_int64)) ; + id.k = INT64_MAX ; + if (is_min) { - minmax_first = GrB_MAX_FIRST_SEMIRING_INT64 ; - any_equal = GxB_ANY_EQ_INT64 ; + id.v = INT64_MAX ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_int64, + Tuple, Tuple, Tuple, "min_int64", MIN_INT64)) ; } - else if (type == GrB_UINT8) + else { - minmax_first = GrB_MAX_FIRST_SEMIRING_UINT8 ; - any_equal = GxB_ANY_EQ_UINT8 ; + id.v = INT64_MIN ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_int64, + Tuple, Tuple, Tuple, "max_int64", MAX_INT64)) ; } - else if (type == GrB_UINT16) + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) { - minmax_first = GrB_MAX_FIRST_SEMIRING_UINT16 ; - any_equal = GxB_ANY_EQ_UINT16 ; + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_int64), + "tuple3_int64", INT64_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_int64, + Tuple3, Tuple, GrB_BOOL, "make3a_int64", MAKE3a_INT64)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_int64, + Tuple3, Tuple, GrB_BOOL, "make3b_int64", MAKE3b_INT64)) ; + } + tuple3_int64 id3 ; + memset (&id3, 0, sizeof (tuple3_int64)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = INT64_MAX ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) min3_int64, + Tuple3, Tuple3, Tuple3, "min3_int64", MIN3_INT64)) ; + } + else + { + id3.v = INT64_MIN ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) max3_int64, + Tuple3, Tuple3, Tuple3, "max3_int64", MAX3_INT64)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; } - else if (type == GrB_UINT32) + else { - minmax_first = GrB_MAX_FIRST_SEMIRING_UINT32 ; - any_equal = GxB_ANY_EQ_UINT32 ; + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_int64, + GrB_INT64, Tuple, "getk_int64", GETK_INT64)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_int64, + GrB_INT64, Tuple, "getv_int64", GETV_INT64)) ; } - else if (type == GrB_UINT64) + + } + else if (A_type == GrB_UINT8) + { + + //---------------------------------------------------------------------- + // uint8 + //---------------------------------------------------------------------- + + OK (GxB_Type_new (&Tuple, sizeof (tuple_uint8), + "tuple_uint8", UINT8_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_uint8, + Tuple, GrB_UINT8, GrB_BOOL, GrB_BOOL, "make_uint8", MAKE_UINT8)) ; + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_uint8 id ; + memset (&id, 0, sizeof (tuple_uint8)) ; + id.k = INT64_MAX ; + if (is_min) { - minmax_first = GrB_MAX_FIRST_SEMIRING_UINT64 ; - any_equal = GxB_ANY_EQ_UINT64 ; + id.v = UINT8_MAX ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_uint8, + Tuple, Tuple, Tuple, "min_uint8", MIN_UINT8)) ; } - else if (type == GrB_FP32) + else { - minmax_first = GrB_MAX_FIRST_SEMIRING_FP32 ; - any_equal = GxB_ANY_EQ_FP32 ; + id.v = 0 ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_uint8, + Tuple, Tuple, Tuple, "max_uint8", MAX_UINT8)) ; } - else if (type == GrB_FP64) + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) { - minmax_first = GrB_MAX_FIRST_SEMIRING_FP64 ; - any_equal = GxB_ANY_EQ_FP64 ; + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_uint8), + "tuple3_uint8", UINT8_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_uint8, + Tuple3, Tuple, GrB_BOOL, "make3a_uint8", MAKE3a_UINT8)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_uint8, + Tuple3, Tuple, GrB_BOOL, "make3b_uint8", MAKE3b_UINT8)) ; + } + tuple3_uint8 id3 ; + memset (&id3, 0, sizeof (tuple3_uint8)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = UINT8_MAX ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) min3_uint8, + Tuple3, Tuple3, Tuple3, "min3_uint8", MIN3_UINT8)) ; + } + else + { + id3.v = 0 ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) max3_uint8, + Tuple3, Tuple3, Tuple3, "max3_uint8", MAX3_UINT8)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; } else { - ERROR ("unsupported type") ; + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_uint8, + GrB_INT64, Tuple, "getk_uint8", GETK_UINT8)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_uint8, + GrB_UINT8, Tuple, "getv_uint8", GETV_UINT8)) ; } + } + else if (A_type == GrB_UINT16) + { - //-------------------------------------------------------------------------- - // compute the argmin/max - //-------------------------------------------------------------------------- + //---------------------------------------------------------------------- + // uint16 + //---------------------------------------------------------------------- - GrB_Matrix x = NULL, p = NULL ; + OK (GxB_Type_new (&Tuple, sizeof (tuple_uint16), + "tuple_uint16", UINT16_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_uint16, + Tuple, GrB_UINT16, GrB_BOOL, GrB_BOOL, "make_uint16", MAKE_UINT16)); + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_uint16 id ; + memset (&id, 0, sizeof (tuple_uint16)) ; + id.k = INT64_MAX ; + if (is_min) + { + id.v = UINT16_MAX ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_uint16, + Tuple, Tuple, Tuple, "min_uint16", MIN_UINT16)) ; + } + else + { + id.v = 0 ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_uint16, + Tuple, Tuple, Tuple, "max_uint16", MAX_UINT16)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) + { + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_uint16), + "tuple3_uint16", UINT16_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_uint16, + Tuple3, Tuple, GrB_BOOL, "make3a_uint16", MAKE3a_UINT16)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_uint16, + Tuple3, Tuple, GrB_BOOL, "make3b_uint16", MAKE3b_UINT16)) ; + } + tuple3_uint16 id3 ; + memset (&id3, 0, sizeof (tuple3_uint16)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = UINT16_MAX ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function)min3_uint16, + Tuple3, Tuple3, Tuple3, "min3_uint16", MIN3_UINT16)) ; + } + else + { + id3.v = 0 ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function)max3_uint16, + Tuple3, Tuple3, Tuple3, "max3_uint16", MAX3_UINT16)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; + } + else + { + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_uint16, + GrB_INT64, Tuple, "getk_uint16", GETK_UINT16)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_uint16, + GrB_UINT16, Tuple, "getv_uint16", GETV_UINT16)) ; + } - if (dim == 0) + } + else if (A_type == GrB_UINT32) { //---------------------------------------------------------------------- - // scalar argmin/max of all of A + // uint32 //---------------------------------------------------------------------- - // [x1,p1] = argmin/max of each column of A - GrB_Matrix x1, p1 ; - gb_argminmax (&x1, &p1, A, 1, minmax_first, any_equal) ; + OK (GxB_Type_new (&Tuple, sizeof (tuple_uint32), + "tuple_uint32", UINT32_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_uint32, + Tuple, GrB_UINT32, GrB_BOOL, GrB_BOOL, "make_uint32", MAKE_UINT32)); + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_uint32 id ; + memset (&id, 0, sizeof (tuple_uint32)) ; + id.k = INT64_MAX ; + if (is_min) + { + id.v = UINT32_MAX ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_uint32, + Tuple, Tuple, Tuple, "min_uint32", MIN_UINT32)) ; + } + else + { + id.v = 0 ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_uint32, + Tuple, Tuple, Tuple, "max_uint32", MAX_UINT32)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) + { + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_uint32), + "tuple3_uint32", UINT32_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_uint32, + Tuple3, Tuple, GrB_BOOL, "make3a_uint32", MAKE3a_UINT32)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_uint32, + Tuple3, Tuple, GrB_BOOL, "make3b_uint32", MAKE3b_UINT32)) ; + } + tuple3_uint32 id3 ; + memset (&id3, 0, sizeof (tuple3_uint32)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = UINT32_MAX ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function)min3_uint32, + Tuple3, Tuple3, Tuple3, "min3_uint32", MIN3_UINT32)) ; + } + else + { + id3.v = 0 ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function)max3_uint32, + Tuple3, Tuple3, Tuple3, "max3_uint32", MAX3_UINT32)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; + } + else + { + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_uint32, + GrB_INT64, Tuple, "getk_uint32", GETK_UINT32)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_uint32, + GrB_UINT32, Tuple, "getv_uint32", GETV_UINT32)) ; + } + + } + else if (A_type == GrB_UINT64) + { - // [x,p] = argmin/max of each entry in x - gb_argminmax (&x, &p, x1, 1, minmax_first, any_equal) ; + //---------------------------------------------------------------------- + // uint64 + //---------------------------------------------------------------------- - // get the row and column index of the overall argmin/max of A - int64_t I [2] = { 0, 0 } ; - GrB_Index nvals0, nvals1 ; - OK (GrB_Matrix_nvals (&nvals0, p)) ; - OK (GrB_Matrix_nvals (&nvals1, p1)) ; - if (nvals0 > 0 && nvals1 > 0) + OK (GxB_Type_new (&Tuple, sizeof (tuple_uint64), + "tuple_uint64", UINT64_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_uint64, + Tuple, GrB_UINT64, GrB_BOOL, GrB_BOOL, "make_uint64", MAKE_UINT64)); + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_uint64 id ; + memset (&id, 0, sizeof (tuple_uint64)) ; + id.k = INT64_MAX ; + if (is_min) + { + id.v = UINT64_MAX ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_uint64, + Tuple, Tuple, Tuple, "min_uint64", MIN_UINT64)) ; + } + else + { + id.v = 0 ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_uint64, + Tuple, Tuple, Tuple, "max_uint64", MAX_UINT64)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) + { + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_uint64), + "tuple3_uint64", UINT64_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_uint64, + Tuple3, Tuple, GrB_BOOL, "make3a_uint64", MAKE3a_UINT64)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_uint64, + Tuple3, Tuple, GrB_BOOL, "make3b_uint64", MAKE3b_UINT64)) ; + } + tuple3_uint64 id3 ; + memset (&id3, 0, sizeof (tuple3_uint64)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = UINT64_MAX ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function)min3_uint64, + Tuple3, Tuple3, Tuple3, "min3_uint64", MIN3_UINT64)) ; + } + else + { + id3.v = 0 ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function)max3_uint64, + Tuple3, Tuple3, Tuple3, "max3_uint64", MAX3_UINT64)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; + } + else { - // I [0] = p [0], the row index of the global argmin/max of A - OK (GrB_Matrix_extractElement_INT64 (&(I [0]), p, 0, 0)) ; - // I [1] = p [I [0]-1] (use -1 since I[0] is 1-based), - // which is the column index of the global argmin/max of A - OK (GrB_Matrix_extractElement_INT64 (&(I [1]), p1, I [0] - 1, 0)) ; + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_uint64, + GrB_INT64, Tuple, "getk_uint64", GETK_UINT64)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_uint64, + GrB_UINT64, Tuple, "getv_uint64", GETV_UINT64)) ; } - // free workspace and create p = [row, col] - OK (GrB_Matrix_free (&x1)) ; - OK (GrB_Matrix_free (&p1)) ; - OK (GrB_Matrix_free (&p)) ; - OK (GrB_Matrix_new (&p, GrB_INT64, 2,1)) ; - if (nvals0 > 0 && nvals1 > 0) + } + else if (A_type == GrB_FP32) + { + + //---------------------------------------------------------------------- + // fp32 + //---------------------------------------------------------------------- + + OK (GxB_Type_new (&Tuple, sizeof (tuple_fp32), "tuple_fp32", FP32_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_fp32, + Tuple, GrB_FP32, GrB_BOOL, GrB_BOOL, "make_fp32", MAKE_FP32)) ; + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_fp32 id ; + memset (&id, 0, sizeof (tuple_fp32)) ; + id.k = INT64_MAX ; + if (is_min) + { + id.v = (float) INFINITY ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_fp32, + Tuple, Tuple, Tuple, "min_fp32", MIN_FP32)) ; + } + else + { + id.v = (float) (-INFINITY) ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_fp32, + Tuple, Tuple, Tuple, "max_fp32", MAX_FP32)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) + { + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_fp32), + "tuple3_fp32", FP32_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_fp32, + Tuple3, Tuple, GrB_BOOL, "make3a_fp32", MAKE3a_FP32)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_fp32, + Tuple3, Tuple, GrB_BOOL, "make3b_fp32", MAKE3b_FP32)) ; + } + tuple3_fp32 id3 ; + memset (&id3, 0, sizeof (tuple3_fp32)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = (float) INFINITY ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) min3_fp32, + Tuple3, Tuple3, Tuple3, "min3_fp32", MIN3_FP32)) ; + } + else + { + id3.v = (float) (-INFINITY) ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) max3_fp32, + Tuple3, Tuple3, Tuple3, "max3_fp32", MAX3_FP32)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; + } + else { - OK (GrB_Matrix_setElement_INT64 (p, I [1], 0, 0)) ; - OK (GrB_Matrix_setElement_INT64 (p, I [0], 1, 0)) ; + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_fp32, + GrB_INT64, Tuple, "getk_fp32", GETK_FP32)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_fp32, + GrB_FP32, Tuple, "getv_fp32", GETV_FP32)) ; } } - else if (dim == 1) + else if (A_type == GrB_FP64) { //---------------------------------------------------------------------- - // argmin/max of each column of A + // fp64 //---------------------------------------------------------------------- - gb_argminmax (&x, &p, A, 1, minmax_first, any_equal) ; + OK (GxB_Type_new (&Tuple, sizeof (tuple_fp64), "tuple_fp64", FP64_K)) ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_fp64, + Tuple, GrB_FP64, GrB_BOOL, GrB_BOOL, "make_fp64", MAKE_FP64)) ; + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + tuple_fp64 id ; + memset (&id, 0, sizeof (tuple_fp64)) ; + id.k = INT64_MAX ; + if (is_min) + { + id.v = (double) INFINITY ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) min_fp64, + Tuple, Tuple, Tuple, "min_fp64", MIN_FP64)) ; + } + else + { + id.v = (double) (-INFINITY) ; + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_fp64, + Tuple, Tuple, Tuple, "max_fp64", MAX_FP64)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + if (dim == 0) + { + OK (GxB_Type_new (&Tuple3, sizeof (tuple3_fp64), + "tuple3_fp64", FP64_IJ)) ; + if (fmt == GxB_BY_ROW) + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3a_fp64, + Tuple3, Tuple, GrB_BOOL, "make3a_fp64", MAKE3a_FP64)) ; + } + else + { + OK (GxB_IndexUnaryOp_new (&Make3, + (GxB_index_unary_function) make3b_fp64, + Tuple3, Tuple, GrB_BOOL, "make3b_fp64", MAKE3b_FP64)) ; + } + tuple3_fp64 id3 ; + memset (&id3, 0, sizeof (tuple3_fp64)) ; + id3.i = INT64_MAX ; + id3.j = INT64_MAX ; + if (is_min) + { + id3.v = (double) INFINITY ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) min3_fp64, + Tuple3, Tuple3, Tuple3, "min3_fp64", MIN3_FP64)) ; + } + else + { + id3.v = (double) (-INFINITY) ; + OK (GxB_BinaryOp_new (&Mon3Op, (GxB_binary_function) max3_fp64, + Tuple3, Tuple3, Tuple3, "max3_fp64", MAX3_FP64)) ; + } + OK (GrB_Monoid_new_UDT (&Monoid3, Mon3Op, &id3)) ; + } + else + { + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_fp64, + GrB_INT64, Tuple, "getk_fp64", GETK_FP64)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_fp64, + GrB_FP64, Tuple, "getv_fp64", GETV_FP64)) ; + } } else { + ERROR ("unsupported type") ; + } + + //-------------------------------------------------------------------------- + // compute the argmin/max + //-------------------------------------------------------------------------- + if (dim == 0) + { //---------------------------------------------------------------------- - // argmin/max of each row of A + // scalar argmin/max of all of A //---------------------------------------------------------------------- - gb_argminmax (&x, &p, A, 2, minmax_first, any_equal) ; + if (fmt == GxB_BY_ROW) + { + // A is held by row + // y = zeros (ncols,1) ; + OK (GrB_Matrix_new (&y, GrB_BOOL, ncols, 1)) ; + OK (GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, + GrB_ALL, ncols, GrB_ALL, 1, NULL)) ; + + // c = A*y using the argmin/argmax semiring + OK (GrB_Matrix_new (&c, Tuple, nrows, 1)) ; + OK (GrB_mxm (c, NULL, NULL, Semiring, A, y, NULL)) ; + // create z + OK (GrB_Matrix_new (&z, Tuple3, nrows, 1)) ; + } + else + { + // A is held by column (the default for MATLAB) + // y = zeros (nrows,1) ; + OK (GrB_Matrix_new (&y, GrB_BOOL, nrows, 1)) ; + OK (GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, + GrB_ALL, nrows, GrB_ALL, 1, NULL)) ; + + // c = A'*y using the argmin/argmax semiring + OK (GrB_Matrix_new (&c, Tuple, ncols, 1)) ; + OK (GrB_mxm (c, NULL, NULL, Semiring, A, y, GrB_DESC_T0)) ; + + // create z + OK (GrB_Matrix_new (&z, Tuple3, ncols, 1)) ; + } + + // z = make3 (c) + OK (GrB_Matrix_apply_IndexOp_BOOL (z, NULL, NULL, Make3, c, 0, NULL)) ; + + // s = max3 (z) + OK (GrB_Scalar_new (&s, Tuple3)) ; + OK (GrB_Matrix_reduce_Monoid_Scalar (s, NULL, Monoid3, z, NULL)) ; + + // x = s.v, p = {s.i, s.j} + OK (GrB_Matrix_new (&x, A_type, 1, 1)) ; + OK (GrB_Matrix_new (&p, GrB_INT64, 2, 1)) ; + OK (GrB_Scalar_nvals (&nvals, s)) ; + int64_t si = INT64_MAX, sj = INT64_MAX ; + if (nvals > 0) + { + if (A_type == GrB_BOOL) + { + tuple3_bool result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_BOOL (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_INT8) + { + tuple3_int8 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_INT8 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_INT16) + { + tuple3_int16 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_INT16 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_INT32) + { + tuple3_int32 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_INT32 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_INT64) + { + tuple3_int64 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_INT64 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_UINT8) + { + tuple3_uint8 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_UINT8 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_UINT16) + { + tuple3_uint16 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_UINT16 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_UINT32) + { + tuple3_uint32 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_UINT32 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_UINT64) + { + tuple3_uint64 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_UINT64 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else if (A_type == GrB_FP32) + { + tuple3_fp32 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_FP32 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + else // if (A_type == GrB_FP64) + { + tuple3_fp64 result ; + OK (GrB_Scalar_extractElement_UDT (&result, s)) ; + OK (GrB_Matrix_setElement_FP64 (x, result.v, 0, 0)) ; + si = result.i ; + sj = result.j ; + } + OK (GrB_Matrix_setElement_INT64 (p, si, 0, 0)) ; + OK (GrB_Matrix_setElement_INT64 (p, sj, 1, 0)) ; + } + + } + else + { + + if (dim == 1) + { + + //------------------------------------------------------------------ + // argmin/max of each column of A + //------------------------------------------------------------------ + + // y = zeros (nrows,1) ; + OK (GrB_Matrix_new (&y, GrB_BOOL, nrows, 1)) ; + OK (GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, + GrB_ALL, nrows, GrB_ALL, 1, NULL)) ; + + // c = A'*y using the argmin/argmax semiring + OK (GrB_Matrix_new (&c, Tuple, ncols, 1)) ; + OK (GrB_mxm (c, NULL, NULL, Semiring, A, y, GrB_DESC_T0)) ; + + // create x and p + OK (GrB_Matrix_new (&x, A_type, ncols, 1)) ; + OK (GrB_Matrix_new (&p, GrB_INT64, ncols, 1)) ; + + } + else + { + + //------------------------------------------------------------------ + // argmin/max of each row of A + //------------------------------------------------------------------ + + // y = zeros (ncols,1) ; + OK (GrB_Matrix_new (&y, GrB_BOOL, ncols, 1)) ; + OK (GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, + GrB_ALL, ncols, GrB_ALL, 1, NULL)) ; + + // c = A*y using the argmin/argmax semiring + OK (GrB_Matrix_new (&c, Tuple, nrows, 1)) ; + OK (GrB_mxm (c, NULL, NULL, Semiring, A, y, NULL)) ; + + // create x and p + OK (GrB_Matrix_new (&x, A_type, nrows, 1)) ; + OK (GrB_Matrix_new (&p, GrB_INT64, nrows, 1)) ; + } + + // x = getv (c) + OK (GrB_Matrix_apply (x, NULL, NULL, Getv, c, NULL)) ; + // p = getk (c) + OK (GrB_Matrix_apply (p, NULL, NULL, Getk, c, NULL)) ; } //-------------------------------------------------------------------------- - // return result + // free workspace and return result //-------------------------------------------------------------------------- + OK (GrB_Type_free (&Tuple)) ; + OK (GrB_Type_free (&Tuple3)) ; + OK (GxB_IndexBinaryOp_free (&Iop)) ; + OK (GrB_IndexUnaryOp_free (&Make3)) ; + OK (GrB_BinaryOp_free (&Bop)) ; + OK (GrB_BinaryOp_free (&MonOp)) ; + OK (GrB_BinaryOp_free (&Mon3Op)) ; + OK (GrB_Monoid_free (&Monoid)) ; + OK (GrB_Monoid_free (&Monoid3)) ; + OK (GrB_Semiring_free (&Semiring)) ; + OK (GrB_UnaryOp_free (&Getv)) ; + OK (GrB_UnaryOp_free (&Getk)) ; + OK (GrB_Matrix_free (&y)) ; + OK (GrB_Matrix_free (&c)) ; OK (GrB_Matrix_free (&A)) ; + OK (GrB_Scalar_free (&Theta)) ; + OK (GrB_Scalar_free (&s)) ; + pargout [0] = gb_export (&x, KIND_GRB) ; pargout [1] = gb_export (&p, KIND_GRB) ; GB_WRAPUP ; diff --git a/GraphBLAS/@GrB/private/mexfunctions/gbver.c b/GraphBLAS/@GrB/private/mexfunctions/gbver.c index 87d719a02a..c250f82c98 100644 --- a/GraphBLAS/@GrB/private/mexfunctions/gbver.c +++ b/GraphBLAS/@GrB/private/mexfunctions/gbver.c @@ -53,9 +53,12 @@ void mexFunction int32_t cver [3] ; int32_t have_openmp ; // OK (GrB_Global_get_SIZE (GrB_GLOBAL, &len, GxB_COMPILER_NAME)) ; - OK (GrB_Global_get_String (GrB_GLOBAL, compiler, GxB_COMPILER_NAME)) ; - OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) cver, GxB_COMPILER_VERSION)) ; - OK (GrB_Global_get_INT32 (GrB_GLOBAL, &have_openmp, GxB_LIBRARY_OPENMP)) ; + OK (GrB_Global_get_String (GrB_GLOBAL, compiler, + (GrB_Field) GxB_COMPILER_NAME)) ; + OK (GrB_Global_get_VOID (GrB_GLOBAL, (void *) cver, + (GrB_Field) GxB_COMPILER_VERSION)) ; + OK (GrB_Global_get_INT32 (GrB_GLOBAL, &have_openmp, + (GrB_Field) GxB_LIBRARY_OPENMP)) ; printf ("GraphBLAS compiled with %s (v%d.%d.%d), %s OpenMP\n", compiler, cver [0], cver [1], cver [2], have_openmp ? "with" : "without") ; diff --git a/GraphBLAS/@GrB/private/util/gb_defaults.c b/GraphBLAS/@GrB/private/util/gb_defaults.c index a5c09ff3a5..30d71656e5 100644 --- a/GraphBLAS/@GrB/private/util/gb_defaults.c +++ b/GraphBLAS/@GrB/private/util/gb_defaults.c @@ -34,7 +34,13 @@ void gb_defaults (void) // set global GraphBLAS defaults for MATLAB OK (GxB_Global_Option_set (GxB_NTHREADS, GB_omp_get_max_threads ( ))) ; // default chunk - OK (GxB_Global_Option_set (GxB_CHUNK, GB_CHUNK_DEFAULT)) ; +// OK (GxB_Global_Option_set (GxB_CHUNK, (double) GB_CHUNK_DEFAULT)) ; + GrB_Scalar chunk_default = NULL ; + OK (GrB_Scalar_new (&chunk_default, GrB_FP64)) ; + OK (GrB_Scalar_setElement_FP64 (chunk_default, GB_CHUNK_DEFAULT)) ; + OK (GrB_Global_set_Scalar (GrB_GLOBAL, chunk_default, + (GrB_Field) GxB_CHUNK)) ; + OK (GrB_Scalar_free (&chunk_default)) ; // for debug only GB_Global_abort_set (gb_abort) ; diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index 10335eee09..14f9eaeb8a 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -20,6 +20,13 @@ set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} include ( GraphBLAS_version ) +#------------------------------------------------------------------------------- +# define the project +#------------------------------------------------------------------------------- + +project ( graphblas_matlab + VERSION "${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}" LANGUAGES C ) + #------------------------------------------------------------------------------- # SuiteSparse policies #------------------------------------------------------------------------------- @@ -51,13 +58,6 @@ endif ( ) include ( GraphBLAS_JIT_paths ) -#------------------------------------------------------------------------------- -# define the project -#------------------------------------------------------------------------------- - -project ( graphblas_matlab - VERSION "${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}" LANGUAGES C ) - #------------------------------------------------------------------------------- # find OpenMP #------------------------------------------------------------------------------- @@ -147,6 +147,7 @@ include_directories ( ${PROJECT_SOURCE_DIR}/../ ../Source ../Include Config ../xxHash ../lz4 ../zstd ../zstd/zstd_subset ../JITpackage rename # include all Source/* folders that have include/ or template/ subfolders: + ../Source/add ../Source/apply ../Source/assign ../Source/builder @@ -154,10 +155,17 @@ include_directories ( ${PROJECT_SOURCE_DIR}/../ ../Source ../Include Config ../Source/callback ../Source/concat ../Source/convert + ../Source/cumsum + ../Source/emult ../Source/ewise + ../Source/extract ../Source/hyper + ../Source/ij ../Source/jit_kernels + ../Source/kronecker + ../Source/mask ../Source/math + ../Source/matrix ../Source/memory ../Source/monoid ../Source/mxm @@ -168,6 +176,7 @@ include_directories ( ${PROJECT_SOURCE_DIR}/../ ../Source ../Include Config ../Source/select ../Source/split ../Source/slice + ../Source/sort ../Source/transpose ../Source/type ../Source/wait diff --git a/GraphBLAS/rename/GB_rename.h b/GraphBLAS/rename/GB_rename.h index 2767635b09..92006af0fd 100644 --- a/GraphBLAS/rename/GB_rename.h +++ b/GraphBLAS/rename/GB_rename.h @@ -39,28 +39,20 @@ #define GB_AxB_meta_adotb_control GM_AxB_meta_adotb_control #define GB_AxB_meta GM_AxB_meta #define GB_AxB_saxbit_generic_first GM_AxB_saxbit_generic_first -#define GB_AxB_saxbit_generic_firsti32 GM_AxB_saxbit_generic_firsti32 -#define GB_AxB_saxbit_generic_firsti64 GM_AxB_saxbit_generic_firsti64 -#define GB_AxB_saxbit_generic_firstj32 GM_AxB_saxbit_generic_firstj32 -#define GB_AxB_saxbit_generic_firstj64 GM_AxB_saxbit_generic_firstj64 #define GB_AxB_saxbit_generic_flipped GM_AxB_saxbit_generic_flipped +#define GB_AxB_saxbit_generic_idx_flipped GM_AxB_saxbit_generic_idx_flipped +#define GB_AxB_saxbit_generic_idx_unflipped GM_AxB_saxbit_generic_idx_unflipped #define GB_AxB_saxbit_generic_second GM_AxB_saxbit_generic_second -#define GB_AxB_saxbit_generic_secondj32 GM_AxB_saxbit_generic_secondj32 -#define GB_AxB_saxbit_generic_secondj64 GM_AxB_saxbit_generic_secondj64 #define GB_AxB_saxbit_generic_unflipped GM_AxB_saxbit_generic_unflipped #define GB_AxB_saxbit GM_AxB_saxbit #define GB_AxB_saxbit_jit GM_AxB_saxbit_jit #define GB_AxB_saxpy3_cumsum GM_AxB_saxpy3_cumsum #define GB_AxB_saxpy3_flopcount GM_AxB_saxpy3_flopcount #define GB_AxB_saxpy3_generic_first GM_AxB_saxpy3_generic_first -#define GB_AxB_saxpy3_generic_firsti32 GM_AxB_saxpy3_generic_firsti32 -#define GB_AxB_saxpy3_generic_firsti64 GM_AxB_saxpy3_generic_firsti64 -#define GB_AxB_saxpy3_generic_firstj32 GM_AxB_saxpy3_generic_firstj32 -#define GB_AxB_saxpy3_generic_firstj64 GM_AxB_saxpy3_generic_firstj64 #define GB_AxB_saxpy3_generic_flipped GM_AxB_saxpy3_generic_flipped +#define GB_AxB_saxpy3_generic_idx_flipped GM_AxB_saxpy3_generic_idx_flipped +#define GB_AxB_saxpy3_generic_idx_unflipped GM_AxB_saxpy3_generic_idx_unflipped #define GB_AxB_saxpy3_generic_second GM_AxB_saxpy3_generic_second -#define GB_AxB_saxpy3_generic_secondj32 GM_AxB_saxpy3_generic_secondj32 -#define GB_AxB_saxpy3_generic_secondj64 GM_AxB_saxpy3_generic_secondj64 #define GB_AxB_saxpy3_generic_unflipped GM_AxB_saxpy3_generic_unflipped #define GB_AxB_saxpy3 GM_AxB_saxpy3 #define GB_AxB_saxpy3_jit GM_AxB_saxpy3_jit @@ -140,26 +132,26 @@ #define GB_bitget_uint32 GM_bitget_uint32 #define GB_bitget_uint64 GM_bitget_uint64 #define GB_bitget_uint8 GM_bitget_uint8 -#define GB_bitmap_assign_fullM_accum GM_bitmap_assign_fullM_accum -#define GB_bitmap_assign_fullM_accum_whole GM_bitmap_assign_fullM_accum_whole -#define GB_bitmap_assign_fullM_noaccum GM_bitmap_assign_fullM_noaccum -#define GB_bitmap_assign_fullM_noaccum_whole GM_bitmap_assign_fullM_noaccum_whole +#define GB_bitmap_assign_1 GM_bitmap_assign_1 +#define GB_bitmap_assign_1_whole GM_bitmap_assign_1_whole +#define GB_bitmap_assign_2 GM_bitmap_assign_2 +#define GB_bitmap_assign_2_whole GM_bitmap_assign_2_whole +#define GB_bitmap_assign_3 GM_bitmap_assign_3 +#define GB_bitmap_assign_3_whole GM_bitmap_assign_3_whole +#define GB_bitmap_assign_4 GM_bitmap_assign_4 +#define GB_bitmap_assign_4_whole GM_bitmap_assign_4_whole +#define GB_bitmap_assign_5 GM_bitmap_assign_5 +#define GB_bitmap_assign_5_whole GM_bitmap_assign_5_whole +#define GB_bitmap_assign_6b_whole GM_bitmap_assign_6b_whole +#define GB_bitmap_assign_6 GM_bitmap_assign_6 +#define GB_bitmap_assign_6_whole GM_bitmap_assign_6_whole +#define GB_bitmap_assign_7 GM_bitmap_assign_7 +#define GB_bitmap_assign_7_whole GM_bitmap_assign_7_whole +#define GB_bitmap_assign_8 GM_bitmap_assign_8 +#define GB_bitmap_assign_8_whole GM_bitmap_assign_8_whole #define GB_bitmap_assign GM_bitmap_assign -#define GB_bitmap_assign_M_accum GM_bitmap_assign_M_accum -#define GB_bitmap_assign_M_accum_whole GM_bitmap_assign_M_accum_whole -#define GB_bitmap_assign_M_noaccum GM_bitmap_assign_M_noaccum -#define GB_bitmap_assign_M_noaccum_whole GM_bitmap_assign_M_noaccum_whole -#define GB_bitmap_assign_noM_accum GM_bitmap_assign_noM_accum -#define GB_bitmap_assign_noM_accum_whole GM_bitmap_assign_noM_accum_whole -#define GB_bitmap_assign_noM_noaccum GM_bitmap_assign_noM_noaccum -#define GB_bitmap_assign_noM_noaccum_whole GM_bitmap_assign_noM_noaccum_whole -#define GB_bitmap_assign_notM_accum GM_bitmap_assign_notM_accum -#define GB_bitmap_assign_notM_accum_whole GM_bitmap_assign_notM_accum_whole -#define GB_bitmap_assign_notM_noaccum GM_bitmap_assign_notM_noaccum -#define GB_bitmap_assign_notM_noaccum_whole GM_bitmap_assign_notM_noaccum_whole #define GB_bitmap_assign_to_full GM_bitmap_assign_to_full #define GB_bitmap_expand_to_hyper GM_bitmap_expand_to_hyper -#define GB_bitmap_M_scatter GM_bitmap_M_scatter #define GB_bitmap_M_scatter_whole GM_bitmap_M_scatter_whole #define GB_bitmap_subref GM_bitmap_subref #define GB_bitset_int16 GM_bitset_int16 @@ -259,16 +251,17 @@ #define GB_convert_any_to_iso GM_convert_any_to_iso #define GB_convert_any_to_non_iso GM_convert_any_to_non_iso #define GB_convert_any_to_sparse GM_convert_any_to_sparse +#define GB_convert_b2s GM_convert_b2s +#define GB_convert_b2s_jit GM_convert_b2s_jit #define GB_convert_bitmap_to_sparse GM_convert_bitmap_to_sparse #define GB_convert_bitmap_to_sparse_test GM_convert_bitmap_to_sparse_test -#define GB_convert_bitmap_worker GM_convert_bitmap_worker #define GB_convert_full_to_bitmap GM_convert_full_to_bitmap #define GB_convert_full_to_sparse GM_convert_full_to_sparse #define GB_convert_hyper_to_sparse GM_convert_hyper_to_sparse #define GB_convert_hyper_to_sparse_test GM_convert_hyper_to_sparse_test #define GB_convert_s2b GM_convert_s2b #define GB_convert_s2b_jit GM_convert_s2b_jit -#define GB_convert_s2b_test GM_convert_s2b_test +#define GB_convert_sparse_to_bitmap_test GM_convert_sparse_to_bitmap_test #define GB_convert_sparse_to_hyper GM_convert_sparse_to_hyper #define GB_convert_sparse_to_hyper_test GM_convert_sparse_to_hyper_test #define GB_convert_to_nonfull GM_convert_to_nonfull @@ -281,6 +274,7 @@ #define GB_ctrunc GM_ctrunc #define GB_cumsum GM_cumsum #define GB_demacrofy_name GM_demacrofy_name +#define GB_desc_name_get GM_desc_name_get #define GB_Descriptor_check GM_Descriptor_check #define GB_Descriptor_get GM_Descriptor_get #define GB_deserialize_from_blob GM_deserialize_from_blob @@ -311,9 +305,12 @@ #define GB_encodify_assign GM_encodify_assign #define GB_encodify_build GM_encodify_build #define GB_encodify_ewise GM_encodify_ewise +#define GB_encodify_masker GM_encodify_masker #define GB_encodify_mxm GM_encodify_mxm #define GB_encodify_reduce GM_encodify_reduce #define GB_encodify_select GM_encodify_select +#define GB_encodify_sort GM_encodify_sort +#define GB_encodify_subref GM_encodify_subref #define GB_encodify_user_op GM_encodify_user_op #define GB_encodify_user_type GM_encodify_user_type #define GB_entry_check GM_entry_check @@ -324,23 +321,23 @@ #define GB_enumify_cuda_atomic GM_enumify_cuda_atomic #define GB_enumify_ewise GM_enumify_ewise #define GB_enumify_identity GM_enumify_identity +#define GB_enumify_masker GM_enumify_masker #define GB_enumify_mask GM_enumify_mask -#define GB_enumify_monoid GM_enumify_monoid #define GB_enumify_mxm GM_enumify_mxm #define GB_enumify_reduce GM_enumify_reduce #define GB_enumify_select GM_enumify_select +#define GB_enumify_sort GM_enumify_sort #define GB_enumify_sparsity GM_enumify_sparsity +#define GB_enumify_subref GM_enumify_subref #define GB_enumify_terminal GM_enumify_terminal #define GB_enumify_unop GM_enumify_unop #define GB_ERR_getErrorString GM_ERR_getErrorString -#define GB_eslice GM_eslice #define GB_ewise_fulla GM_ewise_fulla #define GB_ewise_fulla_jit GM_ewise_fulla_jit #define GB_ewise_fulln GM_ewise_fulln #define GB_ewise_fulln_jit GM_ewise_fulln_jit #define GB_ewise GM_ewise #define GB_ewise_slice GM_ewise_slice -#define GB_expand_iso GM_expand_iso #define GB_export GM_export #define GB_extract GM_extract #define GB_extractTuples GM_extractTuples @@ -515,31 +512,14 @@ #define GB_ijproperties GM_ijproperties #define GB_ijsort GM_ijsort #define GB_import GM_import +#define GB_IndexBinaryOp_check GM_IndexBinaryOp_check #define GB_IndexUnaryOp_check GM_IndexUnaryOp_check #define GB_init GM_init #define GB_is_diagonal GM_is_diagonal +#define GB_iso_expand GM_iso_expand +#define GB_iso_expand_jit GM_iso_expand_jit #define GB_is_shallow GM_is_shallow #define GB_ix_realloc GM_ix_realloc -#define GB_jit__add__1002e0e0eee00__wildtype GM_jit__add__1002e0e0eee00__wildtype -#define GB_jit__add__1002e0e0eee00__wildtype_query GM_jit__add__1002e0e0eee00__wildtype_query -#define GB_jit__apply_unop__0000db0dbe__fx64_cmplx_imag GM_jit__apply_unop__0000db0dbe__fx64_cmplx_imag -#define GB_jit__apply_unop__0000db0dbe__fx64_cmplx_imag_query GM_jit__apply_unop__0000db0dbe__fx64_cmplx_imag_query -#define GB_jit__apply_unop__0000db0dbe__fx64_cmplx_real GM_jit__apply_unop__0000db0dbe__fx64_cmplx_real -#define GB_jit__apply_unop__0000db0dbe__fx64_cmplx_real_query GM_jit__apply_unop__0000db0dbe__fx64_cmplx_real_query -#define GB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss GM_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss -#define GB_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss_query GM_jit__AxB_dot4__03fe900eee0eeec5__addgauss_multgauss_query -#define GB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss GM_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss -#define GB_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss_query GM_jit__AxB_saxbit__03fe100eee0eee8a__addgauss_multgauss_query -#define GB_jit__AxB_saxbit__03fe100eee0eee8a__mycx_plus_mycx_times GM_jit__AxB_saxbit__03fe100eee0eee8a__mycx_plus_mycx_times -#define GB_jit__AxB_saxbit__03fe100eee0eee8a__mycx_plus_mycx_times_query GM_jit__AxB_saxbit__03fe100eee0eee8a__mycx_plus_mycx_times_query -#define GB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult GM_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult -#define GB_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult_query GM_jit__AxB_saxpy3__03fe100eee0eee45__wildadd_wildmult_query -#define GB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss GM_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss -#define GB_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss_query GM_jit__AxB_saxpy4__03fe300eee0eeec7__addgauss_multgauss_query -#define GB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss GM_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss -#define GB_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss_query GM_jit__AxB_saxpy5__03fe500eee0eeecd__addgauss_multgauss_query -#define GB_jit__build__02eeeee__wildtype GM_jit__build__02eeeee__wildtype -#define GB_jit__build__02eeeee__wildtype_query GM_jit__build__02eeeee__wildtype_query #define GB_jitifyer_alloc_space GM_jitifyer_alloc_space #define GB_jitifyer_cmake_compile GM_jitifyer_cmake_compile #define GB_jitifyer_direct_compile GM_jitifyer_direct_compile @@ -749,18 +729,129 @@ #define GB_JITpackage_23 GM_JITpackage_23 #define GB_JITpackage_240 GM_JITpackage_240 #define GB_JITpackage_241 GM_JITpackage_241 +#define GB_JITpackage_242 GM_JITpackage_242 +#define GB_JITpackage_243 GM_JITpackage_243 +#define GB_JITpackage_244 GM_JITpackage_244 +#define GB_JITpackage_245 GM_JITpackage_245 +#define GB_JITpackage_246 GM_JITpackage_246 +#define GB_JITpackage_247 GM_JITpackage_247 +#define GB_JITpackage_248 GM_JITpackage_248 +#define GB_JITpackage_249 GM_JITpackage_249 #define GB_JITpackage_24 GM_JITpackage_24 +#define GB_JITpackage_250 GM_JITpackage_250 +#define GB_JITpackage_251 GM_JITpackage_251 +#define GB_JITpackage_252 GM_JITpackage_252 +#define GB_JITpackage_253 GM_JITpackage_253 +#define GB_JITpackage_254 GM_JITpackage_254 +#define GB_JITpackage_255 GM_JITpackage_255 +#define GB_JITpackage_256 GM_JITpackage_256 +#define GB_JITpackage_257 GM_JITpackage_257 +#define GB_JITpackage_258 GM_JITpackage_258 +#define GB_JITpackage_259 GM_JITpackage_259 #define GB_JITpackage_25 GM_JITpackage_25 +#define GB_JITpackage_260 GM_JITpackage_260 +#define GB_JITpackage_261 GM_JITpackage_261 +#define GB_JITpackage_262 GM_JITpackage_262 +#define GB_JITpackage_263 GM_JITpackage_263 +#define GB_JITpackage_264 GM_JITpackage_264 +#define GB_JITpackage_265 GM_JITpackage_265 +#define GB_JITpackage_266 GM_JITpackage_266 +#define GB_JITpackage_267 GM_JITpackage_267 +#define GB_JITpackage_268 GM_JITpackage_268 +#define GB_JITpackage_269 GM_JITpackage_269 #define GB_JITpackage_26 GM_JITpackage_26 +#define GB_JITpackage_270 GM_JITpackage_270 +#define GB_JITpackage_271 GM_JITpackage_271 +#define GB_JITpackage_272 GM_JITpackage_272 +#define GB_JITpackage_273 GM_JITpackage_273 +#define GB_JITpackage_274 GM_JITpackage_274 +#define GB_JITpackage_275 GM_JITpackage_275 +#define GB_JITpackage_276 GM_JITpackage_276 +#define GB_JITpackage_277 GM_JITpackage_277 +#define GB_JITpackage_278 GM_JITpackage_278 +#define GB_JITpackage_279 GM_JITpackage_279 #define GB_JITpackage_27 GM_JITpackage_27 +#define GB_JITpackage_280 GM_JITpackage_280 +#define GB_JITpackage_281 GM_JITpackage_281 +#define GB_JITpackage_282 GM_JITpackage_282 +#define GB_JITpackage_283 GM_JITpackage_283 +#define GB_JITpackage_284 GM_JITpackage_284 +#define GB_JITpackage_285 GM_JITpackage_285 +#define GB_JITpackage_286 GM_JITpackage_286 +#define GB_JITpackage_287 GM_JITpackage_287 +#define GB_JITpackage_288 GM_JITpackage_288 +#define GB_JITpackage_289 GM_JITpackage_289 #define GB_JITpackage_28 GM_JITpackage_28 +#define GB_JITpackage_290 GM_JITpackage_290 +#define GB_JITpackage_291 GM_JITpackage_291 +#define GB_JITpackage_292 GM_JITpackage_292 +#define GB_JITpackage_293 GM_JITpackage_293 +#define GB_JITpackage_294 GM_JITpackage_294 +#define GB_JITpackage_295 GM_JITpackage_295 +#define GB_JITpackage_296 GM_JITpackage_296 +#define GB_JITpackage_297 GM_JITpackage_297 +#define GB_JITpackage_298 GM_JITpackage_298 +#define GB_JITpackage_299 GM_JITpackage_299 #define GB_JITpackage_29 GM_JITpackage_29 #define GB_JITpackage_2 GM_JITpackage_2 +#define GB_JITpackage_300 GM_JITpackage_300 +#define GB_JITpackage_301 GM_JITpackage_301 +#define GB_JITpackage_302 GM_JITpackage_302 +#define GB_JITpackage_303 GM_JITpackage_303 +#define GB_JITpackage_304 GM_JITpackage_304 +#define GB_JITpackage_305 GM_JITpackage_305 +#define GB_JITpackage_306 GM_JITpackage_306 +#define GB_JITpackage_307 GM_JITpackage_307 +#define GB_JITpackage_308 GM_JITpackage_308 +#define GB_JITpackage_309 GM_JITpackage_309 #define GB_JITpackage_30 GM_JITpackage_30 +#define GB_JITpackage_310 GM_JITpackage_310 +#define GB_JITpackage_311 GM_JITpackage_311 +#define GB_JITpackage_312 GM_JITpackage_312 +#define GB_JITpackage_313 GM_JITpackage_313 +#define GB_JITpackage_314 GM_JITpackage_314 +#define GB_JITpackage_315 GM_JITpackage_315 +#define GB_JITpackage_316 GM_JITpackage_316 +#define GB_JITpackage_317 GM_JITpackage_317 +#define GB_JITpackage_318 GM_JITpackage_318 +#define GB_JITpackage_319 GM_JITpackage_319 #define GB_JITpackage_31 GM_JITpackage_31 +#define GB_JITpackage_320 GM_JITpackage_320 +#define GB_JITpackage_321 GM_JITpackage_321 +#define GB_JITpackage_322 GM_JITpackage_322 +#define GB_JITpackage_323 GM_JITpackage_323 +#define GB_JITpackage_324 GM_JITpackage_324 +#define GB_JITpackage_325 GM_JITpackage_325 +#define GB_JITpackage_326 GM_JITpackage_326 +#define GB_JITpackage_327 GM_JITpackage_327 +#define GB_JITpackage_328 GM_JITpackage_328 +#define GB_JITpackage_329 GM_JITpackage_329 #define GB_JITpackage_32 GM_JITpackage_32 +#define GB_JITpackage_330 GM_JITpackage_330 +#define GB_JITpackage_331 GM_JITpackage_331 +#define GB_JITpackage_332 GM_JITpackage_332 +#define GB_JITpackage_333 GM_JITpackage_333 +#define GB_JITpackage_334 GM_JITpackage_334 +#define GB_JITpackage_335 GM_JITpackage_335 +#define GB_JITpackage_336 GM_JITpackage_336 +#define GB_JITpackage_337 GM_JITpackage_337 +#define GB_JITpackage_338 GM_JITpackage_338 +#define GB_JITpackage_339 GM_JITpackage_339 #define GB_JITpackage_33 GM_JITpackage_33 +#define GB_JITpackage_340 GM_JITpackage_340 +#define GB_JITpackage_341 GM_JITpackage_341 +#define GB_JITpackage_342 GM_JITpackage_342 +#define GB_JITpackage_343 GM_JITpackage_343 +#define GB_JITpackage_344 GM_JITpackage_344 +#define GB_JITpackage_345 GM_JITpackage_345 +#define GB_JITpackage_346 GM_JITpackage_346 +#define GB_JITpackage_347 GM_JITpackage_347 +#define GB_JITpackage_348 GM_JITpackage_348 +#define GB_JITpackage_349 GM_JITpackage_349 #define GB_JITpackage_34 GM_JITpackage_34 +#define GB_JITpackage_350 GM_JITpackage_350 +#define GB_JITpackage_351 GM_JITpackage_351 +#define GB_JITpackage_352 GM_JITpackage_352 #define GB_JITpackage_35 GM_JITpackage_35 #define GB_JITpackage_36 GM_JITpackage_36 #define GB_JITpackage_37 GM_JITpackage_37 @@ -833,29 +924,10 @@ #define GB_JITpackage_98 GM_JITpackage_98 #define GB_JITpackage_99 GM_JITpackage_99 #define GB_JITpackage_9 GM_JITpackage_9 -#define GB_JITpackage_index GM_JITpackage_index -#define GB_JITpackage_nfiles GM_JITpackage_nfiles -#define GB_jit__subassign_22__1000eee0eec8__addgauss GM_jit__subassign_22__1000eee0eec8__addgauss -#define GB_jit__subassign_22__1000eee0eec8__addgauss_query GM_jit__subassign_22__1000eee0eec8__addgauss_query -#define GB_jit__subassign_22__1000eee0eec8__multgauss GM_jit__subassign_22__1000eee0eec8__multgauss -#define GB_jit__subassign_22__1000eee0eec8__multgauss_query GM_jit__subassign_22__1000eee0eec8__multgauss_query -#define GB_jit__trans_bind1st__0000eee0efe41__multgauss GM_jit__trans_bind1st__0000eee0efe41__multgauss -#define GB_jit__trans_bind1st__0000eee0efe41__multgauss_query GM_jit__trans_bind1st__0000eee0efe41__multgauss_query -#define GB_jit__trans_bind2nd__0000eee0eef44__multgauss GM_jit__trans_bind2nd__0000eee0eef44__multgauss -#define GB_jit__trans_bind2nd__0000eee0eef44__multgauss_query GM_jit__trans_bind2nd__0000eee0eef44__multgauss_query -#define GB_jit__trans_unop__08006e06ef__realgauss GM_jit__trans_unop__08006e06ef__realgauss -#define GB_jit__trans_unop__08006e06ef__realgauss_query GM_jit__trans_unop__08006e06ef__realgauss_query -#define GB_jit__trans_unop__0802ee0ee5__gauss GM_jit__trans_unop__0802ee0ee5__gauss -#define GB_jit__trans_unop__0802ee0ee5__gauss_query GM_jit__trans_unop__0802ee0ee5__gauss_query -#define GB_jit__trans_unop__0802ee0ee5__wildtype GM_jit__trans_unop__0802ee0ee5__wildtype -#define GB_jit__trans_unop__0802ee0ee5__wildtype_query GM_jit__trans_unop__0802ee0ee5__wildtype_query -#define GB_jit__trans_unop__0802ee0eef__gauss GM_jit__trans_unop__0802ee0eef__gauss -#define GB_jit__trans_unop__0802ee0eef__gauss_query GM_jit__trans_unop__0802ee0eef__gauss_query -#define GB_jit__user_op__0__addgauss GM_jit__user_op__0__addgauss -#define GB_jit__user_op__0__addgauss_query GM_jit__user_op__0__addgauss_query -#define GB_jit__user_type__0__gauss GM_jit__user_type__0__gauss -#define GB_jit__user_type__0__gauss_query GM_jit__user_type__0__gauss_query +#define GB_JITpackage_index_get GM_JITpackage_index_get +#define GB_JITpackage_nfiles_get GM_JITpackage_nfiles_get #define GB_kroner GM_kroner +#define GB_kroner_jit GM_kroner_jit #define GB_kron GM_kron #define GB_LZ4_attach_dictionary GM_LZ4_attach_dictionary #define GB_LZ4_attach_HC_dictionary GM_LZ4_attach_HC_dictionary @@ -953,6 +1025,7 @@ #define GB_macrofy_family GM_macrofy_family #define GB_macrofy_id GM_macrofy_id #define GB_macrofy_input GM_macrofy_input +#define GB_macrofy_masker GM_macrofy_masker #define GB_macrofy_mask GM_macrofy_mask #define GB_macrofy_monoid GM_macrofy_monoid #define GB_macrofy_multadd GM_macrofy_multadd @@ -964,8 +1037,10 @@ #define GB_macrofy_query GM_macrofy_query #define GB_macrofy_reduce GM_macrofy_reduce #define GB_macrofy_select GM_macrofy_select +#define GB_macrofy_sort GM_macrofy_sort #define GB_macrofy_sparsity GM_macrofy_sparsity #define GB_macrofy_string GM_macrofy_string +#define GB_macrofy_subref GM_macrofy_subref #define GB_macrofy_typedefs GM_macrofy_typedefs #define GB_macrofy_type GM_macrofy_type #define GB_macrofy_unop GM_macrofy_unop @@ -976,7 +1051,9 @@ #define GB_Mask_compatible GM_Mask_compatible #define GB_masker GM_masker #define GB_masker_phase1 GM_masker_phase1 +#define GB_masker_phase1_jit GM_masker_phase1_jit #define GB_masker_phase2 GM_masker_phase2 +#define GB_masker_phase2_jit GM_masker_phase2_jit #define GB_masker_sparsity GM_masker_sparsity #define GB_mask GM_mask #define GB_Matrix_check GM_Matrix_check @@ -1029,6 +1106,7 @@ #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_ensure GM_Pending_ensure #define GB_Pending_free GM_Pending_free #define GB_Pending_n GM_Pending_n #define GB_Pending_realloc GM_Pending_realloc @@ -1057,7 +1135,7 @@ #define GB_pow_uint64 GM_pow_uint64 #define GB_pow_uint8 GM_pow_uint8 #define GB_prejit GM_prejit -#define GB_pslice GM_pslice +#define GB_p_slice GM_p_slice #define GB_qsort_1b GM_qsort_1b #define GB_qsort_1b_size16 GM_qsort_1b_size16 #define GB_qsort_1b_size1 GM_qsort_1b_size1 @@ -1112,6 +1190,7 @@ #define GB_signum GM_signum #define GB_slice_vector GM_slice_vector #define GB_sort GM_sort +#define GB_sort_jit GM_sort_jit #define GB_sparsity_control GM_sparsity_control #define GB_split_bitmap GM_split_bitmap #define GB_split_bitmap_jit GM_split_bitmap_jit @@ -1147,6 +1226,7 @@ #define GB_subassign_23 GM_subassign_23 #define GB_subassign_24 GM_subassign_24 #define GB_subassign_25 GM_subassign_25 +#define GB_subassign_26 GM_subassign_26 #define GB_subassigner GM_subassigner #define GB_subassigner_method GM_subassigner_method #define GB_subassign GM_subassign @@ -1156,11 +1236,13 @@ #define GB_subassign_scalar GM_subassign_scalar #define GB_subassign_symbolic GM_subassign_symbolic #define GB_subassign_zombie GM_subassign_zombie +#define GB_subref_bitmap_jit GM_subref_bitmap_jit #define GB_subref GM_subref #define GB_subref_phase0 GM_subref_phase0 #define GB_subref_phase2 GM_subref_phase2 #define GB_subref_phase3 GM_subref_phase3 #define GB_subref_slice GM_subref_slice +#define GB_subref_sparse_jit GM_subref_sparse_jit #define GB_task_cumsum GM_task_cumsum #define GB_transplant_conform GM_transplant_conform #define GB_transplant GM_transplant @@ -1181,6 +1263,7 @@ #define GB_UnaryOp_check GM_UnaryOp_check #define GB_union_jit GM_union_jit #define GB_unjumble GM_unjumble +#define GB_unjumble_jit GM_unjumble_jit #define GB_unop_code_iso GM_unop_code_iso #define GB_unop_identity GM_unop_identity #define GB_unop_iso GM_unop_iso @@ -2950,6 +3033,7 @@ #define GxB_BGET_UINT8 GxM_BGET_UINT8 #define GxB_BinaryOp_fprint GxM_BinaryOp_fprint #define GxB_BinaryOp_new GxM_BinaryOp_new +#define GxB_BinaryOp_new_IndexOp GxM_BinaryOp_new_IndexOp #define GxB_BinaryOp_xtype GxM_BinaryOp_xtype #define GxB_BinaryOp_xtype_name GxM_BinaryOp_xtype_name #define GxB_BinaryOp_ytype GxM_BinaryOp_ytype @@ -3234,6 +3318,20 @@ #define GxB_IDENTITY_FC32 GxM_IDENTITY_FC32 #define GxB_IDENTITY_FC64 GxM_IDENTITY_FC64 #define GxB_IGNORE_DUP GxM_IGNORE_DUP +#define GxB_IndexBinaryOp_error GxM_IndexBinaryOp_error +#define GxB_IndexBinaryOp_fprint GxM_IndexBinaryOp_fprint +#define GxB_IndexBinaryOp_free GxM_IndexBinaryOp_free +#define GxB_IndexBinaryOp_get_INT32 GxM_IndexBinaryOp_get_INT32 +#define GxB_IndexBinaryOp_get_Scalar GxM_IndexBinaryOp_get_Scalar +#define GxB_IndexBinaryOp_get_SIZE GxM_IndexBinaryOp_get_SIZE +#define GxB_IndexBinaryOp_get_String GxM_IndexBinaryOp_get_String +#define GxB_IndexBinaryOp_get_VOID GxM_IndexBinaryOp_get_VOID +#define GxB_IndexBinaryOp_new GxM_IndexBinaryOp_new +#define GxB_IndexBinaryOp_set_INT32 GxM_IndexBinaryOp_set_INT32 +#define GxB_IndexBinaryOp_set_Scalar GxM_IndexBinaryOp_set_Scalar +#define GxB_IndexBinaryOp_set_String GxM_IndexBinaryOp_set_String +#define GxB_IndexBinaryOp_set_VOID GxM_IndexBinaryOp_set_VOID +#define GxB_IndexBinaryOp_wait GxM_IndexBinaryOp_wait #define GxB_IndexUnaryOp_fprint GxM_IndexUnaryOp_fprint #define GxB_IndexUnaryOp_new GxM_IndexUnaryOp_new #define GxB_IndexUnaryOp_xtype_name GxM_IndexUnaryOp_xtype_name diff --git a/GraphBLAS/rename/Makefile b/GraphBLAS/rename/Makefile index 9d9be39525..3d470a375d 100644 --- a/GraphBLAS/rename/Makefile +++ b/GraphBLAS/rename/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/GraphBLAS/rename/Makefile #------------------------------------------------------------------------------- -# 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/test/Contents.m b/GraphBLAS/test/Contents.m index 372f1e59ba..6b15cc5884 100644 --- a/GraphBLAS/test/Contents.m +++ b/GraphBLAS/test/Contents.m @@ -37,7 +37,7 @@ % gbtest32 - test nonzeros % gbtest33 - test spones, numel, nzmax, size, length, is*, ... % gbtest34 - test repmat -% gbtest35 - test reshape +% gbtest35 - test reshape (built-in variant) % gbtest36 - test abs, sign % gbtest37 - test istril, istriu, isbanded, isdiag, ishermitian, ... % gbtest38 - test sqrt, eps, ceil, floor, round, fix, real, conj, ... @@ -125,6 +125,7 @@ % gbtest119 - test GrB.eunion % gbtest120 - test subsref % gbtest121 - test times with scalars +% gbtest122 - test reshape (extended methods in GrB) % % Utilities and other tests: % @@ -139,6 +140,6 @@ % gb_contains - same as contains (text, pattern) % gb_octave - return true if Octave is in use, false for MATLAB -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/Include/GraphBLAS.h b/Include/GraphBLAS.h index c15defdec9..4e3d34ffaa 100644 --- a/Include/GraphBLAS.h +++ b/Include/GraphBLAS.h @@ -1,4 +1,4 @@ -// SuiteSparse:GraphBLAS 9.3.1 +// SuiteSparse:GraphBLAS 9.4.2 //------------------------------------------------------------------------------ // GraphBLAS.h: definitions for the GraphBLAS package //------------------------------------------------------------------------------ @@ -30,13 +30,6 @@ // with the name GxB_* are user-accessible in SuiteSparse:GraphBLAS but cannot // be guaranteed to appear in all GraphBLAS implementations. -// 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 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 @@ -177,10 +170,10 @@ // // One of the above options is required. To use the JIT, these two // options must also be added at run time via - // GrB_set (GrB_Global, GxB_JIT_C_COMPILER_FLAGS, "...") - // where "..." would be all the flags required to compile a JIT kernel, - // including "-O3 -fopenmp" and so on, as well as one of the above two - // options. + // GrB_set (GrB_Global, GxB_JIT_C_COMPILER_FLAGS, "[flags]") + // where "[flags]" would be all the flags required to compile a JIT + // kernel, including "-O3 -fopenmp" and so on, as well as one of the + // above two options. #else // Let the cmake configuration script determine the complex type // that is available: @@ -257,13 +250,13 @@ // can use tests like this: // // #if GxB_SPEC_VERSION >= GxB_VERSION (2,0,3) -// ... use features in GraphBLAS specification 2.0.3 ... +// use features in GraphBLAS specification 2.0.3 // #else -// ... only use features in early specifications +// only use features in early specifications // #endif // // #if GxB_IMPLEMENTATION > GxB_VERSION (1,4,0) -// ... use features from version 1.4.0 of a GraphBLAS package +// use features from version 1.4.0 of a GraphBLAS package // #endif // X_GRAPHBLAS: names this particular implementation: @@ -275,10 +268,10 @@ // The version of this implementation, and the GraphBLAS API version: #define GxB_IMPLEMENTATION_NAME "SuiteSparse:GraphBLAS" -#define GxB_IMPLEMENTATION_DATE "Aug 12, 2024" +#define GxB_IMPLEMENTATION_DATE "Nov 18, 2024" #define GxB_IMPLEMENTATION_MAJOR 9 -#define GxB_IMPLEMENTATION_MINOR 3 -#define GxB_IMPLEMENTATION_SUB 1 +#define GxB_IMPLEMENTATION_MINOR 4 +#define GxB_IMPLEMENTATION_SUB 2 #define GxB_SPEC_DATE "Dec 22, 2023" #define GxB_SPEC_MAJOR 2 #define GxB_SPEC_MINOR 1 @@ -319,11 +312,11 @@ // The 'spec' string describes the GraphBLAS spec: #define GxB_SPEC_ABOUT \ -"GraphBLAS C API, by Benjamin Brock, Aydin Buluc, Raye Kimmerer,\n" \ +"GraphBLAS C API, by Benjamin Brock, Aydin Buluc, Raye Kimmerer,\n" \ "Jim Kitchen, Manoj 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" +"Michel Pelletier, Erik Welch, and Carl Yang. 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" //============================================================================== // GrB_Index: the GraphBLAS integer @@ -338,11 +331,6 @@ typedef uint64_t GrB_Index ; // matrix or vector dimension is GrB_INDEX_MAX+1, or 2^60 in SuiteSparse:GrB. #define GrB_INDEX_MAX ((GrB_Index) (1ULL << 60) - 1) -// GxB_INDEX_MAX is historical; use GrB_INDEX_MAX+1 instead. It differs by one -// from GrB_INDEX_MAX, since it defined the largest valid matrix or vector -// dimension. -#define GxB_INDEX_MAX ((GrB_Index) (1ULL << 60)) - //============================================================================== // GraphBLAS error and informational codes //============================================================================== @@ -382,7 +370,8 @@ typedef enum GrB_INSUFFICIENT_SPACE = -103, // output array not large enough GrB_INVALID_OBJECT = -104, // object is corrupted GrB_INDEX_OUT_OF_BOUNDS = -105, // row or col index out of bounds - GrB_EMPTY_OBJECT = -106 // an object does not contain a value + GrB_EMPTY_OBJECT = -106, // an object does not contain a value + GxB_JIT_ERROR = -1001, // JIT compiler/loader error } GrB_Info ; @@ -507,7 +496,7 @@ typedef enum GxB_AxB_METHOD = 7090, // descriptor for selecting C=A*B algorithm GxB_SORT = 7091, // control sort in GrB_mxm GxB_COMPRESSION = 7092, // select compression for serialize - GxB_IMPORT = 7093, // secure vs fast import + GxB_IMPORT = 7093, // secure vs fast GxB_pack } GrB_Desc_Field ; @@ -515,7 +504,7 @@ typedef enum { // for all GrB_Descriptor fields: GrB_DEFAULT = 0, // default behavior of the method - GxB_DEFAULT = 0, // historical; use GrB_DEFAULT instead + GxB_DEFAULT = 0, // Historical; use GrB_DEFAULT instead // for GrB_OUTP only: GrB_REPLACE = 1, // clear the output before assigning new values to it @@ -687,22 +676,6 @@ GB_GLOBAL GrB_UnaryOp // GxB_LNOT_BOOL; it just has a different name. GrB_LNOT ; -// GxB_ABS is now in the v1.3 spec, the following names are historical: -GB_GLOBAL GrB_UnaryOp - - // z = abs(x) - GxB_ABS_BOOL, - GxB_ABS_INT8, - GxB_ABS_INT16, - GxB_ABS_INT32, - GxB_ABS_INT64, - GxB_ABS_UINT8, - GxB_ABS_UINT16, - GxB_ABS_UINT32, - GxB_ABS_UINT64, - GxB_ABS_FP32, - GxB_ABS_FP64 ; - //------------------------------------------------------------------------------ // Unary operators for floating-point types only //------------------------------------------------------------------------------ @@ -1220,15 +1193,26 @@ GB_GLOBAL GrB_BinaryOp GxB_IGNORE_DUP ; typedef void (*GxB_binary_function) (void *, const void *, const void *) ; //============================================================================== -// GxB_SelectOp: select operators (DEPRECATED: do not use) +// GxB_IndexBinaryOp: index binary operators //============================================================================== -// 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, GxB_EQ_THUNK, GxB_GT_THUNK, GxB_GE_THUNK, GxB_LT_THUNK, - GxB_LE_THUNK ; +// GxB_IndexBinaryOp: a function z=f(x,ia,jb, y,ib,jb, theta). The function f +// must have the signature: + +// void f (void *z, const void *x, GrB_Index ix, GrB_Index jx, +// const void *y, GrB_Index iy, GrB_Index jy, +// const void *theta) ; + +// The pointers are void * but they are always of pointers to objects of type +// ztype, xtype, ytype, and theta_type, respectively. +// for examples. + +typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp ; + +typedef void (*GxB_index_binary_function) (void *, + const void *, GrB_Index, GrB_Index, + const void *, GrB_Index, GrB_Index, + const void *) ; //============================================================================== // GrB_IndexUnaryOp: a unary operator that depends on the row/col indices @@ -1353,8 +1337,7 @@ typedef struct GB_Semiring_opaque *GrB_Semiring ; // GrB_Scalar: a GraphBLAS scalar //============================================================================== -typedef struct GB_Scalar_opaque *GxB_Scalar ; // historical: use GrB_Scalar -typedef struct GB_Scalar_opaque *GrB_Scalar ; // use this instead +typedef struct GB_Scalar_opaque *GrB_Scalar ; //============================================================================== // GrB_Vector: a GraphBLAS vector @@ -1390,22 +1373,22 @@ typedef enum // for global options or matrix options GxB_HYPER_HASH = 7048, // hyper_hash control (global int64 value, // or bool per matrix) GxB_BITMAP_SWITCH = 7001, // switch to bitmap (double value) - GxB_FORMAT = 7002, // historical; use GrB_STORAGE_ORIENTATION_HINT + GxB_FORMAT = 7002, // Historical; use GrB_STORAGE_ORIENTATION_HINT //------------------------------------------------------------ // GrB_get for GrB_GLOBAL: //------------------------------------------------------------ - 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_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, // historical; use GrB_API_VER_* + 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 *) @@ -1449,7 +1432,7 @@ typedef enum // for global options or matrix options //------------------------------------------------------------ GxB_SPARSITY_STATUS = 7034, // hyper, sparse, bitmap or full (1,2,4,8) - GxB_IS_HYPER = 7035, // historical; use GxB_SPARSITY_STATUS + GxB_IS_HYPER = 7035, // Historical; use GxB_SPARSITY_STATUS //------------------------------------------------------------ // GrB_get/GrB_set for GrB_Matrix: @@ -1470,21 +1453,6 @@ typedef enum } GxB_JIT_Control ; -// GxB_FORMAT is historical, but it can be by row or by column: -typedef enum -{ - GxB_BY_ROW = 0, // CSR: compressed sparse row format - GxB_BY_COL = 1, // CSC: compressed sparse column format - GxB_NO_FORMAT = -1 // format not defined -} -GxB_Format_Value ; - -// The default format is by row. These constants are defined as GB_GLOBAL -// const, so that if SuiteSparse:GraphBLAS is recompiled with a different -// default format, and the application is relinked but not recompiled, it will -// acquire the new default values. -GB_GLOBAL const GxB_Format_Value GxB_FORMAT_DEFAULT ; - // the default hyper_switch parameter GB_GLOBAL const double GxB_HYPER_DEFAULT ; @@ -1637,7 +1605,8 @@ typedef enum // SuiteSparse extensions: //-------------------------------------------------------------------------- - // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, and GrB_IndexUnaryOp: + // GrB_Type, GrB_UnaryOp, GrB_BinaryOp, GrB_IndexUnaryOp, + // and GxB_IndexBinaryOp GxB_JIT_C_NAME = 7041, // C type or function name GxB_JIT_C_DEFINITION = 7042, // C typedef or function definition @@ -1649,6 +1618,13 @@ typedef enum // GrB_Semiring only: GxB_SEMIRING_MONOID = 7046, // semiring monoid GxB_SEMIRING_MULTIPLY = 7047, // semiring multiplicative op + + // GrB_BinaryOp and GxB_IndexBinaryOp: + GxB_THETA_TYPE_CODE = 7050, // for binary and index binary ops + GxB_THETA_TYPE_STRING = 7051, + + // GrB_BinaryOp or GrB_Semiring: + GxB_THETA = 7052, // to get the value of theta } GrB_Field ; @@ -1728,18 +1704,6 @@ GB_GLOBAL GrB_Monoid // 10 MIN monoids: (not for complex types) //-------------------------------------------------------------------------- - // GxB_MIN monoids, historical, use GrB_MIN_MONOID_* instead: - GxB_MIN_INT8_MONOID, // identity: INT8_MAX terminal: INT8_MIN - GxB_MIN_INT16_MONOID, // identity: INT16_MAX terminal: INT16_MIN - GxB_MIN_INT32_MONOID, // identity: INT32_MAX terminal: INT32_MIN - GxB_MIN_INT64_MONOID, // identity: INT64_MAX terminal: INT32_MIN - GxB_MIN_UINT8_MONOID, // identity: UINT8_MAX terminal: 0 - GxB_MIN_UINT16_MONOID, // identity: UINT16_MAX terminal: 0 - GxB_MIN_UINT32_MONOID, // identity: UINT32_MAX terminal: 0 - GxB_MIN_UINT64_MONOID, // identity: UINT64_MAX terminal: 0 - GxB_MIN_FP32_MONOID, // identity: INFINITY terminal: -INFINITY - GxB_MIN_FP64_MONOID, // identity: INFINITY terminal: -INFINITY - // preferred names from the v1.3 spec: GrB_MIN_MONOID_INT8, // identity: INT8_MAX terminal: INT8_MIN GrB_MIN_MONOID_INT16, // identity: INT16_MAX terminal: INT16_MIN @@ -1756,18 +1720,6 @@ GB_GLOBAL GrB_Monoid // 10 MAX monoids: //-------------------------------------------------------------------------- - // GxB_MAX monoids, historical, use GrB_MAX_MONOID_* instead: - GxB_MAX_INT8_MONOID, // identity: INT8_MIN terminal: INT8_MAX - GxB_MAX_INT16_MONOID, // identity: INT16_MIN terminal: INT16_MAX - GxB_MAX_INT32_MONOID, // identity: INT32_MIN terminal: INT32_MAX - GxB_MAX_INT64_MONOID, // identity: INT64_MIN terminal: INT64_MAX - GxB_MAX_UINT8_MONOID, // identity: 0 terminal: UINT8_MAX - GxB_MAX_UINT16_MONOID, // identity: 0 terminal: UINT16_MAX - GxB_MAX_UINT32_MONOID, // identity: 0 terminal: UINT32_MAX - GxB_MAX_UINT64_MONOID, // identity: 0 terminal: UINT64_MAX - GxB_MAX_FP32_MONOID, // identity: -INFINITY terminal: INFINITY - GxB_MAX_FP64_MONOID, // identity: -INFINITY terminal: INFINITY - // preferred names from the v1.3 spec: GrB_MAX_MONOID_INT8, // identity: INT8_MIN terminal: INT8_MAX GrB_MAX_MONOID_INT16, // identity: INT16_MIN terminal: INT16_MAX @@ -1784,18 +1736,6 @@ GB_GLOBAL GrB_Monoid // 12 PLUS monoids: //-------------------------------------------------------------------------- - // GxB_PLUS monoids, historical, use GrB_PLUS_MONOID_* instead: - GxB_PLUS_INT8_MONOID, // identity: 0 - GxB_PLUS_INT16_MONOID, // identity: 0 - GxB_PLUS_INT32_MONOID, // identity: 0 - GxB_PLUS_INT64_MONOID, // identity: 0 - GxB_PLUS_UINT8_MONOID, // identity: 0 - GxB_PLUS_UINT16_MONOID, // identity: 0 - GxB_PLUS_UINT32_MONOID, // identity: 0 - GxB_PLUS_UINT64_MONOID, // identity: 0 - GxB_PLUS_FP32_MONOID, // identity: 0 - GxB_PLUS_FP64_MONOID, // identity: 0 - // preferred names from the v1.3 spec: GrB_PLUS_MONOID_INT8, // identity: 0 GrB_PLUS_MONOID_INT16, // identity: 0 @@ -1816,18 +1756,6 @@ GB_GLOBAL GrB_Monoid // 12 TIMES monoids: identity value is 1, int* and uint* are terminal //-------------------------------------------------------------------------- - // GxB_TIMES monoids, historical, use GrB_TIMES_MONOID_* instead: - GxB_TIMES_INT8_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_INT16_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_INT32_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_INT64_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_UINT8_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_UINT16_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_UINT32_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_UINT64_MONOID, // identity: 1 terminal: 0 - GxB_TIMES_FP32_MONOID, // identity: 1 - GxB_TIMES_FP64_MONOID, // identity: 1 - // preferred names from the v1.3 spec: GrB_TIMES_MONOID_INT8, // identity: 1 terminal: 0 GrB_TIMES_MONOID_INT16, // identity: 1 terminal: 0 @@ -1866,13 +1794,6 @@ GB_GLOBAL GrB_Monoid // 4 Boolean monoids: (see also the GxB_ANY_BOOL_MONOID above) //-------------------------------------------------------------------------- - // GxB_* boolean monoids, historical, use GrB_* instead: - GxB_LOR_BOOL_MONOID, // identity: false terminal: true - GxB_LAND_BOOL_MONOID, // identity: true terminal: false - GxB_LXOR_BOOL_MONOID, // identity: false - GxB_LXNOR_BOOL_MONOID, // identity: true - GxB_EQ_BOOL_MONOID, // (another name for GrB_LXNOR_MONOID_BOOL) - // preferred names from the v1.3 spec: GrB_LOR_MONOID_BOOL, // identity: false terminal: true GrB_LAND_MONOID_BOOL, // identity: true terminal: false @@ -1981,7 +1902,7 @@ GB_GLOBAL GrB_Monoid // with ANY as the multiply operator, but they are not predefined below. // Likewise, additional built-in operators can be used as multiplicative -// operators for floating-point semirings (POW, ATAN2, HYPOT, ...) and many +// operators for floating-point semirings (POW, ATAN2, HYPOT, etc) and many // more semirings can be constructed from bitwise monoids and many integer // binary (non-bitwise) multiplicative operators, but these are not // pre-defined. @@ -1999,6 +1920,8 @@ GB_GLOBAL GrB_Monoid // identical, as are FIRSTJ1 and SECONDI1. These semirings still appear as // predefined, for convenience. +// 124 of the GxB_* semirings are now superceded by GrB_* semirings. + GB_GLOBAL GrB_Semiring //------------------------------------------------------------------------------ @@ -2006,28 +1929,28 @@ GB_GLOBAL GrB_Semiring //------------------------------------------------------------------------------ // semirings with multiply op: z = FIRST (x,y), all types x,y,z the same: - GxB_MIN_FIRST_INT8 , GxB_MAX_FIRST_INT8 , GxB_PLUS_FIRST_INT8 , GxB_TIMES_FIRST_INT8 , GxB_ANY_FIRST_INT8 , - GxB_MIN_FIRST_INT16 , GxB_MAX_FIRST_INT16 , GxB_PLUS_FIRST_INT16 , GxB_TIMES_FIRST_INT16 , GxB_ANY_FIRST_INT16 , - GxB_MIN_FIRST_INT32 , GxB_MAX_FIRST_INT32 , GxB_PLUS_FIRST_INT32 , GxB_TIMES_FIRST_INT32 , GxB_ANY_FIRST_INT32 , - GxB_MIN_FIRST_INT64 , GxB_MAX_FIRST_INT64 , GxB_PLUS_FIRST_INT64 , GxB_TIMES_FIRST_INT64 , GxB_ANY_FIRST_INT64 , - GxB_MIN_FIRST_UINT8 , GxB_MAX_FIRST_UINT8 , GxB_PLUS_FIRST_UINT8 , GxB_TIMES_FIRST_UINT8 , GxB_ANY_FIRST_UINT8 , - GxB_MIN_FIRST_UINT16 , GxB_MAX_FIRST_UINT16 , GxB_PLUS_FIRST_UINT16 , GxB_TIMES_FIRST_UINT16 , GxB_ANY_FIRST_UINT16 , - GxB_MIN_FIRST_UINT32 , GxB_MAX_FIRST_UINT32 , GxB_PLUS_FIRST_UINT32 , GxB_TIMES_FIRST_UINT32 , GxB_ANY_FIRST_UINT32 , - GxB_MIN_FIRST_UINT64 , GxB_MAX_FIRST_UINT64 , GxB_PLUS_FIRST_UINT64 , GxB_TIMES_FIRST_UINT64 , GxB_ANY_FIRST_UINT64 , - GxB_MIN_FIRST_FP32 , GxB_MAX_FIRST_FP32 , GxB_PLUS_FIRST_FP32 , GxB_TIMES_FIRST_FP32 , GxB_ANY_FIRST_FP32 , - GxB_MIN_FIRST_FP64 , GxB_MAX_FIRST_FP64 , GxB_PLUS_FIRST_FP64 , GxB_TIMES_FIRST_FP64 , GxB_ANY_FIRST_FP64 , + GxB_PLUS_FIRST_INT8 , GxB_TIMES_FIRST_INT8 , GxB_ANY_FIRST_INT8 , + GxB_MAX_FIRST_INT16 , GxB_PLUS_FIRST_INT16 , GxB_TIMES_FIRST_INT16 , GxB_ANY_FIRST_INT16 , + GxB_MAX_FIRST_INT32 , GxB_PLUS_FIRST_INT32 , GxB_TIMES_FIRST_INT32 , GxB_ANY_FIRST_INT32 , + GxB_MAX_FIRST_INT64 , GxB_PLUS_FIRST_INT64 , GxB_TIMES_FIRST_INT64 , GxB_ANY_FIRST_INT64 , + GxB_MAX_FIRST_UINT8 , GxB_PLUS_FIRST_UINT8 , GxB_TIMES_FIRST_UINT8 , GxB_ANY_FIRST_UINT8 , + GxB_MAX_FIRST_UINT16 , GxB_PLUS_FIRST_UINT16 , GxB_TIMES_FIRST_UINT16 , GxB_ANY_FIRST_UINT16 , + GxB_MAX_FIRST_UINT32 , GxB_PLUS_FIRST_UINT32 , GxB_TIMES_FIRST_UINT32 , GxB_ANY_FIRST_UINT32 , + GxB_MAX_FIRST_UINT64 , GxB_PLUS_FIRST_UINT64 , GxB_TIMES_FIRST_UINT64 , GxB_ANY_FIRST_UINT64 , + GxB_MAX_FIRST_FP32 , GxB_PLUS_FIRST_FP32 , GxB_TIMES_FIRST_FP32 , GxB_ANY_FIRST_FP32 , + GxB_MAX_FIRST_FP64 , GxB_PLUS_FIRST_FP64 , GxB_TIMES_FIRST_FP64 , GxB_ANY_FIRST_FP64 , // semirings with multiply op: z = SECOND (x,y), all types x,y,z the same: - GxB_MIN_SECOND_INT8 , GxB_MAX_SECOND_INT8 , GxB_PLUS_SECOND_INT8 , GxB_TIMES_SECOND_INT8 , GxB_ANY_SECOND_INT8 , - GxB_MIN_SECOND_INT16 , GxB_MAX_SECOND_INT16 , GxB_PLUS_SECOND_INT16 , GxB_TIMES_SECOND_INT16 , GxB_ANY_SECOND_INT16 , - GxB_MIN_SECOND_INT32 , GxB_MAX_SECOND_INT32 , GxB_PLUS_SECOND_INT32 , GxB_TIMES_SECOND_INT32 , GxB_ANY_SECOND_INT32 , - GxB_MIN_SECOND_INT64 , GxB_MAX_SECOND_INT64 , GxB_PLUS_SECOND_INT64 , GxB_TIMES_SECOND_INT64 , GxB_ANY_SECOND_INT64 , - GxB_MIN_SECOND_UINT8 , GxB_MAX_SECOND_UINT8 , GxB_PLUS_SECOND_UINT8 , GxB_TIMES_SECOND_UINT8 , GxB_ANY_SECOND_UINT8 , - GxB_MIN_SECOND_UINT16 , GxB_MAX_SECOND_UINT16 , GxB_PLUS_SECOND_UINT16 , GxB_TIMES_SECOND_UINT16, GxB_ANY_SECOND_UINT16 , - GxB_MIN_SECOND_UINT32 , GxB_MAX_SECOND_UINT32 , GxB_PLUS_SECOND_UINT32 , GxB_TIMES_SECOND_UINT32, GxB_ANY_SECOND_UINT32 , - GxB_MIN_SECOND_UINT64 , GxB_MAX_SECOND_UINT64 , GxB_PLUS_SECOND_UINT64 , GxB_TIMES_SECOND_UINT64, GxB_ANY_SECOND_UINT64 , - GxB_MIN_SECOND_FP32 , GxB_MAX_SECOND_FP32 , GxB_PLUS_SECOND_FP32 , GxB_TIMES_SECOND_FP32 , GxB_ANY_SECOND_FP32 , - GxB_MIN_SECOND_FP64 , GxB_MAX_SECOND_FP64 , GxB_PLUS_SECOND_FP64 , GxB_TIMES_SECOND_FP64 , GxB_ANY_SECOND_FP64 , + GxB_PLUS_SECOND_INT8 , GxB_TIMES_SECOND_INT8 , GxB_ANY_SECOND_INT8 , + GxB_PLUS_SECOND_INT16 , GxB_TIMES_SECOND_INT16 , GxB_ANY_SECOND_INT16 , + GxB_PLUS_SECOND_INT32 , GxB_TIMES_SECOND_INT32 , GxB_ANY_SECOND_INT32 , + GxB_PLUS_SECOND_INT64 , GxB_TIMES_SECOND_INT64 , GxB_ANY_SECOND_INT64 , + GxB_PLUS_SECOND_UINT8 , GxB_TIMES_SECOND_UINT8 , GxB_ANY_SECOND_UINT8 , + GxB_PLUS_SECOND_UINT16 , GxB_TIMES_SECOND_UINT16, GxB_ANY_SECOND_UINT16 , + GxB_PLUS_SECOND_UINT32 , GxB_TIMES_SECOND_UINT32, GxB_ANY_SECOND_UINT32 , + GxB_PLUS_SECOND_UINT64 , GxB_TIMES_SECOND_UINT64, GxB_ANY_SECOND_UINT64 , + GxB_PLUS_SECOND_FP32 , GxB_TIMES_SECOND_FP32 , GxB_ANY_SECOND_FP32 , + GxB_PLUS_SECOND_FP64 , GxB_TIMES_SECOND_FP64 , GxB_ANY_SECOND_FP64 , // semirings with multiply op: z = PAIR (x,y), all types x,y,z the same: // (note that min_pair, max_pair, times_pair are all identical to any_pair, and are marked below) @@ -2043,40 +1966,40 @@ GB_GLOBAL GrB_Semiring GxB_MIN_PAIR_FP64 /**/, GxB_MAX_PAIR_FP64 /**/, GxB_PLUS_PAIR_FP64 , GxB_TIMES_PAIR_FP64 /**/, GxB_ANY_PAIR_FP64 , // semirings with multiply op: z = MIN (x,y), all types x,y,z the same: - GxB_MIN_MIN_INT8 , GxB_MAX_MIN_INT8 , GxB_PLUS_MIN_INT8 , GxB_TIMES_MIN_INT8 , GxB_ANY_MIN_INT8 , - GxB_MIN_MIN_INT16 , GxB_MAX_MIN_INT16 , GxB_PLUS_MIN_INT16 , GxB_TIMES_MIN_INT16 , GxB_ANY_MIN_INT16 , - GxB_MIN_MIN_INT32 , GxB_MAX_MIN_INT32 , GxB_PLUS_MIN_INT32 , GxB_TIMES_MIN_INT32 , GxB_ANY_MIN_INT32 , - GxB_MIN_MIN_INT64 , GxB_MAX_MIN_INT64 , GxB_PLUS_MIN_INT64 , GxB_TIMES_MIN_INT64 , GxB_ANY_MIN_INT64 , - GxB_MIN_MIN_UINT8 , GxB_MAX_MIN_UINT8 , GxB_PLUS_MIN_UINT8 , GxB_TIMES_MIN_UINT8 , GxB_ANY_MIN_UINT8 , - GxB_MIN_MIN_UINT16 , GxB_MAX_MIN_UINT16 , GxB_PLUS_MIN_UINT16 , GxB_TIMES_MIN_UINT16 , GxB_ANY_MIN_UINT16 , - GxB_MIN_MIN_UINT32 , GxB_MAX_MIN_UINT32 , GxB_PLUS_MIN_UINT32 , GxB_TIMES_MIN_UINT32 , GxB_ANY_MIN_UINT32 , - GxB_MIN_MIN_UINT64 , GxB_MAX_MIN_UINT64 , GxB_PLUS_MIN_UINT64 , GxB_TIMES_MIN_UINT64 , GxB_ANY_MIN_UINT64 , - GxB_MIN_MIN_FP32 , GxB_MAX_MIN_FP32 , GxB_PLUS_MIN_FP32 , GxB_TIMES_MIN_FP32 , GxB_ANY_MIN_FP32 , - GxB_MIN_MIN_FP64 , GxB_MAX_MIN_FP64 , GxB_PLUS_MIN_FP64 , GxB_TIMES_MIN_FP64 , GxB_ANY_MIN_FP64 , + GxB_MIN_MIN_INT8 , GxB_TIMES_MIN_INT8 , GxB_ANY_MIN_INT8 , + GxB_MIN_MIN_INT16 , GxB_TIMES_MIN_INT16 , GxB_ANY_MIN_INT16 , + GxB_MIN_MIN_INT32 , GxB_TIMES_MIN_INT32 , GxB_ANY_MIN_INT32 , + GxB_MIN_MIN_INT64 , GxB_TIMES_MIN_INT64 , GxB_ANY_MIN_INT64 , + GxB_MIN_MIN_UINT8 , GxB_TIMES_MIN_UINT8 , GxB_ANY_MIN_UINT8 , + GxB_MIN_MIN_UINT16 , GxB_TIMES_MIN_UINT16 , GxB_ANY_MIN_UINT16 , + GxB_MIN_MIN_UINT32 , GxB_TIMES_MIN_UINT32 , GxB_ANY_MIN_UINT32 , + GxB_MIN_MIN_UINT64 , GxB_TIMES_MIN_UINT64 , GxB_ANY_MIN_UINT64 , + GxB_MIN_MIN_FP32 , GxB_TIMES_MIN_FP32 , GxB_ANY_MIN_FP32 , + GxB_MIN_MIN_FP64 , GxB_TIMES_MIN_FP64 , GxB_ANY_MIN_FP64 , // semirings with multiply op: z = MAX (x,y), all types x,y,z the same: - GxB_MIN_MAX_INT8 , GxB_MAX_MAX_INT8 , GxB_PLUS_MAX_INT8 , GxB_TIMES_MAX_INT8 , GxB_ANY_MAX_INT8 , - GxB_MIN_MAX_INT16 , GxB_MAX_MAX_INT16 , GxB_PLUS_MAX_INT16 , GxB_TIMES_MAX_INT16 , GxB_ANY_MAX_INT16 , - GxB_MIN_MAX_INT32 , GxB_MAX_MAX_INT32 , GxB_PLUS_MAX_INT32 , GxB_TIMES_MAX_INT32 , GxB_ANY_MAX_INT32 , - GxB_MIN_MAX_INT64 , GxB_MAX_MAX_INT64 , GxB_PLUS_MAX_INT64 , GxB_TIMES_MAX_INT64 , GxB_ANY_MAX_INT64 , - GxB_MIN_MAX_UINT8 , GxB_MAX_MAX_UINT8 , GxB_PLUS_MAX_UINT8 , GxB_TIMES_MAX_UINT8 , GxB_ANY_MAX_UINT8 , - GxB_MIN_MAX_UINT16 , GxB_MAX_MAX_UINT16 , GxB_PLUS_MAX_UINT16 , GxB_TIMES_MAX_UINT16 , GxB_ANY_MAX_UINT16 , - GxB_MIN_MAX_UINT32 , GxB_MAX_MAX_UINT32 , GxB_PLUS_MAX_UINT32 , GxB_TIMES_MAX_UINT32 , GxB_ANY_MAX_UINT32 , - GxB_MIN_MAX_UINT64 , GxB_MAX_MAX_UINT64 , GxB_PLUS_MAX_UINT64 , GxB_TIMES_MAX_UINT64 , GxB_ANY_MAX_UINT64 , - GxB_MIN_MAX_FP32 , GxB_MAX_MAX_FP32 , GxB_PLUS_MAX_FP32 , GxB_TIMES_MAX_FP32 , GxB_ANY_MAX_FP32 , - GxB_MIN_MAX_FP64 , GxB_MAX_MAX_FP64 , GxB_PLUS_MAX_FP64 , GxB_TIMES_MAX_FP64 , GxB_ANY_MAX_FP64 , + GxB_MAX_MAX_INT8 , GxB_PLUS_MAX_INT8 , GxB_TIMES_MAX_INT8 , GxB_ANY_MAX_INT8 , + GxB_MAX_MAX_INT16 , GxB_PLUS_MAX_INT16 , GxB_TIMES_MAX_INT16 , GxB_ANY_MAX_INT16 , + GxB_MAX_MAX_INT32 , GxB_PLUS_MAX_INT32 , GxB_TIMES_MAX_INT32 , GxB_ANY_MAX_INT32 , + GxB_MAX_MAX_INT64 , GxB_PLUS_MAX_INT64 , GxB_TIMES_MAX_INT64 , GxB_ANY_MAX_INT64 , + GxB_MAX_MAX_UINT8 , GxB_PLUS_MAX_UINT8 , GxB_TIMES_MAX_UINT8 , GxB_ANY_MAX_UINT8 , + GxB_MAX_MAX_UINT16 , GxB_PLUS_MAX_UINT16 , GxB_TIMES_MAX_UINT16 , GxB_ANY_MAX_UINT16 , + GxB_MAX_MAX_UINT32 , GxB_PLUS_MAX_UINT32 , GxB_TIMES_MAX_UINT32 , GxB_ANY_MAX_UINT32 , + GxB_MAX_MAX_UINT64 , GxB_PLUS_MAX_UINT64 , GxB_TIMES_MAX_UINT64 , GxB_ANY_MAX_UINT64 , + GxB_MAX_MAX_FP32 , GxB_PLUS_MAX_FP32 , GxB_TIMES_MAX_FP32 , GxB_ANY_MAX_FP32 , + GxB_MAX_MAX_FP64 , GxB_PLUS_MAX_FP64 , GxB_TIMES_MAX_FP64 , GxB_ANY_MAX_FP64 , // semirings with multiply op: z = PLUS (x,y), all types x,y,z the same: - GxB_MIN_PLUS_INT8 , GxB_MAX_PLUS_INT8 , GxB_PLUS_PLUS_INT8 , GxB_TIMES_PLUS_INT8 , GxB_ANY_PLUS_INT8 , - GxB_MIN_PLUS_INT16 , GxB_MAX_PLUS_INT16 , GxB_PLUS_PLUS_INT16 , GxB_TIMES_PLUS_INT16 , GxB_ANY_PLUS_INT16 , - GxB_MIN_PLUS_INT32 , GxB_MAX_PLUS_INT32 , GxB_PLUS_PLUS_INT32 , GxB_TIMES_PLUS_INT32 , GxB_ANY_PLUS_INT32 , - GxB_MIN_PLUS_INT64 , GxB_MAX_PLUS_INT64 , GxB_PLUS_PLUS_INT64 , GxB_TIMES_PLUS_INT64 , GxB_ANY_PLUS_INT64 , - GxB_MIN_PLUS_UINT8 , GxB_MAX_PLUS_UINT8 , GxB_PLUS_PLUS_UINT8 , GxB_TIMES_PLUS_UINT8 , GxB_ANY_PLUS_UINT8 , - GxB_MIN_PLUS_UINT16 , GxB_MAX_PLUS_UINT16 , GxB_PLUS_PLUS_UINT16 , GxB_TIMES_PLUS_UINT16 , GxB_ANY_PLUS_UINT16 , - GxB_MIN_PLUS_UINT32 , GxB_MAX_PLUS_UINT32 , GxB_PLUS_PLUS_UINT32 , GxB_TIMES_PLUS_UINT32 , GxB_ANY_PLUS_UINT32 , - GxB_MIN_PLUS_UINT64 , GxB_MAX_PLUS_UINT64 , GxB_PLUS_PLUS_UINT64 , GxB_TIMES_PLUS_UINT64 , GxB_ANY_PLUS_UINT64 , - GxB_MIN_PLUS_FP32 , GxB_MAX_PLUS_FP32 , GxB_PLUS_PLUS_FP32 , GxB_TIMES_PLUS_FP32 , GxB_ANY_PLUS_FP32 , - GxB_MIN_PLUS_FP64 , GxB_MAX_PLUS_FP64 , GxB_PLUS_PLUS_FP64 , GxB_TIMES_PLUS_FP64 , GxB_ANY_PLUS_FP64 , + GxB_PLUS_PLUS_INT8 , GxB_TIMES_PLUS_INT8 , GxB_ANY_PLUS_INT8 , + GxB_PLUS_PLUS_INT16 , GxB_TIMES_PLUS_INT16 , GxB_ANY_PLUS_INT16 , + GxB_PLUS_PLUS_INT32 , GxB_TIMES_PLUS_INT32 , GxB_ANY_PLUS_INT32 , + GxB_PLUS_PLUS_INT64 , GxB_TIMES_PLUS_INT64 , GxB_ANY_PLUS_INT64 , + GxB_PLUS_PLUS_UINT8 , GxB_TIMES_PLUS_UINT8 , GxB_ANY_PLUS_UINT8 , + GxB_PLUS_PLUS_UINT16 , GxB_TIMES_PLUS_UINT16 , GxB_ANY_PLUS_UINT16 , + GxB_PLUS_PLUS_UINT32 , GxB_TIMES_PLUS_UINT32 , GxB_ANY_PLUS_UINT32 , + GxB_PLUS_PLUS_UINT64 , GxB_TIMES_PLUS_UINT64 , GxB_ANY_PLUS_UINT64 , + GxB_PLUS_PLUS_FP32 , GxB_TIMES_PLUS_FP32 , GxB_ANY_PLUS_FP32 , + GxB_PLUS_PLUS_FP64 , GxB_TIMES_PLUS_FP64 , GxB_ANY_PLUS_FP64 , // semirings with multiply op: z = MINUS (x,y), all types x,y,z the same: GxB_MIN_MINUS_INT8 , GxB_MAX_MINUS_INT8 , GxB_PLUS_MINUS_INT8 , GxB_TIMES_MINUS_INT8 , GxB_ANY_MINUS_INT8 , @@ -2091,16 +2014,16 @@ GB_GLOBAL GrB_Semiring GxB_MIN_MINUS_FP64 , GxB_MAX_MINUS_FP64 , GxB_PLUS_MINUS_FP64 , GxB_TIMES_MINUS_FP64 , GxB_ANY_MINUS_FP64 , // semirings with multiply op: z = TIMES (x,y), all types x,y,z the same: - GxB_MIN_TIMES_INT8 , GxB_MAX_TIMES_INT8 , GxB_PLUS_TIMES_INT8 , GxB_TIMES_TIMES_INT8 , GxB_ANY_TIMES_INT8 , - GxB_MIN_TIMES_INT16 , GxB_MAX_TIMES_INT16 , GxB_PLUS_TIMES_INT16 , GxB_TIMES_TIMES_INT16 , GxB_ANY_TIMES_INT16 , - GxB_MIN_TIMES_INT32 , GxB_MAX_TIMES_INT32 , GxB_PLUS_TIMES_INT32 , GxB_TIMES_TIMES_INT32 , GxB_ANY_TIMES_INT32 , - GxB_MIN_TIMES_INT64 , GxB_MAX_TIMES_INT64 , GxB_PLUS_TIMES_INT64 , GxB_TIMES_TIMES_INT64 , GxB_ANY_TIMES_INT64 , - GxB_MIN_TIMES_UINT8 , GxB_MAX_TIMES_UINT8 , GxB_PLUS_TIMES_UINT8 , GxB_TIMES_TIMES_UINT8 , GxB_ANY_TIMES_UINT8 , - GxB_MIN_TIMES_UINT16 , GxB_MAX_TIMES_UINT16 , GxB_PLUS_TIMES_UINT16 , GxB_TIMES_TIMES_UINT16 , GxB_ANY_TIMES_UINT16 , - GxB_MIN_TIMES_UINT32 , GxB_MAX_TIMES_UINT32 , GxB_PLUS_TIMES_UINT32 , GxB_TIMES_TIMES_UINT32 , GxB_ANY_TIMES_UINT32 , - GxB_MIN_TIMES_UINT64 , GxB_MAX_TIMES_UINT64 , GxB_PLUS_TIMES_UINT64 , GxB_TIMES_TIMES_UINT64 , GxB_ANY_TIMES_UINT64 , - GxB_MIN_TIMES_FP32 , GxB_MAX_TIMES_FP32 , GxB_PLUS_TIMES_FP32 , GxB_TIMES_TIMES_FP32 , GxB_ANY_TIMES_FP32 , - GxB_MIN_TIMES_FP64 , GxB_MAX_TIMES_FP64 , GxB_PLUS_TIMES_FP64 , GxB_TIMES_TIMES_FP64 , GxB_ANY_TIMES_FP64 , + GxB_TIMES_TIMES_INT8 , GxB_ANY_TIMES_INT8 , + GxB_TIMES_TIMES_INT16 , GxB_ANY_TIMES_INT16 , + GxB_TIMES_TIMES_INT32 , GxB_ANY_TIMES_INT32 , + GxB_TIMES_TIMES_INT64 , GxB_ANY_TIMES_INT64 , + GxB_TIMES_TIMES_UINT8 , GxB_ANY_TIMES_UINT8 , + GxB_TIMES_TIMES_UINT16 , GxB_ANY_TIMES_UINT16 , + GxB_TIMES_TIMES_UINT32 , GxB_ANY_TIMES_UINT32 , + GxB_TIMES_TIMES_UINT64 , GxB_ANY_TIMES_UINT64 , + GxB_TIMES_TIMES_FP32 , GxB_ANY_TIMES_FP32 , + GxB_TIMES_TIMES_FP64 , GxB_ANY_TIMES_FP64 , // semirings with multiply op: z = DIV (x,y), all types x,y,z the same: GxB_MIN_DIV_INT8 , GxB_MAX_DIV_INT8 , GxB_PLUS_DIV_INT8 , GxB_TIMES_DIV_INT8 , GxB_ANY_DIV_INT8 , @@ -2339,8 +2262,8 @@ GB_GLOBAL GrB_Semiring GxB_LOR_FIRST_BOOL , GxB_LAND_FIRST_BOOL , GxB_LXOR_FIRST_BOOL , GxB_EQ_FIRST_BOOL , GxB_ANY_FIRST_BOOL , GxB_LOR_SECOND_BOOL , GxB_LAND_SECOND_BOOL , GxB_LXOR_SECOND_BOOL , GxB_EQ_SECOND_BOOL , GxB_ANY_SECOND_BOOL , GxB_LOR_PAIR_BOOL/**/ , GxB_LAND_PAIR_BOOL/**/ , GxB_LXOR_PAIR_BOOL , GxB_EQ_PAIR_BOOL/**/ , GxB_ANY_PAIR_BOOL , - GxB_LOR_LOR_BOOL , GxB_LAND_LOR_BOOL , GxB_LXOR_LOR_BOOL , GxB_EQ_LOR_BOOL , GxB_ANY_LOR_BOOL , - GxB_LOR_LAND_BOOL , GxB_LAND_LAND_BOOL , GxB_LXOR_LAND_BOOL , GxB_EQ_LAND_BOOL , GxB_ANY_LAND_BOOL , + GxB_LOR_LOR_BOOL , GxB_LXOR_LOR_BOOL , GxB_ANY_LOR_BOOL , + GxB_LAND_LAND_BOOL , GxB_EQ_LAND_BOOL , GxB_ANY_LAND_BOOL , GxB_LOR_LXOR_BOOL , GxB_LAND_LXOR_BOOL , GxB_LXOR_LXOR_BOOL , GxB_EQ_LXOR_BOOL , GxB_ANY_LXOR_BOOL , GxB_LOR_EQ_BOOL , GxB_LAND_EQ_BOOL , GxB_LXOR_EQ_BOOL , GxB_EQ_EQ_BOOL , GxB_ANY_EQ_BOOL , GxB_LOR_GT_BOOL , GxB_LAND_GT_BOOL , GxB_LXOR_GT_BOOL , GxB_EQ_GT_BOOL , GxB_ANY_GT_BOOL , @@ -2473,12 +2396,6 @@ GB_GLOBAL GrB_Semiring // GrB_* semirings //------------------------------------------------------------------------------ -// The v1.3 C API for GraphBLAS adds the following 124 predefined semirings, -// with GrB_* names. They are identical to 124 GxB_* semirings defined above, -// with the same name, except that GrB_LXNOR_LOR_SEMIRING_BOOL is identical to -// GxB_EQ_LOR_BOOL (since GrB_EQ_BOOL == GrB_LXNOR). The old names are listed -// below alongside each new name; the new GrB_* names are preferred. - // 12 kinds of GrB_* semirings are available for all 10 real non-boolean types: // PLUS_TIMES, PLUS_MIN, @@ -2489,9 +2406,6 @@ GB_GLOBAL GrB_Semiring // LOR_LAND, LAND_LOR, LXOR_LAND, LXNOR_LOR. -// GxB_* semirings corresponding to the equivalent GrB_* semiring are -// historical. - GB_GLOBAL GrB_Semiring //-------------------------------------------------------------------------- @@ -2499,165 +2413,165 @@ GB_GLOBAL GrB_Semiring //-------------------------------------------------------------------------- // PLUS_TIMES semirings for all 10 real, non-boolean types: - GrB_PLUS_TIMES_SEMIRING_INT8, // GxB_PLUS_TIMES_INT8 - GrB_PLUS_TIMES_SEMIRING_INT16, // GxB_PLUS_TIMES_INT16 - GrB_PLUS_TIMES_SEMIRING_INT32, // GxB_PLUS_TIMES_INT32 - GrB_PLUS_TIMES_SEMIRING_INT64, // GxB_PLUS_TIMES_INT64 - GrB_PLUS_TIMES_SEMIRING_UINT8, // GxB_PLUS_TIMES_UINT8 - GrB_PLUS_TIMES_SEMIRING_UINT16, // GxB_PLUS_TIMES_UINT16 - GrB_PLUS_TIMES_SEMIRING_UINT32, // GxB_PLUS_TIMES_UINT32 - GrB_PLUS_TIMES_SEMIRING_UINT64, // GxB_PLUS_TIMES_UINT64 - GrB_PLUS_TIMES_SEMIRING_FP32, // GxB_PLUS_TIMES_FP32 - GrB_PLUS_TIMES_SEMIRING_FP64, // GxB_PLUS_TIMES_FP64 + GrB_PLUS_TIMES_SEMIRING_INT8, + GrB_PLUS_TIMES_SEMIRING_INT16, + GrB_PLUS_TIMES_SEMIRING_INT32, + GrB_PLUS_TIMES_SEMIRING_INT64, + GrB_PLUS_TIMES_SEMIRING_UINT8, + GrB_PLUS_TIMES_SEMIRING_UINT16, + GrB_PLUS_TIMES_SEMIRING_UINT32, + GrB_PLUS_TIMES_SEMIRING_UINT64, + GrB_PLUS_TIMES_SEMIRING_FP32, + GrB_PLUS_TIMES_SEMIRING_FP64, // PLUS_MIN semirings for all 10 real, non-boolean types: - GrB_PLUS_MIN_SEMIRING_INT8, // GxB_PLUS_MIN_INT8 - GrB_PLUS_MIN_SEMIRING_INT16, // GxB_PLUS_MIN_INT16 - GrB_PLUS_MIN_SEMIRING_INT32, // GxB_PLUS_MIN_INT32 - GrB_PLUS_MIN_SEMIRING_INT64, // GxB_PLUS_MIN_INT64 - GrB_PLUS_MIN_SEMIRING_UINT8, // GxB_PLUS_MIN_UINT8 - GrB_PLUS_MIN_SEMIRING_UINT16, // GxB_PLUS_MIN_UINT16 - GrB_PLUS_MIN_SEMIRING_UINT32, // GxB_PLUS_MIN_UINT32 - GrB_PLUS_MIN_SEMIRING_UINT64, // GxB_PLUS_MIN_UINT64 - GrB_PLUS_MIN_SEMIRING_FP32, // GxB_PLUS_MIN_FP32 - GrB_PLUS_MIN_SEMIRING_FP64, // GxB_PLUS_MIN_FP64 + GrB_PLUS_MIN_SEMIRING_INT8, + GrB_PLUS_MIN_SEMIRING_INT16, + GrB_PLUS_MIN_SEMIRING_INT32, + GrB_PLUS_MIN_SEMIRING_INT64, + GrB_PLUS_MIN_SEMIRING_UINT8, + GrB_PLUS_MIN_SEMIRING_UINT16, + GrB_PLUS_MIN_SEMIRING_UINT32, + GrB_PLUS_MIN_SEMIRING_UINT64, + GrB_PLUS_MIN_SEMIRING_FP32, + GrB_PLUS_MIN_SEMIRING_FP64, //-------------------------------------------------------------------------- // 50 semirings with MIN monoids //-------------------------------------------------------------------------- // MIN_PLUS semirings for all 10 real, non-boolean types: - GrB_MIN_PLUS_SEMIRING_INT8, // GxB_MIN_PLUS_INT8 - GrB_MIN_PLUS_SEMIRING_INT16, // GxB_MIN_PLUS_INT16 - GrB_MIN_PLUS_SEMIRING_INT32, // GxB_MIN_PLUS_INT32 - GrB_MIN_PLUS_SEMIRING_INT64, // GxB_MIN_PLUS_INT64 - GrB_MIN_PLUS_SEMIRING_UINT8, // GxB_MIN_PLUS_UINT8 - GrB_MIN_PLUS_SEMIRING_UINT16, // GxB_MIN_PLUS_UINT16 - GrB_MIN_PLUS_SEMIRING_UINT32, // GxB_MIN_PLUS_UINT32 - GrB_MIN_PLUS_SEMIRING_UINT64, // GxB_MIN_PLUS_UINT64 - GrB_MIN_PLUS_SEMIRING_FP32, // GxB_MIN_PLUS_FP32 - GrB_MIN_PLUS_SEMIRING_FP64, // GxB_MIN_PLUS_FP64 + GrB_MIN_PLUS_SEMIRING_INT8, + GrB_MIN_PLUS_SEMIRING_INT16, + GrB_MIN_PLUS_SEMIRING_INT32, + GrB_MIN_PLUS_SEMIRING_INT64, + GrB_MIN_PLUS_SEMIRING_UINT8, + GrB_MIN_PLUS_SEMIRING_UINT16, + GrB_MIN_PLUS_SEMIRING_UINT32, + GrB_MIN_PLUS_SEMIRING_UINT64, + GrB_MIN_PLUS_SEMIRING_FP32, + GrB_MIN_PLUS_SEMIRING_FP64, // MIN_TIMES semirings for all 10 real, non-boolean types: - GrB_MIN_TIMES_SEMIRING_INT8, // GxB_MIN_TIMES_INT8 - GrB_MIN_TIMES_SEMIRING_INT16, // GxB_MIN_TIMES_INT16 - GrB_MIN_TIMES_SEMIRING_INT32, // GxB_MIN_TIMES_INT32 - GrB_MIN_TIMES_SEMIRING_INT64, // GxB_MIN_TIMES_INT64 - GrB_MIN_TIMES_SEMIRING_UINT8, // GxB_MIN_TIMES_UINT8 - GrB_MIN_TIMES_SEMIRING_UINT16, // GxB_MIN_TIMES_UINT16 - GrB_MIN_TIMES_SEMIRING_UINT32, // GxB_MIN_TIMES_UINT32 - GrB_MIN_TIMES_SEMIRING_UINT64, // GxB_MIN_TIMES_UINT64 - GrB_MIN_TIMES_SEMIRING_FP32, // GxB_MIN_TIMES_FP32 - GrB_MIN_TIMES_SEMIRING_FP64, // GxB_MIN_TIMES_FP64 + GrB_MIN_TIMES_SEMIRING_INT8, + GrB_MIN_TIMES_SEMIRING_INT16, + GrB_MIN_TIMES_SEMIRING_INT32, + GrB_MIN_TIMES_SEMIRING_INT64, + GrB_MIN_TIMES_SEMIRING_UINT8, + GrB_MIN_TIMES_SEMIRING_UINT16, + GrB_MIN_TIMES_SEMIRING_UINT32, + GrB_MIN_TIMES_SEMIRING_UINT64, + GrB_MIN_TIMES_SEMIRING_FP32, + GrB_MIN_TIMES_SEMIRING_FP64, // MIN_FIRST semirings for all 10 real, non-boolean types: - GrB_MIN_FIRST_SEMIRING_INT8, // GxB_MIN_FIRST_INT8 - GrB_MIN_FIRST_SEMIRING_INT16, // GxB_MIN_FIRST_INT16 - GrB_MIN_FIRST_SEMIRING_INT32, // GxB_MIN_FIRST_INT32 - GrB_MIN_FIRST_SEMIRING_INT64, // GxB_MIN_FIRST_INT64 - GrB_MIN_FIRST_SEMIRING_UINT8, // GxB_MIN_FIRST_UINT8 - GrB_MIN_FIRST_SEMIRING_UINT16, // GxB_MIN_FIRST_UINT16 - GrB_MIN_FIRST_SEMIRING_UINT32, // GxB_MIN_FIRST_UINT32 - GrB_MIN_FIRST_SEMIRING_UINT64, // GxB_MIN_FIRST_UINT64 - GrB_MIN_FIRST_SEMIRING_FP32, // GxB_MIN_FIRST_FP32 - GrB_MIN_FIRST_SEMIRING_FP64, // GxB_MIN_FIRST_FP64 + GrB_MIN_FIRST_SEMIRING_INT8, + GrB_MIN_FIRST_SEMIRING_INT16, + GrB_MIN_FIRST_SEMIRING_INT32, + GrB_MIN_FIRST_SEMIRING_INT64, + GrB_MIN_FIRST_SEMIRING_UINT8, + GrB_MIN_FIRST_SEMIRING_UINT16, + GrB_MIN_FIRST_SEMIRING_UINT32, + GrB_MIN_FIRST_SEMIRING_UINT64, + GrB_MIN_FIRST_SEMIRING_FP32, + GrB_MIN_FIRST_SEMIRING_FP64, // MIN_SECOND semirings for all 10 real, non-boolean types: - GrB_MIN_SECOND_SEMIRING_INT8, // GxB_MIN_SECOND_INT8 - GrB_MIN_SECOND_SEMIRING_INT16, // GxB_MIN_SECOND_INT16 - GrB_MIN_SECOND_SEMIRING_INT32, // GxB_MIN_SECOND_INT32 - GrB_MIN_SECOND_SEMIRING_INT64, // GxB_MIN_SECOND_INT64 - GrB_MIN_SECOND_SEMIRING_UINT8, // GxB_MIN_SECOND_UINT8 - GrB_MIN_SECOND_SEMIRING_UINT16, // GxB_MIN_SECOND_UINT16 - GrB_MIN_SECOND_SEMIRING_UINT32, // GxB_MIN_SECOND_UINT32 - GrB_MIN_SECOND_SEMIRING_UINT64, // GxB_MIN_SECOND_UINT64 - GrB_MIN_SECOND_SEMIRING_FP32, // GxB_MIN_SECOND_FP32 - GrB_MIN_SECOND_SEMIRING_FP64, // GxB_MIN_SECOND_FP64 + GrB_MIN_SECOND_SEMIRING_INT8, + GrB_MIN_SECOND_SEMIRING_INT16, + GrB_MIN_SECOND_SEMIRING_INT32, + GrB_MIN_SECOND_SEMIRING_INT64, + GrB_MIN_SECOND_SEMIRING_UINT8, + GrB_MIN_SECOND_SEMIRING_UINT16, + GrB_MIN_SECOND_SEMIRING_UINT32, + GrB_MIN_SECOND_SEMIRING_UINT64, + GrB_MIN_SECOND_SEMIRING_FP32, + GrB_MIN_SECOND_SEMIRING_FP64, // MIN_MAX semirings for all 10 real, non-boolean types: - GrB_MIN_MAX_SEMIRING_INT8, // GxB_MIN_MAX_INT8 - GrB_MIN_MAX_SEMIRING_INT16, // GxB_MIN_MAX_INT16 - GrB_MIN_MAX_SEMIRING_INT32, // GxB_MIN_MAX_INT32 - GrB_MIN_MAX_SEMIRING_INT64, // GxB_MIN_MAX_INT64 - GrB_MIN_MAX_SEMIRING_UINT8, // GxB_MIN_MAX_UINT8 - GrB_MIN_MAX_SEMIRING_UINT16, // GxB_MIN_MAX_UINT16 - GrB_MIN_MAX_SEMIRING_UINT32, // GxB_MIN_MAX_UINT32 - GrB_MIN_MAX_SEMIRING_UINT64, // GxB_MIN_MAX_UINT64 - GrB_MIN_MAX_SEMIRING_FP32, // GxB_MIN_MAX_FP32 - GrB_MIN_MAX_SEMIRING_FP64, // GxB_MIN_MAX_FP64 + GrB_MIN_MAX_SEMIRING_INT8, + GrB_MIN_MAX_SEMIRING_INT16, + GrB_MIN_MAX_SEMIRING_INT32, + GrB_MIN_MAX_SEMIRING_INT64, + GrB_MIN_MAX_SEMIRING_UINT8, + GrB_MIN_MAX_SEMIRING_UINT16, + GrB_MIN_MAX_SEMIRING_UINT32, + GrB_MIN_MAX_SEMIRING_UINT64, + GrB_MIN_MAX_SEMIRING_FP32, + GrB_MIN_MAX_SEMIRING_FP64, //-------------------------------------------------------------------------- // 50 semirings with MAX monoids //-------------------------------------------------------------------------- // MAX_PLUS semirings for all 10 real, non-boolean types - GrB_MAX_PLUS_SEMIRING_INT8, // GxB_MAX_PLUS_INT8 - GrB_MAX_PLUS_SEMIRING_INT16, // GxB_MAX_PLUS_INT16 - GrB_MAX_PLUS_SEMIRING_INT32, // GxB_MAX_PLUS_INT32 - GrB_MAX_PLUS_SEMIRING_INT64, // GxB_MAX_PLUS_INT64 - GrB_MAX_PLUS_SEMIRING_UINT8, // GxB_MAX_PLUS_UINT8 - GrB_MAX_PLUS_SEMIRING_UINT16, // GxB_MAX_PLUS_UINT16 - GrB_MAX_PLUS_SEMIRING_UINT32, // GxB_MAX_PLUS_UINT32 - GrB_MAX_PLUS_SEMIRING_UINT64, // GxB_MAX_PLUS_UINT64 - GrB_MAX_PLUS_SEMIRING_FP32, // GxB_MAX_PLUS_FP32 - GrB_MAX_PLUS_SEMIRING_FP64, // GxB_MAX_PLUS_FP64 + GrB_MAX_PLUS_SEMIRING_INT8, + GrB_MAX_PLUS_SEMIRING_INT16, + GrB_MAX_PLUS_SEMIRING_INT32, + GrB_MAX_PLUS_SEMIRING_INT64, + GrB_MAX_PLUS_SEMIRING_UINT8, + GrB_MAX_PLUS_SEMIRING_UINT16, + GrB_MAX_PLUS_SEMIRING_UINT32, + GrB_MAX_PLUS_SEMIRING_UINT64, + GrB_MAX_PLUS_SEMIRING_FP32, + GrB_MAX_PLUS_SEMIRING_FP64, // MAX_TIMES semirings for all 10 real, non-boolean types: - GrB_MAX_TIMES_SEMIRING_INT8, // GxB_MAX_TIMES_INT8 - GrB_MAX_TIMES_SEMIRING_INT16, // GxB_MAX_TIMES_INT16 - GrB_MAX_TIMES_SEMIRING_INT32, // GxB_MAX_TIMES_INT32 - GrB_MAX_TIMES_SEMIRING_INT64, // GxB_MAX_TIMES_INT64 - GrB_MAX_TIMES_SEMIRING_UINT8, // GxB_MAX_TIMES_UINT8 - GrB_MAX_TIMES_SEMIRING_UINT16, // GxB_MAX_TIMES_UINT16 - GrB_MAX_TIMES_SEMIRING_UINT32, // GxB_MAX_TIMES_UINT32 - GrB_MAX_TIMES_SEMIRING_UINT64, // GxB_MAX_TIMES_UINT64 - GrB_MAX_TIMES_SEMIRING_FP32, // GxB_MAX_TIMES_FP32 - GrB_MAX_TIMES_SEMIRING_FP64, // GxB_MAX_TIMES_FP64 + GrB_MAX_TIMES_SEMIRING_INT8, + GrB_MAX_TIMES_SEMIRING_INT16, + GrB_MAX_TIMES_SEMIRING_INT32, + GrB_MAX_TIMES_SEMIRING_INT64, + GrB_MAX_TIMES_SEMIRING_UINT8, + GrB_MAX_TIMES_SEMIRING_UINT16, + GrB_MAX_TIMES_SEMIRING_UINT32, + GrB_MAX_TIMES_SEMIRING_UINT64, + GrB_MAX_TIMES_SEMIRING_FP32, + GrB_MAX_TIMES_SEMIRING_FP64, // MAX_FIRST semirings for all 10 real, non-boolean types: - GrB_MAX_FIRST_SEMIRING_INT8, // GxB_MAX_FIRST_INT8 - GrB_MAX_FIRST_SEMIRING_INT16, // GxB_MAX_FIRST_INT16 - GrB_MAX_FIRST_SEMIRING_INT32, // GxB_MAX_FIRST_INT32 - GrB_MAX_FIRST_SEMIRING_INT64, // GxB_MAX_FIRST_INT64 - GrB_MAX_FIRST_SEMIRING_UINT8, // GxB_MAX_FIRST_UINT8 - GrB_MAX_FIRST_SEMIRING_UINT16, // GxB_MAX_FIRST_UINT16 - GrB_MAX_FIRST_SEMIRING_UINT32, // GxB_MAX_FIRST_UINT32 - GrB_MAX_FIRST_SEMIRING_UINT64, // GxB_MAX_FIRST_UINT64 - GrB_MAX_FIRST_SEMIRING_FP32, // GxB_MAX_FIRST_FP32 - GrB_MAX_FIRST_SEMIRING_FP64, // GxB_MAX_FIRST_FP64 + GrB_MAX_FIRST_SEMIRING_INT8, + GrB_MAX_FIRST_SEMIRING_INT16, + GrB_MAX_FIRST_SEMIRING_INT32, + GrB_MAX_FIRST_SEMIRING_INT64, + GrB_MAX_FIRST_SEMIRING_UINT8, + GrB_MAX_FIRST_SEMIRING_UINT16, + GrB_MAX_FIRST_SEMIRING_UINT32, + GrB_MAX_FIRST_SEMIRING_UINT64, + GrB_MAX_FIRST_SEMIRING_FP32, + GrB_MAX_FIRST_SEMIRING_FP64, // MAX_SECOND semirings for all 10 real, non-boolean types: - GrB_MAX_SECOND_SEMIRING_INT8, // GxB_MAX_SECOND_INT8 - GrB_MAX_SECOND_SEMIRING_INT16, // GxB_MAX_SECOND_INT16 - GrB_MAX_SECOND_SEMIRING_INT32, // GxB_MAX_SECOND_INT32 - GrB_MAX_SECOND_SEMIRING_INT64, // GxB_MAX_SECOND_INT64 - GrB_MAX_SECOND_SEMIRING_UINT8, // GxB_MAX_SECOND_UINT8 - GrB_MAX_SECOND_SEMIRING_UINT16, // GxB_MAX_SECOND_UINT16 - GrB_MAX_SECOND_SEMIRING_UINT32, // GxB_MAX_SECOND_UINT32 - GrB_MAX_SECOND_SEMIRING_UINT64, // GxB_MAX_SECOND_UINT64 - GrB_MAX_SECOND_SEMIRING_FP32, // GxB_MAX_SECOND_FP32 - GrB_MAX_SECOND_SEMIRING_FP64, // GxB_MAX_SECOND_FP64 + GrB_MAX_SECOND_SEMIRING_INT8, + GrB_MAX_SECOND_SEMIRING_INT16, + GrB_MAX_SECOND_SEMIRING_INT32, + GrB_MAX_SECOND_SEMIRING_INT64, + GrB_MAX_SECOND_SEMIRING_UINT8, + GrB_MAX_SECOND_SEMIRING_UINT16, + GrB_MAX_SECOND_SEMIRING_UINT32, + GrB_MAX_SECOND_SEMIRING_UINT64, + GrB_MAX_SECOND_SEMIRING_FP32, + GrB_MAX_SECOND_SEMIRING_FP64, // MAX_MIN semirings for all 10 real, non-boolean types: - GrB_MAX_MIN_SEMIRING_INT8, // GxB_MAX_MIN_INT8 - GrB_MAX_MIN_SEMIRING_INT16, // GxB_MAX_MIN_INT16 - GrB_MAX_MIN_SEMIRING_INT32, // GxB_MAX_MIN_INT32 - GrB_MAX_MIN_SEMIRING_INT64, // GxB_MAX_MIN_INT64 - GrB_MAX_MIN_SEMIRING_UINT8, // GxB_MAX_MIN_UINT8 - GrB_MAX_MIN_SEMIRING_UINT16, // GxB_MAX_MIN_UINT16 - GrB_MAX_MIN_SEMIRING_UINT32, // GxB_MAX_MIN_UINT32 - GrB_MAX_MIN_SEMIRING_UINT64, // GxB_MAX_MIN_UINT64 - GrB_MAX_MIN_SEMIRING_FP32, // GxB_MAX_MIN_FP32 - GrB_MAX_MIN_SEMIRING_FP64, // GxB_MAX_MIN_FP64 + GrB_MAX_MIN_SEMIRING_INT8, + GrB_MAX_MIN_SEMIRING_INT16, + GrB_MAX_MIN_SEMIRING_INT32, + GrB_MAX_MIN_SEMIRING_INT64, + GrB_MAX_MIN_SEMIRING_UINT8, + GrB_MAX_MIN_SEMIRING_UINT16, + GrB_MAX_MIN_SEMIRING_UINT32, + GrB_MAX_MIN_SEMIRING_UINT64, + GrB_MAX_MIN_SEMIRING_FP32, + GrB_MAX_MIN_SEMIRING_FP64, //-------------------------------------------------------------------------- // 4 boolean semirings: //-------------------------------------------------------------------------- - GrB_LOR_LAND_SEMIRING_BOOL, // GxB_LOR_LAND_BOOL - GrB_LAND_LOR_SEMIRING_BOOL, // GxB_LAND_LOR_BOOL - GrB_LXOR_LAND_SEMIRING_BOOL, // GxB_LXOR_LAND_BOOL - GrB_LXNOR_LOR_SEMIRING_BOOL ; // GxB_EQ_LOR_BOOL (note EQ == LXNOR) + GrB_LOR_LAND_SEMIRING_BOOL, + GrB_LAND_LOR_SEMIRING_BOOL, + GrB_LXOR_LAND_SEMIRING_BOOL, + GrB_LXNOR_LOR_SEMIRING_BOOL ; //============================================================================== // GxB_fprint and GxB_print: print the contents of a GraphBLAS object @@ -2675,7 +2589,7 @@ typedef enum GxB_Print_Level ; //============================================================================== -// GrB import/export +// GrB_import/GrB_export //============================================================================== // The GrB C API specification supports 3 formats: @@ -2687,6 +2601,20 @@ typedef enum } GrB_Format ; +typedef enum +{ + GxB_BY_ROW = 0, // matrix is held by row + GxB_BY_COL = 1, // matrix is held by column + GxB_NO_FORMAT = -1 // row/column storage is not defined +} +GxB_Format_Value ; + +// The default format is by row. These constants are defined as GB_GLOBAL +// const, so that if SuiteSparse:GraphBLAS is recompiled with a different +// default format, and the application is relinked but not recompiled, it will +// acquire the new default values. +GB_GLOBAL const GxB_Format_Value GxB_FORMAT_DEFAULT ; + //============================================================================== // serialize/deserialize compression levels //============================================================================== @@ -2736,22 +2664,6 @@ GrB_Info GxB_init // start up GraphBLAS and also define malloc, etc GrB_Info GrB_finalize (void) ; // finish GraphBLAS -//============================================================================== -// GrB_getVersion: GraphBLAS 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 - unsigned int *subversion // returns GRB_SUBVERSION -) ; - //============================================================================== // GrB_Descriptor: the GraphBLAS descriptor //============================================================================== @@ -2761,16 +2673,6 @@ GrB_Info GrB_Descriptor_new // create a new descriptor GrB_Descriptor *descriptor // handle of descriptor to create ) ; -// 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 ( GrB_Descriptor *descriptor // handle of descriptor to free @@ -2873,10 +2775,6 @@ GrB_Info GxB_Type_new // create a new named GraphBLAS type const char *type_defn // typedef for the type (no max length) ) ; -// 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. @@ -2915,12 +2813,6 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator const char *unop_defn // definition of the user function ) ; -// 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 ( GrB_UnaryOp *unaryop // handle of unary operator to free @@ -2952,26 +2844,40 @@ GrB_Info GxB_BinaryOp_new const char *binop_defn // definition of the user function ) ; -// 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 ( GrB_BinaryOp *binaryop // handle of binary operator to free ) ; //============================================================================== -// GxB_SelectOp: select operators (DEPRECATED: do not use) +// GxB_IndexBinaryOp: index binary operators //============================================================================== -// historical; use GrB_select and GrB_IndexUnaryOp instead: -GrB_Info GxB_SelectOp_xtype (GrB_Type *xtype, GxB_SelectOp selectop) ; -GrB_Info GxB_SelectOp_ttype (GrB_Type *ttype, GxB_SelectOp selectop) ; +// GxB_IndexBinaryOp_new creates a new user-defined index binary op +GrB_Info GxB_IndexBinaryOp_new +( + GxB_IndexBinaryOp *op, // handle for the new index binary operator + GxB_index_binary_function function, // pointer to the index binary function + GrB_Type ztype, // type of output z + GrB_Type xtype, // type of input x + GrB_Type ytype, // type of input y + GrB_Type theta_type, // type of input theta + const char *idxbinop_name, // name of the user function + const char *idxbinop_defn // definition of the user function +) ; + +GrB_Info GxB_IndexBinaryOp_free // free a user-created index binary operator +( + GxB_IndexBinaryOp *op // handle of index binary operator to free +) ; + +// GxB_BinaryOp_new_IndexOp: create a new binary op from an index binary op +GrB_Info GxB_BinaryOp_new_IndexOp +( + GrB_BinaryOp *binop, // handle of binary op to create + GxB_IndexBinaryOp idxbinop, // based on this index binary op + GrB_Scalar theta // theta value to bind to the new binary op +) ; //============================================================================== // GrB_IndexUnaryOp: a unary operator that depends on the row/col indices @@ -2999,11 +2905,6 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp const char *idxop_defn // definition of the user function ) ; -// 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 ( GrB_IndexUnaryOp *op // handle of IndexUnary to free @@ -3013,6 +2914,9 @@ GrB_Info GrB_IndexUnaryOp_free // free a user-created IndexUnaryOp // GrB_Monoid //============================================================================== +// The GrB_BinaryOp must be associative and commutative (but this cannot be +// checked). It cannot be based on a GxB_IndexBinaryOp. + GrB_Info GrB_Monoid_new_BOOL // create a new boolean monoid ( GrB_Monoid *monoid, // handle of monoid to create @@ -3271,11 +3175,6 @@ GrB_Info GxB_Monoid_terminal_new // create a monoid (monoid, op, identity, terminal) #endif -// 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 ( GrB_Monoid *monoid // handle of monoid to free @@ -3285,6 +3184,9 @@ GrB_Info GrB_Monoid_free // free a user-created monoid // GrB_Semiring //============================================================================== +// The multiply op can be any GrB_BinaryOp, including those based on a +// GxB_IndexBinaryOp. + GrB_Info GrB_Semiring_new // create a semiring ( GrB_Semiring *semiring, // handle of semiring to create @@ -3292,10 +3194,6 @@ GrB_Info GrB_Semiring_new // create a semiring GrB_BinaryOp multiply // multiply operator of the semiring ) ; -// 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 ( GrB_Semiring *semiring // handle of semiring to free @@ -3331,10 +3229,6 @@ GrB_Info GrB_Scalar_nvals // get the number of entries in a GrB_Scalar 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 ( size_t *size, // # of bytes used by the scalar s @@ -3346,13 +3240,6 @@ GrB_Info GrB_Scalar_free // free a GrB_Scalar GrB_Scalar *s // handle of GrB_Scalar to free ) ; -// historical names identical to GrB_Scalar_methods above: -GrB_Info GxB_Scalar_new (GrB_Scalar *s, GrB_Type type) ; -GrB_Info GxB_Scalar_dup (GrB_Scalar *s, const GrB_Scalar t) ; -GrB_Info GxB_Scalar_clear (GrB_Scalar s) ; -GrB_Info GxB_Scalar_nvals (GrB_Index *nvals, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_free (GrB_Scalar *s) ; - //------------------------------------------------------------------------------ // GrB_Scalar_setElement //------------------------------------------------------------------------------ @@ -3444,20 +3331,6 @@ GrB_Info GrB_Scalar_setElement_UDT // s = x void *x // user scalar to assign to s ) ; -// historical names identical to GrB_Scalar_methods above: -GrB_Info GxB_Scalar_setElement_BOOL (GrB_Scalar s, bool x) ; -GrB_Info GxB_Scalar_setElement_INT8 (GrB_Scalar s, int8_t x) ; -GrB_Info GxB_Scalar_setElement_INT16 (GrB_Scalar s, int16_t x) ; -GrB_Info GxB_Scalar_setElement_INT32 (GrB_Scalar s, int32_t x) ; -GrB_Info GxB_Scalar_setElement_INT64 (GrB_Scalar s, int64_t x) ; -GrB_Info GxB_Scalar_setElement_UINT8 (GrB_Scalar s, uint8_t x) ; -GrB_Info GxB_Scalar_setElement_UINT16 (GrB_Scalar s, uint16_t x) ; -GrB_Info GxB_Scalar_setElement_UINT32 (GrB_Scalar s, uint32_t x) ; -GrB_Info GxB_Scalar_setElement_UINT64 (GrB_Scalar s, uint64_t x) ; -GrB_Info GxB_Scalar_setElement_FP32 (GrB_Scalar s, float x) ; -GrB_Info GxB_Scalar_setElement_FP64 (GrB_Scalar s, double x) ; -GrB_Info GxB_Scalar_setElement_UDT (GrB_Scalar s, void *x) ; - // Type-generic version: x can be any supported C type or void * for a // user-defined type. @@ -3477,9 +3350,6 @@ GrB_Info GrB_Scalar_setElement // s = x GB_CASES (GrB, Scalar_setElement) \ ) \ (s, x) - -// historical; use GrB_Scalar_setElement instead: -#define GxB_Scalar_setElement(s,x) GrB_Scalar_setElement (s, x) #endif //------------------------------------------------------------------------------ @@ -3573,20 +3443,6 @@ GrB_Info GrB_Scalar_extractElement_UDT // x = s const GrB_Scalar s // GrB_Scalar to extract an entry from ) ; -// historical names identical to GrB_Scalar_methods above: -GrB_Info GxB_Scalar_extractElement_BOOL (bool *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_INT8 (int8_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_INT16 (int16_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_INT32 (int32_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_INT64 (int64_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UINT8 (uint8_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UINT16 (uint16_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UINT32 (uint32_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UINT64 (uint64_t *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_FP32 (float *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_FP64 (double *x, const GrB_Scalar s) ; -GrB_Info GxB_Scalar_extractElement_UDT (void *x, const GrB_Scalar s) ; - // Type-generic version: x can be a pointer to any supported C type or void * // for a user-defined type. @@ -3608,9 +3464,6 @@ GrB_Info GrB_Scalar_extractElement // x = s GB_PCASES (GrB, Scalar_extractElement) \ ) \ (x, s) - -// historical; use GrB_Scalar_extractElement instead: -#define GxB_Scalar_extractElement(x,s) GrB_Scalar_extractElement (x, s) #endif //============================================================================== @@ -3651,10 +3504,6 @@ GrB_Info GrB_Vector_nvals // get the number of entries in a vector 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 ( size_t *size, // # of bytes used by the vector v @@ -3679,6 +3528,8 @@ GrB_Info GrB_Vector_free // free a vector // GrB_Vector_build: w = sparse (I,1,X), but using any // associative operator to assemble duplicate entries. +// The dup operator cannot be based on a GxB_IndexBinaryOp. + GrB_Info GrB_Vector_build_BOOL // build a vector from (I,X) tuples ( GrB_Vector w, // vector to build @@ -4133,8 +3984,8 @@ GrB_Info GrB_Vector_removeElement // GrB_Vector_extractTuples //------------------------------------------------------------------------------ -// Extracts all tuples from a vector, like [I,~,X] = find (v). If -// any parameter I and/or X is NULL, then that component is not extracted. For +// Extracts all tuples from a vector, like [I,~,X] = find (v). If any +// parameter I and/or X is NULL, then that component is not extracted. For // example, to extract just the row indices, pass I as non-NULL, and X as NULL. // This is like [I,~,~] = find (v). @@ -4317,10 +4168,6 @@ GrB_Info GrB_Matrix_nvals // get the number of entries in a matrix 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 ( size_t *size, // # of bytes used by the matrix A @@ -4344,6 +4191,7 @@ GrB_Info GrB_Matrix_free // free a matrix // GrB_Matrix_build: C = sparse (I,J,X), but using any // associative operator to assemble duplicate entries. +// The dup operator cannot be based on a GxB_IndexBinaryOp. GrB_Info GrB_Matrix_build_BOOL // build a matrix from (I,J,X) tuples ( @@ -5148,71 +4996,6 @@ GrB_Info GxB_Context_disengage // disengage a Context GxB_Context Context // Context to disengage ) ; -//============================================================================== -// GxB_set and GxB_get: historical; use GrB_set and GrB_get instead -//============================================================================== - -// 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,...) \ - _Generic \ - ( \ - (arg1), \ - default: GxB_Global_Option_set , \ - GxB_Option_Field : GxB_Global_Option_set , \ - GrB_Vector : GxB_Vector_Option_set , \ - GrB_Matrix : GxB_Matrix_Option_set , \ - GrB_Descriptor : GxB_Desc_set , \ - GxB_Context : GxB_Context_set \ - ) \ - (arg1, __VA_ARGS__) - -#define GxB_get(arg1,...) \ - _Generic \ - ( \ - (arg1), \ - default: GxB_Global_Option_get , \ - GxB_Option_Field : GxB_Global_Option_get , \ - GrB_Vector : GxB_Vector_Option_get , \ - GrB_Matrix : GxB_Matrix_Option_get , \ - GrB_Descriptor : GxB_Desc_get , \ - GxB_Context : GxB_Context_get \ - ) \ - (arg1, __VA_ARGS__) -#endif - //============================================================================== // GrB_set and GrB_get //============================================================================== @@ -5239,11 +5022,16 @@ 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 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) ; @@ -5263,6 +5051,17 @@ GrB_Info GrB_BinaryOp_get_INT32 (GrB_BinaryOp, int32_t * , GrB_Field) ; GrB_Info GrB_BinaryOp_get_SIZE (GrB_BinaryOp, size_t * , GrB_Field) ; GrB_Info GrB_BinaryOp_get_VOID (GrB_BinaryOp, void * , GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_Scalar (GxB_IndexBinaryOp, GrB_Scalar, + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_String (GxB_IndexBinaryOp, char * , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_INT32 (GxB_IndexBinaryOp, int32_t * , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_SIZE (GxB_IndexBinaryOp, size_t * , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_get_VOID (GxB_IndexBinaryOp, void * , + GrB_Field) ; + GrB_Info GrB_Monoid_get_Scalar (GrB_Monoid, GrB_Scalar, GrB_Field) ; GrB_Info GrB_Monoid_get_String (GrB_Monoid, char * , GrB_Field) ; GrB_Info GrB_Monoid_get_INT32 (GrB_Monoid, int32_t * , GrB_Field) ; @@ -5365,6 +5164,16 @@ GrB_Info GxB_Context_get_VOID (GxB_Context, void * , GrB_Field) ; size_t * : GrB_BinaryOp_get_SIZE , \ void * : GrB_BinaryOp_get_VOID \ ) , \ + GxB_IndexBinaryOp : \ + _Generic \ + ( \ + (value), \ + GrB_Scalar : GxB_IndexBinaryOp_get_Scalar , \ + char * : GxB_IndexBinaryOp_get_String , \ + int32_t * : GxB_IndexBinaryOp_get_INT32 , \ + size_t * : GxB_IndexBinaryOp_get_SIZE , \ + void * : GxB_IndexBinaryOp_get_VOID \ + ) , \ GrB_Monoid : \ _Generic \ ( \ @@ -5476,13 +5285,22 @@ 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) ; + size_t) ; GrB_Info GrB_BinaryOp_set_Scalar (GrB_BinaryOp, GrB_Scalar, GrB_Field) ; GrB_Info GrB_BinaryOp_set_String (GrB_BinaryOp, char * , GrB_Field) ; GrB_Info GrB_BinaryOp_set_INT32 (GrB_BinaryOp, int32_t , GrB_Field) ; GrB_Info GrB_BinaryOp_set_VOID (GrB_BinaryOp, void * , GrB_Field, size_t) ; +GrB_Info GxB_IndexBinaryOp_set_Scalar (GxB_IndexBinaryOp, GrB_Scalar, + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_set_String (GxB_IndexBinaryOp, char * , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_set_INT32 (GxB_IndexBinaryOp, int32_t , + GrB_Field) ; +GrB_Info GxB_IndexBinaryOp_set_VOID (GxB_IndexBinaryOp, void * , + GrB_Field, size_t) ; + GrB_Info GrB_Monoid_set_Scalar (GrB_Monoid, GrB_Scalar, GrB_Field) ; GrB_Info GrB_Monoid_set_String (GrB_Monoid, char * , GrB_Field) ; GrB_Info GrB_Monoid_set_INT32 (GrB_Monoid, int32_t , GrB_Field) ; @@ -5574,6 +5392,15 @@ GrB_Info GxB_Context_set_VOID (GxB_Context, void * , GrB_Field, size_t) ; int32_t : GrB_BinaryOp_set_INT32 , \ void * : GrB_BinaryOp_set_VOID \ ) , \ + GxB_IndexBinaryOp : \ + _Generic \ + ( \ + (value), \ + GrB_Scalar : GxB_IndexBinaryOp_set_Scalar , \ + char * : GxB_IndexBinaryOp_set_String , \ + int32_t : GxB_IndexBinaryOp_set_INT32 , \ + void * : GxB_IndexBinaryOp_set_VOID \ + ) , \ GrB_Monoid : \ _Generic \ ( \ @@ -5644,6 +5471,7 @@ GrB_Info GxB_Context_set_VOID (GxB_Context, void * , GrB_Field, size_t) ; GrB_UnaryOp *: GrB_UnaryOp_free , \ GrB_BinaryOp *: GrB_BinaryOp_free , \ GrB_IndexUnaryOp *: GrB_IndexUnaryOp_free , \ + GxB_IndexBinaryOp*: GxB_IndexBinaryOp_free, \ GrB_Monoid *: GrB_Monoid_free , \ GrB_Semiring *: GrB_Semiring_free , \ GrB_Scalar *: GrB_Scalar_free , \ @@ -5666,6 +5494,7 @@ GrB_Info GrB_Type_wait (GrB_Type type , GrB_WaitMode waitmode); GrB_Info GrB_UnaryOp_wait (GrB_UnaryOp op , GrB_WaitMode waitmode); GrB_Info GrB_BinaryOp_wait (GrB_BinaryOp op , GrB_WaitMode waitmode); GrB_Info GrB_IndexUnaryOp_wait (GrB_IndexUnaryOp op , GrB_WaitMode waitmode); +GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp op , GrB_WaitMode waitmode); GrB_Info GrB_Monoid_wait (GrB_Monoid monoid , GrB_WaitMode waitmode); GrB_Info GrB_Semiring_wait (GrB_Semiring semiring, GrB_WaitMode waitmode); GrB_Info GrB_Descriptor_wait (GrB_Descriptor desc , GrB_WaitMode waitmode); @@ -5684,6 +5513,7 @@ GrB_Info GxB_Context_wait (GxB_Context Context , GrB_WaitMode waitmode); GrB_UnaryOp : GrB_UnaryOp_wait , \ GrB_BinaryOp : GrB_BinaryOp_wait , \ GrB_IndexUnaryOp : GrB_IndexUnaryOp_wait , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_wait, \ GrB_Monoid : GrB_Monoid_wait , \ GrB_Semiring : GrB_Semiring_wait , \ GrB_Scalar : GrB_Scalar_wait , \ @@ -5695,9 +5525,6 @@ GrB_Info GxB_Context_wait (GxB_Context Context , GrB_WaitMode waitmode); (object, waitmode) #endif -// NOTE: GxB_Scalar_wait is historical; use GrB_Scalar_wait instead -GrB_Info GxB_Scalar_wait (GrB_Scalar *s) ; - //============================================================================== // GrB_error: error handling //============================================================================== @@ -5710,16 +5537,18 @@ GrB_Info GxB_Scalar_wait (GrB_Scalar *s) ; GrB_Info GrB_Type_error (const char **error, const GrB_Type type) ; GrB_Info GrB_UnaryOp_error (const char **error, const GrB_UnaryOp op) ; GrB_Info GrB_BinaryOp_error (const char **error, const GrB_BinaryOp op) ; -GrB_Info GrB_IndexUnaryOp_error (const char **error, const GrB_IndexUnaryOp op) ; +GrB_Info GrB_IndexUnaryOp_error (const char **error, + const GrB_IndexUnaryOp op) ; +GrB_Info GxB_IndexBinaryOp_error(const char **error, + const GxB_IndexBinaryOp op); GrB_Info GrB_Monoid_error (const char **error, const GrB_Monoid monoid) ; -GrB_Info GrB_Semiring_error (const char **error, const GrB_Semiring semiring) ; +GrB_Info GrB_Semiring_error (const char **error, const GrB_Semiring + semiring) ; GrB_Info GrB_Scalar_error (const char **error, const GrB_Scalar s) ; GrB_Info GrB_Vector_error (const char **error, const GrB_Vector v) ; GrB_Info GrB_Matrix_error (const char **error, const GrB_Matrix A) ; GrB_Info GrB_Descriptor_error (const char **error, const GrB_Descriptor d) ; -// GxB_Scalar_error is historical: use GrB_Scalar_error instead -GrB_Info GxB_Scalar_error (const char **error, const GrB_Scalar s) ; -GrB_Info GxB_Context_error (const char **error, const GxB_Context Context); +GrB_Info GxB_Context_error (const char **error, const GxB_Context c) ; // GrB_error (error,object) polymorphic function: #if GxB_STDC_VERSION >= 201112L @@ -5731,6 +5560,7 @@ GrB_Info GxB_Context_error (const char **error, const GxB_Context Context); GrB_UnaryOp : GrB_UnaryOp_error , \ GrB_BinaryOp : GrB_BinaryOp_error , \ GrB_IndexUnaryOp : GrB_IndexUnaryOp_error , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_error, \ GrB_Monoid : GrB_Monoid_error , \ GrB_Semiring : GrB_Semiring_error , \ GrB_Scalar : GrB_Scalar_error , \ @@ -5746,6 +5576,8 @@ GrB_Info GxB_Context_error (const char **error, const GxB_Context Context); // GrB_mxm, vxm, mxv: matrix multiplication over a semiring //============================================================================== +// No accum operator in any method can be based on a GxB_IndexBinaryOp. + GrB_Info GrB_mxm // C = accum (C, A*B) ( GrB_Matrix C, // input/output matrix for results @@ -5787,6 +5619,8 @@ GrB_Info GrB_mxv // w = accum (w, A*u) // product, and where pairs of elements in two matrices (or vectors) are // pairwise "multiplied" with C(i,j) = mult (A(i,j),B(i,j)). +// The mult operator can be based on a GxB_IndexBinaryOp. + GrB_Info GrB_Vector_eWiseMult_Semiring // w = accum (w, u.*v) ( GrB_Vector w, // input/output vector for results @@ -7146,18 +6980,6 @@ GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar // w = accum (w, op(x,u)) const GrB_Descriptor desc // descriptor for w and mask ) ; -// historical: identical to GrB_Vector_apply_BinaryOp1st_Scalar -GrB_Info GxB_Vector_apply_BinaryOp1st // w = accum (w, op(x,u)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Scalar x, // first input: scalar x - const GrB_Vector u, // second input: vector u - const GrB_Descriptor desc // descriptor for w and mask -) ; - GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL // w = accum (w, op(x,u)) ( GrB_Vector w, // input/output vector for results @@ -7330,18 +7152,6 @@ GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar // w = accum (w, op(u,y)) const GrB_Descriptor desc // descriptor for w and mask ) ; -// historical: identical to GrB_Vector_apply_BinaryOp2nd_Scalar -GrB_Info GxB_Vector_apply_BinaryOp2nd // w = accum (w, op(u,y)) -( - GrB_Vector w, // input/output vector for results - const GrB_Vector mask, // optional mask for w, unused if NULL - const GrB_BinaryOp accum, // optional accum for z=accum(w,t) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Vector u, // first input: vector u - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for w and mask -) ; - GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL // w = accum (w, op(u,y)) ( GrB_Vector w, // input/output vector for results @@ -7685,18 +7495,6 @@ GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar // C=accum(C,op(x,A)) const GrB_Descriptor desc // descriptor for C, mask, and A ) ; -// historical: identical to GrB_Matrix_apply_BinaryOp1st_Scalar -GrB_Info GxB_Matrix_apply_BinaryOp1st // C=accum(C,op(x,A)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Scalar x, // first input: scalar x - const GrB_Matrix A, // second input: matrix A - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL // C=accum(C,op(x,A)) ( GrB_Matrix C, // input/output matrix for results @@ -7869,18 +7667,6 @@ GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar // C=accum(C,op(A,y)) const GrB_Descriptor desc // descriptor for C, mask, and A ) ; -// historical: identical to GrB_Matrix_apply_BinaryOp2nd_Scalar -GrB_Info GxB_Matrix_apply_BinaryOp2nd // C=accum(C,op(A,y)) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // operator to apply to the entries - const GrB_Matrix A, // first input: matrix A - const GrB_Scalar y, // second input: scalar y - const GrB_Descriptor desc // descriptor for C, mask, and A -) ; - GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL // C=accum(C,op(A,y)) ( GrB_Matrix C, // input/output matrix for results @@ -8646,22 +8432,6 @@ GrB_Info GrB_Matrix_select_UDT // C=accum(C,op(A)) (C, Mask, accum, op, x, y, d) #endif -//============================================================================== -// GxB_select: matrix and vector selection (DEPRECATED: use GrB_select instead) -//============================================================================== - -GrB_Info GxB_Vector_select (GrB_Vector w, const GrB_Vector mask, - const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, - const GrB_Scalar Thunk, const GrB_Descriptor desc) ; -GrB_Info GxB_Matrix_select (GrB_Matrix C, const GrB_Matrix Mask, - const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, - const GrB_Scalar Thunk, const GrB_Descriptor desc) ; -#if GxB_STDC_VERSION >= 201112L -#define GxB_select(C,Mask,accum,op,A,Thunk,desc) _Generic \ -((C), GrB_Vector:GxB_Vector_select , GrB_Matrix:GxB_Matrix_select ) \ -(C, Mask, accum, op, A, Thunk, desc) -#endif - //============================================================================== // GrB_reduce: matrix and vector reduction //============================================================================== @@ -9066,18 +8836,6 @@ GrB_Info GrB_transpose // C = accum (C, A') // GrB_kronecker: Kronecker product //============================================================================== -// GxB_kron is historical; use GrB_kronecker instead -GrB_Info GxB_kron // C = accum(C,kron(A,B)) (historical) -( - GrB_Matrix C, // input/output matrix for results - const GrB_Matrix Mask, // optional mask for C, unused if NULL - const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) - const GrB_BinaryOp op, // defines '*' for T=kron(A,B) - const GrB_Matrix A, // first input: matrix A - const GrB_Matrix B, // second input: matrix B - const GrB_Descriptor desc // descriptor for C, Mask, A, and B -) ; - GrB_Info GrB_Matrix_kronecker_BinaryOp // C = accum (C, kron(A,B)) ( GrB_Matrix C, // input/output matrix for results @@ -9143,25 +8901,9 @@ GrB_Info GrB_Vector_resize // change the size of a vector GrB_Index nrows_new // new number of rows in vector ) ; -// GxB_*_resize are identical to the GrB_*resize methods above -GrB_Info GxB_Matrix_resize // change the size of a matrix (historical) -( - GrB_Matrix C, // matrix to modify - GrB_Index nrows_new, // new number of rows in matrix - GrB_Index ncols_new // new number of columns in matrix -) ; - -GrB_Info GxB_Vector_resize // change the size of a vector (historical) -( - GrB_Vector w, // vector to modify - GrB_Index nrows_new // new number of rows in vector -) ; - // GxB_resize is a generic function for resizing a matrix or vector: - // GrB_Vector_resize (u,nrows_new) // GrB_Matrix_resize (A,nrows_new,ncols_new) - #if GxB_STDC_VERSION >= 201112L #define GxB_resize(arg1,...) \ _Generic \ @@ -9250,8 +8992,13 @@ GrB_Info GxB_IndexUnaryOp_fprint // print and check a GrB_IndexUnaryOp FILE *f // file for output ) ; -GrB_Info GxB_SelectOp_fprint (GxB_SelectOp op, const char *name, - GxB_Print_Level pr, FILE *f) ; +GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp +( + GxB_IndexBinaryOp op, // object to print and check + const char *name, // name of the object + GxB_Print_Level pr, // print level + FILE *f // file for output +) ; GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid ( @@ -9318,7 +9065,7 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context GrB_UnaryOp : GxB_UnaryOp_fprint , \ GrB_BinaryOp : GxB_BinaryOp_fprint , \ GrB_IndexUnaryOp : GxB_IndexUnaryOp_fprint , \ - GxB_SelectOp : GxB_SelectOp_fprint , \ + GxB_IndexBinaryOp: GxB_IndexBinaryOp_fprint, \ GrB_Monoid : GxB_Monoid_fprint , \ GrB_Semiring : GxB_Semiring_fprint , \ GrB_Scalar : GxB_Scalar_fprint , \ @@ -9333,61 +9080,58 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context #endif //============================================================================== -// Matrix and vector import/export/pack/unpack -//============================================================================== - -// The import/export/pack/unpack functions allow the user application to create -// a GrB_Matrix or GrB_Vector object, and to extract its contents, faster and -// with less memory overhead than the GrB_*_build and GrB_*_extractTuples -// functions. - -// The semantics of import/export/pack/unpack are the same as the "move -// constructor" in C++. On import, the user provides a set of arrays that have -// been previously allocated via the ANSI C malloc function. The arrays define -// the content of the matrix or vector. Unlike GrB_*_build, the GraphBLAS -// library then takes ownership of the user's input arrays and may either (a) -// incorporate them into its internal data structure for the new GrB_Matrix or -// GrB_Vector, potentially creating the GrB_Matrix or GrB_Vector in constant -// time with no memory copying performed, or (b) if the library does not -// support the import format directly, then it may convert the input to its -// internal format, and then free the user's input arrays. GraphBLAS may also -// choose to use a mix of the two strategies. In either case, the input arrays -// are no longer "owned" by the user application. If A is a GrB_Matrix created -// by an import/pack, the user input arrays are freed no later than GrB_free -// (&A), and may be freed earlier, at the discretion of the GraphBLAS library. -// The data structure of the GrB_Matrix and GrB_Vector remain opaque. - -// The export/unpack of a GrB_Matrix or GrB_Vector is symmetric with the import -// operation. The export is destructive, where the GrB_Matrix or GrB_Vector no -// longer exists when the export completes. The GrB_Matrix or GrB_Vector -// exists after an unpack operation, just with no entries. In both export and -// unpack, the user is returned several arrays that contain the matrix or -// vector in the requested format. Ownership of these arrays is given to the -// user application, which is then responsible for freeing them via the ANSI C -// free function. If the output format is supported by the GraphBLAS library, -// then these arrays may be returned to the user application in O(1) time and -// with no memory copying performed. Otherwise, the GraphBLAS library will -// create the output arrays for the user (via the ANSI C malloc function), fill -// them with the GrB_Matrix or GrB_Vector data, and then return the newly -// allocated arrays to the user. - -// Eight different formats are provided for import/export. For each format, -// the Ax array has a C-type corresponding to one of the 13 built-in -// types in GraphBLAS (bool, int*_t, uint*_t, float, double, float complex, or -// double complex), or a user-defined type. - -// On import/pack, the required user arrays Ah, Ap, Ab, Ai, Aj, and/or Ax must -// be non-NULL pointers to memory space allocated by the ANSI C malloc (or -// calloc, or realloc), unless nzmax is zero (in which case the Ab, Ai, Aj, Ax, -// vb, vi, and vx arrays may all be NULL). For the import, A (or GrB_Vector v) -// is undefined on input, just like GrB_*_new, the GrB_Matrix. If the import -// is successful, the GrB_Matrix A or GrB_Vector v is created, and the pointers -// to the user input arrays have been set to NULL. These user arrays have -// either been incorporated directly into the GrB_Matrix A or GrB_Vector v, in -// which case the user input arrays will eventually be freed by GrB_free (&A), -// or their contents have been copied and the arrays freed. This decision is -// made by the GraphBLAS library itself, and the user application has no -// control over this decision. +// GxB_pack/GxB_unpack: Matrix and vector pack/unpack +//============================================================================== + +// The pack/unpack functions allow the user application to create a GrB_Matrix +// or GrB_Vector object, and to extract its contents, faster and with less +// memory overhead than the GrB_*_build and GrB_*_extractTuples functions. + +// The semantics of pack/unpack are the same as the "move constructor" in C++. +// On pack, the user provides a set of arrays that have been previously +// allocated via the ANSI C malloc function. The arrays define the content of +// the matrix or vector. Unlike GrB_*_build, the GraphBLAS library then takes +// ownership of the user's input arrays and may either (a) incorporate them +// into its internal data structure for the new GrB_Matrix or GrB_Vector, +// potentially creating the GrB_Matrix or GrB_Vector in constant time with no +// memory copying performed, or (b) if the library does not support the format +// directly, then it may convert the input to its internal format, and then +// free the user's input arrays. GraphBLAS may also choose to use a mix of the +// two strategies. In either case, the input arrays are no longer "owned" by +// the user application. If A is a GrB_Matrix created by a pack, the user +// input arrays are freed no later than GrB_free (&A), and may be freed +// earlier, at the discretion of the GraphBLAS library. The data structure of +// the GrB_Matrix and GrB_Vector remain opaque. + +// The unpack of a GrB_Matrix or GrB_Vector is symmetric with the pack +// operation. The GrB_Matrix or GrB_Vector exists after an unpack operation, +// just with no entries. For unpack, the user is returned several arrays that +// contain the matrix or vector in the requested format. Ownership of these +// arrays is given to the user application, which is then responsible for +// freeing them via the ANSI C free function. If the output format is +// supported by the GraphBLAS library, then these arrays may be returned to the +// user application in O(1) time and with no memory copying performed. +// Otherwise, the GraphBLAS library will create the output arrays for the user +// (via the ANSI C malloc function), fill them with the GrB_Matrix or +// GrB_Vector data, and then return the newly allocated arrays to the user. + +// Eight different formats are provided for pack/unpack. For each format, the +// Ax array has a C-type corresponding to one of the 13 built-in types +// in GraphBLAS (bool, int*_t, uint*_t, float, double, float complex, or double +// complex), or a user-defined type. + +// On pack, the required user arrays Ah, Ap, Ab, Ai, Aj, and/or Ax must be +// non-NULL pointers to memory space allocated by the ANSI C malloc (or calloc, +// or realloc), unless nzmax is zero (in which case the Ab, Ai, Aj, Ax, vb, vi, +// and vx arrays may all be NULL). For the pack, A (or GrB_Vector v) is +// undefined on input, just like GrB_*_new, the GrB_Matrix. If the pack is +// successful, the GrB_Matrix A or GrB_Vector v is created, and the pointers to +// the user input arrays have been set to NULL. These user arrays have either +// been incorporated directly into the GrB_Matrix A or GrB_Vector v, in which +// case the user input arrays will eventually be freed by GrB_free (&A), or +// their contents have been copied and the arrays freed. This decision is made +// by the GraphBLAS library itself, and the user application has no control +// over this decision. // If any of the arrays Ab, Aj, Ai, Ax, vb, vi, or vx have zero size (with // nzmax of zero), they are allowed to be be NULL pointers on input. @@ -9400,52 +9144,25 @@ GrB_Info GxB_Context_fprint // print and check a GxB_Context // No error checking is performed on the content of the user input arrays. If // the user input arrays do not conform to the precise specifications above, // results are undefined. No typecasting of the values of the matrix or vector -// entries is performed on import or export. +// entries is performed on pack/unpack // SuiteSparse:GraphBLAS supports all eight formats natively (CSR, CSC, // HyperCSR, and HyperCSC, BitmapR, BitmapC, FullR, FullC). For vectors, only -// CSC, BitmapC, and FullC formats are used. On import, the all eight formats -// take O(1) time and memory to import. On export, if the GrB_Matrix or -// GrB_Vector is already in this particular format, then the export takes O(1) +// CSC, BitmapC, and FullC formats are used. On pack, the all eight formats +// take O(1) time and memory to pack. On unpack, if the GrB_Matrix or +// GrB_Vector is already in this particular format, then the unpack takes O(1) // time and no memory copying is performed. -// If the import is not successful, the GxB_Matrix_import_* functions return A -// as NULL, GxB_Vector_import returns v as NULL, and the user input arrays are -// neither modified nor freed. They are still owned by the user application. - // If the input data is untrusted, use the following descriptor setting for -// GxB_Matrix_import* and GxB_Matrix_pack*. The import/pack will be slower, -// but secure. GrB_Matrix_import uses the slow, secure method, since it has -// no descriptor input. +// GxB_Matrix_pack*. The pack will be slower, but secure. GrB_Matrix_import +// uses the slow, secure method, since it has no descriptor input. // // GxB_set (desc, GxB_IMPORT, GxB_SECURE_IMPORT) ; -// As of v5.2.0, GxB_*import* and GxB_*export* are declared historical. Use -// GxB_*pack* and GxB_*unpack* instead. The GxB import/export will be kept -// but only documented here, not in the User Guide. - //------------------------------------------------------------------------------ // GxB_Matrix_pack_CSR: pack a CSR matrix //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_CSR // historical: use GxB_Matrix_pack_CSR -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers", Ap_size >= (nrows+1)* sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A) * sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9467,7 +9184,7 @@ GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix // GrB_Index Ap [nrows+1], Aj [nvals] ; Ax [nvals] ; // // The column indices of entries in the ith row of the matrix are held - // in Aj [Ap [i] ... Ap[i+1]], and the corresponding values are held + // in Aj [Ap [i] to Ap[i+1]-1], and the corresponding values are held // in the same positions in Ax. Column indices must be in the range 0 // to ncols-1. If jumbled is false, the column indices must appear in // sorted order within each row. No duplicate column indices may @@ -9481,24 +9198,6 @@ GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix // GxB_Matrix_pack_CSC: pack a CSC matrix //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_CSC // historical: use GxB_Matrix_pack_CSC -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - GrB_Index **Ap, // col "pointers", Ap_size >= (ncols+1)*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9520,7 +9219,7 @@ GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix // GrB_Index Ap [ncols+1], Ai [nvals] ; Ax [nvals] ; // // The row indices of entries in the jth column of the matrix are held - // in Ai [Ap [j] ... Ap[j+1]], and the corresponding values are held + // in Ai [Ap [j] to Ap[j+1]-1], and the corresponding values are held // in the same positions in Ax. Row indices must be in the range 0 to // nrows-1. If jumbled is false, the row indices must appear in // sorted order within each column. No duplicate row indices may @@ -9534,27 +9233,6 @@ GrB_Info GxB_Matrix_pack_CSC // pack a CSC matrix // GxB_Matrix_pack_HyperCSR: pack a hypersparse CSR matrix //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_HyperCSR // historical: use GxB_Matrix_pack_HyperCSR -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers", Ap_size >= (nvec+1)*sizeof(int64_t) - GrB_Index **Ah, // row indices, Ah_size >= nvec*sizeof(int64_t) - GrB_Index **Aj, // column indices, Aj_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A) * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Aj_size, // size of Aj in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of rows that appear in Ah - bool jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9587,7 +9265,7 @@ GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix // the matrix. It // must appear in sorted order, and no duplicates may appear. If i = // Ah [k] is the kth row, then the column indices of the ith - // row appear in Aj [Ap [k] ... Ap [k+1]], and the corresponding + // row appear in Aj [Ap [k] to Ap [k+1]-1], and the corresponding // values appear in the same locations in Ax. Column indices must be // in the range 0 to ncols-1, and must appear in sorted order within // each row. No duplicate column indices may appear in any row. nvec @@ -9600,27 +9278,6 @@ GrB_Info GxB_Matrix_pack_HyperCSR // pack a hypersparse CSR matrix // GxB_Matrix_pack_HyperCSC: pack a hypersparse CSC matrix //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_HyperCSC // historical: use GxB_Matrix_pack_HyperCSC -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - GrB_Index **Ap, // col "pointers", Ap_size >= (nvec+1)*sizeof(int64_t) - GrB_Index **Ah, // column indices, Ah_size >= nvec*sizeof(int64_t) - GrB_Index **Ai, // row indices, Ai_size >= nvals(A)*sizeof(int64_t) - void **Ax, // values, Ax_size >= nvals(A)*(type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ap_size, // size of Ap in bytes - GrB_Index Ah_size, // size of Ah in bytes - GrB_Index Ai_size, // size of Ai in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvec, // number of columns that appear in Ah - bool jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9653,7 +9310,7 @@ GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix // The Ah array is a list of the column indices of non-empty columns. // It must appear in sorted order, and no duplicates may appear. If j // = Ah [k] is the kth non-empty column, then the row indices of the - // jth column appear in Ai [Ap [k] ... Ap [k+1]], and the + // jth column appear in Ai [Ap [k] to Ap [k+1]-1], and the // corresponding values appear in the same locations in Ax. Row // indices must be in the range 0 to nrows-1, and must appear in // sorted order within each column. No duplicate row indices may @@ -9667,22 +9324,6 @@ GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix // GxB_Matrix_pack_BitmapR: pack a bitmap matrix, held by row //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_BitmapR // historical: use GxB_Matrix_pack_BitmapR -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9710,22 +9351,6 @@ GrB_Info GxB_Matrix_pack_BitmapR // pack a bitmap matrix, held by row // GxB_Matrix_pack_BitmapC: pack a bitmap matrix, held by column //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_BitmapC // historical: use GxB_Matrix_pack_BitmapC -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - int8_t **Ab, // bitmap, Ab_size >= nrows*ncols - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ab_size, // size of Ab in bytes - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9753,19 +9378,6 @@ GrB_Info GxB_Matrix_pack_BitmapC // pack a bitmap matrix, held by column // GxB_Matrix_pack_FullR: pack a full matrix, held by row //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_FullR // historical: use GxB_Matrix_pack_FullR -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9787,19 +9399,6 @@ GrB_Info GxB_Matrix_pack_FullR // pack a full matrix, held by row // GxB_Matrix_pack_FullC: pack a full matrix, held by column //------------------------------------------------------------------------------ -GrB_Info GxB_Matrix_import_FullC // historical: use GxB_Matrix_pack_FullC -( - GrB_Matrix *A, // handle of matrix to create - GrB_Type type, // type of matrix to create - GrB_Index nrows, // number of rows of the matrix - GrB_Index ncols, // number of columns of the matrix - void **Ax, // values, Ax_size >= nrows*ncols * (type size) - // or Ax_size >= (type size), if iso is true - GrB_Index Ax_size, // size of Ax in bytes - bool iso, // if true, A is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column ( GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged) @@ -9818,25 +9417,9 @@ GrB_Info GxB_Matrix_pack_FullC // pack a full matrix, held by column // Ax [i+j*nrows]. All entries in A are present. //------------------------------------------------------------------------------ -// GxB_Vector_pack_CSC: import/pack a vector in CSC format +// GxB_Vector_pack_CSC: pack a vector in CSC format //------------------------------------------------------------------------------ -GrB_Info GxB_Vector_import_CSC // historical: use GxB_Vector_pack_CSC -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n, // vector length - GrB_Index **vi, // indices, vi_size >= nvals(v) * sizeof(int64_t) - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vi_size, // size of vi in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in vector - bool jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format ( GrB_Vector v, // vector to create (type and length unchanged) @@ -9859,21 +9442,6 @@ GrB_Info GxB_Vector_pack_CSC // pack a vector in CSC format // GxB_Vector_pack_Bitmap: pack a vector in bitmap format //------------------------------------------------------------------------------ -GrB_Info GxB_Vector_import_Bitmap // historical: GxB_Vector_pack_Bitmap -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n, // vector length - int8_t **vb, // bitmap, vb_size >= n - void **vx, // values, vx_size >= n * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vb_size, // size of vb in bytes - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - GrB_Index nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector ( GrB_Vector v, // vector to create (type and length unchanged) @@ -9894,18 +9462,6 @@ GrB_Info GxB_Vector_pack_Bitmap // pack a bitmap vector // GxB_Vector_pack_Full: pack a vector in full format //------------------------------------------------------------------------------ -GrB_Info GxB_Vector_import_Full // historical: use GxB_Vector_pack_Full -( - GrB_Vector *v, // handle of vector to create - GrB_Type type, // type of vector to create - GrB_Index n, // vector length - void **vx, // values, vx_size >= nvals(v) * (type size) - // or vx_size >= (type size), if iso is true - GrB_Index vx_size, // size of vx in bytes - bool iso, // if true, v is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_pack_Full // pack a full vector ( GrB_Vector v, // vector to create (type and length unchanged) @@ -9920,58 +9476,35 @@ GrB_Info GxB_Vector_pack_Full // pack a full vector // matrix in FullC format. //------------------------------------------------------------------------------ -// GxB* export/unpack +// GxB unpack //------------------------------------------------------------------------------ -// The GxB_*_export/unpack functions are symmetric with the GxB_*_import/pack -// functions. The export/unpack functions force completion of any pending -// operations, prior to the export, except if the only pending operation is to -// unjumble the matrix. +// The GxB_*_unpack functions are symmetric with the GxB_*_pack functions. The +// unpack functions force completion of any pending operations, prior to the +// unpack, except if the only pending operation is to unjumble the matrix. // // If there are no entries in the matrix or vector, then the index arrays (Ai, // Aj, or vi) and value arrays (Ax or vx) are returned as NULL. This is not an // error condition. // -// A GrB_Matrix may be exported/unpacked in any one of four different formats. -// On successful export, the input GrB_Matrix A is freed, and the output arrays -// Ah, Ap, Ai, Aj, and/or Ax are returned to the user application as arrays -// allocated by the ANSI C malloc function. The four formats are the same as -// the import formats for GxB_Matrix_import/pack. +// A GrB_Matrix may be unpacked in any one of four different formats. // -// If jumbled is NULL on input, this indicates to GxB_*export/unpack* that the -// exported/unpacked matrix cannot be returned in a jumbled format. In this -// case, if the matrix is jumbled, it is sorted before exporting it to the -// caller. +// If jumbled is NULL on input, this indicates to GxB_*unpack* that the +// unpacked matrix cannot be returned in a jumbled format. In this case, if +// the matrix is jumbled, it is sorted before unpacking it to the caller. // -// If iso is NULL on input, this indicates to the export/unpack methods that -// the exported/unpacked matrix cannot be returned in a iso format, with an Ax -// array with just one entry. In this case, if the matrix is iso, it is -// expanded before exporting/unpacking it to the caller. +// If iso is NULL on input, this indicates to the unpack methods that the +// unpacked matrix cannot be returned in a iso format, with an Ax array with +// just one entry. In this case, if the matrix is iso, it is expanded before +// unpacking it to the caller. // -// For the export/unpack*Full* methods, all entries in the matrix or must be -// present. That is, GrB_*_nvals must report nvals equal to nrows*ncols or a -// matrix. If this condition does not hold, the matrix/vector is not exported, -// and GrB_INVALID_VALUE is returned. +// For the unpack*Full* methods, all entries in the matrix or must be present. +// That is, GrB_*_nvals must report nvals equal to nrows*ncols or a matrix. If +// this condition does not hold, the matrix/vector is not unpack, and +// GrB_INVALID_VALUE is returned. // -// If the export/unpack is not successful, the export/unpack functions do not -// modify matrix or vector and the user arrays are returned as NULL. - -GrB_Info GxB_Matrix_export_CSR // historical: use GxB_Matrix_unpack_CSR -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers" - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; +// If the unpack is not successful, the unpack functions do not modify matrix +// or vector and the user arrays are returned as NULL. GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix ( @@ -9987,23 +9520,6 @@ GrB_Info GxB_Matrix_unpack_CSR // unpack a CSR matrix const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_CSC // historical: use GxB_Matrix_unpack_CSC -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - GrB_Index **Ap, // column "pointers" - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10018,26 +9534,6 @@ GrB_Info GxB_Matrix_unpack_CSC // unpack a CSC matrix const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_HyperCSR //historical: use GxB_Matrix_unpack_HyperCSR -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - GrB_Index **Ap, // row "pointers" - GrB_Index **Ah, // row indices - GrB_Index **Aj, // column indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Aj_size, // size of Aj in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of rows that appear in Ah - bool *jumbled, // if true, indices in each row may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10055,26 +9551,6 @@ GrB_Info GxB_Matrix_unpack_HyperCSR // unpack a hypersparse CSR matrix const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_HyperCSC //historical: use GxB_Matrix_unpack_HyperCSC -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - GrB_Index **Ap, // column "pointers" - GrB_Index **Ah, // column indices - GrB_Index **Ai, // row indices - void **Ax, // values - GrB_Index *Ap_size, // size of Ap in bytes - GrB_Index *Ah_size, // size of Ah in bytes - GrB_Index *Ai_size, // size of Ai in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvec, // number of columns that appear in Ah - bool *jumbled, // if true, indices in each column may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10092,21 +9568,6 @@ GrB_Info GxB_Matrix_unpack_HyperCSC // unpack a hypersparse CSC matrix const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_BitmapR // historical: use GxB_Matrix_unpack_BitmapR -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10119,21 +9580,6 @@ GrB_Info GxB_Matrix_unpack_BitmapR // unpack a bitmap matrix, by row const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_BitmapC // historical: use GxB_Matrix_unpack_BitmapC -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - int8_t **Ab, // bitmap - void **Ax, // values - GrB_Index *Ab_size, // size of Ab in bytes - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10146,18 +9592,6 @@ GrB_Info GxB_Matrix_unpack_BitmapC // unpack a bitmap matrix, by col const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_FullR // historical: use GxB_Matrix_unpack_FullR -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10167,18 +9601,6 @@ GrB_Info GxB_Matrix_unpack_FullR // unpack a full matrix, by row const GrB_Descriptor desc ) ; -GrB_Info GxB_Matrix_export_FullC // historical: use GxB_Matrix_unpack_FullC -( - GrB_Matrix *A, // handle of matrix to export and free - GrB_Type *type, // type of matrix exported - GrB_Index *nrows, // number of rows of the matrix - GrB_Index *ncols, // number of columns of the matrix - void **Ax, // values - GrB_Index *Ax_size, // size of Ax in bytes - bool *iso, // if true, A is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column ( GrB_Matrix A, // matrix to unpack (type, nrows, ncols unchanged) @@ -10188,21 +9610,6 @@ GrB_Info GxB_Matrix_unpack_FullC // unpack a full matrix, by column const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_export_CSC // historical: use GxB_Vector_unpack_CSC -( - GrB_Vector *v, // handle of vector to export and free - GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector - GrB_Index **vi, // indices - void **vx, // values - GrB_Index *vi_size, // size of vi in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in vector - bool *jumbled, // if true, indices may be unsorted - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector ( GrB_Vector v, // vector to unpack (type and length unchanged) @@ -10216,20 +9623,6 @@ GrB_Info GxB_Vector_unpack_CSC // unpack a CSC vector const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_export_Bitmap // historical: use GxB_Vector_unpack_Bitmap -( - GrB_Vector *v, // handle of vector to export and free - GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector - int8_t **vb, // bitmap - void **vx, // values - GrB_Index *vb_size, // size of vb in bytes - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - GrB_Index *nvals, // # of entries in bitmap - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector ( GrB_Vector v, // vector to unpack (type and length unchanged) @@ -10242,17 +9635,6 @@ GrB_Info GxB_Vector_unpack_Bitmap // unpack a bitmap vector const GrB_Descriptor desc ) ; -GrB_Info GxB_Vector_export_Full // historical: use GxB_Vector_unpack_Full -( - GrB_Vector *v, // handle of vector to export and free - GrB_Type *type, // type of vector exported - GrB_Index *n, // length of the vector - void **vx, // values - GrB_Index *vx_size, // size of vx in bytes - bool *iso, // if true, v is iso - const GrB_Descriptor desc -) ; - GrB_Info GxB_Vector_unpack_Full // unpack a full vector ( GrB_Vector v, // vector to unpack (type and length unchanged) @@ -10272,7 +9654,7 @@ GrB_Info GxB_Vector_unpack_Full // unpack a full vector // GxB_unpack_HyperHash unpacks the hyper_hash from the hypersparse matrix A. // Normally, this method is called immediately before calling one of the four -// methods GxB_Matrix_(export/unpack)_Hyper(CSR/CSC). For example, to unpack +// methods GxB_Matrix_unpack_Hyper(CSR/CSC). For example, to unpack // then pack a hypersparse CSC matrix: // GrB_Matrix Y = NULL ; @@ -10284,14 +9666,12 @@ GrB_Info GxB_Vector_unpack_Full // unpack a full vector // &iso, &nvec, &jumbled, descriptor) ; // // // use the unpacked contents of A here, but do not change Ah or nvec. -// ... // // // to pack the data back into A: -// GxB_Matrix_pack_HyperCSC (A, ...) ; // pack most of A, except A->Y +// GxB_Matrix_pack_HyperCSC (A, etc) ; // pack most of A, except A->Y // GxB_pack_HyperHash (A, &Y, desc) ; // then pack A->Y -// The same process is used with GxB_Matrix_unpack_HyperCSR, -// an the GxB_Matrix_export_Hyper* and GxB_Matrix_import_Hyper* methods. +// The same process is used with GxB_Matrix_unpack_HyperCSR. // If A is not hypersparse on input to GxB_unpack_HyperHash, or if A is // hypersparse but does yet not have a hyper_hash, then Y is returned as NULL. @@ -10318,7 +9698,7 @@ GrB_Info GxB_unpack_HyperHash // move A->Y into Y // GxB_pack_HyperHash assigns the input Y matrix as the A->Y hyper_hash of the // hypersparse matrix A. Normally, this method is called immediately after -// calling one of the four methods GxB_Matrix_(import/pack)_Hyper(CSR/CSC). +// calling one of the four methods GxB_Matrix_pack_Hyper(CSR/CSC). // If A is not hypersparse on input to GxB_pack_HyperHash, or if A already has // a hyper_hash matrix, or if Y is NULL on input, then nothing happens and Y is @@ -10342,8 +9722,8 @@ GrB_Info GxB_unpack_HyperHash // move A->Y into Y // Results are undefined if the input Y was not created by GxB_unpack_HyperHash // (see the example above) or if the Ah contents or nvec of the matrix A are -// modified after they were exported/unpacked by -// GxB_Matrix_(export/unpack)_Hyper(CSR/CSC). +// modified after they were unpacked by +// GxB_Matrix_unpack_Hyper(CSR/CSC). GrB_Info GxB_pack_HyperHash // move Y into A->Y ( @@ -10353,7 +9733,7 @@ GrB_Info GxB_pack_HyperHash // move Y into A->Y ) ; //============================================================================== -// GrB import/export +// GrB_import/GrB_export //============================================================================== // The GrB_Matrix_import method copies from user-provided arrays into an @@ -11001,9 +10381,6 @@ GrB_Info GxB_Vector_deserialize // deserialize blob into a GrB_Vector const GrB_Descriptor desc // to control # of threads used ) ; -// 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 //============================================================================== @@ -11111,7 +10488,7 @@ outer loop), and one entry at a time within the row (in the inner loop): GxB_Iterator_new (&iterator) ; // attach it to the matrix A, known to be type GrB_FP64 GrB_Info info = GxB_rowIterator_attach (iterator, A, NULL) ; - if (info < 0) { handle the failure ... } + if (info < 0) { handle the failure } // seek to A(0,:) info = GxB_rowIterator_seekRow (iterator, 0) ; while (info != GxB_EXHAUSTED) @@ -11145,7 +10522,7 @@ parallel iteration using 4 threads (work may be imbalanced however): GxB_Iterator iterator ; GxB_Iterator_new (&iterator) ; GrB_Info info = GxB_rowIterator_attach (iterator, A, NULL) ; - if (info < 0) { handle the failure ... } + if (info < 0) { handle the failure } // seek to A(row1,:) info = GxB_rowIterator_seekRow (iterator, row1) ; while (info != GxB_EXHAUSTED) @@ -11181,9 +10558,9 @@ parallel iteration using 4 threads (work may be imbalanced however): // The contents of an iterator must not be directly accessed by the user // application. Only the functions and macros provided here may access -// "iterator->..." contents. The iterator is defined here only so that macros +// "iterator->" contents. The iterator is defined here only so that macros // can be used to speed up the use of the iterator methods. User applications -// must not use "iterator->..." directly. +// must not use "iterator->" directly. struct GB_Iterator_opaque { @@ -11666,7 +11043,7 @@ GrB_Index GxB_colIterator_getRowIndex (GxB_Iterator iterator) ; GxB_Iterator_new (&iterator) ; // attach it to the matrix A, known to be type GrB_FP64 GrB_Info info = GxB_Matrix_Iterator_attach (iterator, A, NULL) ; - if (info < 0) { handle the failure ... } + if (info < 0) { handle the failure } // seek to the first entry info = GxB_Matrix_Iterator_seek (iterator, 0) ; while (info != GxB_EXHAUSTED) @@ -11797,7 +11174,7 @@ single thread iteration of a whole vector, one entry at at time GxB_Iterator_new (&iterator) ; // attach it to the vector v, known to be type GrB_FP64 GrB_Info info = GxB_Vector_Iterator_attach (iterator, v, NULL) ; - if (info < 0) { handle the failure ... } + if (info < 0) { handle the failure } // seek to the first entry info = GxB_Vector_Iterator_seek (iterator, 0) ; while (info != GxB_EXHAUSTED) @@ -12059,9 +11436,375 @@ void GxB_Iterator_get_UDT (GxB_Iterator iterator, (iterator)->type_size) \ ) +//============================================================================== +//=== Historical methods ======================================================= +//============================================================================== + +// 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 in +// working order for historical backward compatibility; it might no longer be +// mentioned in the user guide. Historical functions and symbols listed below +// would only be removed in the rare case that they cause a serious conflict +// with future methods. Replacements for these historical objects and +// functions are listed below. If tagged "as-is" then only the name is +// changed. Otherwise, refer to the older SuiteSparse:GraphBLAS user guides on +// the usage of these historical methods, and upgrade to the newer methods +// present in this version of GraphBLAS. + +// GrB_getVersion: use GrB_get instead +GrB_Info GrB_getVersion (unsigned int *, unsigned int *) ; + +// GxB_INDEX_MAX: use GrB_INDEX_MAX+1 instead +#define GxB_INDEX_MAX ((GrB_Index) (1ULL << 60)) + +// GxB_ABS_*: use GrB_ABS_* instead (as-is) +GB_GLOBAL GrB_UnaryOp + GxB_ABS_BOOL, GxB_ABS_INT8, GxB_ABS_INT16, GxB_ABS_INT32, GxB_ABS_INT64, + GxB_ABS_UINT8, GxB_ABS_UINT16, GxB_ABS_UINT32, GxB_ABS_UINT64, GxB_ABS_FP32, + GxB_ABS_FP64 ; + +// GxB_SelectOp: use 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, GxB_EQ_THUNK, GxB_GT_THUNK, GxB_GE_THUNK, GxB_LT_THUNK, + GxB_LE_THUNK ; +GrB_Info GxB_SelectOp_xtype (GrB_Type *, GxB_SelectOp) ; +GrB_Info GxB_SelectOp_ttype (GrB_Type *, GxB_SelectOp) ; +GrB_Info GxB_SelectOp_fprint (GxB_SelectOp op, const char *name, + GxB_Print_Level pr, FILE *f) ; + +// GxB_Scalar: use GrB_Scalar instead (as-is) +typedef struct GB_Scalar_opaque *GxB_Scalar ; + +// GxB_* monoids: GrB_* monoids instead (as-is) +GB_GLOBAL GrB_Monoid + GxB_MIN_INT8_MONOID, GxB_MIN_INT16_MONOID, GxB_MIN_INT32_MONOID, + GxB_MIN_INT64_MONOID, GxB_MIN_UINT8_MONOID, GxB_MIN_UINT16_MONOID, + GxB_MIN_UINT32_MONOID, GxB_MIN_UINT64_MONOID, GxB_MIN_FP32_MONOID, + GxB_MIN_FP64_MONOID, GxB_MAX_INT8_MONOID, GxB_MAX_INT16_MONOID, + GxB_MAX_INT32_MONOID, GxB_MAX_INT64_MONOID, GxB_MAX_UINT8_MONOID, + GxB_MAX_UINT16_MONOID, GxB_MAX_UINT32_MONOID, GxB_MAX_UINT64_MONOID, + GxB_MAX_FP32_MONOID, GxB_MAX_FP64_MONOID, GxB_PLUS_INT8_MONOID, + GxB_PLUS_INT16_MONOID, GxB_PLUS_INT32_MONOID, GxB_PLUS_INT64_MONOID, + GxB_PLUS_UINT8_MONOID, GxB_PLUS_UINT16_MONOID, GxB_PLUS_UINT32_MONOID, + GxB_PLUS_UINT64_MONOID, GxB_PLUS_FP32_MONOID, GxB_PLUS_FP64_MONOID, + GxB_TIMES_INT8_MONOID, GxB_TIMES_INT16_MONOID, GxB_TIMES_INT32_MONOID, + GxB_TIMES_INT64_MONOID, GxB_TIMES_UINT8_MONOID, GxB_TIMES_UINT16_MONOID, + GxB_TIMES_UINT32_MONOID, GxB_TIMES_UINT64_MONOID, GxB_TIMES_FP32_MONOID, + GxB_TIMES_FP64_MONOID, GxB_LOR_BOOL_MONOID, GxB_LAND_BOOL_MONOID, + GxB_LXOR_BOOL_MONOID, GxB_LXNOR_BOOL_MONOID, GxB_EQ_BOOL_MONOID ; + +// GxB_* semirings: use the GrB_* semirings instead (as-is) +GB_GLOBAL GrB_Semiring + + GxB_PLUS_TIMES_INT8, GxB_PLUS_MIN_INT8, GxB_MIN_PLUS_INT8, + GxB_PLUS_TIMES_INT16, GxB_PLUS_MIN_INT16, GxB_MIN_PLUS_INT16, + GxB_PLUS_TIMES_INT32, GxB_PLUS_MIN_INT32, GxB_MIN_PLUS_INT32, + GxB_PLUS_TIMES_INT64, GxB_PLUS_MIN_INT64, GxB_MIN_PLUS_INT64, + GxB_PLUS_TIMES_UINT8, GxB_PLUS_MIN_UINT8, GxB_MIN_PLUS_UINT8, + GxB_PLUS_TIMES_UINT16, GxB_PLUS_MIN_UINT16, GxB_MIN_PLUS_UINT16, + GxB_PLUS_TIMES_UINT32, GxB_PLUS_MIN_UINT32, GxB_MIN_PLUS_UINT32, + GxB_PLUS_TIMES_UINT64, GxB_PLUS_MIN_UINT64, GxB_MIN_PLUS_UINT64, + GxB_PLUS_TIMES_FP32, GxB_PLUS_MIN_FP32, GxB_MIN_PLUS_FP32, + GxB_PLUS_TIMES_FP64, GxB_PLUS_MIN_FP64, GxB_MIN_PLUS_FP64, + + GxB_MIN_TIMES_INT8, GxB_MIN_FIRST_INT8, GxB_MIN_SECOND_INT8, + GxB_MIN_TIMES_INT16, GxB_MIN_FIRST_INT16, GxB_MIN_SECOND_INT16, + GxB_MIN_TIMES_INT32, GxB_MIN_FIRST_INT32, GxB_MIN_SECOND_INT32, + GxB_MIN_TIMES_INT64, GxB_MIN_FIRST_INT64, GxB_MIN_SECOND_INT64, + GxB_MIN_TIMES_UINT8, GxB_MIN_FIRST_UINT8, GxB_MIN_SECOND_UINT8, + GxB_MIN_TIMES_UINT16, GxB_MIN_FIRST_UINT16, GxB_MIN_SECOND_UINT16, + GxB_MIN_TIMES_UINT32, GxB_MIN_FIRST_UINT32, GxB_MIN_SECOND_UINT32, + GxB_MIN_TIMES_UINT64, GxB_MIN_FIRST_UINT64, GxB_MIN_SECOND_UINT64, + GxB_MIN_TIMES_FP32, GxB_MIN_FIRST_FP32, GxB_MIN_SECOND_FP32, + GxB_MIN_TIMES_FP64, GxB_MIN_FIRST_FP64, GxB_MIN_SECOND_FP64, + + GxB_MIN_MAX_INT8, GxB_MAX_PLUS_INT8, GxB_MAX_TIMES_INT8, + GxB_MIN_MAX_INT16, GxB_MAX_PLUS_INT16, GxB_MAX_TIMES_INT16, + GxB_MIN_MAX_INT32, GxB_MAX_PLUS_INT32, GxB_MAX_TIMES_INT32, + GxB_MIN_MAX_INT64, GxB_MAX_PLUS_INT64, GxB_MAX_TIMES_INT64, + GxB_MIN_MAX_UINT8, GxB_MAX_PLUS_UINT8, GxB_MAX_TIMES_UINT8, + GxB_MIN_MAX_UINT16, GxB_MAX_PLUS_UINT16, GxB_MAX_TIMES_UINT16, + GxB_MIN_MAX_UINT32, GxB_MAX_PLUS_UINT32, GxB_MAX_TIMES_UINT32, + GxB_MIN_MAX_UINT64, GxB_MAX_PLUS_UINT64, GxB_MAX_TIMES_UINT64, + GxB_MIN_MAX_FP32, GxB_MAX_PLUS_FP32, GxB_MAX_TIMES_FP32, + GxB_MIN_MAX_FP64, GxB_MAX_PLUS_FP64, GxB_MAX_TIMES_FP64, + + GxB_MAX_FIRST_INT8, GxB_MAX_SECOND_INT8, GxB_MAX_MIN_INT8, + GxB_MAX_FIRST_INT16, GxB_MAX_SECOND_INT16, GxB_MAX_MIN_INT16, + GxB_MAX_FIRST_INT32, GxB_MAX_SECOND_INT32, GxB_MAX_MIN_INT32, + GxB_MAX_FIRST_INT64, GxB_MAX_SECOND_INT64, GxB_MAX_MIN_INT64, + GxB_MAX_FIRST_UINT8, GxB_MAX_SECOND_UINT8, GxB_MAX_MIN_UINT8, + GxB_MAX_FIRST_UINT16, GxB_MAX_SECOND_UINT16, GxB_MAX_MIN_UINT16, + GxB_MAX_FIRST_UINT32, GxB_MAX_SECOND_UINT32, GxB_MAX_MIN_UINT32, + GxB_MAX_FIRST_UINT64, GxB_MAX_SECOND_UINT64, GxB_MAX_MIN_UINT64, + GxB_MAX_FIRST_FP32, GxB_MAX_SECOND_FP32, GxB_MAX_MIN_FP32, + GxB_MAX_FIRST_FP64, GxB_MAX_SECOND_FP64, GxB_MAX_MIN_FP64, + + GxB_LOR_LAND_BOOL, GxB_LAND_LOR_BOOL, GxB_LXOR_LAND_BOOL, + GxB_EQ_LOR_BOOL ; // use GrB_LXNOR_LOR_SEMIRING_BOOL instead (as-is) + +// GxB_Desc*get/set and GrB_Descriptor_set: use GrB_get/set instead. +GrB_Info GrB_Descriptor_set (GrB_Descriptor, GrB_Desc_Field, GrB_Desc_Value) ; +GrB_Info GxB_Descriptor_get (GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field) ; +GrB_Info GxB_Desc_set (GrB_Descriptor, GrB_Desc_Field, ...) ; +GrB_Info GxB_Desc_set_INT32 (GrB_Descriptor, GrB_Desc_Field, int32_t) ; +GrB_Info GxB_Desc_set_FP64 (GrB_Descriptor, GrB_Desc_Field, double) ; +GrB_Info GxB_Desc_get (GrB_Descriptor, GrB_Desc_Field, ...) ; +GrB_Info GxB_Desc_get_INT32 (GrB_Descriptor, GrB_Desc_Field, int32_t *) ; +GrB_Info GxB_Desc_get_FP64 (GrB_Descriptor, GrB_Desc_Field, double *) ; + +// GxB_Type_* queries: use GrB_get instead +GrB_Info GxB_Type_name (char *, const GrB_Type) ; +GrB_Info GxB_Type_size (size_t *, const GrB_Type) ; + +// GxB_UnaryOp_* queries: use GrB_get_instead +GrB_Info GxB_UnaryOp_ztype (GrB_Type *, GrB_UnaryOp) ; +GrB_Info GxB_UnaryOp_ztype_name (char *, const GrB_UnaryOp) ; +GrB_Info GxB_UnaryOp_xtype (GrB_Type *, GrB_UnaryOp) ; +GrB_Info GxB_UnaryOp_xtype_name (char *, const GrB_UnaryOp) ; + +// GxB_BinaryOp_* queries: use GrB_get_instead +GrB_Info GxB_BinaryOp_ztype (GrB_Type *, GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_ztype_name (char *, const GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_xtype (GrB_Type *, GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_xtype_name (char *, const GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_ytype (GrB_Type *, GrB_BinaryOp) ; +GrB_Info GxB_BinaryOp_ytype_name (char *, const GrB_BinaryOp) ; + +// GxB_IndexUnaryOp_* queries: use GrB_get instead +GrB_Info GxB_IndexUnaryOp_ztype_name (char *, const GrB_IndexUnaryOp) ; +GrB_Info GxB_IndexUnaryOp_xtype_name (char *, const GrB_IndexUnaryOp) ; +GrB_Info GxB_IndexUnaryOp_ytype_name (char *, const GrB_IndexUnaryOp) ; + +// GxB_Monoid_* queries: use GrB_get instead +GrB_Info GxB_Monoid_operator (GrB_BinaryOp *, GrB_Monoid) ; +GrB_Info GxB_Monoid_identity (void *, GrB_Monoid) ; +GrB_Info GxB_Monoid_terminal (bool *, void *, GrB_Monoid) ; + +// GxB_Semiring_* queries: use GrB_get instead +GrB_Info GxB_Semiring_add (GrB_Monoid *, GrB_Semiring) ; +GrB_Info GxB_Semiring_multiply (GrB_BinaryOp *, GrB_Semiring) ; + +// GxB_Scalar_* queries: use GrB_get instead +GrB_Info GxB_Scalar_type (GrB_Type *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_type_name (char *, const GrB_Scalar) ; + +// GxB_Scalar_* methods: use GrB_Scalar_* instead (as-is) +GrB_Info GxB_Scalar_new (GrB_Scalar *, GrB_Type) ; +GrB_Info GxB_Scalar_dup (GrB_Scalar *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_clear (GrB_Scalar ) ; +GrB_Info GxB_Scalar_nvals (GrB_Index *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_free (GrB_Scalar *) ; +GrB_Info GxB_Scalar_setElement_BOOL (GrB_Scalar, bool) ; +GrB_Info GxB_Scalar_setElement_INT8 (GrB_Scalar, int8_t) ; +GrB_Info GxB_Scalar_setElement_INT16 (GrB_Scalar, int16_t) ; +GrB_Info GxB_Scalar_setElement_INT32 (GrB_Scalar, int32_t) ; +GrB_Info GxB_Scalar_setElement_INT64 (GrB_Scalar, int64_t) ; +GrB_Info GxB_Scalar_setElement_UINT8 (GrB_Scalar, uint8_t) ; +GrB_Info GxB_Scalar_setElement_UINT16 (GrB_Scalar, uint16_t) ; +GrB_Info GxB_Scalar_setElement_UINT32 (GrB_Scalar, uint32_t) ; +GrB_Info GxB_Scalar_setElement_UINT64 (GrB_Scalar, uint64_t) ; +GrB_Info GxB_Scalar_setElement_FP32 (GrB_Scalar, float) ; +GrB_Info GxB_Scalar_setElement_FP64 (GrB_Scalar, double) ; +GrB_Info GxB_Scalar_setElement_UDT (GrB_Scalar, void *) ; +GrB_Info GxB_Scalar_extractElement_BOOL (bool *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_INT8 (int8_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_INT16 (int16_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_INT32 (int32_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_INT64 (int64_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UINT8 (uint8_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UINT16 (uint16_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UINT32 (uint32_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UINT64 (uint64_t *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_FP32 (float *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_FP64 (double *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_extractElement_UDT (void *, const GrB_Scalar) ; +GrB_Info GxB_Scalar_wait (GrB_Scalar *) ; +GrB_Info GxB_Scalar_error (const char **, const GrB_Scalar) ; +#if GxB_STDC_VERSION >= 201112L +#define GxB_Scalar_setElement(s,x) GrB_Scalar_setElement (s, x) +#define GxB_Scalar_extractElement(x,s) GrB_Scalar_extractElement (x, s) +#endif + +// GxB_Vector_* queries: use GrB_get instead +GrB_Info GxB_Vector_type (GrB_Type *, const GrB_Vector) ; +GrB_Info GxB_Vector_type_name (char *, const GrB_Vector) ; + +// GxB_Matrix_* queries: use GrB_get instead +GrB_Info GxB_Matrix_type (GrB_Type *, const GrB_Matrix) ; +GrB_Info GxB_Matrix_type_name (char *, const GrB_Matrix) ; + +// GxB_*_Option_set/get: use GrB_get/set instead +GrB_Info GxB_Matrix_Option_set (GrB_Matrix, GxB_Option_Field, ...) ; +GrB_Info GxB_Matrix_Option_set_INT32 (GrB_Matrix, GxB_Option_Field, int32_t) ; +GrB_Info GxB_Matrix_Option_set_FP64 (GrB_Matrix, GxB_Option_Field, double) ; +GrB_Info GxB_Matrix_Option_get (GrB_Matrix, GxB_Option_Field, ...) ; +GrB_Info GxB_Matrix_Option_get_INT32 (GrB_Matrix, GxB_Option_Field, int32_t *) ; +GrB_Info GxB_Matrix_Option_get_FP64 (GrB_Matrix, GxB_Option_Field, double *) ; +GrB_Info GxB_Vector_Option_set (GrB_Vector, GxB_Option_Field, ...) ; +GrB_Info GxB_Vector_Option_set_INT32 (GrB_Vector, GxB_Option_Field, int32_t) ; +GrB_Info GxB_Vector_Option_set_FP64 (GrB_Vector, GxB_Option_Field, double) ; +GrB_Info GxB_Vector_Option_get (GrB_Vector, GxB_Option_Field, ...) ; +GrB_Info GxB_Vector_Option_get_INT32 (GrB_Vector, GxB_Option_Field, int32_t *) ; +GrB_Info GxB_Vector_Option_get_FP64 (GrB_Vector, GxB_Option_Field, double *) ; +GrB_Info GxB_Global_Option_set (GxB_Option_Field, ...) ; +GrB_Info GxB_Global_Option_set_INT32 (GxB_Option_Field, int32_t) ; +GrB_Info GxB_Global_Option_set_FP64 (GxB_Option_Field, double) ; +GrB_Info GxB_Global_Option_set_FP64_ARRAY (GxB_Option_Field, double *) ; +GrB_Info GxB_Global_Option_set_INT64_ARRAY (GxB_Option_Field, int64_t *) ; +GrB_Info GxB_Global_Option_set_CHAR (GxB_Option_Field, const char *) ; +GrB_Info GxB_Global_Option_set_FUNCTION (GxB_Option_Field, void *) ; +GrB_Info GxB_Global_Option_get (GxB_Option_Field, ...) ; +GrB_Info GxB_Global_Option_get_INT32 (GxB_Option_Field, int32_t *) ; +GrB_Info GxB_Global_Option_get_FP64 (GxB_Option_Field, double *) ; +GrB_Info GxB_Global_Option_get_INT64 (GxB_Option_Field, int64_t *) ; +GrB_Info GxB_Global_Option_get_CHAR (GxB_Option_Field, const char **) ; +GrB_Info GxB_Global_Option_get_FUNCTION (GxB_Option_Field, void **) ; +GrB_Info GxB_Context_set_INT32 (GxB_Context, GxB_Context_Field, int32_t) ; +GrB_Info GxB_Context_set_FP64 (GxB_Context, GxB_Context_Field, double) ; +GrB_Info GxB_Context_set (GxB_Context, GxB_Context_Field, ...) ; +GrB_Info GxB_Context_get_INT32 (GxB_Context, GxB_Context_Field, int32_t *) ; +GrB_Info GxB_Context_get_FP64 (GxB_Context, GxB_Context_Field, double *) ; +GrB_Info GxB_Context_get (GxB_Context, GxB_Context_Field, ...) ; + +// GxB_get/set: use GrB_get/set instead +#if GxB_STDC_VERSION >= 201112L +#define GxB_set(arg1,...) \ + _Generic \ + ( \ + (arg1), \ + default: GxB_Global_Option_set , \ + GxB_Option_Field : GxB_Global_Option_set , \ + GrB_Vector : GxB_Vector_Option_set , \ + GrB_Matrix : GxB_Matrix_Option_set , \ + GrB_Descriptor : GxB_Desc_set , \ + GxB_Context : GxB_Context_set \ + ) \ + (arg1, __VA_ARGS__) +#define GxB_get(arg1,...) \ + _Generic \ + ( \ + (arg1), \ + default: GxB_Global_Option_get , \ + GxB_Option_Field : GxB_Global_Option_get , \ + GrB_Vector : GxB_Vector_Option_get , \ + GrB_Matrix : GxB_Matrix_Option_get , \ + GrB_Descriptor : GxB_Desc_get , \ + GxB_Context : GxB_Context_get \ + ) \ + (arg1, __VA_ARGS__) +#endif + +// GxB_*_apply_BinaryOp*: GrB_*_apply_BinaryOp*_Scalar instead (as-is) +GrB_Info GxB_Vector_apply_BinaryOp1st (GrB_Vector, const GrB_Vector, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Vector, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_apply_BinaryOp2nd (GrB_Vector, const GrB_Vector, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Vector, const GrB_Scalar, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_apply_BinaryOp1st (GrB_Matrix, const GrB_Matrix, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Matrix, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_apply_BinaryOp2nd (GrB_Matrix, const GrB_Matrix, + const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Scalar, + const GrB_Descriptor) ; + +// GxB_kron: use GrB_Matrix_kronecker_BinaryOp instead (as-is) +GrB_Info GxB_kron (GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, + const GrB_BinaryOp, const GrB_Matrix, const GrB_Matrix, + const GrB_Descriptor) ; + +// GxB_*_resize: use GrB_*_resize instead (as-is) +GrB_Info GxB_Matrix_resize (GrB_Matrix, GrB_Index, GrB_Index) ; +GrB_Info GxB_Vector_resize (GrB_Vector, GrB_Index) ; + +// GxB_*_import/export_[FORMAT]: use GxB_*_pack/unpack_[FORMAT] instead +GrB_Info GxB_Matrix_import_CSR (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, + GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, + bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_BitmapR (GrB_Matrix *, GrB_Type, GrB_Index, + GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_CSC (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, + GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, + bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_HyperCSR (GrB_Matrix *, GrB_Type, GrB_Index, + GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, + GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_HyperCSC (GrB_Matrix *, GrB_Type, GrB_Index, + GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, + GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_BitmapC (GrB_Matrix *, GrB_Type, GrB_Index, + GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_FullR (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, + void **, GrB_Index, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_import_FullC (GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, + void **, GrB_Index, bool, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_CSC (GrB_Vector *, GrB_Type, GrB_Index, GrB_Index **, + void **, GrB_Index, GrB_Index, bool, GrB_Index, bool, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_Bitmap (GrB_Vector *, GrB_Type, GrB_Index, int8_t **, + void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor) ; +GrB_Info GxB_Vector_import_Full (GrB_Vector *, GrB_Type, GrB_Index, void **, + GrB_Index, bool, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_CSR (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, + GrB_Index *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_CSC (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, + GrB_Index *, bool *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_HyperCSR (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, + GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, + bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_HyperCSC (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, + GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, + const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_BitmapR (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, + GrB_Index *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_BitmapC (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, + GrB_Index *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_FullR (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Matrix_export_FullC (GrB_Matrix *, GrB_Type *, GrB_Index *, + GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_CSC (GrB_Vector *, GrB_Type *, GrB_Index *, + GrB_Index **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, + bool *, const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_Bitmap (GrB_Vector *, GrB_Type *, GrB_Index *, + int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, + const GrB_Descriptor) ; +GrB_Info GxB_Vector_export_Full (GrB_Vector *, GrB_Type *, GrB_Index *, + void **, GrB_Index *, bool *, const GrB_Descriptor) ; + +// GxB_select: use GrB_select instead +GrB_Info GxB_Vector_select (GrB_Vector w, const GrB_Vector mask, + const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, + const GrB_Scalar Thunk, const GrB_Descriptor desc) ; +GrB_Info GxB_Matrix_select (GrB_Matrix C, const GrB_Matrix Mask, + const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, + const GrB_Scalar Thunk, const GrB_Descriptor desc) ; +#if GxB_STDC_VERSION >= 201112L +#define GxB_select(C,Mask,accum,op,A,Thunk,desc) _Generic ((C), \ + GrB_Vector : GxB_Vector_select , \ + GrB_Matrix : GxB_Matrix_select ) (C, Mask, accum, op, A, Thunk, desc) +#endif + +// GxB_deserialize_* queries: use GrB_get instead +GrB_Info GxB_deserialize_type_name (char *, const void *, GrB_Index) ; + #endif // GB_CUDA_FOLDER #if defined ( __cplusplus ) } #endif + #endif diff --git a/README.md b/README.md index 1be913fb8e..e5143e2b0f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 -VERSION 9.3.1, Aug 12, 2024 +VERSION 9.4.2, Nov 18, 2024 SuiteSparse:GraphBLAS is a complete implementation of the GraphBLAS standard, which defines a set of sparse matrix operations on an extended algebra of diff --git a/Source/GB.h b/Source/GB.h index 1cfe63524a..dabda328a1 100644 --- a/Source/GB.h +++ b/Source/GB.h @@ -17,7 +17,6 @@ #if defined ( GRAPHBLAS_HAS_CUDA ) #include "rmm_wrap.h" #endif -#include "matrix/GB_static_header.h" #include "positional/GB_positional.h" #include "math/GB_bitwise.h" #include "print/GB_check.h" @@ -36,7 +35,6 @@ #include "slice/GB_task_methods.h" #include "transplant/GB_transplant.h" #include "type/GB_type.h" -#include "slice/GB_slice.h" #include "math/GB_uint64_multiply.h" #include "math/GB_int64_multiply.h" #include "math/GB_size_t_multiply.h" @@ -45,7 +43,7 @@ #include "element/GB_Element.h" #include "op/GB_op.h" #include "hyper/GB_hyper.h" -#include "ok/GB_ok.h" +#include "ok/GB_check_inputs.h" #include "cast/GB_cast.h" #include "wait/GB_wait.h" #include "convert/GB_convert.h" diff --git a/Source/GB_control.h b/Source/GB_control.h index 7d07af3cad..c4e260deff 100644 --- a/Source/GB_control.h +++ b/Source/GB_control.h @@ -77,85 +77,6 @@ // The ANY_PAIR semirings appear in Source/GB_AxB__any_pair_iso.c and // cannot be disabled. -// In this version of SuiteSparse:GraphBLAS, some of the fast hard-coded -// semirings have been disabled below. They still work, but are now slower -// unless the JIT is used. These semirings are likely not needed by any -// application, and disabling them here saves compile time and reduces the size -// of the compiled library. Hard-coded semirings removed: - -// (1) *_IS* semirings are removed. -// (2) semirings with DIV, RDIV, MINUS, RMINUS and ANY multiplicative -// operators are removed. ANY still appears as a monoid for many fast -// hard-coded semirings, just not as a multiplicative operator. -// (3) MIN, MAX, and TIMES monoids with the PAIR, LAND, LOR and LXOR -// multiplicative operators are removed. -// (4) PLUS monoids with LAND, LOR, and LXOR multiplicative ops. -// (5) MAX_MAX, MIN_MIN, semirings are removed. -// (5) ANY monoids with the EQ, NE, GE, LE, GT, LT, LAND, LOR, LXOR, MAX, MIN, -// PLUS and TIMES operators. -// (6) boolean semirings with non-boolean inputs removed -// (EQ_LT_FP32 for example), and boolean inputs with comparators -// (GE, GT, LE, LT) -// (7) positional semirings with PLUS and TIMES monoid removed. -// (8) some complex semirings removed. -// (9) All INT16 and UINT16 types and operators are removed. - -// With the above semirings removed, the remaining 398 semirings are: - -// 25 boolean semirings -// -// monoid multiply ops -// EQ: EQ (=LXNOR), LAND, LOR, LXOR (=NE), FIRST, SECOND -// LAND: EQ (=LXNOR), LAND, LOR, LXOR (=NE), FIRST, SECOND -// LOR: EQ (=LXNOR), LAND, LOR, LXOR (=NE), FIRST, SECOND -// LXOR: EQ (=LXNOR), LAND, LOR, LXOR (=NE), FIRST, SECOND, PAIR. -// -// note: EQ_BOOL and LXNOR are the same operator, and -// NE_BOOL and LXOR are the same operator. -// -// 100 semirings with MIN/MAX monoids (10 kinds, 10 real types each): -// -// monoid multiply ops -// MAX: MIN, PLUS, TIMES, FIRST, SECOND -// MIN: MAX, PLUS, TIMES, FIRST, SECOND -// -// 70 semirings with PLUS monoids (10 real types each): -// 60 semirings with TIMES monoids (10 real types each): -// -// monoid multiply ops -// PLUS: MIN, MAX, PLUS, TIMES, FIRST, SECOND, PAIR -// TIMES: MIN, MAX, PLUS, TIMES, FIRST, SECOND -// -// 10 semirings for 2 complex types (PLUS and TIMES monoids only): -// -// monoid multiply ops -// PLUS: TIMES, FIRST, SECOND -// TIMES: FIRST, SECOND -// -// 33 semirings enabled with the ANY monoid: -// -// ANY: FIRST, SECOND, PAIR (with bool, 10 real types) -// -// 64 bitwise semirings: for 4 unsigned integer types: -// -// (BOR, BAND, BXOR, BXNOR) x (BOR, BAND, BXOR, BXNOR) -// -// 36 positional semirings: -// -// monoids: (MIN, MAX, ANY) x -// mult: (FIRSTI, FIRSTI1, FIRSTJ, FIRSTJ1, SECONDJ, SECONDJ1) x -// types: (int32, int64) -// -// note: -// EQ_PAIR_BOOL, XNOR_PAIR_BOOL, LAND_PAIR_BOOL, LOR_PAIR_BOOL, are all -// the same as ANY_PAIR_BOOL. For the other types, MAX_PAIR, MIN_PAIR, -// and TIMES_PAIR are the same as ANY_PAIR. These are excluded from the -// list above, but are just as fast as ANY_PAIR. - -// These changes have no effect on the performance of binary operations such -// as eWiseAdd, eWiseMult, or the unary GrB_apply to GrB_reduce. They only -// affect GrB_mxm, GrB_mxv, and GrB_vxm. - // To renable the fast versions of these semirings, simply comment out the // specific "#define GxB_NO..." statements below, and recompile this library. @@ -169,9 +90,6 @@ // They also disable the hard-coded functions for GrB_eWiseAdd, GrB_eWiseMult, // GrB_reduce, GrB_*_build, GrB_apply, and GrB_transpose for this type. -// If disabled, the types still work just fine, but operations on them will be -// slower unless the JIT is used (which is on by default). - // #define GxB_NO_BOOL 1 // #define GxB_NO_FP32 1 // #define GxB_NO_FP64 1 @@ -180,11 +98,11 @@ #define GxB_NO_INT16 1 // #define GxB_NO_INT32 1 // #define GxB_NO_INT64 1 -// #define GxB_NO_INT8 1 + #define GxB_NO_INT8 1 #define GxB_NO_UINT16 1 // #define GxB_NO_UINT32 1 // #define GxB_NO_UINT64 1 -// #define GxB_NO_UINT8 1 + #define GxB_NO_UINT8 1 //------------------------------------------------------------------------------ // uncomment any of these lines to disable the unary operators @@ -194,9 +112,6 @@ // effect on GrB_mxm, GrB_vxm, GrB_mxv, GrB_eWiseAdd, GrB_eWiseMult, // GrB_reduce, or GrB_*_build. -// Any disabled unary operators will still work just fine, but operations using -// them will be slower. - // #define GxB_NO_ABS 1 // #define GxB_NO_AINV 1 // #define GxB_NO_IDENTITY 1 @@ -265,9 +180,6 @@ // They also disable the hard-coded functions for GrB_eWiseAdd, GrB_eWiseMult, // GrB_reduce, and GrB_*_build for this binary operator. -// Any disabled binary operators will still work just fine, but operations -// using them will be slower. - // #define GxB_NO_FIRST 1 // #define GxB_NO_SECOND 1 // #define GxB_NO_PAIR 1 @@ -280,12 +192,12 @@ // #define GxB_NO_TIMES 1 // #define GxB_NO_DIV 1 // #define GxB_NO_RDIV 1 -// #define GxB_NO_ISEQ 1 -// #define GxB_NO_ISNE 1 -// #define GxB_NO_ISGT 1 -// #define GxB_NO_ISGE 1 -// #define GxB_NO_ISLT 1 -// #define GxB_NO_ISLE 1 + #define GxB_NO_ISEQ 1 + #define GxB_NO_ISNE 1 + #define GxB_NO_ISGT 1 + #define GxB_NO_ISGE 1 + #define GxB_NO_ISLT 1 + #define GxB_NO_ISLE 1 // #define GxB_NO_EQ 1 // #define GxB_NO_NE 1 // #define GxB_NO_GT 1 @@ -305,12 +217,12 @@ // #define GxB_NO_BCLR 1 // #define GxB_NO_BSHIFT 1 -// #define GxB_NO_ATAN2 1 -// #define GxB_NO_HYPOT 1 -// #define GxB_NO_FMOD 1 -// #define GxB_NO_REMAINDER 1 -// #define GxB_NO_COPYSIGN 1 -// #define GxB_NO_LDEXP 1 + #define GxB_NO_ATAN2 1 + #define GxB_NO_HYPOT 1 + #define GxB_NO_FMOD 1 + #define GxB_NO_REMAINDER 1 + #define GxB_NO_COPYSIGN 1 + #define GxB_NO_LDEXP 1 // #define GxB_NO_CMPLX 1 // #define GxB_NO_POW 1 @@ -348,9 +260,6 @@ // GrB_TIMES_BOOL are renamed internally to GrB_LAND_BOOL, for example, so // uncommenting GxB_NO_LAND_BOOL disables all three operators. -// Any disabled binary operators will still work just fine, but operations -// using them will be slower. - // also needed by GrB_reduce to vector // #define GxB_NO_FIRST_INT8 1 // #define GxB_NO_FIRST_INT16 1 @@ -652,42 +561,42 @@ // #define GxB_NO_LE_UINT64 1 // #define GxB_NO_LE_FP32 1 // #define GxB_NO_LE_FP64 1 -// #define GxB_NO_LE_BOOL - -// #define GxB_NO_LOR_INT8 1 -// #define GxB_NO_LOR_INT16 1 -// #define GxB_NO_LOR_INT32 1 -// #define GxB_NO_LOR_INT64 1 -// #define GxB_NO_LOR_UINT8 1 -// #define GxB_NO_LOR_UINT16 1 -// #define GxB_NO_LOR_UINT32 1 -// #define GxB_NO_LOR_UINT64 1 -// #define GxB_NO_LOR_FP32 1 -// #define GxB_NO_LOR_FP64 1 +// #define GxB_NO_LE_BOOL 1 + + #define GxB_NO_LOR_INT8 1 + #define GxB_NO_LOR_INT16 1 + #define GxB_NO_LOR_INT32 1 + #define GxB_NO_LOR_INT64 1 + #define GxB_NO_LOR_UINT8 1 + #define GxB_NO_LOR_UINT16 1 + #define GxB_NO_LOR_UINT32 1 + #define GxB_NO_LOR_UINT64 1 + #define GxB_NO_LOR_FP32 1 + #define GxB_NO_LOR_FP64 1 // #define GxB_NO_LOR_BOOL 1 -// #define GxB_NO_LAND_INT8 1 -// #define GxB_NO_LAND_INT16 1 -// #define GxB_NO_LAND_INT32 1 -// #define GxB_NO_LAND_INT64 1 -// #define GxB_NO_LAND_UINT8 1 -// #define GxB_NO_LAND_UINT16 1 -// #define GxB_NO_LAND_UINT32 1 -// #define GxB_NO_LAND_UINT64 1 -// #define GxB_NO_LAND_FP32 1 -// #define GxB_NO_LAND_FP64 1 + #define GxB_NO_LAND_INT8 1 + #define GxB_NO_LAND_INT16 1 + #define GxB_NO_LAND_INT32 1 + #define GxB_NO_LAND_INT64 1 + #define GxB_NO_LAND_UINT8 1 + #define GxB_NO_LAND_UINT16 1 + #define GxB_NO_LAND_UINT32 1 + #define GxB_NO_LAND_UINT64 1 + #define GxB_NO_LAND_FP32 1 + #define GxB_NO_LAND_FP64 1 // #define GxB_NO_LAND_BOOL 1 -// #define GxB_NO_LXOR_INT8 1 -// #define GxB_NO_LXOR_INT16 1 -// #define GxB_NO_LXOR_INT32 1 -// #define GxB_NO_LXOR_INT64 1 -// #define GxB_NO_LXOR_UINT8 1 -// #define GxB_NO_LXOR_UINT16 1 -// #define GxB_NO_LXOR_UINT32 1 -// #define GxB_NO_LXOR_UINT64 1 -// #define GxB_NO_LXOR_FP32 1 -// #define GxB_NO_LXOR_FP64 1 + #define GxB_NO_LXOR_INT8 1 + #define GxB_NO_LXOR_INT16 1 + #define GxB_NO_LXOR_INT32 1 + #define GxB_NO_LXOR_INT64 1 + #define GxB_NO_LXOR_UINT8 1 + #define GxB_NO_LXOR_UINT16 1 + #define GxB_NO_LXOR_UINT32 1 + #define GxB_NO_LXOR_UINT64 1 + #define GxB_NO_LXOR_FP32 1 + #define GxB_NO_LXOR_FP64 1 // #define GxB_NO_LXOR_BOOL 1 // #define GxB_NO_ATAN2_FP32 1 @@ -711,87 +620,87 @@ // #define GxB_NO_CMPLX_FP32 1 // #define GxB_NO_CMPLX_FP64 1 -// #define GxB_NO_POW_INT8 1 -// #define GxB_NO_POW_INT16 1 -// #define GxB_NO_POW_INT32 1 -// #define GxB_NO_POW_INT64 1 -// #define GxB_NO_POW_UINT8 1 -// #define GxB_NO_POW_UINT16 1 -// #define GxB_NO_POW_UINT32 1 -// #define GxB_NO_POW_UINT64 1 + #define GxB_NO_POW_INT8 1 + #define GxB_NO_POW_INT16 1 + #define GxB_NO_POW_INT32 1 + #define GxB_NO_POW_INT64 1 + #define GxB_NO_POW_UINT8 1 + #define GxB_NO_POW_UINT16 1 + #define GxB_NO_POW_UINT32 1 + #define GxB_NO_POW_UINT64 1 // #define GxB_NO_POW_FP32 1 // #define GxB_NO_POW_FP64 1 -// #define GxB_NO_POW_FC32 1 -// #define GxB_NO_POW_FC64 1 -// #define GxB_NO_POW_BOOL 1 - -// #define GxB_NO_BOR_INT8 1 -// #define GxB_NO_BOR_INT16 1 -// #define GxB_NO_BOR_INT32 1 -// #define GxB_NO_BOR_INT64 1 + #define GxB_NO_POW_FC32 1 + #define GxB_NO_POW_FC64 1 + #define GxB_NO_POW_BOOL 1 + + #define GxB_NO_BOR_INT8 1 + #define GxB_NO_BOR_INT16 1 + #define GxB_NO_BOR_INT32 1 + #define GxB_NO_BOR_INT64 1 // #define GxB_NO_BOR_UINT8 1 // #define GxB_NO_BOR_UINT16 1 // #define GxB_NO_BOR_UINT32 1 // #define GxB_NO_BOR_UINT64 1 -// #define GxB_NO_BAND_INT8 1 -// #define GxB_NO_BAND_INT16 1 -// #define GxB_NO_BAND_INT32 1 -// #define GxB_NO_BAND_INT64 1 + #define GxB_NO_BAND_INT8 1 + #define GxB_NO_BAND_INT16 1 + #define GxB_NO_BAND_INT32 1 + #define GxB_NO_BAND_INT64 1 // #define GxB_NO_BAND_UINT8 1 // #define GxB_NO_BAND_UINT16 1 // #define GxB_NO_BAND_UINT32 1 // #define GxB_NO_BAND_UINT64 1 -// #define GxB_NO_BXOR_INT8 1 -// #define GxB_NO_BXOR_INT16 1 -// #define GxB_NO_BXOR_INT32 1 -// #define GxB_NO_BXOR_INT64 1 + #define GxB_NO_BXOR_INT8 1 + #define GxB_NO_BXOR_INT16 1 + #define GxB_NO_BXOR_INT32 1 + #define GxB_NO_BXOR_INT64 1 // #define GxB_NO_BXOR_UINT8 1 // #define GxB_NO_BXOR_UINT16 1 // #define GxB_NO_BXOR_UINT32 1 // #define GxB_NO_BXOR_UINT64 1 -// #define GxB_NO_BXNOR_INT8 1 -// #define GxB_NO_BXNOR_INT16 1 -// #define GxB_NO_BXNOR_INT32 1 -// #define GxB_NO_BXNOR_INT64 1 + #define GxB_NO_BXNOR_INT8 1 + #define GxB_NO_BXNOR_INT16 1 + #define GxB_NO_BXNOR_INT32 1 + #define GxB_NO_BXNOR_INT64 1 // #define GxB_NO_BXNOR_UINT8 1 // #define GxB_NO_BXNOR_UINT16 1 // #define GxB_NO_BXNOR_UINT32 1 // #define GxB_NO_BXNOR_UINT64 1 -// #define GxB_NO_BGET_INT8 1 -// #define GxB_NO_BGET_INT16 1 -// #define GxB_NO_BGET_INT32 1 -// #define GxB_NO_BGET_INT64 1 + #define GxB_NO_BGET_INT8 1 + #define GxB_NO_BGET_INT16 1 + #define GxB_NO_BGET_INT32 1 + #define GxB_NO_BGET_INT64 1 // #define GxB_NO_BGET_UINT8 1 // #define GxB_NO_BGET_UINT16 1 // #define GxB_NO_BGET_UINT32 1 // #define GxB_NO_BGET_UINT64 1 -// #define GxB_NO_BSET_INT8 1 -// #define GxB_NO_BSET_INT16 1 -// #define GxB_NO_BSET_INT32 1 -// #define GxB_NO_BSET_INT64 1 + #define GxB_NO_BSET_INT8 1 + #define GxB_NO_BSET_INT16 1 + #define GxB_NO_BSET_INT32 1 + #define GxB_NO_BSET_INT64 1 // #define GxB_NO_BSET_UINT8 1 // #define GxB_NO_BSET_UINT16 1 // #define GxB_NO_BSET_UINT32 1 // #define GxB_NO_BSET_UINT64 1 -// #define GxB_NO_BCLR_INT8 1 -// #define GxB_NO_BCLR_INT16 1 -// #define GxB_NO_BCLR_INT32 1 -// #define GxB_NO_BCLR_INT64 1 + #define GxB_NO_BCLR_INT8 1 + #define GxB_NO_BCLR_INT16 1 + #define GxB_NO_BCLR_INT32 1 + #define GxB_NO_BCLR_INT64 1 // #define GxB_NO_BCLR_UINT8 1 // #define GxB_NO_BCLR_UINT16 1 // #define GxB_NO_BCLR_UINT32 1 // #define GxB_NO_BCLR_UINT64 1 -// #define GxB_NO_BSHIFT_INT8 1 -// #define GxB_NO_BSHIFT_INT16 1 -// #define GxB_NO_BSHIFT_INT32 1 -// #define GxB_NO_BSHIFT_INT64 1 + #define GxB_NO_BSHIFT_INT8 1 + #define GxB_NO_BSHIFT_INT16 1 + #define GxB_NO_BSHIFT_INT32 1 + #define GxB_NO_BSHIFT_INT64 1 // #define GxB_NO_BSHIFT_UINT8 1 // #define GxB_NO_BSHIFT_UINT16 1 // #define GxB_NO_BSHIFT_UINT32 1 @@ -830,9 +739,6 @@ // GrB_*_build, or GrB_apply. They do affect GrB_reduce to vector, which // converts the reduction of a vector into a matrix-vector multiplication. -// Any disabled semirings will still work just fine, but operations using them -// will be slower. - //------------------------------------------------------------ // semirings with the boolean EQ monoid (also called XNOR) //------------------------------------------------------------ @@ -842,14 +748,13 @@ // 6 semirings with the EQ monoid -// #define GxB_NO_EQ_EQ_BOOL 1 -// #define GxB_NO_EQ_LAND_BOOL 1 + #define GxB_NO_EQ_EQ_BOOL 1 + #define GxB_NO_EQ_LAND_BOOL 1 // builtin: GrB_LXNOR_LOR_SEMIRING_BOOL == GxB_EQ_LOR_BOOL: -// #define GxB_NO_EQ_LOR_BOOL 1 -// #define GxB_NO_EQ_LXOR_BOOL 1 -// FIRST and SECOND are needed by GrB_reduce to vector: -// #define GxB_NO_EQ_FIRST_BOOL 1 -// #define GxB_NO_EQ_SECOND_BOOL 1 + #define GxB_NO_EQ_LOR_BOOL 1 + #define GxB_NO_EQ_LXOR_BOOL 1 + #define GxB_NO_EQ_FIRST_BOOL 1 + #define GxB_NO_EQ_SECOND_BOOL 1 #define GxB_NO_EQ_EQ_FP32 1 #define GxB_NO_EQ_EQ_FP64 1 @@ -935,14 +840,13 @@ // 6 semirings with the LAND monoid -// #define GxB_NO_LAND_EQ_BOOL 1 -// #define GxB_NO_LAND_LAND_BOOL 1 + #define GxB_NO_LAND_EQ_BOOL 1 + #define GxB_NO_LAND_LAND_BOOL 1 // builtin: GrB_LAND_LOR_SEMIRING_BOOL == GxB_LAND_LOR_BOOL: // #define GxB_NO_LAND_LOR_BOOL 1 -// #define GxB_NO_LAND_LXOR_BOOL 1 -// FIRST and SECOND are needed by GrB_reduce to vector: -// #define GxB_NO_LAND_FIRST_BOOL 1 -// #define GxB_NO_LAND_SECOND_BOOL 1 + #define GxB_NO_LAND_LXOR_BOOL 1 + #define GxB_NO_LAND_FIRST_BOOL 1 + #define GxB_NO_LAND_SECOND_BOOL 1 #define GxB_NO_LAND_EQ_FP32 1 #define GxB_NO_LAND_EQ_FP64 1 @@ -1029,14 +933,13 @@ // 6 semirings with the LOR monoid -// #define GxB_NO_LOR_EQ_BOOL 1 + #define GxB_NO_LOR_EQ_BOOL 1 // builtin GrB_LOR_LAND_SEMIRING_BOOL == GxB_LOR_LAND_BOOL: // #define GxB_NO_LOR_LAND_BOOL 1 -// #define GxB_NO_LOR_LOR_BOOL 1 -// #define GxB_NO_LOR_LXOR_BOOL 1 -// FIRST and SECOND are needed by GrB_reduce to vector: -// #define GxB_NO_LOR_FIRST_BOOL 1 -// #define GxB_NO_LOR_SECOND_BOOL 1 + #define GxB_NO_LOR_LOR_BOOL 1 + #define GxB_NO_LOR_LXOR_BOOL 1 + #define GxB_NO_LOR_FIRST_BOOL 1 + #define GxB_NO_LOR_SECOND_BOOL 1 #define GxB_NO_LOR_EQ_FP32 1 #define GxB_NO_LOR_EQ_FP64 1 @@ -1122,15 +1025,17 @@ // 7 semirings with the LXOR monoid (PAIR is unique to this monoid) -// #define GxB_NO_LXOR_EQ_BOOL 1 + #define GxB_NO_LXOR_EQ_BOOL 1 // builtin: GrB_LXOR_LAND_SEMIRING_BOOL == GxB_LXOR_LAND_BOOL: -// #define GxB_NO_LXOR_LAND_BOOL 1 -// #define GxB_NO_LXOR_LOR_BOOL 1 -// #define GxB_NO_LXOR_LXOR_BOOL 1 -// FIRST and SECOND are needed by GrB_reduce to vector: -// #define GxB_NO_LXOR_FIRST_BOOL 1 -// #define GxB_NO_LXOR_SECOND_BOOL 1 -// #define GxB_NO_LXOR_PAIR_BOOL 1 + #define GxB_NO_LXOR_LAND_BOOL 1 + #define GxB_NO_LXOR_LOR_BOOL 1 + #define GxB_NO_LXOR_LXOR_BOOL 1 + #define GxB_NO_LXOR_FIRST_BOOL 1 + #define GxB_NO_LXOR_SECOND_BOOL 1 + #ifndef GBMATLAB + // required for test coverage + #define GxB_NO_LXOR_PAIR_BOOL 1 + #endif #define GxB_NO_LXOR_EQ_FP32 1 #define GxB_NO_LXOR_EQ_FP64 1 @@ -1220,40 +1125,40 @@ // MAX: MIN, PLUS, TIMES, FIRST, SECOND // builtin GrB_*: -// #define GxB_NO_MAX_MIN_FP32 1 -// #define GxB_NO_MAX_MIN_FP64 1 -// #define GxB_NO_MAX_MIN_INT16 1 -// #define GxB_NO_MAX_MIN_INT32 1 -// #define GxB_NO_MAX_MIN_INT64 1 -// #define GxB_NO_MAX_MIN_INT8 1 -// #define GxB_NO_MAX_MIN_UINT16 1 -// #define GxB_NO_MAX_MIN_UINT32 1 -// #define GxB_NO_MAX_MIN_UINT64 1 -// #define GxB_NO_MAX_MIN_UINT8 1 + #define GxB_NO_MAX_MIN_FP32 1 + #define GxB_NO_MAX_MIN_FP64 1 + #define GxB_NO_MAX_MIN_INT16 1 + #define GxB_NO_MAX_MIN_INT32 1 + #define GxB_NO_MAX_MIN_INT64 1 + #define GxB_NO_MAX_MIN_INT8 1 + #define GxB_NO_MAX_MIN_UINT16 1 + #define GxB_NO_MAX_MIN_UINT32 1 + #define GxB_NO_MAX_MIN_UINT64 1 + #define GxB_NO_MAX_MIN_UINT8 1 // builtin GrB_*: -// #define GxB_NO_MAX_PLUS_FP32 1 -// #define GxB_NO_MAX_PLUS_FP64 1 -// #define GxB_NO_MAX_PLUS_INT16 1 -// #define GxB_NO_MAX_PLUS_INT32 1 -// #define GxB_NO_MAX_PLUS_INT64 1 -// #define GxB_NO_MAX_PLUS_INT8 1 -// #define GxB_NO_MAX_PLUS_UINT16 1 -// #define GxB_NO_MAX_PLUS_UINT32 1 -// #define GxB_NO_MAX_PLUS_UINT64 1 -// #define GxB_NO_MAX_PLUS_UINT8 1 + #define GxB_NO_MAX_PLUS_FP32 1 + #define GxB_NO_MAX_PLUS_FP64 1 + #define GxB_NO_MAX_PLUS_INT16 1 + #define GxB_NO_MAX_PLUS_INT32 1 + #define GxB_NO_MAX_PLUS_INT64 1 + #define GxB_NO_MAX_PLUS_INT8 1 + #define GxB_NO_MAX_PLUS_UINT16 1 + #define GxB_NO_MAX_PLUS_UINT32 1 + #define GxB_NO_MAX_PLUS_UINT64 1 + #define GxB_NO_MAX_PLUS_UINT8 1 // builtin GrB_*: -// #define GxB_NO_MAX_TIMES_FP32 1 -// #define GxB_NO_MAX_TIMES_FP64 1 -// #define GxB_NO_MAX_TIMES_INT16 1 -// #define GxB_NO_MAX_TIMES_INT32 1 -// #define GxB_NO_MAX_TIMES_INT64 1 -// #define GxB_NO_MAX_TIMES_INT8 1 -// #define GxB_NO_MAX_TIMES_UINT16 1 -// #define GxB_NO_MAX_TIMES_UINT32 1 -// #define GxB_NO_MAX_TIMES_UINT64 1 -// #define GxB_NO_MAX_TIMES_UINT8 1 + #define GxB_NO_MAX_TIMES_FP32 1 + #define GxB_NO_MAX_TIMES_FP64 1 + #define GxB_NO_MAX_TIMES_INT16 1 + #define GxB_NO_MAX_TIMES_INT32 1 + #define GxB_NO_MAX_TIMES_INT64 1 + #define GxB_NO_MAX_TIMES_INT8 1 + #define GxB_NO_MAX_TIMES_UINT16 1 + #define GxB_NO_MAX_TIMES_UINT32 1 + #define GxB_NO_MAX_TIMES_UINT64 1 + #define GxB_NO_MAX_TIMES_UINT8 1 // builtin GrB_*: also needed by GrB_reduce to vector // #define GxB_NO_MAX_FIRST_FP32 1 @@ -1390,16 +1295,16 @@ // MIN: MAX, PLUS, TIMES, FIRST, SECOND // builtin GrB_*: -// #define GxB_NO_MIN_MAX_FP32 1 -// #define GxB_NO_MIN_MAX_FP64 1 -// #define GxB_NO_MIN_MAX_INT16 1 -// #define GxB_NO_MIN_MAX_INT32 1 -// #define GxB_NO_MIN_MAX_INT64 1 -// #define GxB_NO_MIN_MAX_INT8 1 -// #define GxB_NO_MIN_MAX_UINT16 1 -// #define GxB_NO_MIN_MAX_UINT32 1 -// #define GxB_NO_MIN_MAX_UINT64 1 -// #define GxB_NO_MIN_MAX_UINT8 1 + #define GxB_NO_MIN_MAX_FP32 1 + #define GxB_NO_MIN_MAX_FP64 1 + #define GxB_NO_MIN_MAX_INT16 1 + #define GxB_NO_MIN_MAX_INT32 1 + #define GxB_NO_MIN_MAX_INT64 1 + #define GxB_NO_MIN_MAX_INT8 1 + #define GxB_NO_MIN_MAX_UINT16 1 + #define GxB_NO_MIN_MAX_UINT32 1 + #define GxB_NO_MIN_MAX_UINT64 1 + #define GxB_NO_MIN_MAX_UINT8 1 // builtin GrB_*: // #define GxB_NO_MIN_PLUS_FP32 1 @@ -1414,16 +1319,16 @@ // #define GxB_NO_MIN_PLUS_UINT8 1 // builtin GrB_*: -// #define GxB_NO_MIN_TIMES_FP32 1 -// #define GxB_NO_MIN_TIMES_FP64 1 -// #define GxB_NO_MIN_TIMES_INT16 1 -// #define GxB_NO_MIN_TIMES_INT32 1 -// #define GxB_NO_MIN_TIMES_INT64 1 -// #define GxB_NO_MIN_TIMES_INT8 1 -// #define GxB_NO_MIN_TIMES_UINT16 1 -// #define GxB_NO_MIN_TIMES_UINT32 1 -// #define GxB_NO_MIN_TIMES_UINT64 1 -// #define GxB_NO_MIN_TIMES_UINT8 1 + #define GxB_NO_MIN_TIMES_FP32 1 + #define GxB_NO_MIN_TIMES_FP64 1 + #define GxB_NO_MIN_TIMES_INT16 1 + #define GxB_NO_MIN_TIMES_INT32 1 + #define GxB_NO_MIN_TIMES_INT64 1 + #define GxB_NO_MIN_TIMES_INT8 1 + #define GxB_NO_MIN_TIMES_UINT16 1 + #define GxB_NO_MIN_TIMES_UINT32 1 + #define GxB_NO_MIN_TIMES_UINT64 1 + #define GxB_NO_MIN_TIMES_UINT8 1 // builtin GrB_*: also needed by GrB_reduce to vector // #define GxB_NO_MIN_FIRST_FP32 1 @@ -1572,27 +1477,27 @@ // #define GxB_NO_PLUS_PAIR_UINT8 1 // builtin GrB_*: -// #define GxB_NO_PLUS_MIN_FP32 1 -// #define GxB_NO_PLUS_MIN_FP64 1 -// #define GxB_NO_PLUS_MIN_INT16 1 -// #define GxB_NO_PLUS_MIN_INT32 1 -// #define GxB_NO_PLUS_MIN_INT64 1 -// #define GxB_NO_PLUS_MIN_INT8 1 -// #define GxB_NO_PLUS_MIN_UINT16 1 -// #define GxB_NO_PLUS_MIN_UINT32 1 -// #define GxB_NO_PLUS_MIN_UINT64 1 -// #define GxB_NO_PLUS_MIN_UINT8 1 - -// #define GxB_NO_PLUS_MAX_FP32 1 -// #define GxB_NO_PLUS_MAX_FP64 1 -// #define GxB_NO_PLUS_MAX_INT16 1 -// #define GxB_NO_PLUS_MAX_INT32 1 -// #define GxB_NO_PLUS_MAX_INT64 1 -// #define GxB_NO_PLUS_MAX_INT8 1 -// #define GxB_NO_PLUS_MAX_UINT16 1 -// #define GxB_NO_PLUS_MAX_UINT32 1 -// #define GxB_NO_PLUS_MAX_UINT64 1 -// #define GxB_NO_PLUS_MAX_UINT8 1 + #define GxB_NO_PLUS_MIN_FP32 1 + #define GxB_NO_PLUS_MIN_FP64 1 + #define GxB_NO_PLUS_MIN_INT16 1 + #define GxB_NO_PLUS_MIN_INT32 1 + #define GxB_NO_PLUS_MIN_INT64 1 + #define GxB_NO_PLUS_MIN_INT8 1 + #define GxB_NO_PLUS_MIN_UINT16 1 + #define GxB_NO_PLUS_MIN_UINT32 1 + #define GxB_NO_PLUS_MIN_UINT64 1 + #define GxB_NO_PLUS_MIN_UINT8 1 + + #define GxB_NO_PLUS_MAX_FP32 1 + #define GxB_NO_PLUS_MAX_FP64 1 + #define GxB_NO_PLUS_MAX_INT16 1 + #define GxB_NO_PLUS_MAX_INT32 1 + #define GxB_NO_PLUS_MAX_INT64 1 + #define GxB_NO_PLUS_MAX_INT8 1 + #define GxB_NO_PLUS_MAX_UINT16 1 + #define GxB_NO_PLUS_MAX_UINT32 1 + #define GxB_NO_PLUS_MAX_UINT64 1 + #define GxB_NO_PLUS_MAX_UINT8 1 // not GrB_*, used in LAGraph: sparse deep neural network // #define GxB_NO_PLUS_PLUS_FP32 1 @@ -1745,73 +1650,73 @@ // monoid multiply ops // TIMES: MIN, MAX, PLUS, TIMES, FIRST, SECOND -// #define GxB_NO_TIMES_MIN_FP32 1 -// #define GxB_NO_TIMES_MIN_FP64 1 -// #define GxB_NO_TIMES_MIN_INT16 1 -// #define GxB_NO_TIMES_MIN_INT32 1 -// #define GxB_NO_TIMES_MIN_INT64 1 -// #define GxB_NO_TIMES_MIN_INT8 1 -// #define GxB_NO_TIMES_MIN_UINT16 1 -// #define GxB_NO_TIMES_MIN_UINT32 1 -// #define GxB_NO_TIMES_MIN_UINT64 1 -// #define GxB_NO_TIMES_MIN_UINT8 1 - -// #define GxB_NO_TIMES_MAX_FP32 1 -// #define GxB_NO_TIMES_MAX_FP64 1 -// #define GxB_NO_TIMES_MAX_INT16 1 -// #define GxB_NO_TIMES_MAX_INT32 1 -// #define GxB_NO_TIMES_MAX_INT64 1 -// #define GxB_NO_TIMES_MAX_INT8 1 -// #define GxB_NO_TIMES_MAX_UINT16 1 -// #define GxB_NO_TIMES_MAX_UINT32 1 -// #define GxB_NO_TIMES_MAX_UINT64 1 -// #define GxB_NO_TIMES_MAX_UINT8 1 - -// #define GxB_NO_TIMES_PLUS_FP32 1 -// #define GxB_NO_TIMES_PLUS_FP64 1 -// #define GxB_NO_TIMES_PLUS_INT16 1 -// #define GxB_NO_TIMES_PLUS_INT32 1 -// #define GxB_NO_TIMES_PLUS_INT64 1 -// #define GxB_NO_TIMES_PLUS_INT8 1 -// #define GxB_NO_TIMES_PLUS_UINT16 1 -// #define GxB_NO_TIMES_PLUS_UINT32 1 -// #define GxB_NO_TIMES_PLUS_UINT64 1 -// #define GxB_NO_TIMES_PLUS_UINT8 1 - -// #define GxB_NO_TIMES_TIMES_FP32 1 -// #define GxB_NO_TIMES_TIMES_FP64 1 -// #define GxB_NO_TIMES_TIMES_INT16 1 -// #define GxB_NO_TIMES_TIMES_INT32 1 -// #define GxB_NO_TIMES_TIMES_INT64 1 -// #define GxB_NO_TIMES_TIMES_INT8 1 -// #define GxB_NO_TIMES_TIMES_UINT16 1 -// #define GxB_NO_TIMES_TIMES_UINT32 1 -// #define GxB_NO_TIMES_TIMES_UINT64 1 -// #define GxB_NO_TIMES_TIMES_UINT8 1 + #define GxB_NO_TIMES_MIN_FP32 1 + #define GxB_NO_TIMES_MIN_FP64 1 + #define GxB_NO_TIMES_MIN_INT16 1 + #define GxB_NO_TIMES_MIN_INT32 1 + #define GxB_NO_TIMES_MIN_INT64 1 + #define GxB_NO_TIMES_MIN_INT8 1 + #define GxB_NO_TIMES_MIN_UINT16 1 + #define GxB_NO_TIMES_MIN_UINT32 1 + #define GxB_NO_TIMES_MIN_UINT64 1 + #define GxB_NO_TIMES_MIN_UINT8 1 + + #define GxB_NO_TIMES_MAX_FP32 1 + #define GxB_NO_TIMES_MAX_FP64 1 + #define GxB_NO_TIMES_MAX_INT16 1 + #define GxB_NO_TIMES_MAX_INT32 1 + #define GxB_NO_TIMES_MAX_INT64 1 + #define GxB_NO_TIMES_MAX_INT8 1 + #define GxB_NO_TIMES_MAX_UINT16 1 + #define GxB_NO_TIMES_MAX_UINT32 1 + #define GxB_NO_TIMES_MAX_UINT64 1 + #define GxB_NO_TIMES_MAX_UINT8 1 + + #define GxB_NO_TIMES_PLUS_FP32 1 + #define GxB_NO_TIMES_PLUS_FP64 1 + #define GxB_NO_TIMES_PLUS_INT16 1 + #define GxB_NO_TIMES_PLUS_INT32 1 + #define GxB_NO_TIMES_PLUS_INT64 1 + #define GxB_NO_TIMES_PLUS_INT8 1 + #define GxB_NO_TIMES_PLUS_UINT16 1 + #define GxB_NO_TIMES_PLUS_UINT32 1 + #define GxB_NO_TIMES_PLUS_UINT64 1 + #define GxB_NO_TIMES_PLUS_UINT8 1 + + #define GxB_NO_TIMES_TIMES_FP32 1 + #define GxB_NO_TIMES_TIMES_FP64 1 + #define GxB_NO_TIMES_TIMES_INT16 1 + #define GxB_NO_TIMES_TIMES_INT32 1 + #define GxB_NO_TIMES_TIMES_INT64 1 + #define GxB_NO_TIMES_TIMES_INT8 1 + #define GxB_NO_TIMES_TIMES_UINT16 1 + #define GxB_NO_TIMES_TIMES_UINT32 1 + #define GxB_NO_TIMES_TIMES_UINT64 1 + #define GxB_NO_TIMES_TIMES_UINT8 1 // needed by GrB_reduce to vector -// #define GxB_NO_TIMES_FIRST_FP32 1 -// #define GxB_NO_TIMES_FIRST_FP64 1 -// #define GxB_NO_TIMES_FIRST_INT16 1 -// #define GxB_NO_TIMES_FIRST_INT32 1 -// #define GxB_NO_TIMES_FIRST_INT64 1 -// #define GxB_NO_TIMES_FIRST_INT8 1 -// #define GxB_NO_TIMES_FIRST_UINT16 1 -// #define GxB_NO_TIMES_FIRST_UINT32 1 -// #define GxB_NO_TIMES_FIRST_UINT64 1 -// #define GxB_NO_TIMES_FIRST_UINT8 1 + #define GxB_NO_TIMES_FIRST_FP32 1 + #define GxB_NO_TIMES_FIRST_FP64 1 + #define GxB_NO_TIMES_FIRST_INT16 1 + #define GxB_NO_TIMES_FIRST_INT32 1 + #define GxB_NO_TIMES_FIRST_INT64 1 + #define GxB_NO_TIMES_FIRST_INT8 1 + #define GxB_NO_TIMES_FIRST_UINT16 1 + #define GxB_NO_TIMES_FIRST_UINT32 1 + #define GxB_NO_TIMES_FIRST_UINT64 1 + #define GxB_NO_TIMES_FIRST_UINT8 1 // needed by GrB_reduce to vector -// #define GxB_NO_TIMES_SECOND_FP32 1 -// #define GxB_NO_TIMES_SECOND_FP64 1 -// #define GxB_NO_TIMES_SECOND_INT16 1 -// #define GxB_NO_TIMES_SECOND_INT32 1 -// #define GxB_NO_TIMES_SECOND_INT64 1 -// #define GxB_NO_TIMES_SECOND_INT8 1 -// #define GxB_NO_TIMES_SECOND_UINT16 1 -// #define GxB_NO_TIMES_SECOND_UINT32 1 -// #define GxB_NO_TIMES_SECOND_UINT64 1 -// #define GxB_NO_TIMES_SECOND_UINT8 1 + #define GxB_NO_TIMES_SECOND_FP32 1 + #define GxB_NO_TIMES_SECOND_FP64 1 + #define GxB_NO_TIMES_SECOND_INT16 1 + #define GxB_NO_TIMES_SECOND_INT32 1 + #define GxB_NO_TIMES_SECOND_INT64 1 + #define GxB_NO_TIMES_SECOND_INT8 1 + #define GxB_NO_TIMES_SECOND_UINT16 1 + #define GxB_NO_TIMES_SECOND_UINT32 1 + #define GxB_NO_TIMES_SECOND_UINT64 1 + #define GxB_NO_TIMES_SECOND_UINT8 1 #define GxB_NO_TIMES_DIV_FP32 1 #define GxB_NO_TIMES_DIV_FP64 1 @@ -1921,12 +1826,12 @@ // #define GxB_NO_PLUS_TIMES_FC64 1 // needed by GrB_reduce to vector, or s = sum (A) in @GrB interface -// #define GxB_NO_PLUS_FIRST_FC32 1 -// #define GxB_NO_PLUS_FIRST_FC64 1 + #define GxB_NO_PLUS_FIRST_FC32 1 + #define GxB_NO_PLUS_FIRST_FC64 1 // needed by GrB_reduce to vector, or s = sum (A) in @GrB interface -// #define GxB_NO_PLUS_SECOND_FC32 1 -// #define GxB_NO_PLUS_SECOND_FC64 1 + #define GxB_NO_PLUS_SECOND_FC32 1 + #define GxB_NO_PLUS_SECOND_FC64 1 #define GxB_NO_PLUS_PAIR_FC32 1 #define GxB_NO_PLUS_PAIR_FC64 1 @@ -1946,20 +1851,19 @@ #define GxB_NO_TIMES_PLUS_FC32 1 #define GxB_NO_TIMES_PLUS_FC64 1 -// GxB_TIMES_TIMES_FC32 is required for testing (GraphBLAS/Test and Tcov), -// so it is not disabled when GraphBLAS is compiled for MATLAB. #ifndef GBMATLAB + // required for test coverage #define GxB_NO_TIMES_TIMES_FC32 1 #endif #define GxB_NO_TIMES_TIMES_FC64 1 // needed by GrB_reduce to vector, or s = prod (A) in @GrB interface -// #define GxB_NO_TIMES_FIRST_FC32 1 -// #define GxB_NO_TIMES_FIRST_FC64 1 + #define GxB_NO_TIMES_FIRST_FC32 1 + #define GxB_NO_TIMES_FIRST_FC64 1 // needed by GrB_reduce to vector, or s = prod (A) in @GrB interface -// #define GxB_NO_TIMES_SECOND_FC32 1 -// #define GxB_NO_TIMES_SECOND_FC64 1 + #define GxB_NO_TIMES_SECOND_FC32 1 + #define GxB_NO_TIMES_SECOND_FC64 1 #define GxB_NO_TIMES_MINUS_FC32 1 #define GxB_NO_TIMES_MINUS_FC64 1 @@ -2234,89 +2138,89 @@ // bitwise semirings: //---------------------------------------- -// 64 bitwise semirings: for 4 unsigned integer types, all enabled below: +// 64 bitwise semirings: for 4 unsigned integer types // // (BOR, BAND, BXOR, BXNOR) x (BOR, BAND, BXOR, BXNOR) -// #define GxB_NO_BOR_BOR_UINT8 1 -// #define GxB_NO_BOR_BOR_UINT16 1 -// #define GxB_NO_BOR_BOR_UINT32 1 -// #define GxB_NO_BOR_BOR_UINT64 1 - -// #define GxB_NO_BOR_BAND_UINT8 1 -// #define GxB_NO_BOR_BAND_UINT16 1 -// #define GxB_NO_BOR_BAND_UINT32 1 -// #define GxB_NO_BOR_BAND_UINT64 1 - -// #define GxB_NO_BOR_BXOR_UINT8 1 -// #define GxB_NO_BOR_BXOR_UINT16 1 -// #define GxB_NO_BOR_BXOR_UINT32 1 -// #define GxB_NO_BOR_BXOR_UINT64 1 - -// #define GxB_NO_BOR_BXNOR_UINT8 1 -// #define GxB_NO_BOR_BXNOR_UINT16 1 -// #define GxB_NO_BOR_BXNOR_UINT32 1 -// #define GxB_NO_BOR_BXNOR_UINT64 1 - -// #define GxB_NO_BAND_BOR_UINT8 1 -// #define GxB_NO_BAND_BOR_UINT16 1 -// #define GxB_NO_BAND_BOR_UINT32 1 -// #define GxB_NO_BAND_BOR_UINT64 1 - -// #define GxB_NO_BAND_BAND_UINT8 1 -// #define GxB_NO_BAND_BAND_UINT16 1 -// #define GxB_NO_BAND_BAND_UINT32 1 -// #define GxB_NO_BAND_BAND_UINT64 1 - -// #define GxB_NO_BAND_BXOR_UINT8 1 -// #define GxB_NO_BAND_BXOR_UINT16 1 -// #define GxB_NO_BAND_BXOR_UINT32 1 -// #define GxB_NO_BAND_BXOR_UINT64 1 - -// #define GxB_NO_BAND_BXNOR_UINT8 1 -// #define GxB_NO_BAND_BXNOR_UINT16 1 -// #define GxB_NO_BAND_BXNOR_UINT32 1 -// #define GxB_NO_BAND_BXNOR_UINT64 1 - -// #define GxB_NO_BXOR_BOR_UINT8 1 -// #define GxB_NO_BXOR_BOR_UINT16 1 -// #define GxB_NO_BXOR_BOR_UINT32 1 -// #define GxB_NO_BXOR_BOR_UINT64 1 - -// #define GxB_NO_BXOR_BAND_UINT8 1 -// #define GxB_NO_BXOR_BAND_UINT16 1 -// #define GxB_NO_BXOR_BAND_UINT32 1 -// #define GxB_NO_BXOR_BAND_UINT64 1 - -// #define GxB_NO_BXOR_BXOR_UINT8 1 -// #define GxB_NO_BXOR_BXOR_UINT16 1 -// #define GxB_NO_BXOR_BXOR_UINT32 1 -// #define GxB_NO_BXOR_BXOR_UINT64 1 - -// #define GxB_NO_BXOR_BXNOR_UINT8 1 -// #define GxB_NO_BXOR_BXNOR_UINT16 1 -// #define GxB_NO_BXOR_BXNOR_UINT32 1 -// #define GxB_NO_BXOR_BXNOR_UINT64 1 - -// #define GxB_NO_BXNOR_BOR_UINT8 1 -// #define GxB_NO_BXNOR_BOR_UINT16 1 -// #define GxB_NO_BXNOR_BOR_UINT32 1 -// #define GxB_NO_BXNOR_BOR_UINT64 1 - -// #define GxB_NO_BXNOR_BAND_UINT8 1 -// #define GxB_NO_BXNOR_BAND_UINT16 1 -// #define GxB_NO_BXNOR_BAND_UINT32 1 -// #define GxB_NO_BXNOR_BAND_UINT64 1 - -// #define GxB_NO_BXNOR_BXOR_UINT8 1 -// #define GxB_NO_BXNOR_BXOR_UINT16 1 -// #define GxB_NO_BXNOR_BXOR_UINT32 1 -// #define GxB_NO_BXNOR_BXOR_UINT64 1 - -// #define GxB_NO_BXNOR_BXNOR_UINT8 1 -// #define GxB_NO_BXNOR_BXNOR_UINT16 1 -// #define GxB_NO_BXNOR_BXNOR_UINT32 1 -// #define GxB_NO_BXNOR_BXNOR_UINT64 1 + #define GxB_NO_BOR_BOR_UINT8 1 + #define GxB_NO_BOR_BOR_UINT16 1 + #define GxB_NO_BOR_BOR_UINT32 1 + #define GxB_NO_BOR_BOR_UINT64 1 + + #define GxB_NO_BOR_BAND_UINT8 1 + #define GxB_NO_BOR_BAND_UINT16 1 + #define GxB_NO_BOR_BAND_UINT32 1 + #define GxB_NO_BOR_BAND_UINT64 1 + + #define GxB_NO_BOR_BXOR_UINT8 1 + #define GxB_NO_BOR_BXOR_UINT16 1 + #define GxB_NO_BOR_BXOR_UINT32 1 + #define GxB_NO_BOR_BXOR_UINT64 1 + + #define GxB_NO_BOR_BXNOR_UINT8 1 + #define GxB_NO_BOR_BXNOR_UINT16 1 + #define GxB_NO_BOR_BXNOR_UINT32 1 + #define GxB_NO_BOR_BXNOR_UINT64 1 + + #define GxB_NO_BAND_BOR_UINT8 1 + #define GxB_NO_BAND_BOR_UINT16 1 + #define GxB_NO_BAND_BOR_UINT32 1 + #define GxB_NO_BAND_BOR_UINT64 1 + + #define GxB_NO_BAND_BAND_UINT8 1 + #define GxB_NO_BAND_BAND_UINT16 1 + #define GxB_NO_BAND_BAND_UINT32 1 + #define GxB_NO_BAND_BAND_UINT64 1 + + #define GxB_NO_BAND_BXOR_UINT8 1 + #define GxB_NO_BAND_BXOR_UINT16 1 + #define GxB_NO_BAND_BXOR_UINT32 1 + #define GxB_NO_BAND_BXOR_UINT64 1 + + #define GxB_NO_BAND_BXNOR_UINT8 1 + #define GxB_NO_BAND_BXNOR_UINT16 1 + #define GxB_NO_BAND_BXNOR_UINT32 1 + #define GxB_NO_BAND_BXNOR_UINT64 1 + + #define GxB_NO_BXOR_BOR_UINT8 1 + #define GxB_NO_BXOR_BOR_UINT16 1 + #define GxB_NO_BXOR_BOR_UINT32 1 + #define GxB_NO_BXOR_BOR_UINT64 1 + + #define GxB_NO_BXOR_BAND_UINT8 1 + #define GxB_NO_BXOR_BAND_UINT16 1 + #define GxB_NO_BXOR_BAND_UINT32 1 + #define GxB_NO_BXOR_BAND_UINT64 1 + + #define GxB_NO_BXOR_BXOR_UINT8 1 + #define GxB_NO_BXOR_BXOR_UINT16 1 + #define GxB_NO_BXOR_BXOR_UINT32 1 + #define GxB_NO_BXOR_BXOR_UINT64 1 + + #define GxB_NO_BXOR_BXNOR_UINT8 1 + #define GxB_NO_BXOR_BXNOR_UINT16 1 + #define GxB_NO_BXOR_BXNOR_UINT32 1 + #define GxB_NO_BXOR_BXNOR_UINT64 1 + + #define GxB_NO_BXNOR_BOR_UINT8 1 + #define GxB_NO_BXNOR_BOR_UINT16 1 + #define GxB_NO_BXNOR_BOR_UINT32 1 + #define GxB_NO_BXNOR_BOR_UINT64 1 + + #define GxB_NO_BXNOR_BAND_UINT8 1 + #define GxB_NO_BXNOR_BAND_UINT16 1 + #define GxB_NO_BXNOR_BAND_UINT32 1 + #define GxB_NO_BXNOR_BAND_UINT64 1 + + #define GxB_NO_BXNOR_BXOR_UINT8 1 + #define GxB_NO_BXNOR_BXOR_UINT16 1 + #define GxB_NO_BXNOR_BXOR_UINT32 1 + #define GxB_NO_BXNOR_BXOR_UINT64 1 + + #define GxB_NO_BXNOR_BXNOR_UINT8 1 + #define GxB_NO_BXNOR_BXNOR_UINT16 1 + #define GxB_NO_BXNOR_BXNOR_UINT32 1 + #define GxB_NO_BXNOR_BXNOR_UINT64 1 //---------------------------------------- // semirings with positional multiplicative operators: @@ -2333,8 +2237,10 @@ // mult: (FIRSTI, FIRSTI1, FIRSTJ, FIRSTJ1, SECONDJ, SECONDJ1) x // types: (int32, int64) -// enable GxB_MIN_FIRSTI_INT32 for test coverage: -// #define GxB_NO_MIN_FIRSTI_INT32 1 + #ifndef GBMATLAB + // required for test coverage + #define GxB_NO_MIN_FIRSTI_INT32 1 + #endif #define GxB_NO_MIN_FIRSTI_INT64 1 #define GxB_NO_MIN_FIRSTI1_INT32 1 #define GxB_NO_MIN_FIRSTI1_INT64 1 diff --git a/Source/README.txt b/Source/README.txt index daa6740c2f..1962acd4fa 100644 --- a/Source/README.txt +++ b/Source/README.txt @@ -15,6 +15,8 @@ Source/*/factory/* files are not used in the JIT. Files and folders in Source/ +add GrB_eWiseAdd and GxB_eWiseUnion (see also ewise folder) + aliased methods for determining if any components of a matrix are aliased (shared) with another matrix. Such a matrix is called shallow (an array such as A->i is shallow @@ -24,7 +26,7 @@ aliased methods for determining if any components of a matrix apply GrB_apply -assign GrB_assgn and GxB_assign +assign GrB_assign and GxB_assign binaryop GrB_BinaryOp object @@ -67,7 +69,9 @@ dup GrB_dup element GrB_setElement, GrB_extractElement, GrB_removeElement -ewise GrB_eWiseAdd, GrB_eWiseMult, and GxB_eWiseUnion +emult GrB_eWiseMult (see also ewise folder) + +ewise element-wise methods for ewise add, emult, and union extract GrB_extract @@ -99,6 +103,8 @@ include general-purpose header files that do not fit into any settings, and GB_include.h which is a primary internal include file. +indexbinaryop GxB_IndexBinaryOp object + indexunaryop GrB_IndexUnaryOp object init GrB_init, GxB_init, GrB_finalize, GrB_error, GrB_getVersion @@ -190,3 +196,4 @@ werk the Werk space is a small amount of space on the stack zstd_wrapper wrapper for the zstd compression package + diff --git a/Source/ewise/GB_add.c b/Source/add/GB_add.c similarity index 98% rename from Source/ewise/GB_add.c rename to Source/add/GB_add.c index 0c99242920..7739c5bf53 100644 --- a/Source/ewise/GB_add.c +++ b/Source/add/GB_add.c @@ -46,7 +46,7 @@ // C on input is empty, see GB_add_phase2.c. -#include "ewise/GB_add.h" +#include "add/GB_add.h" #define GB_FREE_ALL ; @@ -65,6 +65,7 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B const GrB_Scalar alpha, // alpha and beta ignored for eWiseAdd, const GrB_Scalar beta, // nonempty scalars for GxB_eWiseUnion const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped const bool A_and_B_are_disjoint, // if true, A and B are disjoint GB_Werk Werk ) @@ -216,7 +217,7 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B info = GB_add_phase2 ( // computed or used by phase2: - C, ctype, C_is_csc, op, A_and_B_are_disjoint, + C, ctype, C_is_csc, op, flipij, A_and_B_are_disjoint, // from phase1 &Cp, Cp_size, Cnvec_nonempty, // from phase1a: diff --git a/Source/ewise/GB_add.h b/Source/add/GB_add.h similarity index 82% rename from Source/ewise/GB_add.h rename to Source/add/GB_add.h index c2d0cdedff..a3adeb59d0 100644 --- a/Source/ewise/GB_add.h +++ b/Source/add/GB_add.h @@ -27,29 +27,11 @@ GrB_Info GB_add // C=A+B, C=A+B, or C=A+B const GrB_Scalar alpha, // alpha and beta ignored for eWiseAdd, const GrB_Scalar beta, // nonempty scalars for GxB_eWiseUnion const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped const bool A_and_B_are_disjoint, // if true, A and B are disjoint GB_Werk Werk ) ; -GrB_Info GB_add_phase0 // find vectors in C for C=A+B or C=A+B -( - int64_t *p_Cnvec, // # of vectors to compute in C - int64_t *restrict *Ch_handle, // Ch: size Cnvec, or NULL - size_t *Ch_size_handle, // size of Ch in bytes - int64_t *restrict *C_to_M_handle, // C_to_M: size Cnvec, or NULL - size_t *C_to_M_size_handle, // size of C_to_M in bytes - int64_t *restrict *C_to_A_handle, // C_to_A: size Cnvec, or NULL - size_t *C_to_A_size_handle, // size of C_to_A in bytes - int64_t *restrict *C_to_B_handle, // C_to_B: of size Cnvec, or NULL - size_t *C_to_B_size_handle, // size of C_to_A in bytes - bool *p_Ch_is_Mh, // if true, then Ch == Mh - int *C_sparsity, // sparsity structure of C - const GrB_Matrix M, // optional mask, may be NULL; not complemented - const GrB_Matrix A, // first input matrix - const GrB_Matrix B, // second input matrix - GB_Werk Werk -) ; - GrB_Info GB_add_phase1 // count nnz in each C(:,j) ( int64_t **Cp_handle, // output of size Cnvec+1 @@ -82,6 +64,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B const GrB_Type ctype, // type of output matrix C const bool C_is_csc, // format of output matrix C const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped const bool A_and_B_are_disjoint, // if true, then A and B are disjoint // from phase1: int64_t **Cp_handle, // vector pointers for C diff --git a/Source/ewise/GB_add_iso.c b/Source/add/GB_add_iso.c similarity index 98% rename from Source/ewise/GB_add_iso.c rename to Source/add/GB_add_iso.c index 18703f2c6d..1b3637c197 100644 --- a/Source/ewise/GB_add_iso.c +++ b/Source/add/GB_add_iso.c @@ -11,8 +11,8 @@ // results in an iso matrix C. If true, the output scalar c is the iso value // for the matrix C. -#include "ewise/GB_add.h" -#include "ewise/GB_emult.h" +#include "add/GB_add.h" +#include "emult/GB_emult.h" bool GB_add_iso // c = op(a,b), return true if C is iso ( @@ -171,6 +171,8 @@ bool GB_add_iso // c = op(a,b), return true if C is iso // C is iso if op(a,beta) == op(a,b) == op(alpha,b) //------------------------------------------------------------------ + ASSERT (fadd != NULL) ; + // a = (xtype) Ax [0] GB_void a [GB_VLA(xsize)] ; GB_cast_scalar (a, xcode, A->x, acode, asize) ; @@ -248,6 +250,7 @@ bool GB_add_iso // c = op(a,b), return true if C is iso // get the binary operator const GxB_binary_function fadd = op->binop_function ; + ASSERT (fadd != NULL) ; const GrB_Type xtype = op->xtype ; const GrB_Type ytype = op->ytype ; diff --git a/Source/ewise/GB_add_phase0.c b/Source/add/GB_add_phase0.c similarity index 96% rename from Source/ewise/GB_add_phase0.c rename to Source/add/GB_add_phase0.c index 2074c577a6..a1a0bfcb16 100644 --- a/Source/ewise/GB_add_phase0.c +++ b/Source/add/GB_add_phase0.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // The eWise add of two matrices, C=A+B, C=A+B, or C=A+B starts with // this phase, which determines which vectors of C need to be computed. // This phase is also used for GB_masker, and for GB_SUBASSIGN_TWO_SLICE. @@ -72,7 +70,7 @@ GB_FREE_WORKSPACE ; \ } -#include "ewise/GB_add.h" +#include "add/GB_add.h" //------------------------------------------------------------------------------ // GB_allocate_result @@ -115,24 +113,7 @@ static inline bool GB_allocate_result // GB_add_phase0: find the vectors of C for C=A+B //------------------------------------------------------------------------------ -GrB_Info GB_add_phase0 // find vectors in C for C=A+B or C=A+B -( - int64_t *p_Cnvec, // # of vectors to compute in C - int64_t *restrict *Ch_handle, // Ch: size Cnvec, or NULL - size_t *Ch_size_handle, // size of Ch in bytes - int64_t *restrict *C_to_M_handle, // C_to_M: size Cnvec, or NULL - size_t *C_to_M_size_handle, // size of C_to_M in bytes - int64_t *restrict *C_to_A_handle, // C_to_A: size Cnvec, or NULL - size_t *C_to_A_size_handle, // size of C_to_A in bytes - int64_t *restrict *C_to_B_handle, // C_to_B: of size Cnvec, or NULL - size_t *C_to_B_size_handle, // size of C_to_A in bytes - bool *p_Ch_is_Mh, // if true, then Ch == Mh - int *C_sparsity, // sparsity structure of C - const GrB_Matrix M, // optional mask, may be NULL; not complemented - const GrB_Matrix A, // first input matrix - const GrB_Matrix B, // second input matrix - GB_Werk Werk -) +GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) { //-------------------------------------------------------------------------- @@ -407,7 +388,7 @@ GrB_Info GB_add_phase0 // find vectors in C for C=A+B or C=A+B // cumulative sum of entries in Ch for each task //---------------------------------------------------------------------- - GB_cumsum (kC_start, ntasks, NULL, 1, NULL) ; + GB_cumsum1 (kC_start, ntasks) ; Cnvec = kC_start [ntasks] ; //---------------------------------------------------------------------- diff --git a/Source/ewise/GB_add_phase1.c b/Source/add/GB_add_phase1.c similarity index 98% rename from Source/ewise/GB_add_phase1.c rename to Source/add/GB_add_phase1.c index e33eaa0c32..dd81a89780 100644 --- a/Source/ewise/GB_add_phase1.c +++ b/Source/add/GB_add_phase1.c @@ -19,7 +19,7 @@ // Cp is constructed here, and either freed by phase2, or transplanted into C. -#include "ewise/GB_add.h" +#include "add/GB_add.h" #include "include/GB_unused.h" GrB_Info GB_add_phase1 // count nnz in each C(:,j) @@ -95,7 +95,7 @@ GrB_Info GB_add_phase1 // count nnz in each C(:,j) bool M_is_B = GB_all_aliased (M, B) ; #define GB_ADD_PHASE 1 - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" //-------------------------------------------------------------------------- // cumulative sum of Cp and fine tasks in TaskList diff --git a/Source/ewise/GB_add_phase2.c b/Source/add/GB_add_phase2.c similarity index 88% rename from Source/ewise/GB_add_phase2.c rename to Source/add/GB_add_phase2.c index 73b06b3738..b07c095d7d 100644 --- a/Source/ewise/GB_add_phase2.c +++ b/Source/add/GB_add_phase2.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // GB_add_phase2 computes C=A+B, C=A+B, or CA+B. It is preceded first // by GB_add_phase0, which computes the list of vectors of C to compute (Ch) // and their location in A and B (C_to_[AB]). Next, GB_add_phase1 counts the @@ -29,12 +27,13 @@ // This is used by GB_wait only, for merging the pending tuple matrix T into A. // In this case, C is always sparse or hypersparse, not bitmap or full. -#include "ewise/GB_add.h" +#include "add/GB_add.h" #include "binaryop/GB_binop.h" #include "include/GB_unused.h" #include "slice/GB_ek_slice.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -59,6 +58,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B const GrB_Type ctype, // type of output matrix C const bool C_is_csc, // format of output matrix C const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped const bool A_and_B_are_disjoint, // if true, then A and B are disjoint // from phase1: int64_t **Cp_handle, // vector pointers for C @@ -124,7 +124,10 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B ASSERT (C_is_hyper == (Ch != NULL)) ; GB_Opcode opcode = op->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + bool op_is_index_binop = GB_IS_INDEXBINARYOP_CODE (opcode) ; + bool op_is_positional = op_is_builtin_positional || op_is_index_binop ; 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) ; @@ -140,10 +143,15 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B ASSERT (GB_Type_compatible (ctype, B->type)) ; } ASSERT (GB_Type_compatible (ctype, op->ztype)) ; - ASSERT (GB_IMPLIES (!(op_is_second || op_is_pair || op_is_positional), - GB_Type_compatible (A->type, op->xtype))) ; - ASSERT (GB_IMPLIES (!(op_is_first || op_is_pair || op_is_positional), - GB_Type_compatible (B->type, op->ytype))) ; + ASSERT (GB_IMPLIES (!(op_is_second || op_is_pair || + op_is_builtin_positional), + GB_Type_compatible (A->type, op->xtype))) ; + ASSERT (GB_IMPLIES (!(op_is_first || op_is_pair || + op_is_builtin_positional), + GB_Type_compatible (B->type, op->ytype))) ; + // builtin positional ops have already been flipped by changing the op, + // and other ops never need i,j flipped + ASSERT (GB_IMPLIES (!op_is_index_binop, !flipij)) ; #endif //-------------------------------------------------------------------------- @@ -177,7 +185,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B asize = A->type->size ; bsize = B->type->size ; - if (op_is_second || op_is_pair || op_is_positional) + if (op_is_second || op_is_pair || op_is_builtin_positional) { // the op does not depend on the value of A(i,j) xsize = 1 ; @@ -189,7 +197,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B cast_A_to_X = GB_cast_factory (op->xtype->code, A->type->code) ; } - if (op_is_first || op_is_pair || op_is_positional) + if (op_is_first || op_is_pair || op_is_builtin_positional) { // the op does not depend on the value of B(i,j) ysize = 1 ; @@ -343,7 +351,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B // are used, and the operator is not used. #define GB_ISO_ADD #define GB_IS_EWISEUNION 0 - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" info = GrB_SUCCESS ; } @@ -431,7 +439,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B if (is_eWiseUnion) { info = GB_union_jit (C, C_sparsity, M, Mask_struct, - Mask_comp, op, A, B, alpha_scalar, beta_scalar, + Mask_comp, op, flipij, A, B, alpha_scalar, beta_scalar, Ch_is_Mh, C_to_M, C_to_A, C_to_B, TaskList, C_ntasks, C_nthreads, M_ek_slicing, M_nthreads, M_ntasks, @@ -441,7 +449,7 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B else { info = GB_add_jit (C, C_sparsity, M, Mask_struct, - Mask_comp, op, A, B, + Mask_comp, op, flipij, A, B, Ch_is_Mh, C_to_M, C_to_A, C_to_B, TaskList, C_ntasks, C_nthreads, M_ek_slicing, M_nthreads, M_ntasks, @@ -457,6 +465,9 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B if (info == GrB_NO_VALUE) { + GxB_binary_function fadd = op->binop_function ; + GxB_index_binary_function fadd_idx = op->idxbinop_function ; + #include "generic/GB_generic.h" GB_BURBLE_MATRIX (C, "(generic add: %s) ", op->name) ; @@ -500,70 +511,55 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B #undef GB_PUTC #define GB_PUTC(z, Cx, p) cast_Z_to_C (Cx +((p)*csize), &z, csize) - if (op_is_positional) + if (fadd_idx != NULL) { //------------------------------------------------------------------ - // C(i,j) = positional_op (aij, bij) + // index binary operator //------------------------------------------------------------------ - // z = op (aij, bij) - #undef GB_BINOP - #define GB_BINOP(z,x,y,i,j) \ - z = (positional_is_i ? (i):(j)) + offset - - #define GB_POSITIONAL_OP - const bool positional_is_i = - (opcode == GB_FIRSTI_binop_code) || - (opcode == GB_FIRSTI1_binop_code) || - (opcode == GB_SECONDI_binop_code) || - (opcode == GB_SECONDI1_binop_code) ; - const int64_t offset = GB_positional_offset (opcode, NULL, NULL) ; - if (op->ztype == GrB_INT64) - { + // C(i,j) = (ctype) (A(i,j) + B(i,j)) + #undef GB_EWISEOP + #define GB_EWISEOP(Cx, p, aij, bij, i, j) \ + { \ + GB_void z [GB_VLA(zsize)] ; \ + GB_BINOP (z, aij, bij, i, j) ; \ + GB_PUTC (z, Cx, p) ; \ + } - // C(i,j) = positional_op (aij, bij) - #undef GB_EWISEOP - #define GB_EWISEOP(Cx, p, aij, bij, i, j) \ - { \ - int64_t z ; \ - GB_BINOP (z, , , i, j) ; \ - GB_PUTC (z, Cx, p) ; \ - } + const void *theta = op->theta ; + if (flipij) + { + // i and j must be flipped + #undef GB_BINOP + #define GB_BINOP(z, aij, bij, j, i) \ + fadd_idx (z, aij, i, j, bij, i, j, theta) ; if (is_eWiseUnion) { #define GB_IS_EWISEUNION 1 - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" } else { #define GB_IS_EWISEUNION 0 - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" } } else { - - // C(i,j) = positional_op (aij, bij) - #undef GB_EWISEOP - #define GB_EWISEOP(Cx, p, aij, bij, i, j) \ - { \ - int64_t z ; \ - GB_BINOP (z, , , i, j) ; \ - int32_t z32 = (int32_t) z ; \ - GB_PUTC (z32, Cx, p) ; \ - } - + #undef GB_BINOP + #define GB_BINOP(z, aij, bij, i, j) \ + fadd_idx (z, aij, i, j, bij, i, j, theta) ; if (is_eWiseUnion) { #define GB_IS_EWISEUNION 1 - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" } else { #define GB_IS_EWISEUNION 0 - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" } } @@ -575,9 +571,6 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B // standard binary operator //------------------------------------------------------------------ - #undef GB_POSITIONAL_OP - GxB_binary_function fadd = op->binop_function ; - // The binary op is not used if fadd is null since in that case // the intersection of A and B is empty @@ -599,12 +592,12 @@ GrB_Info GB_add_phase2 // C=A+B, C=A+B, or C=A+B if (is_eWiseUnion) { #define GB_IS_EWISEUNION 1 - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" } else { #define GB_IS_EWISEUNION 0 - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" } } info = GrB_SUCCESS ; diff --git a/Source/ewise/GB_add_sparsity.c b/Source/add/GB_add_sparsity.c similarity index 99% rename from Source/ewise/GB_add_sparsity.c rename to Source/add/GB_add_sparsity.c index 61369f9427..a05ee29225 100644 --- a/Source/ewise/GB_add_sparsity.c +++ b/Source/add/GB_add_sparsity.c @@ -16,7 +16,7 @@ // If C should be hypersparse or sparse, on output, this function simply // returns GxB_SPARSE. The final determination is made by GB_add_phase0. -#include "ewise/GB_add.h" +#include "add/GB_add.h" #include "mask/GB_mask_very_sparse.h" int GB_add_sparsity // return the sparsity structure for C diff --git a/Source/ewise/GrB_Matrix_eWiseAdd.c b/Source/add/GrB_Matrix_eWiseAdd.c similarity index 100% rename from Source/ewise/GrB_Matrix_eWiseAdd.c rename to Source/add/GrB_Matrix_eWiseAdd.c diff --git a/Source/ewise/GrB_Vector_eWiseAdd.c b/Source/add/GrB_Vector_eWiseAdd.c similarity index 100% rename from Source/ewise/GrB_Vector_eWiseAdd.c rename to Source/add/GrB_Vector_eWiseAdd.c diff --git a/Source/ewise/GxB_Matrix_eWiseUnion.c b/Source/add/GxB_Matrix_eWiseUnion.c similarity index 100% rename from Source/ewise/GxB_Matrix_eWiseUnion.c rename to Source/add/GxB_Matrix_eWiseUnion.c diff --git a/Source/ewise/GxB_Vector_eWiseUnion.c b/Source/add/GxB_Vector_eWiseUnion.c similarity index 100% rename from Source/ewise/GxB_Vector_eWiseUnion.c rename to Source/add/GxB_Vector_eWiseUnion.c diff --git a/Source/ewise/template/GB_add_bitmap_M_bitmap.c b/Source/add/template/GB_add_bitmap_M_bitmap.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_M_bitmap.c rename to Source/add/template/GB_add_bitmap_M_bitmap.c diff --git a/Source/ewise/template/GB_add_bitmap_M_bitmap_27.c b/Source/add/template/GB_add_bitmap_M_bitmap_27.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_M_bitmap_27.c rename to Source/add/template/GB_add_bitmap_M_bitmap_27.c diff --git a/Source/ewise/template/GB_add_bitmap_M_bitmap_28.c b/Source/add/template/GB_add_bitmap_M_bitmap_28.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_M_bitmap_28.c rename to Source/add/template/GB_add_bitmap_M_bitmap_28.c diff --git a/Source/ewise/template/GB_add_bitmap_M_bitmap_29.c b/Source/add/template/GB_add_bitmap_M_bitmap_29.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_M_bitmap_29.c rename to Source/add/template/GB_add_bitmap_M_bitmap_29.c diff --git a/Source/ewise/template/GB_add_bitmap_M_sparse.c b/Source/add/template/GB_add_bitmap_M_sparse.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_M_sparse.c rename to Source/add/template/GB_add_bitmap_M_sparse.c diff --git a/Source/ewise/template/GB_add_bitmap_M_sparse_24.c b/Source/add/template/GB_add_bitmap_M_sparse_24.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_M_sparse_24.c rename to Source/add/template/GB_add_bitmap_M_sparse_24.c diff --git a/Source/ewise/template/GB_add_bitmap_M_sparse_25.c b/Source/add/template/GB_add_bitmap_M_sparse_25.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_M_sparse_25.c rename to Source/add/template/GB_add_bitmap_M_sparse_25.c diff --git a/Source/ewise/template/GB_add_bitmap_M_sparse_26.c b/Source/add/template/GB_add_bitmap_M_sparse_26.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_M_sparse_26.c rename to Source/add/template/GB_add_bitmap_M_sparse_26.c diff --git a/Source/ewise/template/GB_add_bitmap_noM.c b/Source/add/template/GB_add_bitmap_noM.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_noM.c rename to Source/add/template/GB_add_bitmap_noM.c diff --git a/Source/ewise/template/GB_add_bitmap_noM_21.c b/Source/add/template/GB_add_bitmap_noM_21.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_noM_21.c rename to Source/add/template/GB_add_bitmap_noM_21.c diff --git a/Source/ewise/template/GB_add_bitmap_noM_22.c b/Source/add/template/GB_add_bitmap_noM_22.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_noM_22.c rename to Source/add/template/GB_add_bitmap_noM_22.c diff --git a/Source/ewise/template/GB_add_bitmap_noM_23.c b/Source/add/template/GB_add_bitmap_noM_23.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_noM_23.c rename to Source/add/template/GB_add_bitmap_noM_23.c diff --git a/Source/ewise/template/GB_add_bitmap_template.c b/Source/add/template/GB_add_bitmap_template.c similarity index 100% rename from Source/ewise/template/GB_add_bitmap_template.c rename to Source/add/template/GB_add_bitmap_template.c diff --git a/Source/ewise/template/GB_add_full_30.c b/Source/add/template/GB_add_full_30.c similarity index 100% rename from Source/ewise/template/GB_add_full_30.c rename to Source/add/template/GB_add_full_30.c diff --git a/Source/ewise/template/GB_add_full_31.c b/Source/add/template/GB_add_full_31.c similarity index 100% rename from Source/ewise/template/GB_add_full_31.c rename to Source/add/template/GB_add_full_31.c diff --git a/Source/ewise/template/GB_add_full_32.c b/Source/add/template/GB_add_full_32.c similarity index 100% rename from Source/ewise/template/GB_add_full_32.c rename to Source/add/template/GB_add_full_32.c diff --git a/Source/ewise/template/GB_add_full_33.c b/Source/add/template/GB_add_full_33.c similarity index 100% rename from Source/ewise/template/GB_add_full_33.c rename to Source/add/template/GB_add_full_33.c diff --git a/Source/ewise/template/GB_add_full_34.c b/Source/add/template/GB_add_full_34.c similarity index 100% rename from Source/ewise/template/GB_add_full_34.c rename to Source/add/template/GB_add_full_34.c diff --git a/Source/ewise/template/GB_add_full_template.c b/Source/add/template/GB_add_full_template.c similarity index 100% rename from Source/ewise/template/GB_add_full_template.c rename to Source/add/template/GB_add_full_template.c diff --git a/Source/ewise/template/GB_add_sparse_M_bitmap.c b/Source/add/template/GB_add_sparse_M_bitmap.c similarity index 100% rename from Source/ewise/template/GB_add_sparse_M_bitmap.c rename to Source/add/template/GB_add_sparse_M_bitmap.c diff --git a/Source/ewise/template/GB_add_sparse_M_sparse.c b/Source/add/template/GB_add_sparse_M_sparse.c similarity index 100% rename from Source/ewise/template/GB_add_sparse_M_sparse.c rename to Source/add/template/GB_add_sparse_M_sparse.c diff --git a/Source/ewise/template/GB_add_sparse_noM.c b/Source/add/template/GB_add_sparse_noM.c similarity index 100% rename from Source/ewise/template/GB_add_sparse_noM.c rename to Source/add/template/GB_add_sparse_noM.c diff --git a/Source/ewise/template/GB_add_sparse_template.c b/Source/add/template/GB_add_sparse_template.c similarity index 100% rename from Source/ewise/template/GB_add_sparse_template.c rename to Source/add/template/GB_add_sparse_template.c diff --git a/Source/ewise/template/GB_add_template.c b/Source/add/template/GB_add_template.c similarity index 99% rename from Source/ewise/template/GB_add_template.c rename to Source/add/template/GB_add_template.c index 633d9a06fe..a82a10e93f 100644 --- a/Source/ewise/template/GB_add_template.c +++ b/Source/add/template/GB_add_template.c @@ -155,7 +155,7 @@ // phase2: numerical phase - #ifdef GB_POSITIONAL_OP + #ifdef GB_BUILTIN_POSITIONAL_OP // op doesn't depend aij, bij, alpha_scalar, or beta_scalar #define GB_LOAD_A(aij, Ax,pA,A_iso) #define GB_LOAD_B(bij, Bx,pB,B_iso) diff --git a/Source/apply/GB_apply.c b/Source/apply/GB_apply.c index 46c6b7190f..8da6bd9958 100644 --- a/Source/apply/GB_apply.c +++ b/Source/apply/GB_apply.c @@ -65,7 +65,13 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') struct GB_Scalar_opaque Thunk_header ; int64_t ithunk = 0 ; - if (op_is_unop) + if (GB_IS_INDEXBINARYOP_CODE (opcode)) + { + // user-defined GxB_IndexBinaryOp not allowed here + GB_ERROR (GrB_DOMAIN_MISMATCH, "%s", + "User-defined GxB_IndexBinaryOps cannot be used in GrB_apply") ; + } + else if (op_is_unop) { // apply a unary operator: scalar is ignored ASSERT_OP_OK ( op, "unop for GB_apply", GB0) ; @@ -234,7 +240,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') bool T_is_csc = C->is_csc ; if (T_is_csc != A->is_csc) { - // Flip the sense of A_transpose + // Negate A_transpose A_transpose = !A_transpose ; } @@ -247,6 +253,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') } else if (op_is_binop) { + // flip i and j for any builtin positional ops (not user-defined) op = (GB_Operator) GB_positional_binop_ijflip ((GrB_BinaryOp) op) ; } else // op_is_idxunop @@ -258,7 +265,7 @@ GrB_Info GB_apply // C = accum (C, op(A)) or op(A') opcode = op->opcode ; } - // user operator must have i,j flipped + // user-defined index unary ops must have their i,j flipped bool flipij = (!T_is_csc && opcode == GB_USER_idxunop_code) ; if (A_transpose) diff --git a/Source/apply/GB_apply_op.c b/Source/apply/GB_apply_op.c index d1ffe66906..48bf4ba527 100644 --- a/Source/apply/GB_apply_op.c +++ b/Source/apply/GB_apply_op.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done, but could extend for positional ops. - // Cx = op (A) // Cx and A->x may be aliased. @@ -23,6 +21,7 @@ #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_uop__include.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -93,12 +92,13 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) opcode = op->opcode ; op_is_unop = GB_IS_UNARYOP_CODE (opcode) ; op_is_binop = GB_IS_BINARYOP_CODE (opcode) ; + ASSERT (!GB_IS_INDEXBINARYOP_CODE (opcode)) ; is64 = (op->ztype == GrB_INT64) ; is32 = (op->ztype == GrB_INT32) ; - if (op_is_binop && GB_OPCODE_IS_POSITIONAL (opcode)) + if (GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode)) { - // rename positional binary ops to positional unary ops + // rename builtin positional binary ops to positional unary ops GrB_UnaryOp op1 = NULL ; switch (opcode) { @@ -133,7 +133,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) opcode = op->opcode ; op_is_unop = true ; op_is_binop = false ; - ASSERT (GB_OPCODE_IS_POSITIONAL (opcode)) ; + ASSERT (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ; } } @@ -216,7 +216,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_POSITIONI1_unop_code : // z = pos_i1(A(i,j)) == i+1 case GB_ROWINDEX_idxunop_code : // z = i+thunk #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (i + thunk) ; #include "apply/template/GB_apply_unop_ip.c" break ; @@ -231,14 +231,14 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_DIAGINDEX_idxunop_code : // z = (j-(i+thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (j - (i+thunk)) ; #include "apply/template/GB_apply_unop_ijp.c" break ; case GB_FLIPDIAGINDEX_idxunop_code : // z = (i-(j+thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (i - (j+thunk)) ; #include "apply/template/GB_apply_unop_ijp.c" break ; @@ -262,7 +262,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_POSITIONI1_unop_code : // z = pos_i1(A(i,j)) == i+1 case GB_ROWINDEX_idxunop_code : // z = i+thunk #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (int32_t) (i + thunk) ; #include "apply/template/GB_apply_unop_ip.c" break ; @@ -277,14 +277,14 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_DIAGINDEX_idxunop_code : // z = (j-(i+thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (int32_t) (j - (i+thunk)) ; #include "apply/template/GB_apply_unop_ijp.c" break ; case GB_FLIPDIAGINDEX_idxunop_code : // z = (i-(j+thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (int32_t) (i - (j+thunk)) ; #include "apply/template/GB_apply_unop_ijp.c" break ; @@ -307,28 +307,28 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_TRIL_idxunop_code : // z = (j <= (i+thunk)) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (j <= (i + thunk)) ; #include "apply/template/GB_apply_unop_ijp.c" break ; ; case GB_TRIU_idxunop_code : // z = (j >= (i+thunk)) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (j >= (i + thunk)) ; #include "apply/template/GB_apply_unop_ijp.c" break ; ; case GB_DIAG_idxunop_code : // z = (j == (i+thunk)) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (j == (i + thunk)) ; #include "apply/template/GB_apply_unop_ijp.c" break ; ; case GB_OFFDIAG_idxunop_code : // z = (j != (i+thunk)) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (j != (i + thunk)) ; #include "apply/template/GB_apply_unop_ijp.c" break ; ; @@ -347,14 +347,14 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) case GB_ROWLE_idxunop_code : // z = (i <= thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (i <= thunk) ; #include "apply/template/GB_apply_unop_ip.c" break ; ; case GB_ROWGT_idxunop_code : // z = (i > thunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ Cz [pC] = (i > thunk) ; #include "apply/template/GB_apply_unop_ip.c" break ; ; @@ -491,6 +491,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) ASSERT (opcode != GB_SECOND_binop_code) ; ASSERT (opcode != GB_PAIR_binop_code) ; ASSERT (opcode != GB_ANY_binop_code) ; + ASSERT (opcode != GB_USER_idxbinop_code) ; size_t asize = Atype->size ; size_t ssize = scalar->type->size ; @@ -498,29 +499,30 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) size_t xsize = op->xtype->size ; size_t ysize = op->ytype->size ; - GB_Type_code scode = scalar->type->code ; + GB_Type_code scalar_code = scalar->type->code ; xcode = op->xtype->code ; ycode = op->ytype->code ; // typecast the scalar to the operator input size_t ssize_cast ; - GB_Type_code scode_cast ; + GB_Type_code scalar_code_cast ; if (binop_bind1st) { ssize_cast = xsize ; - scode_cast = xcode ; + scalar_code_cast = xcode ; } else { ssize_cast = ysize ; - scode_cast = ycode ; + scalar_code_cast = ycode ; } GB_void swork [GB_VLA(ssize_cast)] ; GB_void *scalarx = (GB_void *) scalar->x ; - if (scode_cast != scode) + if (scalar_code_cast != scalar_code) { // typecast the scalar to the operator input, in swork - GB_cast_function cast_s = GB_cast_factory (scode_cast, scode) ; + GB_cast_function cast_s = + GB_cast_factory (scalar_code_cast, scalar_code) ; cast_s (swork, scalar->x, ssize) ; scalarx = swork ; } @@ -666,6 +668,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) GB_Type_code acode = Atype->code ; GxB_binary_function fop = op->binop_function ; + ASSERT (fop != NULL) ; ASSERT (!A->iso) ; if (binop_bind1st) @@ -714,15 +717,15 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) size_t ssize = scalar->type->size ; size_t ysize = op->ytype->size ; - GB_Type_code scode = scalar->type->code ; + GB_Type_code scalar_code = scalar->type->code ; GB_Type_code ycode = op->ytype->code ; GB_void ywork [GB_VLA(ysize)] ; GB_void *ythunk = (GB_void *) scalar->x ; - if (ycode != scode) + if (ycode != scalar_code) { // typecast the scalar to the operator input, in ywork - GB_cast_function cast_s = GB_cast_factory (ycode, scode) ; + GB_cast_function cast_s = GB_cast_factory (ycode, scalar_code) ; cast_s (ywork, scalar->x, ssize) ; ythunk = ywork ; } @@ -775,7 +778,7 @@ GrB_Info GB_apply_op // apply a unary op, idxunop, or binop, Cx = op (A) // Cx [pC] = op (Ax [A_iso ? 0 : pA], i, j, ythunk) #define GB_APPLY_OP(pC,pA) \ - int64_t i = GBI_A (Ai, pA, avlen) ; \ + int64_t i = GBI (Ai, pA, avlen) ; \ GB_void xwork [GB_VLA(xsize)] ; \ cast_A_to_X (xwork, Ax +(A_iso ? 0 : (pA))*asize, asize) ; \ fop (Cx +((pC)*zsize), xwork, \ diff --git a/Source/apply/GB_shallow_op.c b/Source/apply/GB_shallow_op.c index cc62330f42..b3d0bbf434 100644 --- a/Source/apply/GB_shallow_op.c +++ b/Source/apply/GB_shallow_op.c @@ -55,12 +55,12 @@ GrB_Info GB_shallow_op // create shallow matrix and apply operator GrB_Type ztype = op->ztype ; GrB_Type op_intype = NULL ; GB_Opcode opcode = op->opcode ; + ASSERT (!GB_IS_INDEXBINARYOP_CODE (opcode)) ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; if (GB_IS_UNARYOP_CODE (opcode)) { ASSERT_OP_OK (op, "unop for shallow_op", GB0) ; - if (!op_is_positional) + if (!GB_IS_BUILTIN_UNOP_CODE_POSITIONAL (opcode)) { ASSERT (GB_Type_compatible (op->xtype, A->type)) ; op_intype = op->xtype ; @@ -69,7 +69,7 @@ GrB_Info GB_shallow_op // create shallow matrix and apply operator else if (GB_IS_BINARYOP_CODE (opcode)) { ASSERT_OP_OK (op, "binop for shallow_op", GB0) ; - if (!op_is_positional) + if (!GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode)) { op_intype = (binop_bind1st) ? op->xtype : op->ytype ; ASSERT (GB_Type_compatible (op_intype, A->type)) ; diff --git a/Source/apply/factory/GB_unop_factory.c b/Source/apply/factory/GB_unop_factory.c index 974b18b47d..3adf72f56f 100644 --- a/Source/apply/factory/GB_unop_factory.c +++ b/Source/apply/factory/GB_unop_factory.c @@ -2,7 +2,7 @@ // GB_unop_factory.c: switch factory for unary operators and 2 types //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -16,6 +16,97 @@ // handled by the built-in operator, then this switch factory falls through // with no action taken. +#if defined (GxB_NO_BOOL) +#define GB_CASE_BOOL(op,zname,ztype) +#else +#define GB_CASE_BOOL(op,zname,ztype) \ + case GB_BOOL_code: GB_WORKER (op, zname, ztype, _bool , bool ) +#endif + +#if defined (GxB_NO_INT8) +#define GB_CASE_INT8(op,zname,ztype) +#else +#define GB_CASE_INT8(op,zname,ztype) \ + case GB_INT8_code: GB_WORKER (op, zname, ztype, _int8 , int8_t ) +#endif + +#if defined (GxB_NO_INT16) +#define GB_CASE_INT16(op,zname,ztype) +#else +#define GB_CASE_INT16(op,zname,ztype) \ + case GB_INT16_code: GB_WORKER (op, zname, ztype, _int16 , int16_t ) +#endif + +#if defined (GxB_NO_INT32) +#define GB_CASE_INT32(op,zname,ztype) +#else +#define GB_CASE_INT32(op,zname,ztype) \ + case GB_INT32_code: GB_WORKER (op, zname, ztype, _int32 , int32_t ) +#endif + +#if defined (GxB_NO_INT64) +#define GB_CASE_INT64(op,zname,ztype) +#else +#define GB_CASE_INT64(op,zname,ztype) \ + case GB_INT64_code: GB_WORKER (op, zname, ztype, _int64 , int64_t ) +#endif + +#if defined (GxB_NO_UINT8) +#define GB_CASE_UINT8(op,zname,ztype) +#else +#define GB_CASE_UINT8(op,zname,ztype) \ + case GB_UINT8_code: GB_WORKER (op, zname, ztype, _uint8 , uint8_t ) +#endif + +#if defined (GxB_NO_UINT16) +#define GB_CASE_UINT16(op,zname,ztype) +#else +#define GB_CASE_UINT16(op,zname,ztype) \ + case GB_UINT16_code: GB_WORKER (op, zname, ztype, _uint16, uint16_t) +#endif + +#if defined (GxB_NO_UINT32) +#define GB_CASE_UINT32(op,zname,ztype) +#else +#define GB_CASE_UINT32(op,zname,ztype) \ + case GB_UINT32_code: GB_WORKER (op, zname, ztype, _uint32, uint32_t) +#endif + +#if defined (GxB_NO_UINT64) +#define GB_CASE_UINT64(op,zname,ztype) +#else +#define GB_CASE_UINT64(op,zname,ztype) \ + case GB_UINT64_code: GB_WORKER (op, zname, ztype, _uint64, uint64_t) +#endif + +#if defined (GxB_NO_FP32) +#define GB_CASE_FP32(op,zname,ztype) +#else +#define GB_CASE_FP32(op,zname,ztype) \ + case GB_FP32_code: GB_WORKER (op, zname, ztype, _fp32 , float ) +#endif + +#if defined (GxB_NO_FP64) +#define GB_CASE_FP64(op,zname,ztype) +#else +#define GB_CASE_FP64(op,zname,ztype) \ + case GB_FP64_code: GB_WORKER (op, zname, ztype, _fp64 , double ) +#endif + +#if defined (GxB_NO_FC32) +#define GB_CASE_FC32(op,zname,ztype) +#else +#define GB_CASE_FC32(op,zname,ztype) \ + case GB_FC32_code: GB_WORKER (op, zname, ztype, _fc32 , GxB_FC32_t) +#endif + +#if defined (GxB_NO_FC64) +#define GB_CASE_FC64(op,zname,ztype) +#else +#define GB_CASE_FC64(op,zname,ztype) \ + case GB_FC64_code: GB_WORKER (op, zname, ztype, _fc64 , GxB_FC64_t) +#endif + { // switch factory for two types, controlled by code1 and code2 GB_Type_code code1 = op->ztype->code ; // defines ztype @@ -44,7 +135,7 @@ } else if ((code1 == GB_FP32_code && code2 == GB_FC32_code) || (code1 == GB_FP64_code && code2 == GB_FC64_code)) - { + { //---------------------------------------------------------------------- // z = f (x) where z is real and x is complex (same base type) @@ -57,8 +148,8 @@ switch (code2) { - case GB_FC32_code : GB_WORKER (_abs, _fp32, float , _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_abs, _fp64, double, _fc64, GxB_FC64_t) + GB_CASE_FC32 (_abs, _fp32, float ) + GB_CASE_FC64 (_abs, _fp64, double) default: ; } break ; @@ -67,8 +158,8 @@ switch (code2) { - case GB_FC32_code : GB_WORKER (_creal, _fp32, float , _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_creal, _fp64, double, _fc64, GxB_FC64_t) + GB_CASE_FC32 (_creal, _fp32, float ) + GB_CASE_FC64 (_creal, _fp64, double) default: ; } break ; @@ -77,8 +168,8 @@ switch (code2) { - case GB_FC32_code : GB_WORKER (_cimag, _fp32, float , _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_cimag, _fp64, double, _fc64, GxB_FC64_t) + GB_CASE_FC32 (_cimag, _fp32, float ) + GB_CASE_FC64 (_cimag, _fp64, double) default: ; } break ; @@ -87,8 +178,8 @@ switch (code2) { - case GB_FC32_code : GB_WORKER (_carg, _fp32, float , _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_carg, _fp64, double, _fc64, GxB_FC64_t) + GB_CASE_FC32 (_carg, _fp32, float ) + GB_CASE_FC64 (_carg, _fp64, double) default: ; } break ; @@ -98,7 +189,7 @@ } else if (code1 == GB_BOOL_code && (code2 >= GB_FP32_code && code2 <= GB_FC64_code)) - { + { //---------------------------------------------------------------------- // z = f (x) where z is boolean and x is floating-point @@ -111,10 +202,10 @@ switch (code2) { - case GB_FP32_code : GB_WORKER (_isinf, _bool, bool, _fp32, float ) - case GB_FP64_code : GB_WORKER (_isinf, _bool, bool, _fp64, double ) - case GB_FC32_code : GB_WORKER (_isinf, _bool, bool, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_isinf, _bool, bool, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_isinf, _bool, bool) + GB_CASE_FP64 (_isinf, _bool, bool) + GB_CASE_FC32 (_isinf, _bool, bool) + GB_CASE_FC64 (_isinf, _bool, bool) default: ; } break ; @@ -123,10 +214,10 @@ switch (code2) { - case GB_FP32_code : GB_WORKER (_isnan, _bool, bool, _fp32, float ) - case GB_FP64_code : GB_WORKER (_isnan, _bool, bool, _fp64, double ) - case GB_FC32_code : GB_WORKER (_isnan, _bool, bool, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_isnan, _bool, bool, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_isnan, _bool, bool) + GB_CASE_FP64 (_isnan, _bool, bool) + GB_CASE_FC32 (_isnan, _bool, bool) + GB_CASE_FC64 (_isnan, _bool, bool) default: ; } break ; @@ -135,10 +226,10 @@ switch (code2) { - case GB_FP32_code : GB_WORKER (_isfinite, _bool, bool, _fp32, float ) - case GB_FP64_code : GB_WORKER (_isfinite, _bool, bool, _fp64, double ) - case GB_FC32_code : GB_WORKER (_isfinite, _bool, bool, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_isfinite, _bool, bool, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_isfinite, _bool, bool) + GB_CASE_FP64 (_isfinite, _bool, bool) + GB_CASE_FC32 (_isfinite, _bool, bool) + GB_CASE_FC64 (_isfinite, _bool, bool) default: ; } break ; @@ -149,7 +240,7 @@ } else if (code1 == code2) - { + { //---------------------------------------------------------------------- // z = f (x) with no typecasting @@ -162,19 +253,19 @@ switch (code1) { - case GB_BOOL_code : GB_WORKER (_ainv, _bool , bool , _bool , bool ) - case GB_INT8_code : GB_WORKER (_ainv, _int8 , int8_t , _int8 , int8_t ) - case GB_INT16_code : GB_WORKER (_ainv, _int16 , int16_t , _int16 , int16_t ) - case GB_INT32_code : GB_WORKER (_ainv, _int32 , int32_t , _int32 , int32_t ) - case GB_INT64_code : GB_WORKER (_ainv, _int64 , int64_t , _int64 , int64_t ) - case GB_UINT8_code : GB_WORKER (_ainv, _uint8 , uint8_t , _uint8 , uint8_t ) - case GB_UINT16_code : GB_WORKER (_ainv, _uint16, uint16_t , _uint16, uint16_t ) - case GB_UINT32_code : GB_WORKER (_ainv, _uint32, uint32_t , _uint32, uint32_t ) - case GB_UINT64_code : GB_WORKER (_ainv, _uint64, uint64_t , _uint64, uint64_t ) - case GB_FP32_code : GB_WORKER (_ainv, _fp32 , float , _fp32 , float ) - case GB_FP64_code : GB_WORKER (_ainv, _fp64 , double , _fp64 , double ) - case GB_FC32_code : GB_WORKER (_ainv, _fc32 , GxB_FC32_t, _fc32 , GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_ainv, _fc64 , GxB_FC64_t, _fc64 , GxB_FC64_t) + GB_CASE_BOOL (_ainv, _bool , bool ) + GB_CASE_INT8 (_ainv, _int8 , int8_t ) + GB_CASE_INT16 (_ainv, _int16 , int16_t ) + GB_CASE_INT32 (_ainv, _int32 , int32_t ) + GB_CASE_INT64 (_ainv, _int64 , int64_t ) + GB_CASE_UINT8 (_ainv, _uint8 , uint8_t ) + GB_CASE_UINT16 (_ainv, _uint16, uint16_t ) + GB_CASE_UINT32 (_ainv, _uint32, uint32_t ) + GB_CASE_UINT64 (_ainv, _uint64, uint64_t ) + GB_CASE_FP32 (_ainv, _fp32 , float ) + GB_CASE_FP64 (_ainv, _fp64 , double ) + GB_CASE_FC32 (_ainv, _fc32 , GxB_FC32_t) + GB_CASE_FC64 (_ainv, _fc64 , GxB_FC64_t) default: ; } break ; @@ -183,19 +274,19 @@ switch (code1) { - case GB_BOOL_code : GB_WORKER (_minv, _bool , bool , _bool , bool ) - case GB_INT8_code : GB_WORKER (_minv, _int8 , int8_t , _int8 , int8_t ) - case GB_INT16_code : GB_WORKER (_minv, _int16 , int16_t , _int16 , int16_t ) - case GB_INT32_code : GB_WORKER (_minv, _int32 , int32_t , _int32 , int32_t ) - case GB_INT64_code : GB_WORKER (_minv, _int64 , int64_t , _int64 , int64_t ) - case GB_UINT8_code : GB_WORKER (_minv, _uint8 , uint8_t , _uint8 , uint8_t ) - case GB_UINT16_code : GB_WORKER (_minv, _uint16, uint16_t , _uint16, uint16_t ) - case GB_UINT32_code : GB_WORKER (_minv, _uint32, uint32_t , _uint32, uint32_t ) - case GB_UINT64_code : GB_WORKER (_minv, _uint64, uint64_t , _uint64, uint64_t ) - case GB_FP32_code : GB_WORKER (_minv, _fp32 , float , _fp32 , float ) - case GB_FP64_code : GB_WORKER (_minv, _fp64 , double , _fp64 , double ) - case GB_FC32_code : GB_WORKER (_minv, _fc32 , GxB_FC32_t, _fc32 , GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_minv, _fc64 , GxB_FC64_t, _fc64 , GxB_FC64_t) + GB_CASE_BOOL (_minv, _bool , bool ) + GB_CASE_INT8 (_minv, _int8 , int8_t ) + GB_CASE_INT16 (_minv, _int16 , int16_t ) + GB_CASE_INT32 (_minv, _int32 , int32_t ) + GB_CASE_INT64 (_minv, _int64 , int64_t ) + GB_CASE_UINT8 (_minv, _uint8 , uint8_t ) + GB_CASE_UINT16 (_minv, _uint16, uint16_t ) + GB_CASE_UINT32 (_minv, _uint32, uint32_t ) + GB_CASE_UINT64 (_minv, _uint64, uint64_t ) + GB_CASE_FP32 (_minv, _fp32 , float ) + GB_CASE_FP64 (_minv, _fp64 , double ) + GB_CASE_FC32 (_minv, _fc32 , GxB_FC32_t) + GB_CASE_FC64 (_minv, _fc64 , GxB_FC64_t) default: ; } break ; @@ -204,17 +295,17 @@ switch (code1) { - case GB_BOOL_code : GB_WORKER (_abs, _bool , bool , _bool , bool ) - case GB_INT8_code : GB_WORKER (_abs, _int8 , int8_t , _int8 , int8_t ) - case GB_INT16_code : GB_WORKER (_abs, _int16 , int16_t , _int16 , int16_t ) - case GB_INT32_code : GB_WORKER (_abs, _int32 , int32_t , _int32 , int32_t ) - case GB_INT64_code : GB_WORKER (_abs, _int64 , int64_t , _int64 , int64_t ) - case GB_UINT8_code : GB_WORKER (_abs, _uint8 , uint8_t , _uint8 , uint8_t ) - case GB_UINT16_code : GB_WORKER (_abs, _uint16, uint16_t , _uint16, uint16_t) - case GB_UINT32_code : GB_WORKER (_abs, _uint32, uint32_t , _uint32, uint32_t) - case GB_UINT64_code : GB_WORKER (_abs, _uint64, uint64_t , _uint64, uint64_t) - case GB_FP32_code : GB_WORKER (_abs, _fp32 , float , _fp32 , float ) - case GB_FP64_code : GB_WORKER (_abs, _fp64 , double , _fp64 , double ) + GB_CASE_BOOL (_abs, _bool , bool ) + GB_CASE_INT8 (_abs, _int8 , int8_t ) + GB_CASE_INT16 (_abs, _int16 , int16_t ) + GB_CASE_INT32 (_abs, _int32 , int32_t ) + GB_CASE_INT64 (_abs, _int64 , int64_t ) + GB_CASE_UINT8 (_abs, _uint8 , uint8_t ) + GB_CASE_UINT16 (_abs, _uint16, uint16_t) + GB_CASE_UINT32 (_abs, _uint32, uint32_t) + GB_CASE_UINT64 (_abs, _uint64, uint64_t) + GB_CASE_FP32 (_abs, _fp32 , float ) + GB_CASE_FP64 (_abs, _fp64 , double ) default: ; } break ; @@ -223,17 +314,17 @@ switch (code1) { - case GB_BOOL_code : GB_WORKER (_lnot, _bool , bool , _bool , bool ) - case GB_INT8_code : GB_WORKER (_lnot, _int8 , int8_t , _int8 , int8_t ) - case GB_INT16_code : GB_WORKER (_lnot, _int16 , int16_t , _int16 , int16_t ) - case GB_INT32_code : GB_WORKER (_lnot, _int32 , int32_t , _int32 , int32_t ) - case GB_INT64_code : GB_WORKER (_lnot, _int64 , int64_t , _int64 , int64_t ) - case GB_UINT8_code : GB_WORKER (_lnot, _uint8 , uint8_t , _uint8 , uint8_t ) - case GB_UINT16_code : GB_WORKER (_lnot, _uint16, uint16_t, _uint16, uint16_t) - case GB_UINT32_code : GB_WORKER (_lnot, _uint32, uint32_t, _uint32, uint32_t) - case GB_UINT64_code : GB_WORKER (_lnot, _uint64, uint64_t, _uint64, uint64_t) - case GB_FP32_code : GB_WORKER (_lnot, _fp32 , float , _fp32 , float ) - case GB_FP64_code : GB_WORKER (_lnot, _fp64 , double , _fp64 , double ) + GB_CASE_BOOL (_lnot, _bool , bool ) + GB_CASE_INT8 (_lnot, _int8 , int8_t ) + GB_CASE_INT16 (_lnot, _int16 , int16_t ) + GB_CASE_INT32 (_lnot, _int32 , int32_t ) + GB_CASE_INT64 (_lnot, _int64 , int64_t ) + GB_CASE_UINT8 (_lnot, _uint8 , uint8_t ) + GB_CASE_UINT16 (_lnot, _uint16, uint16_t) + GB_CASE_UINT32 (_lnot, _uint32, uint32_t) + GB_CASE_UINT64 (_lnot, _uint64, uint64_t) + GB_CASE_FP32 (_lnot, _fp32 , float ) + GB_CASE_FP64 (_lnot, _fp64 , double ) default: ; } break ; @@ -242,14 +333,14 @@ switch (code1) { - case GB_INT8_code : GB_WORKER (_bnot, _int8 , int8_t , _int8 , int8_t ) - case GB_INT16_code : GB_WORKER (_bnot, _int16 , int16_t , _int16 , int16_t ) - case GB_INT32_code : GB_WORKER (_bnot, _int32 , int32_t , _int32 , int32_t ) - case GB_INT64_code : GB_WORKER (_bnot, _int64 , int64_t , _int64 , int64_t ) - case GB_UINT8_code : GB_WORKER (_bnot, _uint8 , uint8_t , _uint8 , uint8_t ) - case GB_UINT16_code : GB_WORKER (_bnot, _uint16, uint16_t, _uint16, uint16_t) - case GB_UINT32_code : GB_WORKER (_bnot, _uint32, uint32_t, _uint32, uint32_t) - case GB_UINT64_code : GB_WORKER (_bnot, _uint64, uint64_t, _uint64, uint64_t) + GB_CASE_INT8 (_bnot, _int8 , int8_t ) + GB_CASE_INT16 (_bnot, _int16 , int16_t ) + GB_CASE_INT32 (_bnot, _int32 , int32_t ) + GB_CASE_INT64 (_bnot, _int64 , int64_t ) + GB_CASE_UINT8 (_bnot, _uint8 , uint8_t ) + GB_CASE_UINT16 (_bnot, _uint16, uint16_t) + GB_CASE_UINT32 (_bnot, _uint32, uint32_t) + GB_CASE_UINT64 (_bnot, _uint64, uint64_t) default: ; } break ; @@ -258,10 +349,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_sqrt, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_sqrt, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_sqrt, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_sqrt, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_sqrt, _fp32, float ) + GB_CASE_FP64 (_sqrt, _fp64, double ) + GB_CASE_FC32 (_sqrt, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_sqrt, _fc64, GxB_FC64_t) default: ; } break ; @@ -270,10 +361,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_log, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_log, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_log, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_log, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_log, _fp32, float ) + GB_CASE_FP64 (_log, _fp64, double ) + GB_CASE_FC32 (_log, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_log, _fc64, GxB_FC64_t) default: ; } break ; @@ -283,10 +374,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_exp, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_exp, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_exp, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_exp, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_exp, _fp32, float ) + GB_CASE_FP64 (_exp, _fp64, double ) + GB_CASE_FC32 (_exp, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_exp, _fc64, GxB_FC64_t) default: ; } break ; @@ -296,10 +387,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_sin, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_sin, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_sin, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_sin, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_sin, _fp32, float ) + GB_CASE_FP64 (_sin, _fp64, double ) + GB_CASE_FC32 (_sin, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_sin, _fc64, GxB_FC64_t) default: ; } break ; @@ -308,10 +399,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_cos, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_cos, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_cos, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_cos, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_cos, _fp32, float ) + GB_CASE_FP64 (_cos, _fp64, double ) + GB_CASE_FC32 (_cos, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_cos, _fc64, GxB_FC64_t) default: ; } break ; @@ -320,10 +411,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_tan, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_tan, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_tan, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_tan, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_tan, _fp32, float ) + GB_CASE_FP64 (_tan, _fp64, double ) + GB_CASE_FC32 (_tan, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_tan, _fc64, GxB_FC64_t) default: ; } break ; @@ -333,10 +424,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_asin, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_asin, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_asin, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_asin, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_asin, _fp32, float ) + GB_CASE_FP64 (_asin, _fp64, double ) + GB_CASE_FC32 (_asin, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_asin, _fc64, GxB_FC64_t) default: ; } break ; @@ -345,10 +436,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_acos, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_acos, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_acos, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_acos, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_acos, _fp32, float ) + GB_CASE_FP64 (_acos, _fp64, double ) + GB_CASE_FC32 (_acos, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_acos, _fc64, GxB_FC64_t) default: ; } break ; @@ -357,10 +448,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_atan, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_atan, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_atan, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_atan, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_atan, _fp32, float ) + GB_CASE_FP64 (_atan, _fp64, double ) + GB_CASE_FC32 (_atan, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_atan, _fc64, GxB_FC64_t) default: ; } break ; @@ -370,10 +461,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_sinh, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_sinh, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_sinh, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_sinh, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_sinh, _fp32, float ) + GB_CASE_FP64 (_sinh, _fp64, double ) + GB_CASE_FC32 (_sinh, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_sinh, _fc64, GxB_FC64_t) default: ; } break ; @@ -382,10 +473,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_cosh, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_cosh, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_cosh, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_cosh, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_cosh, _fp32, float ) + GB_CASE_FP64 (_cosh, _fp64, double ) + GB_CASE_FC32 (_cosh, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_cosh, _fc64, GxB_FC64_t) default: ; } break ; @@ -394,10 +485,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_tanh, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_tanh, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_tanh, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_tanh, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_tanh, _fp32, float ) + GB_CASE_FP64 (_tanh, _fp64, double ) + GB_CASE_FC32 (_tanh, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_tanh, _fc64, GxB_FC64_t) default: ; } break ; @@ -407,10 +498,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_asinh, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_asinh, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_asinh, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_asinh, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_asinh, _fp32, float ) + GB_CASE_FP64 (_asinh, _fp64, double ) + GB_CASE_FC32 (_asinh, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_asinh, _fc64, GxB_FC64_t) default: ; } break ; @@ -419,10 +510,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_acosh, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_acosh, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_acosh, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_acosh, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_acosh, _fp32, float ) + GB_CASE_FP64 (_acosh, _fp64, double ) + GB_CASE_FC32 (_acosh, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_acosh, _fc64, GxB_FC64_t) default: ; } break ; @@ -431,10 +522,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_atanh, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_atanh, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_atanh, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_atanh, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_atanh, _fp32, float ) + GB_CASE_FP64 (_atanh, _fp64, double ) + GB_CASE_FC32 (_atanh, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_atanh, _fc64, GxB_FC64_t) default: ; } break ; @@ -443,10 +534,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_signum, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_signum, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_signum, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_signum, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_signum, _fp32, float ) + GB_CASE_FP64 (_signum, _fp64, double ) + GB_CASE_FC32 (_signum, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_signum, _fc64, GxB_FC64_t) default: ; } break ; @@ -455,10 +546,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_ceil, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_ceil, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_ceil, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_ceil, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_ceil, _fp32, float ) + GB_CASE_FP64 (_ceil, _fp64, double ) + GB_CASE_FC32 (_ceil, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_ceil, _fc64, GxB_FC64_t) default: ; } break ; @@ -467,10 +558,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_floor, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_floor, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_floor, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_floor, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_floor, _fp32, float ) + GB_CASE_FP64 (_floor, _fp64, double ) + GB_CASE_FC32 (_floor, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_floor, _fc64, GxB_FC64_t) default: ; } break ; @@ -479,10 +570,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_round, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_round, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_round, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_round, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_round, _fp32, float ) + GB_CASE_FP64 (_round, _fp64, double ) + GB_CASE_FC32 (_round, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_round, _fc64, GxB_FC64_t) default: ; } break ; @@ -491,10 +582,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_trunc, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_trunc, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_trunc, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_trunc, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_trunc, _fp32, float ) + GB_CASE_FP64 (_trunc, _fp64, double ) + GB_CASE_FC32 (_trunc, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_trunc, _fc64, GxB_FC64_t) default: ; } break ; @@ -504,10 +595,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_exp2, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_exp2, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_exp2, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_exp2, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_exp2, _fp32, float ) + GB_CASE_FP64 (_exp2, _fp64, double ) + GB_CASE_FC32 (_exp2, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_exp2, _fc64, GxB_FC64_t) default: ; } break ; @@ -516,10 +607,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_expm1, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_expm1, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_expm1, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_expm1, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_expm1, _fp32, float ) + GB_CASE_FP64 (_expm1, _fp64, double ) + GB_CASE_FC32 (_expm1, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_expm1, _fc64, GxB_FC64_t) default: ; } break ; @@ -528,10 +619,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_log10, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_log10, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_log10, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_log10, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_log10, _fp32, float ) + GB_CASE_FP64 (_log10, _fp64, double ) + GB_CASE_FC32 (_log10, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_log10, _fc64, GxB_FC64_t) default: ; } break ; @@ -540,10 +631,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_log1p, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_log1p, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_log1p, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_log1p, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_log1p, _fp32, float ) + GB_CASE_FP64 (_log1p, _fp64, double ) + GB_CASE_FC32 (_log1p, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_log1p, _fc64, GxB_FC64_t) default: ; } break ; @@ -552,10 +643,10 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_log2, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_log2, _fp64, double , _fp64, double ) - case GB_FC32_code : GB_WORKER (_log2, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_log2, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FP32 (_log2, _fp32, float ) + GB_CASE_FP64 (_log2, _fp64, double ) + GB_CASE_FC32 (_log2, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_log2, _fc64, GxB_FC64_t) default: ; } break ; @@ -564,8 +655,8 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_lgamma, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_lgamma, _fp64, double , _fp64, double) + GB_CASE_FP32 (_lgamma, _fp32, float ) + GB_CASE_FP64 (_lgamma, _fp64, double) default: ; } break ; @@ -574,8 +665,8 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_tgamma, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_tgamma, _fp64, double , _fp64, double) + GB_CASE_FP32 (_tgamma, _fp32, float ) + GB_CASE_FP64 (_tgamma, _fp64, double) default: ; } break ; @@ -584,8 +675,8 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_erf, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_erf, _fp64, double , _fp64, double) + GB_CASE_FP32 (_erf, _fp32, float ) + GB_CASE_FP64 (_erf, _fp64, double) default: ; } break ; @@ -594,8 +685,8 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_erfc, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_erfc, _fp64, double , _fp64, double) + GB_CASE_FP32 (_erfc, _fp32, float ) + GB_CASE_FP64 (_erfc, _fp64, double) default: ; } break ; @@ -604,8 +695,8 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_cbrt, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_cbrt, _fp64, double , _fp64, double) + GB_CASE_FP32 (_cbrt, _fp32, float ) + GB_CASE_FP64 (_cbrt, _fp64, double) default: ; } break ; @@ -614,8 +705,8 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_frexpx, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_frexpx, _fp64, double , _fp64, double) + GB_CASE_FP32 (_frexpx, _fp32, float ) + GB_CASE_FP64 (_frexpx, _fp64, double) default: ; } break ; @@ -624,8 +715,8 @@ switch (code1) { - case GB_FP32_code : GB_WORKER (_frexpe, _fp32, float , _fp32, float ) - case GB_FP64_code : GB_WORKER (_frexpe, _fp64, double , _fp64, double) + GB_CASE_FP32 (_frexpe, _fp32, float ) + GB_CASE_FP64 (_frexpe, _fp64, double) default: ; } break ; @@ -634,8 +725,8 @@ switch (code1) { - case GB_FC32_code : GB_WORKER (_conj, _fc32, GxB_FC32_t, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_WORKER (_conj, _fc64, GxB_FC64_t, _fc64, GxB_FC64_t) + GB_CASE_FC32 (_conj, _fc32, GxB_FC32_t) + GB_CASE_FC64 (_conj, _fc64, GxB_FC64_t) default: ; } break ; @@ -645,3 +736,17 @@ } } +#undef GB_CASE_BOOL +#undef GB_CASE_INT8 +#undef GB_CASE_INT16 +#undef GB_CASE_INT32 +#undef GB_CASE_INT64 +#undef GB_CASE_UINT8 +#undef GB_CASE_UINT16 +#undef GB_CASE_UINT32 +#undef GB_CASE_UINT64 +#undef GB_CASE_FP32 +#undef GB_CASE_FP64 +#undef GB_CASE_FC32 +#undef GB_CASE_FC64 + diff --git a/Source/apply/include/GB_apply_shared_definitions.h b/Source/apply/include/GB_apply_shared_definitions.h deleted file mode 100644 index a3e829abdc..0000000000 --- a/Source/apply/include/GB_apply_shared_definitions.h +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_apply_shared_definitions.h: common macros for unop kernels -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// GB_apply_shared_definitions.h provides default definitions for all unop -// kernels, if the special cases have not been #define'd prior to #include'ing -// this file. This file is shared by generic, factory, and both CPU and -// CUDA JIT kernels. - -#include "include/GB_kernel_shared_definitions.h" - -#ifndef GB_APPLY_SHARED_DEFINITIONS_H -#define GB_APPLY_SHARED_DEFINITIONS_H - -// nothing here so far that is unique to apply methods ... - -#endif - diff --git a/Source/assign/GB_assign.c b/Source/assign/GB_assign.c index 750e2fb105..2d61e52ac9 100644 --- a/Source/assign/GB_assign.c +++ b/Source/assign/GB_assign.c @@ -2,7 +2,7 @@ // GB_assign: submatrix assignment: C(Rows,Cols) = accum (C(Rows,Cols),A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -164,9 +164,9 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' // structure, but otherwise C is returned as bitmap. GB_OK (GB_bitmap_assign (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_comp, Mask_struct, accum, A, - scalar, scalar_type, assign_kind, Werk)) ; + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + assign_kind, Werk)) ; } else @@ -286,7 +286,7 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' // This code requires C and M not to be aliased to each other. ASSERT (M != NULL) ; - ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS C==M in C_replace_phase + ASSERT (!GB_any_aliased (C, M)) ;// NO ALIAS C==M in C_replace_phase ASSERT (!whole_submatrix) ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; @@ -320,7 +320,7 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' ASSERT (M->vlen == C->vlen && M->vdim == 1 && M->h == NULL) ; int64_t j = GB_ijlist (J, 0, Jkind, Jcolon) ; GBURBLE ("assign zombies outside C(I,j) ") ; - GB_MATRIX_WAIT (M) ; + GB_UNJUMBLE (M) ; GB_OK (GB_hyper_hash_build (C, Werk)) ; GB_OK (GB_assign_zombie3 (C, M, Mask_comp, Mask_struct, j, I, nI, Ikind, Icolon)) ; @@ -339,8 +339,8 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' ASSERT (M->vlen == 1 && M->vdim == C->vdim) ; int64_t i = GB_ijlist (I, 0, Ikind, Icolon) ; GBURBLE ("assign zombies outside C(i,J) ") ; - GB_MATRIX_WAIT_IF_JUMBLED (C) ; - GB_MATRIX_WAIT (M) ; + GB_UNJUMBLE (C) ; + GB_UNJUMBLE (M) ; GB_OK (GB_hyper_hash_build (M, Werk)) ; GB_OK (GB_assign_zombie4 (C, M, Mask_comp, Mask_struct, i, J, nJ, Jkind, Jcolon)) ; @@ -356,12 +356,12 @@ GrB_Info GB_assign // C(Rows,Cols) += A or A' // M has the same size as C ASSERT (M->vlen == C->vlen && M->vdim == C->vdim) ; GBURBLE ("assign zombies outside C(I,J) ") ; - GB_MATRIX_WAIT (M) ; + GB_UNJUMBLE (M) ; GB_OK (GB_hyper_hash_build (M, Werk)) ; GB_OK (GB_assign_zombie5 (C, M, Mask_comp, Mask_struct, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, Werk)) ; } - ASSERT_MATRIX_OK (C, "C for C-replace-phase done", GB_FLIP (GB0)) ; + ASSERT_MATRIX_OK (C, "C for C-replace-phase done", GB_ZOMBIE (GB0)) ; } } diff --git a/Source/assign/GB_assign.h b/Source/assign/GB_assign.h index ef491915e5..c81f4b398c 100644 --- a/Source/assign/GB_assign.h +++ b/Source/assign/GB_assign.h @@ -2,7 +2,7 @@ // GB_assign.h: definitions for GB_assign and related functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GB_assign_burble.c b/Source/assign/GB_assign_burble.c index 186344ead8..790f956f90 100644 --- a/Source/assign/GB_assign_burble.c +++ b/Source/assign/GB_assign_burble.c @@ -2,7 +2,7 @@ // GB_assign_burble.c: burble the assign method //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,14 +11,15 @@ void GB_assign_burble ( + const char *method, // method const bool C_replace, // descriptor for C const int Ikind, const int Jkind, - const GrB_Matrix M, // mask matrix, which is not NULL here + const GrB_Matrix M, // mask matrix (NULL if not present) const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present here - const GrB_Matrix A, // input matrix, not transposed + const GrB_Matrix A, // input matrix (NULL for scalar assign) const int assign_kind // row assign, col assign, assign, or subassign ) { @@ -46,6 +47,6 @@ void GB_assign_burble // burble the description //-------------------------------------------------------------------------- - GBURBLE ("%s", description) ; + GBURBLE ("(%s: %s) ", method, description) ; } diff --git a/Source/assign/GB_assign_describe.c b/Source/assign/GB_assign_describe.c index 5dd15d46ec..05e8602bae 100644 --- a/Source/assign/GB_assign_describe.c +++ b/Source/assign/GB_assign_describe.c @@ -2,7 +2,7 @@ // GB_assign_describe: construct a string that describes GrB_assign / subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GB_assign_prep.c b/Source/assign/GB_assign_prep.c index a5bf52bf36..3969225290 100644 --- a/Source/assign/GB_assign_prep.c +++ b/Source/assign/GB_assign_prep.c @@ -2,7 +2,7 @@ // GB_assign_prep: check and prepare inputs for GB_assign and GB_subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -12,7 +12,6 @@ #include "assign/GB_subassign.h" #include "assign/GB_bitmap_assign.h" #include "assign/GB_assign_zombie.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "assign/GB_subassign_methods.h" #include "transpose/GB_transpose.h" #include "extract/GB_subref.h" @@ -31,9 +30,6 @@ GB_FREE_WORK (&J2k, J2k_size) ; \ } -// redefine to use the revised GB_FREE_ALL above: -#include "matrix/GB_static_header.h" - GrB_Info GB_assign_prep ( // output: @@ -92,7 +88,7 @@ GrB_Info GB_assign_prep const GrB_Index nCols_in, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded - const GB_Type_code scode, // type code of scalar to expand + const GB_Type_code scalar_code, // type code of scalar to expand GB_Werk Werk ) { @@ -114,7 +110,7 @@ GrB_Info GB_assign_prep ASSERT (!GB_is_shallow (C)) ; ASSERT_MATRIX_OK_OR_NULL (M, "M for GB_assign_prep", GB0) ; ASSERT_BINARYOP_OK_OR_NULL (accum, "accum for GB_assign_prep", GB0) ; - ASSERT (scode <= GB_UDT_code) ; + ASSERT (scalar_code <= GB_UDT_code) ; GrB_Matrix Cwork = NULL ; GrB_Matrix Mwork = NULL ; @@ -163,7 +159,7 @@ GrB_Info GB_assign_prep ASSERT (scalar != NULL) ; ASSERT (A == NULL) ; ASSERT ((*assign_kind) == GB_ASSIGN || (*assign_kind) == GB_SUBASSIGN) ; - scalar_type = GB_code_type (scode, ctype) ; + scalar_type = GB_code_type (scalar_code, ctype) ; atype = scalar_type ; } else @@ -204,18 +200,18 @@ GrB_Info GB_assign_prep // C(Rows,Cols) = accum (C(Rows,Cols),A) GB_OK (GB_BinaryOp_compatible (accum, ctype, ctype, (scalar_expansion) ? NULL : atype, - (scalar_expansion) ? scode : GB_ignore_code, Werk)) ; + (scalar_expansion) ? scalar_code : GB_ignore_code, Werk)) ; } // C(Rows,Cols) = T, so C and T must be compatible. // also C(Rows,Cols) = accum(C,T) for entries in T but not C if (scalar_expansion) { - if (!GB_code_compatible (ctype->code, scode)) + if (!GB_code_compatible (ctype->code, scalar_code)) { GB_ERROR (GrB_DOMAIN_MISMATCH, "Input scalar of type [%s]\n" "cannot be typecast to output of type [%s]", - GB_code_string (scode), ctype->name) ; + GB_code_string (scalar_code), ctype->name) ; } } else @@ -370,13 +366,13 @@ GrB_Info GB_assign_prep // GrB_Matrix_assign, GxB_Matrix_subassign: A and C can be in any format, // and A_transpose can be true or false, depending on the descriptor. If // the CSR/CSC formats of A and C are the same, then A_transpose remains - // as-is. If they differ, then A_transpose is flipped. Then the CSR-CSC + // as-is. If they differ, then A_transpose is negated. Then the CSR-CSC // agnostic assignment proceeds. bool C_is_csc = C->is_csc ; if (!scalar_expansion && C_is_csc != A->is_csc) { - // Flip the sense of A_transpose + // negate the sense of A_transpose A_transpose = !A_transpose ; } @@ -444,17 +440,17 @@ GrB_Info GB_assign_prep // The mask M is empty, and complemented, and thus M(i,j)=0 for all i // and j. The result does not depend on A or accum. The output C is // either untouched (if C_replace is false) or cleared (if C_replace is - // true). However, the GrB_Row_assign and GrB_Col_assign only clear - // their specific row or column of C, respectively. GB_subassign only - // clears C(I,J). GrB_assign clears all of C. + // true). However, GrB_Row_assign and GrB_Col_assign only clear their + // specific row or column of C, respectively. GB_subassign only clears + // C(I,J). GrB_assign clears all of C. - // M is NULL so C and M cannot be the same, and A is ignored so - // it doesn't matter whether or not C == A. Thus C is not aliased - // to the inputs. + // M is NULL so C and M cannot be the same, and A is ignored so it + // doesn't matter whether or not C == A. Thus C is not aliased to the + // inputs. - // This condition is like GB_RETURN_IF_QUICK_MASK(...), except that - // the action taken by C_replace is different for row/col assign - // and subassign. + // This condition is like GB_RETURN_IF_QUICK_MASK(...), except that the + // action taken by C_replace is different for row/col assign and + // subassign. if (*C_replace) { @@ -485,8 +481,8 @@ GrB_Info GB_assign_prep GBURBLE ("bitmap C(i,:)=zombie ") ; int scalar_unused = 0 ; GB_OK (GB_bitmap_assign (C, /* C_replace: */ true, - I, 1, GB_LIST, NULL, // I - NULL, 0, GB_ALL, NULL, // J + I, 1, 1, GB_LIST, NULL, // I = [i] + NULL, 0, 0, GB_ALL, NULL, // J = [:] /* no M: */ NULL, /* Mask_comp: */ true, /* Mask_struct: ignored */ false, @@ -497,7 +493,7 @@ GrB_Info GB_assign_prep } else { - GB_MATRIX_WAIT_IF_JUMBLED (C) ; + GB_UNJUMBLE (C) ; GB_ENSURE_SPARSE (C) ; GBURBLE ("C(i,:)=zombie ") ; GB_OK (GB_assign_zombie2 (C, I [0])) ; @@ -519,8 +515,8 @@ GrB_Info GB_assign_prep GBURBLE ("bitmap C(:,j)=zombie ") ; int scalar_unused = 0 ; GB_OK (GB_bitmap_assign (C, /* C_replace: */ true, - NULL, 0, GB_ALL, NULL, // I - J, 1, GB_LIST, NULL, // J + NULL, 0, 0, GB_ALL, NULL, // I = [:] + J, 1, 1, GB_LIST, NULL, // J = [j] /* no M: */ NULL, /* Mask_comp: */ true, /* Mask_struct: ignored */ false, @@ -570,8 +566,8 @@ GrB_Info GB_assign_prep GBURBLE ("bitmap C(I,J)=zombie ") ; int scalar_unused = 0 ; GB_OK (GB_bitmap_assign (C, /* C_replace: */ true, - I, nI, Ikind, Icolon, - J, nJ, Jkind, Jcolon, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, /* no M: */ NULL, /* Mask_comp: */ true, /* Mask_struct: ignored */ false, diff --git a/Source/assign/GB_assign_scalar.c b/Source/assign/GB_assign_scalar.c index 49ee4ecee6..1e4511cdb8 100644 --- a/Source/assign/GB_assign_scalar.c +++ b/Source/assign/GB_assign_scalar.c @@ -2,7 +2,7 @@ // GB_assign_scalar: C(Rows,Cols) = accum (C(Rows,Cols),x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GB_assign_zombie.h b/Source/assign/GB_assign_zombie.h index 4a2e115068..0bfd692b97 100644 --- a/Source/assign/GB_assign_zombie.h +++ b/Source/assign/GB_assign_zombie.h @@ -2,7 +2,7 @@ // GB_assign_zombie.h: definitions for GB_assign_zombie* functions //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GB_assign_zombie1.c b/Source/assign/GB_assign_zombie1.c index 561ddd3efc..4e2b4a2c01 100644 --- a/Source/assign/GB_assign_zombie1.c +++ b/Source/assign/GB_assign_zombie1.c @@ -2,13 +2,11 @@ // GB_assign_zombie1: delete all entries in C(:,j) for GB_assign //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // C(:,j) = anything: GrB_Row_assign or GrB_Col_assign with an empty // complemented mask requires all entries in the C(:,j) vector to be deleted. // C must be sparse or hypersparse. @@ -43,7 +41,7 @@ GrB_Info GB_assign_zombie1 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 ; + const int64_t Cnvec = C->nvec ; if (Ch != NULL) { @@ -52,7 +50,7 @@ GrB_Info GB_assign_zombie1 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, + GB_hyper_hash_lookup (Ch, Cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, j, &pC_start, &pC_end) ; } else @@ -87,7 +85,7 @@ GrB_Info GB_assign_zombie1 { // delete C(i,j) by marking it as a zombie nzombies++ ; - Ci [pC] = GB_FLIP (i) ; + Ci [pC] = GB_ZOMBIE (i) ; } } diff --git a/Source/assign/GB_assign_zombie2.c b/Source/assign/GB_assign_zombie2.c index c1a95649a3..5be9b40587 100644 --- a/Source/assign/GB_assign_zombie2.c +++ b/Source/assign/GB_assign_zombie2.c @@ -2,13 +2,11 @@ // GB_assign_zombie2: delete all entries in C(i,:) for GB_assign //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // C(i,:) = anything: GrB_Row_assign or GrB_Col_assign with an empty // complemented mask requires all entries in C(i,:) to be deleted. // C must be sparse or hypersparse. @@ -87,7 +85,7 @@ GrB_Info GB_assign_zombie2 { ASSERT (i == Ci [pC]) ; nzombies++ ; - Ci [pC] = GB_FLIP (i) ; + Ci [pC] = GB_ZOMBIE (i) ; } } } diff --git a/Source/assign/GB_assign_zombie3.c b/Source/assign/GB_assign_zombie3.c index 27d460348e..9176d9cfa2 100644 --- a/Source/assign/GB_assign_zombie3.c +++ b/Source/assign/GB_assign_zombie3.c @@ -2,13 +2,13 @@ // GB_assign_zombie3: delete entries in C(:,j) for C_replace_phase //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed, but 36 variants possible, one for each mask type (6: 1, 2, -// 4, 8, 16 bytes and structural), for each matrix type (3: bitmap/full/sparse +// JIT: possible: 48 variants, one for each mask type (6: 1, 2, +// 4, 8, 16 bytes and structural), for each matrix type (4: bitmap/full/sparse // & hyper), mask comp (2). No variants needed for C. // For GrB_Row_assign or GrB_Col_assign, C(I,j)<#M,repl>=any must delete all @@ -19,14 +19,17 @@ // GB_assign_zombie3 and GB_assign_zombie4 are transposes of each other. // C must be sparse or hypersparse. -// M can have any sparsity structure: hypersparse, sparse, bitmap, or full +// M can have any sparsity structure: hypersparse, sparse, bitmap, or full, +// and is always present. // C->iso is not affected. #include "assign/GB_assign.h" #include "assign/GB_assign_zombie.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "assign/GB_subassign_methods.h" +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 0 +#include "assign/include/GB_assign_shared_definitions.h" GrB_Info GB_assign_zombie3 ( @@ -51,6 +54,7 @@ GrB_Info GB_assign_zombie3 ASSERT (GB_ZOMBIES_OK (C)) ; ASSERT (GB_JUMBLED_OK (C)) ; ASSERT (!GB_PENDING (C)) ; + ASSERT (M != NULL) ; ASSERT (!GB_ZOMBIES (M)) ; ASSERT (!GB_JUMBLED (M)) ; // binary search on M ASSERT (!GB_PENDING (M)) ; @@ -64,7 +68,7 @@ GrB_Info GB_assign_zombie3 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 ; + const int64_t Cnvec = C->nvec ; if (Ch != NULL) { @@ -73,7 +77,7 @@ GrB_Info GB_assign_zombie3 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, + GB_hyper_hash_lookup (Ch, Cnvec, Cp, C_Yp, C_Yi, C_Yx, C_hash_bits, j, &pC_start, &pC_end) ; } else @@ -96,9 +100,10 @@ GrB_Info GB_assign_zombie3 const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; const size_t msize = M->type->size ; const int64_t Mvlen = M->vlen ; - int64_t pM_start = 0 ; // Mp [0] - int64_t pM_end = GBP (Mp, 1, Mvlen) ; const bool M_is_bitmap = GB_IS_BITMAP (M) ; + + int64_t pM_start = 0 ; // Mp [0] + int64_t pM_end = GBP_M (Mp, 1, Mvlen) ; const bool mjdense = (pM_end - pM_start) == Mvlen ; //-------------------------------------------------------------------------- @@ -155,7 +160,7 @@ GrB_Info GB_assign_zombie3 { // delete C(i,j) by marking it as a zombie nzombies++ ; - Ci [pC] = GB_FLIP (i) ; + Ci [pC] = GB_ZOMBIE (i) ; } } } diff --git a/Source/assign/GB_assign_zombie4.c b/Source/assign/GB_assign_zombie4.c index 8f0065d353..673acfa9e1 100644 --- a/Source/assign/GB_assign_zombie4.c +++ b/Source/assign/GB_assign_zombie4.c @@ -2,12 +2,12 @@ // GB_assign_zombie4: delete entries in C(i,:) for C_replace_phase //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed, but 96 variants. Could use one for each mask type (6: 1, 2, +// JIT: possible: 96 variants. Could use one for each mask type (6: 1, 2, // 4, 8, 16 bytes and structural), for each matrix type (4: bitmap/full/sparse/ // hyper), mask comp (2), C sparsity (2: sparse/hyper): 6*4*2*2 = 96 variants, // so a JIT kernel is reasonable. @@ -114,7 +114,7 @@ GrB_Info GB_assign_zombie4 // get C(:,j) and determine if j is outside the list J //------------------------------------------------------------------ - int64_t j = GBH (Ch, k) ; + int64_t j = GBH_C (Ch, k) ; bool j_outside = !GB_ij_is_in_list (J, nJ, j, Jkind, Jcolon) ; if (j_outside) { @@ -148,7 +148,7 @@ GrB_Info GB_assign_zombie4 { // M is bitmap/full int64_t pM = j ; - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; } else { @@ -184,7 +184,7 @@ GrB_Info GB_assign_zombie4 { // delete C(i,j) by marking it as a zombie nzombies++ ; - Ci [pC] = GB_FLIP (i) ; + Ci [pC] = GB_ZOMBIE (i) ; } } } diff --git a/Source/assign/GB_assign_zombie5.c b/Source/assign/GB_assign_zombie5.c index 23560055c7..e39707d446 100644 --- a/Source/assign/GB_assign_zombie5.c +++ b/Source/assign/GB_assign_zombie5.c @@ -2,12 +2,12 @@ // GB_assign_zombie5: delete entries in C for C_replace_phase //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed, but 96 variants. Could use one for each mask type (6: 1, 2, +// JIT: possible: 96 variants. Could use one for each mask type (6: 1, 2, // 4, 8, 16 bytes and structural), for each matrix type (4: bitmap/full/sparse/ // hyper), mask comp (2), C sparsity (2: sparse/hyper): 6*4*2*2 = 96 variants, // so a JIT kernel is reasonable. @@ -24,9 +24,11 @@ #include "assign/GB_assign.h" #include "assign/GB_assign_zombie.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "assign/GB_subassign_methods.h" #include "slice/GB_ek_slice.h" +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 0 +#include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL #define GB_FREE_ALL \ @@ -140,32 +142,18 @@ GrB_Info GB_assign_zombie5 // get C(:,j) and determine if j is outside the list J //------------------------------------------------------------------ - int64_t j = GBH (Ch, k) ; + int64_t j = GBH_C (Ch, k) ; // j_outside is true if column j is outside the C(I,J) submatrix bool j_outside = !GB_ij_is_in_list (J, nJ, j, Jkind, Jcolon) ; - int64_t pC_start, pC_end ; - GB_get_pA (&pC_start, &pC_end, tid, k, - kfirst, klast, pstart_Cslice, Cp, zvlen) ; + GB_GET_PA (pC_start, pC_end, tid, k, kfirst, klast, pstart_Cslice, + Cp [k], Cp [k+1]) ; //------------------------------------------------------------------ // get M(:,j) //------------------------------------------------------------------ - // this works for M with any sparsity structure int64_t pM_start, pM_end ; - - if (M_is_hyper) - { - // M is hypersparse - GB_hyper_hash_lookup (Mh, Mnvec, Mp, M_Yp, M_Yi, M_Yx, - M_hash_bits, j, &pM_start, &pM_end) ; - } - else - { - // M is sparse, bitmap, or full - pM_start = GBP (Mp, j , Mvlen) ; - pM_end = GBP (Mp, j+1, Mvlen) ; - } + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; bool mjdense = (pM_end - pM_start) == Mvlen ; @@ -202,7 +190,7 @@ GrB_Info GB_assign_zombie5 { // delete C(i,j) by marking it as a zombie nzombies++ ; - Ci [pC] = GB_FLIP (i) ; + Ci [pC] = GB_ZOMBIE (i) ; } } } diff --git a/Source/assign/GB_bitmap_M_scatter.c b/Source/assign/GB_bitmap_M_scatter.c deleted file mode 100644 index e02fe6f9b5..0000000000 --- a/Source/assign/GB_bitmap_M_scatter.c +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_bitmap_M_scatter: scatter M into/from the C bitmap -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// JIT: not needed, but variants possible for each kind of mask matrix. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" - -GB_CALLBACK_BITMAP_M_SCATTER_PROTO (GB_bitmap_M_scatter) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - ASSERT_MATRIX_OK (M, "M for bitmap scatter", GB0) ; - ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; - ASSERT (M_ntasks > 0) ; - ASSERT (M_nthreads > 0) ; - ASSERT (M_ek_slicing != NULL) ; - - //-------------------------------------------------------------------------- - // get C and M - //-------------------------------------------------------------------------- - - GB_GET_M - int8_t *Cb = C->b ; - const int64_t cvlen = C->vlen ; - int64_t cnvals = 0 ; - - //-------------------------------------------------------------------------- - // scatter M into the C bitmap - //-------------------------------------------------------------------------- - - switch (operation) - { - - case GB_BITMAP_M_SCATTER_PLUS_2 : // Cb (i,j) += 2 - - #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) Cb [pC] += 2 - #include "assign/factory/GB_bitmap_assign_M_template.c" - break ; - - case GB_BITMAP_M_SCATTER_MINUS_2 : // Cb (i,j) -= 2 - - #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) Cb [pC] -= 2 - #include "assign/factory/GB_bitmap_assign_M_template.c" - break ; - - case GB_BITMAP_M_SCATTER_MOD_2 : // Cb (i,j) %= 2 - - #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) Cb [pC] %= 2 - #include "assign/factory/GB_bitmap_assign_M_template.c" - break ; - - default: ; - } -} - diff --git a/Source/assign/GB_bitmap_M_scatter_whole.c b/Source/assign/GB_bitmap_M_scatter_whole.c index 9ae55e04ef..22b9f0a0ef 100644 --- a/Source/assign/GB_bitmap_M_scatter_whole.c +++ b/Source/assign/GB_bitmap_M_scatter_whole.c @@ -2,15 +2,21 @@ // GB_bitmap_M_scatter_whole: scatter M into/from the C bitmap //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed, but variants possible for each kind of mask matrix. +// This method only handles the full assign case, where there are no I and J +// index lists. The C and M matrices must have the same size. + +// C is bitmap. M is sparse or hypersparse, and may be jumbled. #include "assign/GB_bitmap_assign_methods.h" +#define GB_GENERIC #include "assign/include/GB_assign_shared_definitions.h" +#undef GB_FREE_ALL +#define GB_FREE_ALL ; GB_CALLBACK_BITMAP_M_SCATTER_WHOLE_PROTO (GB_bitmap_M_scatter_whole) { @@ -20,6 +26,7 @@ GB_CALLBACK_BITMAP_M_SCATTER_WHOLE_PROTO (GB_bitmap_M_scatter_whole) //-------------------------------------------------------------------------- ASSERT_MATRIX_OK (M, "M for bitmap scatter, whole", GB0) ; + ASSERT (GB_IS_BITMAP (C)) ; ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; ASSERT (GB_JUMBLED_OK (M)) ; ASSERT (M_ntasks > 0) ; @@ -30,40 +37,74 @@ GB_CALLBACK_BITMAP_M_SCATTER_WHOLE_PROTO (GB_bitmap_M_scatter_whole) // get C and M //-------------------------------------------------------------------------- - GB_GET_M + GB_GET_MASK int8_t *Cb = C->b ; - const int64_t cvlen = C->vlen ; - int64_t cnvals = 0 ; + const int64_t Cvlen = C->vlen ; + int64_t cnvals = 0 ; // not needed + ASSERT ((Mx == NULL) == Mask_struct) ; //-------------------------------------------------------------------------- // scatter M into the C bitmap //-------------------------------------------------------------------------- - switch (operation) + if (Mx == NULL) + { + #undef GB_MCAST + #define GB_MCAST(Mx,p,msize) 1 + #include "assign/factory/GB_bitmap_M_scatter_whole_template.c" + } + else { - - case GB_BITMAP_M_SCATTER_PLUS_2 : // Cb (i,j) += 2 - - #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) Cb [pC] += 2 - #include "assign/factory/GB_bitmap_assign_M_all_template.c" + switch (msize) + { + + default: + case GB_1BYTE : + { + uint8_t *Mx1 = (uint8_t *) Mx ; + #undef GB_MCAST + #define GB_MCAST(Mx,p,msize) (Mx1 [p] != 0) + #include "assign/factory/GB_bitmap_M_scatter_whole_template.c" + } break ; - case GB_BITMAP_M_SCATTER_MINUS_2 : // Cb (i,j) -= 2 - - #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) Cb [pC] -= 2 - #include "assign/factory/GB_bitmap_assign_M_all_template.c" + case GB_2BYTE : + { + uint16_t *Mx2 = (uint16_t *) Mx ; + #undef GB_MCAST + #define GB_MCAST(Mx,p,msize) (Mx2 [p] != 0) + #include "assign/factory/GB_bitmap_M_scatter_whole_template.c" + } break ; - case GB_BITMAP_M_SCATTER_SET_2 : // Cb (i,j) = 2 + case GB_4BYTE : + { + uint32_t *Mx4 = (uint32_t *) Mx ; + #undef GB_MCAST + #define GB_MCAST(Mx,p,msize) (Mx4 [p] != 0) + #include "assign/factory/GB_bitmap_M_scatter_whole_template.c" + } + break ; - #undef GB_MASK_WORK - #define GB_MASK_WORK(pC) Cb [pC] = 2 - #include "assign/factory/GB_bitmap_assign_M_all_template.c" + case GB_8BYTE : + { + uint64_t *Mx8 = (uint64_t *) Mx ; + #undef GB_MCAST + #define GB_MCAST(Mx,p,msize) (Mx8 [p] != 0) + #include "assign/factory/GB_bitmap_M_scatter_whole_template.c" + } break ; - default: ; + case GB_16BYTE : + { + uint64_t *Mx16 = (uint64_t *) Mx ; + #undef GB_MCAST + #define GB_MCAST(Mx,p,msize) \ + (Mx16 [2*(p)] != 0) || (Mx16 [2*(p)+1] != 0) + #include "assign/factory/GB_bitmap_M_scatter_whole_template.c" + } + break ; + } } } diff --git a/Source/assign/GB_bitmap_assign.c b/Source/assign/GB_bitmap_assign.c index 0a047c4d5f..ff515ceaa7 100644 --- a/Source/assign/GB_bitmap_assign.c +++ b/Source/assign/GB_bitmap_assign.c @@ -2,7 +2,7 @@ // GB_bitmap_assign: assign to C bitmap //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -11,10 +11,11 @@ // is in bitmap form, or when C is converted into bitmap form. // C is returned as bitmap in all cases except for C = A or C = scalar (the -// whole_C_matrix case with GB_bitmap_assign_noM_noaccum_whole). For that +// whole_C_matrix case with GB_bitmap_assign_6_whole). For that // method, C can be returned with any sparsity structure. #include "assign/GB_bitmap_assign_methods.h" +#define GB_GENERIC #include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL @@ -27,10 +28,12 @@ GrB_Info GB_bitmap_assign // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -73,16 +76,19 @@ GrB_Info GB_bitmap_assign if (whole_C_matrix) { // C = A or scalar, no mask. C may become sparse, hyper, or - // full, or it may remain bitmap. - GB_OK (GB_bitmap_assign_noM_noaccum_whole (C, C_replace, - /* no M, */ Mask_comp, Mask_struct, /* no accum, */ + // full, or it may remain bitmap. The Mask_comp = true and/or + // C_replace = true cases are handled in GB_assign_prep, and + // in that case, GB_bitmap_assign is not called. + ASSERT (!C_replace) ; + ASSERT (!Mask_comp) ; + GB_OK (GB_bitmap_assign_6_whole (C, A, scalar, scalar_type, Werk)) ; } else { // C(I,J) = A or scalar, no mask - GB_OK (GB_bitmap_assign_noM_noaccum (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + GB_OK (GB_bitmap_assign_6 (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, /* no M, */ Mask_comp, Mask_struct, /* no accum, */ A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -92,15 +98,15 @@ GrB_Info GB_bitmap_assign if (whole_C_matrix) { // C += A or scalar, no mask. - GB_OK (GB_bitmap_assign_noM_accum_whole (C, C_replace, + GB_OK (GB_bitmap_assign_5_whole (C, C_replace, /* no M, */ Mask_comp, Mask_struct, accum, A, scalar, scalar_type, Werk)) ; } else { // C(I,J) += A or scalar, no mask. - GB_OK (GB_bitmap_assign_noM_accum (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + GB_OK (GB_bitmap_assign_5 (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, /* no M, */ Mask_comp, Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -112,16 +118,16 @@ GrB_Info GB_bitmap_assign { if (whole_C_matrix) { - // C = A or scalar - GB_OK (GB_bitmap_assign_fullM_noaccum_whole (C, C_replace, + // C = A or scalar + GB_OK (GB_bitmap_assign_2_whole (C, C_replace, M, Mask_comp, Mask_struct, /* no accum, */ A, scalar, scalar_type, Werk)) ; } else { - // C(I,J) = A or scalar - GB_OK (GB_bitmap_assign_fullM_noaccum (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + // C(I,J) = A or scalar + GB_OK (GB_bitmap_assign_2 (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, /* no accum, */ A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -130,16 +136,16 @@ GrB_Info GB_bitmap_assign { if (whole_C_matrix) { - // C = A or scalar - GB_OK (GB_bitmap_assign_fullM_accum_whole (C, C_replace, + // C += A or scalar + GB_OK (GB_bitmap_assign_1_whole (C, C_replace, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, Werk)) ; } else { - // C(I,J) = A or scalar - GB_OK (GB_bitmap_assign_fullM_accum (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + // C(I,J) + A or scalar + GB_OK (GB_bitmap_assign_1 (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -152,15 +158,15 @@ GrB_Info GB_bitmap_assign if (whole_C_matrix) { // C = A or scalar, M is sparse or hypersparse - GB_OK (GB_bitmap_assign_M_noaccum_whole (C, C_replace, + GB_OK (GB_bitmap_assign_4_whole (C, C_replace, M, /* Mask_comp false, */ Mask_struct, /* no accum, */ A, scalar, scalar_type, Werk)) ; } else { // C(I,J) = A or scalar, M is sparse or hypersparse - GB_OK (GB_bitmap_assign_M_noaccum (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + GB_OK (GB_bitmap_assign_4 (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, /* Mask_comp false, */ Mask_struct, /* no accum, */ A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -170,15 +176,15 @@ GrB_Info GB_bitmap_assign if (whole_C_matrix) { // C += A or scalar, M is sparse or hypersparse - GB_OK (GB_bitmap_assign_M_accum_whole (C, C_replace, + GB_OK (GB_bitmap_assign_3_whole (C, C_replace, M, /* Mask_comp false, */ Mask_struct, accum, A, scalar, scalar_type, Werk)) ; } else { // C(I,J) += A or scalar, M is sparse or hypersparse - GB_OK (GB_bitmap_assign_M_accum (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + GB_OK (GB_bitmap_assign_3 (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, /* Mask_comp false, */ Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -191,15 +197,15 @@ GrB_Info GB_bitmap_assign if (whole_C_matrix) { // C = A or scalar, M is sparse or hypersparse - GB_OK (GB_bitmap_assign_notM_noaccum_whole (C, C_replace, + GB_OK (GB_bitmap_assign_8_whole (C, C_replace, M, /* Mask_comp true, */ Mask_struct, /* no accum, */ A, scalar, scalar_type, Werk)) ; } else { // C(I,J) = A or scalar, M is sparse or hypersparse - GB_OK (GB_bitmap_assign_notM_noaccum (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + GB_OK (GB_bitmap_assign_8 (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, /* Mask_comp true, */ Mask_struct, /* no accum, */ A, scalar, scalar_type, assign_kind, Werk)) ; } @@ -209,15 +215,15 @@ GrB_Info GB_bitmap_assign if (whole_C_matrix) { // C += A or scalar, M is sparse or hypersparse - GB_OK (GB_bitmap_assign_notM_accum_whole (C, C_replace, + GB_OK (GB_bitmap_assign_7_whole (C, C_replace, M, /* Mask_comp true, */ Mask_struct, accum, A, scalar, scalar_type, Werk)) ; } else { // C(I,J) += A or scalar, M is sparse or hypersparse - GB_OK (GB_bitmap_assign_notM_accum (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + GB_OK (GB_bitmap_assign_7 (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, /* Mask_comp true, */ Mask_struct, accum, A, scalar, scalar_type, assign_kind, Werk)) ; } diff --git a/Source/assign/GB_bitmap_assign.h b/Source/assign/GB_bitmap_assign.h index ece8114191..860d26e6c5 100644 --- a/Source/assign/GB_bitmap_assign.h +++ b/Source/assign/GB_bitmap_assign.h @@ -2,7 +2,7 @@ // GB_bitmap_assign.h: definitions for GB_bitmap_assign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -19,10 +19,12 @@ GrB_Info GB_bitmap_assign // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], diff --git a/Source/assign/GB_bitmap_assign_1.c b/Source/assign/GB_bitmap_assign_1.c new file mode 100644 index 0000000000..53fd90d0ed --- /dev/null +++ b/Source/assign/GB_bitmap_assign_1.c @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_1: C bitmap, M bitmap/full, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C(I,J) += A assign +// C(I,J) += A subassign + +// C(I,J) += A assign +// C(I,J) += A subassign + +// C(I,J) += A assign +// C(I,J) += A subassign + +// C(I,J) += A assign +// C(I,J) += A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, bitmap or full (not hypersparse or sparse) +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: true or false +// accum: present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign, row assign, col assign, or subassign + +// If C were full: entries can be deleted only if C_replace is true. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_1 // C bitmap, M bitmap/full, with accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + const GrB_Index *I, // I index list + const int64_t ni, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const GrB_Index *J, // J index list + const int64_t nj, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + const GrB_Matrix M, // mask matrix, which is present here + const bool Mask_comp, // true for !M, false for M + const bool Mask_struct, // true if M is structural, false if valued + const GrB_BinaryOp accum, // present here + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + const int assign_kind, // row assign, col assign, assign, or subassign + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit1", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, M full, accum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, M full, accum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M full, accum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_1, "bitmap_assign_1", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_1_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_1_whole.c b/Source/assign/GB_bitmap_assign_1_whole.c new file mode 100644 index 0000000000..035564ab56 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_1_whole.c @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_1_whole: C bitmap, M bitmap/full, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C += A assign +// C += A subassign + +// C += A assign +// C += A subassign + +// C += A assign +// C += A subassign + +// C += A assign +// C += A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, bitmap or full (not hypersparse or sparse) +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: true or false +// accum: present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign or subassign (same action) + +// If C were full: entries can be deleted only if C_replace is true. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_1_whole // C bitmap, M bitmap/full, with accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + const GrB_Matrix M, // mask matrix, which is present here + const bool Mask_comp, // true for !M, false for M + const bool Mask_struct, // true if M is structural, false if valued + const GrB_BinaryOp accum, // present here + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit1_whole", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, M full, accum, whole", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, M full, accum, whole", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap_assign_1_whole", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_1_WHOLE, "bitmap_assign_1_whole", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_1_whole_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_2.c b/Source/assign/GB_bitmap_assign_2.c new file mode 100644 index 0000000000..34d8e3075f --- /dev/null +++ b/Source/assign/GB_bitmap_assign_2.c @@ -0,0 +1,104 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_2: C bitmap, M bitmap/full, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C(I,J) = A assign +// C(I,J) = A subassign + +// C(I,J) = A assign +// C(I,J) = A subassign + +// C(I,J) = A assign +// C(I,J) = A subassign + +// C(I,J) = A assign +// C(I,J) = A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, bitmap or full (not hypersparse or sparse) +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: true or false +// accum: not present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign, row assign, col assign, or subassign + +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_2 // C bitmap, M bitmap/full, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + const GrB_Index *I, // I index list + const int64_t ni, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const GrB_Index *J, // J index list + const int64_t nj, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + const GrB_Matrix M, // mask matrix, which is present here + const bool Mask_comp, // true for !M, false for M + const bool Mask_struct, // true if M is structural, false if valued + #define accum NULL /* not present */ + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + const int assign_kind, // row assign, col assign, assign, or subassign + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit2", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, M full, noaccum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, M full, noaccum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M full, noaccum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_2, "bitmap_assign_2", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_2_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_2_whole.c b/Source/assign/GB_bitmap_assign_2_whole.c new file mode 100644 index 0000000000..13ddc5edc0 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_2_whole.c @@ -0,0 +1,104 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_2_whole: C bitmap, M bitmap/full, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C = A assign +// C = A subassign + +// C = A assign +// C = A subassign + +// C = A assign +// C = A subassign + +// C = A assign +// C = A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, bitmap or full (not hypersparse or sparse) +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: true or false +// accum: not present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign or subassign (same action) + +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_2_whole // C bitmap, M bitmap/full, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + const GrB_Matrix M, // mask matrix, which is present here + const bool Mask_comp, // true for !M, false for M + const bool Mask_struct, // true if M is structural, false if valued + #define accum NULL /* not present */ + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit2_whole", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, M full, noaccum, whole", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, M full, noaccum, whole", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap_assign_2_whole", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_2_WHOLE, "bitmap_assign_2_whole", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_2_whole_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_3.c b/Source/assign/GB_bitmap_assign_3.c new file mode 100644 index 0000000000..4c7ac244cf --- /dev/null +++ b/Source/assign/GB_bitmap_assign_3.c @@ -0,0 +1,97 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_3: C bitmap, M sparse/hyper, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C(I,J) += A assign +// C(I,J) += A subassign + +// C(I,J) += A assign +// C(I,J) += A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, hypersparse or sparse (not bitmap or full) +// Mask_comp: false +// Mask_struct: true or false +// C_replace: true or false +// accum: present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign, row assign, col assign, or subassign + +// If C were full: entries can be deleted only if C_replace is true. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_3 // C bitmap, M sparse/hyper, with accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + const GrB_Index *I, // I index list + const int64_t ni, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const GrB_Index *J, // J index list + const int64_t nj, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + const GrB_Matrix M, // mask matrix, which is present here + #define Mask_comp false + const bool Mask_struct, // true if M is structural, false if valued + const GrB_BinaryOp accum, // present here + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + const int assign_kind, // row assign, col assign, assign, or subassign + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit3", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, M, accum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, M, accum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M, accum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_3, "bitmap_assign_3", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_3_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_3_whole.c b/Source/assign/GB_bitmap_assign_3_whole.c new file mode 100644 index 0000000000..b4abb0fb0d --- /dev/null +++ b/Source/assign/GB_bitmap_assign_3_whole.c @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_3_whole: C bitmap, M sparse/hyper, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C += A assign +// C += A subassign + +// C += A assign +// C += A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, hypersparse or sparse (not bitmap or full) +// Mask_comp: false +// Mask_struct: true or false +// C_replace: true or false +// accum: present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign or subassign (same action) + +// If C were full: entries can be deleted only if C_replace is true. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_3_whole // C bitmap, M sparse/hyper, with accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + const GrB_Matrix M, // mask matrix, which is present here + #define Mask_comp false + const bool Mask_struct, // true if M is structural, false if valued + const GrB_BinaryOp accum, // present here + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit3_whole", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT (GB_JUMBLED_OK (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, M, accum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, M, accum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M, accum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_3_WHOLE, "bitmap_assign_3_whole", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_3_whole_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_4.c b/Source/assign/GB_bitmap_assign_4.c new file mode 100644 index 0000000000..d2d4003457 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_4.c @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_4: C bitmap, M sparse/hyper, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C(I,J) = A assign +// C(I,J) = A subassign + +// C(I,J) = A assign +// C(I,J) = A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, hypersparse or sparse, (not bitmap or full) +// Mask_comp: false +// Mask_struct: true or false +// C_replace: true or false +// accum: not present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign, row assign, col assign, or subassign + +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_4 // C bitmap, M sparse/hyper, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + const GrB_Index *I, // I index list + const int64_t ni, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const GrB_Index *J, // J index list + const int64_t nj, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + const GrB_Matrix M, // mask matrix, which is present here + #define Mask_comp false + const bool Mask_struct, // true if M is structural, false if valued + #define accum NULL + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + const int assign_kind, // row assign, col assign, assign, or subassign + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit4", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, M, noaccum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, M, noaccum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M, noaccum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_4, "bitmap_assign_4", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_4_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_4_whole.c b/Source/assign/GB_bitmap_assign_4_whole.c new file mode 100644 index 0000000000..de79262536 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_4_whole.c @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_4_whole: C bitmap, M sparse/hyper, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C = A assign +// C = A subassign + +// C = A assign +// C = A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, hypersparse or sparse, (not bitmap or full) +// Mask_comp: false +// Mask_struct: true or false +// C_replace: true or false +// accum: not present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign or subassign (same action) + +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_4_whole // C bitmap, M sparse/hyper, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + const GrB_Matrix M, // mask matrix, which is present here + #define Mask_comp false + const bool Mask_struct, // true if M is structural, false if valued + #define accum NULL + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit4_whole", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT (GB_JUMBLED_OK (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, M, noaccum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, M, noaccum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M, noaccum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_4_WHOLE, "bitmap_assign_4_whole", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_4_whole_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_5.c b/Source/assign/GB_bitmap_assign_5.c new file mode 100644 index 0000000000..a817dd66c3 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_5.c @@ -0,0 +1,106 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_5: C bitmap, no M, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C<>(I,J) += A assign +// C(I,J)<> += A subassign + +// C(I,J) += A assign +// C(I,J) += A subassign + +// C(I,J) += A assign: no work to do +// C(I,J) += A subassign: no work to do + +// C(I,J) += A assign: just clear C(I,J) of all entries +// C(I,J) += A subassign: just clear C(I,J) of all entries +//------------------------------------------------------------------------------ + +// C: bitmap +// M: none +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: true or false +// accum: present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign, row assign, col assign, or subassign (all the same) + +// If Mask_comp is true, then an empty mask is complemented. This case has +// already been handled by GB_assign_prep, which calls GB_bitmap_assign with a +// scalar (which is unused). + +// If C were full: entries can be deleted only if C_replace is true. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_5 // C bitmap, no M, with accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + const GrB_Index *I, // I index list + const int64_t ni, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const GrB_Index *J, // J index list + const int64_t nj, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + #define M NULL /* mask matrix, not present here */ + const bool Mask_comp, // true for !M, false for M + const bool Mask_struct, // true if M is structural, false if valued + const GrB_BinaryOp accum, // present + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + const int assign_kind, // row assign, col assign, assign, or subassign + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit5", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT_MATRIX_OK (C, "C for bitmap_assign_5", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap_assign_5", GB0) ; + ASSERT_BINARYOP_OK (accum, "accum for bitmap_assign_5", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_5, "bitmap_assign_5", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_5_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_5_whole.c b/Source/assign/GB_bitmap_assign_5_whole.c new file mode 100644 index 0000000000..1e81bd38e7 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_5_whole.c @@ -0,0 +1,106 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_5_whole: C bitmap, no M, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C<> += A assign +// C<> += A subassign + +// C += A assign +// C += A subassign + +// C += A assign: no work to do +// C += A subassign: no work to do + +// C += A assign: just clear C of all entries, not done here +// C += A subassign: just clear C of all entries, not done here +//------------------------------------------------------------------------------ + +// C: bitmap +// M: none +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: true or false +// accum: present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign or subassign (same action) + +// If Mask_comp is true, then an empty mask is complemented. This case has +// already been handled by GB_assign_prep, which calls GB_clear, and thus +// Mask_comp is always false in this method. + +// If C were full: entries can be deleted only if C_replace is true. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_5_whole // C bitmap, no M, with accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + #define M NULL /* mask matrix, not present here */ + const bool Mask_comp, // true for !M, false for M + const bool Mask_struct, // true if M is structural, false if valued + const GrB_BinaryOp accum, // present + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit5_whole", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT_MATRIX_OK (C, "C for bitmap_assign_5_whole", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap_assign_5_whole", GB0) ; + ASSERT_BINARYOP_OK (accum, "accum for bitmap_assign_5_whole", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_5_WHOLE, "bitmap_assign_5_whole", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_5_whole_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_6.c b/Source/assign/GB_bitmap_assign_6.c new file mode 100644 index 0000000000..fefa0554ba --- /dev/null +++ b/Source/assign/GB_bitmap_assign_6.c @@ -0,0 +1,108 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_6: C bitmap, no M, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C<>(I,J) = A assign +// C(I,J)<> = A subassign + +// C(I,J) = A assign +// C(I,J) = A subassign + +// C(I,J) = A assign +// C(I,J) = A subassign + +// C(I,J) = A assign +// C(I,J) = A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: none +// Mask_comp: true or false +// Mask_struct: true or false (ignored) +// C_replace: true or false +// accum: not present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign, row assign, col assign, or subassign + +// If M is not present and Mask_comp is true, then an empty mask is +// complemented. This case is handled by GB_assign_prep by calling this +// method with no matrix A, but with a scalar (which is unused). However, +// for GB_ASSIGN, C(I,J)=anything clears all of C, regardless of +// I and J. In that case, GB_assign_prep calls GB_clear instead. + +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_6 // C bitmap, no M, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + const GrB_Index *I, // I index list + const int64_t ni, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const GrB_Index *J, // J index list + const int64_t nj, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + #define M NULL /* mask matrix, not present here */ + const bool Mask_comp, // true for !M, false for M + const bool Mask_struct, // true if M is structural, false if valued + #define accum NULL /* not present */ + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + const int assign_kind, // row assign, col assign, assign, or subassign + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit6", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT_MATRIX_OK (C, "C for bitmap_assign_6", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap_assign", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_6, "bitmap_assign_6", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_6_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_6_whole.c b/Source/assign/GB_bitmap_assign_6_whole.c new file mode 100644 index 0000000000..da15070ce6 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_6_whole.c @@ -0,0 +1,160 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_6_whole: C bitmap, no M, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C<> = A assign +// C<> = A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: none +// Mask_comp: false +// Mask_struct: true or false (ignored) +// C_replace: false +// accum: not present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign or subassign (same action) + +// If M is not present and Mask_comp is true, then an empty mask is +// complemented. This case is handled by GB_assign_prep: if C_replace is +// true, the matrix is cleared by GB_clear, or no action is taken otherwise. +// In either case, this method is not called. As a result, Mask_comp and +// C_replace will always be false here. + +// For scalar assignment, C = x, this method just calls GB_convert_any_to_full, +// which converts C to an iso full matrix (the iso value has already been set +// by GB_assign_prep). + +// For matrix assignment, C = A, if A is sparse or hyper and C may become +// sparse or hyper, then the assignement is done by GB_subassign_24. + +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. + +#include "assign/GB_bitmap_assign_methods.h" +#include "assign/GB_subassign_dense.h" + +#undef GB_FREE_ALL +#define GB_FREE_ALL ; + +GrB_Info GB_bitmap_assign_6_whole // C bitmap, no M, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + #define C_replace false + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + #define M NULL /* mask matrix, not present here */ + #define Mask_comp false + #define Mask_struct true + #define accum NULL /* not present */ + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit6_whole", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + GrB_Info info ; + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT_MATRIX_OK (C, "C for bit6_whole", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bit6_whole", GB0) ; + + //-------------------------------------------------------------------------- + // C = A or C = scalar + //-------------------------------------------------------------------------- + + if (A == NULL) + { + + //---------------------------------------------------------------------- + // scalar assignment: C = scalar + //---------------------------------------------------------------------- + + ASSERT (C->iso) ; + GB_convert_any_to_full (C) ; + + } + else + { + + //---------------------------------------------------------------------- + // matrix assignment: C = A + //---------------------------------------------------------------------- + + if (GB_IS_BITMAP (A) || GB_IS_FULL (A)) + { + + //------------------------------------------------------------------ + // C = A where C is bitmap and A is bitmap or full + //------------------------------------------------------------------ + + // copy or typecast the values + GB_OK (GB_cast_matrix (C, A)) ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + + if (GB_IS_BITMAP (A)) + { + // copy the bitmap + GB_memcpy (C->b, A->b, GB_nnz_held (A), nthreads_max) ; + C->nvals = GB_nnz (A) ; + } + else + { + // free the bitmap or set it to all ones + GB_bitmap_assign_to_full (C, nthreads_max) ; + } + + } + else + { + + //------------------------------------------------------------------ + // C = A where C is bitmap and A is sparse or hyper + //------------------------------------------------------------------ + + int sparsity_control = + GB_sparsity_control (C->sparsity_control, C->vdim) ; + if ((GB_IS_SPARSE (A) && (sparsity_control & GxB_SPARSE)) || + (GB_IS_HYPERSPARSE (A) && (sparsity_control & GxB_HYPERSPARSE))) + { + // C becomes sparse or hypersparse, the same as A + GB_OK (GB_subassign_24 (C, A, Werk)) ; + } + else + { + // C remains bitmap: scatter A into the C bitmap + GB_OK (GB_bitmap_assign_6b_whole (C, A, Werk)) ; + } + } + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_MATRIX_OK (C, "final C, bit6_whole", GB0) ; + return (GrB_SUCCESS) ; +} + diff --git a/Source/assign/GB_bitmap_assign_6b_whole.c b/Source/assign/GB_bitmap_assign_6b_whole.c new file mode 100644 index 0000000000..2ed7de32b7 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_6b_whole.c @@ -0,0 +1,79 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_6b_whole: C bitmap, no M, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// C = A, C is bitmap, A is sparse/hyper + +#include "assign/GB_bitmap_assign_methods.h" +#include "assign/GB_subassign_dense.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_6b_whole // C bitmap, no M, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + #define C_replace false + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + #define M NULL /* mask matrix, not present here */ + #define Mask_comp false + #define Mask_struct true + #define accum NULL /* not present */ + const GrB_Matrix A, // input matrix, not transposed + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (A) || GB_IS_SPARSE (A)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign_6b_whole", GB0) ; + ASSERT_MATRIX_OK (A, "A for bitmap assign_6b_whole", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_6b_WHOLE, "bitmap_assign_6b_whole", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_6b_whole_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_7.c b/Source/assign/GB_bitmap_assign_7.c new file mode 100644 index 0000000000..1e4c85e2af --- /dev/null +++ b/Source/assign/GB_bitmap_assign_7.c @@ -0,0 +1,97 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_7: C bitmap, !M sparse/hyper, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C(I,J) += A assign +// C(I,J) += A subassign + +// C(I,J) += A assign +// C(I,J) += A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, hypersparse or sparse (not bitmap or full) +// Mask_comp: true +// Mask_struct: true or false +// C_replace: true or false +// accum: present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign, row assign, col assign, or subassign + +// If C were full: entries can be deleted only if C_replace is true. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_7 // C bitmap, !M sparse/hyper, with accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + const GrB_Index *I, // I index list + const int64_t ni, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const GrB_Index *J, // J index list + const int64_t nj, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + const GrB_Matrix M, // mask matrix + #define Mask_comp true /* true here, for !M only */ + const bool Mask_struct, // true if M is structural, false if valued + const GrB_BinaryOp accum, // present + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + const int assign_kind, // row assign, col assign, assign, or subassign + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit7", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, !M, accum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, !M, accum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, !M, accum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_7, "bitmap_assign_7", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_7_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_7_whole.c b/Source/assign/GB_bitmap_assign_7_whole.c new file mode 100644 index 0000000000..7a0d655a50 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_7_whole.c @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_7_whole: C bitmap, !M sparse/hyper, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C += A assign +// C += A subassign + +// C += A assign +// C += A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, hypersparse or sparse (not bitmap or full) +// Mask_comp: true +// Mask_struct: true or false +// C_replace: true or false +// accum: present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign or subassign (same action) + +// If C were full: entries can be deleted only if C_replace is true. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_7_whole // C bitmap, !M sparse/hyper, with accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + const GrB_Matrix M, // mask matrix + #define Mask_comp true /* true here, for !M only */ + const bool Mask_struct, // true if M is structural, false if valued + const GrB_BinaryOp accum, // present + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit7_whole", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT (GB_JUMBLED_OK (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, !M, accum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, !M, accum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, !M, accum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_7_WHOLE, "bitmap_assign_7_whole", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_7_whole_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_8.c b/Source/assign/GB_bitmap_assign_8.c new file mode 100644 index 0000000000..00ff601e3c --- /dev/null +++ b/Source/assign/GB_bitmap_assign_8.c @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_8: C bitmap, !M sparse/hyper, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C(I,J) = A assign +// C(I,J) = A subassign + +// C(I,J) = A assign +// C(I,J) = A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, hypersparse or sparse (not bitmap or full) +// Mask_comp: true +// Mask_struct: true or false +// C_replace: true or false +// accum: not present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign, row assign, col assign, or subassign + +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_8 // C bitmap, !M sparse/hyper, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + const GrB_Index *I, // I index list + const int64_t ni, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + const GrB_Index *J, // J index list + const int64_t nj, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + const GrB_Matrix M, // mask matrix + #define Mask_comp true /* true here, for !M only */ + const bool Mask_struct, // true if M is structural, false if valued + #define accum NULL /* not present */ + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + const int assign_kind, // row assign, col assign, assign, or subassign + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit8", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, !M, noaccum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, !M, noaccum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, !M, noaccum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_8, "bitmap_assign_8", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_8_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_8_whole.c b/Source/assign/GB_bitmap_assign_8_whole.c new file mode 100644 index 0000000000..77ab5d0653 --- /dev/null +++ b/Source/assign/GB_bitmap_assign_8_whole.c @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_8_whole: C bitmap, !M sparse/hyper, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ +// C = A assign +// C = A subassign + +// C = A assign +// C = A subassign +//------------------------------------------------------------------------------ + +// C: bitmap +// M: present, hypersparse or sparse (not bitmap or full) +// Mask_comp: true +// Mask_struct: true or false +// C_replace: true or false +// accum: not present +// A: matrix (hyper, sparse, bitmap, or full), or scalar +// kind: assign or subassign (same action) + +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. + +#include "assign/GB_bitmap_assign_methods.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GB_bitmap_assign_8_whole // C bitmap, !M sparse/hyper, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const bool C_replace, // descriptor for C + #define I NULL /* I index list */ + #define ni 0 + #define nI 0 + #define Ikind GB_ALL + #define Icolon NULL + #define J NULL /* J index list */ + #define nj 0 + #define nJ 0 + #define Jkind GB_ALL + #define Jcolon NULL + const GrB_Matrix M, // mask matrix + #define Mask_comp true /* true here, for !M only */ + const bool Mask_struct, // true if M is structural, false if valued + #define accum NULL /* not present */ + const GrB_Matrix A, // input matrix, not transposed + const void *scalar, // input scalar + const GrB_Type scalar_type, // type of input scalar + #define assign_kind GB_ASSIGN + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_assign_burble ("bit8_whole", C_replace, Ikind, Jkind, + M, Mask_comp, Mask_struct, accum, A, assign_kind) ; + + ASSERT (GB_IS_BITMAP (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT_MATRIX_OK (C, "C for bitmap assign, !M, noaccum", GB0) ; + ASSERT_MATRIX_OK (M, "M for bitmap assign, !M, noaccum", GB0) ; + ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, !M, noaccum", GB0) ; + + //-------------------------------------------------------------------------- + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + GrB_Info info = GB_subassign_jit (C, C_replace, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, + /* S: */ NULL, assign_kind, + GB_JIT_KERNEL_BITMAP_ASSIGN_8_WHOLE, "bitmap_assign_8_whole", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + GBURBLE ("(generic assign) ") ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + #define GB_GENERIC + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_bitmap_assign_8_whole_template.c" +} + diff --git a/Source/assign/GB_bitmap_assign_methods.h b/Source/assign/GB_bitmap_assign_methods.h index bfe7ee8560..2a60e8cb28 100644 --- a/Source/assign/GB_bitmap_assign_methods.h +++ b/Source/assign/GB_bitmap_assign_methods.h @@ -2,7 +2,7 @@ // GB_bitmap_assign_methods.h: definitions for GB_bitmap_assign* methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,7 +14,6 @@ #include "assign/GB_bitmap_assign.h" #include "slice/GB_ek_slice.h" #include "ij/GB_ij.h" -#include "assign/GB_subassign_IxJ_slice.h" #include "include/GB_unused.h" #include "assign/include/GB_bitmap_scatter.h" @@ -22,21 +21,23 @@ // prototypes //------------------------------------------------------------------------------ -GrB_Info GB_bitmap_assign_fullM_accum +GrB_Info GB_bitmap_assign_1 // C bitmap, M or !M bitmap/full, with accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix, which is not NULL here + const GrB_Matrix M, // mask matrix, which is present here const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present here @@ -47,7 +48,7 @@ GrB_Info GB_bitmap_assign_fullM_accum GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_fullM_accum_whole +GrB_Info GB_bitmap_assign_1_whole // C bitmap, M or !M bitmap/full, with accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format @@ -60,20 +61,23 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar +// const int assign_kind, // assign GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_fullM_noaccum +GrB_Info GB_bitmap_assign_2 // C bitmap, M or !M bitmap/full, no accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format - const bool C_replace, // descriptor for C // inputs: + const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -88,12 +92,12 @@ GrB_Info GB_bitmap_assign_fullM_noaccum GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_fullM_noaccum_whole +GrB_Info GB_bitmap_assign_2_whole // C bitmap, M or !M bitmap/full, no accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format - const bool C_replace, // descriptor for C // inputs: + const bool C_replace, // descriptor for C const GrB_Matrix M, // mask matrix, which is present here const bool Mask_comp, // true for !M, false for M const bool Mask_struct, // true if M is structural, false if valued @@ -101,24 +105,27 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar +// const int assign_kind, // assign GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_M_accum +GrB_Info GB_bitmap_assign_3 // C bitmap, M sparse/hyper, with accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix, which is not NULL here + const GrB_Matrix M, // mask matrix, which is present here // const bool Mask_comp, // false here const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present here @@ -129,37 +136,40 @@ GrB_Info GB_bitmap_assign_M_accum GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_M_accum_whole +GrB_Info GB_bitmap_assign_3_whole // C bitmap, M sparse/hyper, with accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Matrix M, // mask matrix, which is not NULL here + const GrB_Matrix M, // mask matrix, which is present here // const bool Mask_comp, // false here const bool Mask_struct, // true if M is structural, false if valued const GrB_BinaryOp accum, // present here const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar +// const int assign_kind, // assign GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_M_noaccum +GrB_Info GB_bitmap_assign_4 // C bitmap, M sparse/hyper, no accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix, which is not NULL here + const GrB_Matrix M, // mask matrix, which is present here // const bool Mask_comp, // false here const bool Mask_struct, // true if M is structural, false if valued // const GrB_BinaryOp accum, // not present @@ -170,33 +180,36 @@ GrB_Info GB_bitmap_assign_M_noaccum GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_M_noaccum_whole +GrB_Info GB_bitmap_assign_4_whole // C bitmap, M sparse/hyper, no accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C - const GrB_Matrix M, // mask matrix, which is not NULL here + const GrB_Matrix M, // mask matrix, which is present here // const bool Mask_comp, // false here const bool Mask_struct, // true if M is structural, false if valued // const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar +// const int assign_kind, // assign GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_noM_accum +GrB_Info GB_bitmap_assign_5 // C bitmap, no M, with accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -211,7 +224,7 @@ GrB_Info GB_bitmap_assign_noM_accum GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_noM_accum_whole +GrB_Info GB_bitmap_assign_5_whole // C bitmap, no M, with accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format @@ -224,20 +237,23 @@ GrB_Info GB_bitmap_assign_noM_accum_whole const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar +// const int assign_kind, // assign GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_noM_noaccum +GrB_Info GB_bitmap_assign_6 // C bitmap, no M, no accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -252,33 +268,39 @@ GrB_Info GB_bitmap_assign_noM_noaccum GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_noM_noaccum_whole +GrB_Info GB_bitmap_assign_6_whole // C bitmap, no M, no accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: - const bool C_replace, // descriptor for C -// const GrB_Matrix M, // mask matrix, not present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_notM_accum +GrB_Info GB_bitmap_assign_6b_whole // C bitmap, no M, no accum +( + // input/output: + GrB_Matrix C, // input/output matrix in bitmap format + // inputs: + const GrB_Matrix A, // input matrix, not transposed + GB_Werk Werk +) ; + +GrB_Info GB_bitmap_assign_7 // C bitmap, !M sparse/hyper, with accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -293,7 +315,7 @@ GrB_Info GB_bitmap_assign_notM_accum GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_notM_accum_whole +GrB_Info GB_bitmap_assign_7_whole // C bitmap, !M sparse/hyper, with accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format @@ -306,20 +328,23 @@ GrB_Info GB_bitmap_assign_notM_accum_whole const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar +// const int assign_kind, // assign GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_notM_noaccum +GrB_Info GB_bitmap_assign_8 // C bitmap, !M sparse/hyper, no accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format // inputs: const bool C_replace, // descriptor for C const GrB_Index *I, // I index list + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, // J index list + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -334,7 +359,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum GB_Werk Werk ) ; -GrB_Info GB_bitmap_assign_notM_noaccum_whole +GrB_Info GB_bitmap_assign_8_whole // C bitmap, !M sparse/hyper, no accum ( // input/output: GrB_Matrix C, // input/output matrix in bitmap format @@ -347,14 +372,9 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole const GrB_Matrix A, // input matrix, not transposed const void *scalar, // input scalar const GrB_Type scalar_type, // type of input scalar +// const int assign_kind, // assign GB_Werk Werk ) ; -void GB_bitmap_assign_to_full // set all C->b to 1, or free it and make C full -( - GrB_Matrix C, - int nthreads_max -) ; - #endif diff --git a/Source/assign/GB_bitmap_assign_noM_noaccum_whole.c b/Source/assign/GB_bitmap_assign_noM_noaccum_whole.c deleted file mode 100644 index 51875e256f..0000000000 --- a/Source/assign/GB_bitmap_assign_noM_noaccum_whole.c +++ /dev/null @@ -1,176 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_bitmap_assign_noM_noaccum_whole: assign to C bitmap -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ -// C<> = A assign -// C<> = A subassign - -// C = A assign -// C = A subassign - -// C = A assign -// C = A subassign - -// C = A assign -// C = A subassign -//------------------------------------------------------------------------------ - -// C: bitmap -// M: none -// Mask_comp: true or false -// Mask_struct: true or false (ignored) -// C_replace: true or false -// accum: not present -// A: matrix (hyper, sparse, bitmap, or full), or scalar -// kind: assign or subassign (same action) - -// If M is not present and Mask_comp is true, then an empty mask is -// complemented. This case is handled by GB_assign_prep: if C_replace is -// true, the matrix is cleared by GB_clear, or no action is taken otherwise. -// In either case, this method is not called. However, the "if (!Mask_comp)" -// test is left in below, for clarity. Mask_comp will always be false here. - -// For scalar assignment, C = x, this method just calls GB_convert_any_to_full, -// which converts C to an iso full matrix (the iso value has already been set -// by GB_assign_prep). - -// For matrix assignment, C = A, if A is sparse or hyper and C may become -// sparse or hyper, then the assignement is done by GB_subassign_24. - -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" -#include "assign/GB_subassign_dense.h" - -#undef GB_FREE_ALL -#define GB_FREE_ALL ; - -GrB_Info GB_bitmap_assign_noM_noaccum_whole -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C -// const GrB_Matrix M, // mask matrix, not present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Info info ; - GBURBLE_BITMAP_ASSIGN ("bit6:whole", NULL, Mask_comp, NULL, - GB_ALL, GB_ALL, GB_ASSIGN) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign: noM, noaccum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign: noM, noaccum", GB0) ; - - //-------------------------------------------------------------------------- - // do the assignment - //-------------------------------------------------------------------------- - - if (!Mask_comp) - { - - //---------------------------------------------------------------------- - // C = A or C = scalar - //---------------------------------------------------------------------- - - if (A == NULL) - { - - //------------------------------------------------------------------ - // scalar assignment: C = scalar - //------------------------------------------------------------------ - - ASSERT (C->iso) ; - GB_convert_any_to_full (C) ; - - } - else - { - - //------------------------------------------------------------------ - // matrix assignment: C = A - //------------------------------------------------------------------ - - GB_GET_C_BITMAP ; // C must be bitmap - GB_GET_A_AND_SCALAR - - if (GB_IS_BITMAP (A) || GB_IS_FULL (A)) - { - - //-------------------------------------------------------------- - // C = A where C is bitmap and A is bitmap or full - //-------------------------------------------------------------- - - // copy or typecast the values - GB_OK (GB_cast_matrix (C, A)) ; - - if (GB_IS_BITMAP (A)) - { - // copy the bitmap - GB_memcpy (Cb, Ab, cnzmax, nthreads_max) ; - C->nvals = GB_nnz (A) ; - } - else - { - // free the bitmap or set it to all ones - GB_bitmap_assign_to_full (C, nthreads_max) ; - } - - } - else - { - - //-------------------------------------------------------------- - // C = A where C is bitmap and A is sparse or hyper - //-------------------------------------------------------------- - - int sparsity_control = - GB_sparsity_control (C->sparsity_control, C->vdim) ; - if ((GB_IS_SPARSE (A) && (sparsity_control & GxB_SPARSE)) || - (GB_IS_HYPERSPARSE (A) && - (sparsity_control & GxB_HYPERSPARSE))) - { - // C becomes sparse or hypersparse, the same as A - GB_OK (GB_subassign_24 (C, A, Werk)) ; - } - else - { - // C remains bitmap: scatter A into the C bitmap - GB_memset (Cb, 0, cnzmax, nthreads_max) ; - cnvals = 0 ; - #define GB_AIJ_WORK(pC,pA) \ - { \ - /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ - Cb [pC] = 1 ; \ - } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" - C->nvals = GB_nnz (A) ; - } - } - } - } - - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- - - ASSERT_MATRIX_OK (C, "final C bitmap assign: noM, noaccum, whole", GB0) ; - return (GrB_SUCCESS) ; -} - diff --git a/Source/assign/GB_bitmap_assign_to_full.c b/Source/assign/GB_bitmap_assign_to_full.c index a05e24fe2b..2f5d32abc2 100644 --- a/Source/assign/GB_bitmap_assign_to_full.c +++ b/Source/assign/GB_bitmap_assign_to_full.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_to_full: make a full bitmap +// GB_bitmap_assign_to_full: all entries present in C; set bitmap to all 1's //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -12,11 +12,7 @@ #include "assign/GB_bitmap_assign_methods.h" -void GB_bitmap_assign_to_full // set all C->b to 1, or free it and make C full -( - GrB_Matrix C, - int nthreads_max -) +GB_CALLBACK_BITMAP_ASSIGN_TO_FULL_PROTO (GB_bitmap_assign_to_full) { //-------------------------------------------------------------------------- diff --git a/Source/assign/GB_subassign.c b/Source/assign/GB_subassign.c index 4f44ee96a7..a1218a759f 100644 --- a/Source/assign/GB_subassign.c +++ b/Source/assign/GB_subassign.c @@ -2,7 +2,7 @@ // GB_subassign: C(Rows,Cols) = accum (C(Rows,Cols),A) or A' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GB_subassign.h b/Source/assign/GB_subassign.h index e2904c82a6..35a2e67c96 100644 --- a/Source/assign/GB_subassign.h +++ b/Source/assign/GB_subassign.h @@ -2,7 +2,7 @@ // GB_subassign.h: definitions for GB_subassign //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ #ifndef GB_SUBASSIGN_H #define GB_SUBASSIGN_H #include "ij/GB_ij.h" -#include "ewise/GB_add.h" +#include "add/GB_add.h" GrB_Info GB_subassign // C(Rows,Cols) += A or A' ( @@ -48,28 +48,6 @@ GrB_Info GB_subassign_scalar // C(Rows,Cols) += x GB_Werk Werk ) ; -#if 0 -int GB_subassigner_method // return method to use in GB_subassigner -( - // outputs - bool *C_iso_out, // true if C is iso on output - GB_void *cout, // iso value of C on output - // inputs - const GrB_Matrix C, // input/output matrix for results - const bool C_replace, // C matrix descriptor - const GrB_Matrix M, // optional mask for C(I,J), unused if NULL - const bool Mask_comp, // mask descriptor - const bool Mask_struct, // if true, use the only structure of M - const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),A) - const GrB_Matrix A, // input matrix (NULL for scalar expansion) - const int Ikind, - const int Jkind, - const bool scalar_expansion, // if true, expand scalar to A - const void *scalar, - const GrB_Type scalar_type // type of the scalar -) ; -#endif - int GB_subassigner_method // return method to use in GB_subassigner ( // outputs @@ -178,7 +156,7 @@ GrB_Info GB_assign_prep const GrB_Index nCols_in, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded - const GB_Type_code scode, // type code of scalar to expand + const GB_Type_code scalar_code, // type code of scalar to expand GB_Werk Werk ) ; diff --git a/Source/assign/GB_subassign_01.c b/Source/assign/GB_subassign_01.c index 307b0d0649..ceb8227edc 100644 --- a/Source/assign/GB_subassign_01.c +++ b/Source/assign/GB_subassign_01.c @@ -2,13 +2,11 @@ // GB_subassign_01: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 01: C(I,J) = scalar ; using S // M: NULL @@ -21,12 +19,14 @@ // C: not bitmap #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_01 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -37,187 +37,65 @@ GrB_Info GB_subassign_01 const int64_t nJ, const int Jkind, const int64_t Jcolon [3], + #define M NULL + #define Mask_comp false + #define Mask_struct true + #define accum NULL + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) -{ +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_GET_C ; // C must not be bitmap - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; - GB_GET_SCALAR ; - GB_GET_S ; - GrB_BinaryOp accum = NULL ; - - //-------------------------------------------------------------------------- - // Method 01: C(I,J) = scalar ; using S - //-------------------------------------------------------------------------- - - // Time: Optimal; must visit all IxJ, so Omega(|I|*|J|) is required. - - // Entries in S are found and the corresponding entry in C replaced with - // the scalar. The traversal of S is identical to the traversal of M in - // Method 4. - - // Method 01 and Method 03 are very similar. - - //-------------------------------------------------------------------------- - // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) - //-------------------------------------------------------------------------- - - GB_SUBASSIGN_IXJ_SLICE ; - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) = scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - bool found = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - if (!found) - { - // ----[. A 1]---------------------------------------------- - // S (i,j) is not present, the scalar is present - // [. A 1]: action: ( insert ) - task_pending++ ; - } - else - { - // ----[C A 1] or [X A 1]----------------------------------- - // both S (i,j) and A (i,j) present - // [C A 1]: action: ( =A ): scalar to C, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_noaccum_C_A_1_scalar ; - GB_NEXT (S) ; - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) = scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - bool found = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - if (!found) - { - // ----[. A 1]---------------------------------------------- - // S (i,j) is not present, the scalar is present - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_NEXT (S) ; - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + /* M: */ NULL, + /* Mask_comp: */ false, + /* Mask_struct: */ true, + /* accum: */ NULL, + /* A: */ NULL, + scalar, scalar_type, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_01, "subassign_01", + Werk) ; + if (info != GrB_NO_VALUE) + { + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_01_template.c" } diff --git a/Source/assign/GB_subassign_02.c b/Source/assign/GB_subassign_02.c index b1d573a059..bc8cbd87ae 100644 --- a/Source/assign/GB_subassign_02.c +++ b/Source/assign/GB_subassign_02.c @@ -2,13 +2,11 @@ // GB_subassign_02: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 02: C(I,J) = A ; using S // M: NULL @@ -22,12 +20,14 @@ // A: any sparsity structure. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_02 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -38,7 +38,14 @@ GrB_Info GB_subassign_02 const int64_t nJ, const int Jkind, const int64_t Jcolon [3], + #define M NULL + #define Mask_comp false + #define Mask_struct true + #define accum NULL const GrB_Matrix A, + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -47,389 +54,51 @@ GrB_Info GB_subassign_02 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (A) ; - - GB_GET_C ; // C must not be bitmap - GB_GET_A ; - GB_GET_S ; - GrB_BinaryOp accum = NULL ; - - //-------------------------------------------------------------------------- - // Method 02: C(I,J) = A ; using S - //-------------------------------------------------------------------------- - - // Time: Optimal. All entries in A+S must be examined, so the work is - // Omega (nnz(A)+nnz(S)). - - // Method 02 and Method 04 are somewhat similar. They differ on how C is - // modified when the entry is present in S but not A. - - // TODO: phase2 of Method 02 and 04 are identical and could be - // done in a single function. - - //-------------------------------------------------------------------------- - // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - if (A_is_bitmap) + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + /* M: */ NULL, + /* Mask_comp: */ false, + /* Mask_struct: */ true, + /* accum: */ NULL, + A, + /* scalar, scalar_type: */ NULL, NULL, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_02, "subassign_02", + Werk) ; + if (info != GrB_NO_VALUE) { - // all of IxJ must be examined - GB_SUBASSIGN_IXJ_SLICE ; - } - else - { - // traverse all A+S - GB_SUBASSIGN_TWO_SLICE (A, S) ; - } - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase1: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - if (Sfound && !Afound) - { - // ----[C . 1] or [X . 1]------------------------------- - // S (i,j) is present but A (i,j) is not - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still a zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - else if (!Sfound && Afound) - { - // ----[. A 1]------------------------------------------ - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - task_pending++ ; - } - else if (Sfound && Afound) - { - // ----[C A 1] or [X A 1]------------------------------- - // both S (i,j) and A (i,j) present - // [C A 1]: action: ( =A ): copy A into C, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_noaccum_C_A_1_matrix ; - GB_NEXT (S) ; - } - } - } - GB_PHASE1_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase1: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // ----[C . 1] or [X . 1]------------------------------- - // S (i,j) is present but A (i,j) is not - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still a zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - else if (iA < iS) - { - // ----[. A 1]------------------------------------------ - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - task_pending++ ; - GB_NEXT (A) ; - } - else - { - // ----[C A 1] or [X A 1]------------------------------- - // both S (i,j) and A (i,j) present - // [C A 1]: action: ( =A ): copy A into C, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_noaccum_C_A_1_matrix ; - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // while list S (:,j) has entries. List A (:,j) exhausted. - while (pS < pS_end) - { - // ----[C . 1] or [X . 1]----------------------------------- - // S (i,j) is present but A (i,j) is not - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still a zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - - // List A (:,j) has entries. List S (:,j) exhausted. - task_pending += (pA_end - pA) ; - } - - GB_PHASE1_TASK_WRAPUP ; - } - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase2: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - if (!Sfound && Afound) - { - // ----[. A 1]------------------------------------------ - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - GB_NEXT (A) ; - } - else if (Sfound) - { - // S (i,j) present - GB_NEXT (S) ; - } - } - } - GB_PHASE2_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase2: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - GB_NEXT (S) ; - } - else if (iA < iS) - { - // ----[. A 1]------------------------------------------ - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - GB_NEXT (A) ; - } - else - { - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // ignore the remainder of S (:,j) - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // ----[. A 1]---------------------------------------------- - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - int64_t iA = GBI (Ai, pA, Avlen) ; - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - GB_NEXT (A) ; - } - } - GB_PHASE2_TASK_WRAPUP ; - } + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 0 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_02_template.c" } diff --git a/Source/assign/GB_subassign_03.c b/Source/assign/GB_subassign_03.c index e944dd2dbe..79cfbd850f 100644 --- a/Source/assign/GB_subassign_03.c +++ b/Source/assign/GB_subassign_03.c @@ -2,13 +2,11 @@ // GB_subassign_03: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 03: C(I,J) += scalar ; using S // M: NULL @@ -18,15 +16,17 @@ // A: scalar // S: constructed -// C is not bitmap: use GB_bitmap_assign instead +// C: not bitmap #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_03 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -37,9 +37,14 @@ GrB_Info GB_subassign_03 const int64_t nJ, const int Jkind, const int64_t Jcolon [3], + #define M NULL + #define Mask_comp false + #define Mask_struct true const GrB_BinaryOp accum, + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -48,175 +53,49 @@ GrB_Info GB_subassign_03 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_GET_C ; // C must not be bitmap - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; - GB_GET_S ; - GB_GET_ACCUM_SCALAR ; - - //-------------------------------------------------------------------------- - // Method 03: C(I,J) += scalar ; using S - //-------------------------------------------------------------------------- - - // Time: Optimal; must visit all IxJ, so Omega(|I|*|J|) is required. - - // Entries in S are found and the corresponding entry in C replaced with - // the scalar. - - // Method 01 and Method 03 are very similar. - - //-------------------------------------------------------------------------- - // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) - //-------------------------------------------------------------------------- - - GB_SUBASSIGN_IXJ_SLICE ; - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) += scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - bool found = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - if (!found) - { - // ----[. A 1]---------------------------------------------- - // S (i,j) is not present, the scalar is present - // [. A 1]: action: ( insert ) - task_pending++ ; - } - else - { - // ----[C A 1] or [X A 1]----------------------------------- - // both S (i,j) and A (i,j) present - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_withaccum_C_A_1_scalar ; - GB_NEXT (S) ; - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) += scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - bool found = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - if (!found) - { - // ----[. A 1]---------------------------------------------- - // S (i,j) is not present, the scalar is present - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_NEXT (S) ; - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + /* M: */ NULL, + /* Mask_comp: */ false, + /* Mask_struct: */ true, + accum, + /* A: */ NULL, + scalar, scalar_type, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_03, "subassign_03", + Werk) ; + if (info != GrB_NO_VALUE) + { + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_03_template.c" } diff --git a/Source/assign/GB_subassign_04.c b/Source/assign/GB_subassign_04.c index a7b455c852..350c5a7dc9 100644 --- a/Source/assign/GB_subassign_04.c +++ b/Source/assign/GB_subassign_04.c @@ -2,13 +2,11 @@ // GB_subassign_04: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 04: C(I,J) += A ; using S // M: NULL @@ -22,12 +20,14 @@ // A: any sparsity structure. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_04 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -38,8 +38,14 @@ GrB_Info GB_subassign_04 const int64_t nJ, const int Jkind, const int64_t Jcolon [3], + #define M NULL + #define Mask_comp false + #define Mask_struct true const GrB_BinaryOp accum, const GrB_Matrix A, + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -48,381 +54,51 @@ GrB_Info GB_subassign_04 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (A) ; - - GB_GET_C ; // C must not be bitmap - GB_GET_S ; - GB_GET_ACCUM_MATRIX ; - - //-------------------------------------------------------------------------- - // Method 04: C(I,J) += A ; using S - //-------------------------------------------------------------------------- - - // Time: Close to Optimal. Every entry in A must be visited, and the - // corresponding entry in S must then be found. Time for this phase is - // Omega(nnz(A)), but S has already been constructed, in Omega(nnz(S)) - // time. This method simply traverses all of A+S (like GB_add for - // computing A+S), the same as Method 02. Time taken is O(nnz(A)+nnz(S)). - // The only difference is that the traversal of A+S can terminate if A is - // exhausted. Entries in S but not A do not actually require any work - // (unlike Method 02, which must visit all entries in A+S). - - // Method 02 and Method 04 are somewhat similar. They differ on how C is - // modified when the entry is present in S but not A. - - // TODO: phase2 of Method 02 and 04 are identical and could be - // done in a single function. - - // Compare with Method 16, which computes C(I,J) += A, using S. - - //-------------------------------------------------------------------------- - // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) - //-------------------------------------------------------------------------- - - if (A_is_bitmap) - { - // all of IxJ must be examined - GB_SUBASSIGN_IXJ_SLICE ; - } - else - { - // traverse all A+S - GB_SUBASSIGN_TWO_SLICE (A, S) ; - } - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase1: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - if (Sfound && !Afound) - { - // ----[C . 1] or [X . 1]------------------------------- - // S (i,j) is present but A (i,j) is not - // [C . 1]: action: ( C ): no change, with accum - // [X . 1]: action: ( X ): still a zombie - GB_NEXT (S) ; - } - else if (!Sfound && Afound) - { - // ----[. A 1]------------------------------------------ - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - task_pending++ ; - } - else if (Sfound && Afound) - { - // ----[C A 1] or [X A 1]------------------------------- - // both S (i,j) and A (i,j) present - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_withaccum_C_A_1_matrix ; - GB_NEXT (S) ; - } - } - } - GB_PHASE1_TASK_WRAPUP ; - } - } - else - { - - //---------------------------------------------------------------------- - // phase1: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // ----[C . 1] or [X . 1]------------------------------- - // S (i,j) is present but A (i,j) is not - // [C . 1]: action: ( C ): no change, with accum - // [X . 1]: action: ( X ): still a zombie - GB_NEXT (S) ; - } - else if (iA < iS) - { - // ----[. A 1]------------------------------------------ - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - task_pending++ ; - GB_NEXT (A) ; - } - else - { - // ----[C A 1] or [X A 1]------------------------------- - // both S (i,j) and A (i,j) present - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_withaccum_C_A_1_matrix ; - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // ignore the remainder of S (:,j) - - // List A (:,j) has entries. List S (:,j) exhausted. - task_pending += (pA_end - pA) ; - } - - GB_PHASE1_TASK_WRAPUP ; - } - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase2: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - if (!Sfound && Afound) - { - // ----[. A 1]------------------------------------------ - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - GB_NEXT (A) ; - } - else if (Sfound) - { - // S (i,j) present - GB_NEXT (S) ; - } - } - } - GB_PHASE2_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase2: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - GB_NEXT (S) ; - } - else if (iA < iS) - { - // ----[. A 1]------------------------------------------ - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - GB_NEXT (A) ; - } - else - { - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // ignore the remainder of S (:,j) - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // ----[. A 1]---------------------------------------------- - // S (i,j) is not present, A (i,j) is present - // [. A 1]: action: ( insert ) - int64_t iA = GBI (Ai, pA, Avlen) ; - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - GB_NEXT (A) ; - } - } - GB_PHASE2_TASK_WRAPUP ; - } + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + /* M: */ NULL, + /* Mask_comp: */ false, + /* Mask_struct: */ true, + accum, + A, + /* scalar, scalar_type: */ NULL, NULL, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_04, "subassign_04", + Werk) ; + if (info != GrB_NO_VALUE) + { + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 0 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_04_template.c" } diff --git a/Source/assign/GB_subassign_05.c b/Source/assign/GB_subassign_05.c index 88db737782..69afa1689f 100644 --- a/Source/assign/GB_subassign_05.c +++ b/Source/assign/GB_subassign_05.c @@ -2,13 +2,11 @@ // GB_subassign_05: C(I,J) = scalar ; no S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 05: C(I,J) = scalar ; no S // M: present @@ -22,24 +20,32 @@ // M: any sparsity #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL ; GrB_Info GB_subassign_05 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp false const bool Mask_struct, + #define accum NULL + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -48,247 +54,43 @@ GrB_Info GB_subassign_05 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; // not constructed ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M + GB_UNJUMBLE (C) ; + GB_UNJUMBLE (M) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_EMPTY_TASKLIST ; - GB_MATRIX_WAIT_IF_JUMBLED (C) ; - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - - GB_GET_C ; // C must not be bitmap - int64_t zorig = C->nzombies ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; - GB_GET_C_HYPER_HASH ; - GB_GET_MASK ; - GB_GET_SCALAR ; - GrB_BinaryOp accum = NULL ; - - //-------------------------------------------------------------------------- - // Method 05: C(I,J) = scalar ; no S - //-------------------------------------------------------------------------- - - // Time: Close to Optimal: the method must iterate over all entries in M, - // so the time is Omega(nnz(M)). For each entry M(i,j)=1, the - // corresponding entry in C must be found and updated (inserted or - // modified). This method does this with a binary search of C(:,jC) or a - // direct lookup if C(:,jC) is dense. The time is thus O(nnz(M)*log(n)) in - // the worst case, usually less than that since C(:,jC) often has O(1) - // entries. An additional time of O(|J|*log(Cnvec)) is added if C is - // hypersparse. There is no equivalent method that computes - // C(I,J)=scalar using the matrix S. - - // Method 05 and Method 07 are very similar. Also compare with Method 06n. - - //-------------------------------------------------------------------------- - // Parallel: slice M into coarse/fine tasks (Method 05, 06n, 07) - //-------------------------------------------------------------------------- - - GB_SUBASSIGN_ONE_SLICE (M) ; // M cannot be jumbled - - //-------------------------------------------------------------------------- - // phase 1: undelete zombies, update entries, and count pending tuples + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //------------------------------------------------------------------ - // get j, the kth vector of M - //------------------------------------------------------------------ - - int64_t j = GBH (Mh, k) ; - GB_GET_VECTOR (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; - int64_t mjnz = pM_end - pM ; - if (mjnz == 0) continue ; - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_jC (fine_task, taskid) ; - int64_t cjnz = pC_end - pC_start ; - bool cjdense = (cjnz == Cvlen) ; - - //------------------------------------------------------------------ - // C(I,jC) = scalar ; no S - //------------------------------------------------------------------ - - if (cjdense) - { - - //-------------------------------------------------------------- - // C(:,jC) is dense so the binary search of C is not needed - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - bool mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (mij) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - GB_iC_DENSE_LOOKUP ; - - // ----[C A 1] or [X A 1]------------------------------- - // [C A 1]: action: ( =A ): copy A into C, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_scalar ; - } - } - - } - else - { - - //-------------------------------------------------------------- - // C(:,jC) is sparse; use binary search for C - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - bool mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (mij) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - - // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; - if (cij_found) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): copy A into C, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_scalar ; - } - else - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - zorig = C->nzombies ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //------------------------------------------------------------------ - // get j, the kth vector of M - //------------------------------------------------------------------ - - int64_t j = GBH (Mh, k) ; - GB_GET_VECTOR (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; - int64_t mjnz = pM_end - pM ; - if (mjnz == 0) continue ; - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_jC (fine_task, taskid) ; - bool cjdense = ((pC_end - pC_start) == Cvlen) ; - - //------------------------------------------------------------------ - // C(I,jC) = scalar ; no S - //------------------------------------------------------------------ - - if (!cjdense) - { - - //-------------------------------------------------------------- - // C(:,jC) is sparse; use binary search for C - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - bool mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (mij) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - - // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; - if (!cij_found) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - GB_PENDING_INSERT (scalar) ; - } - } - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ false, + Mask_struct, + /* accum: */ NULL, + /* A: */ NULL, + scalar, scalar_type, + /* S: */ NULL, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_05, "subassign_05", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_05_template.c" } diff --git a/Source/assign/GB_subassign_05d.c b/Source/assign/GB_subassign_05d.c index baede03fe1..85c5e8ba41 100644 --- a/Source/assign/GB_subassign_05d.c +++ b/Source/assign/GB_subassign_05d.c @@ -2,16 +2,15 @@ // GB_subassign_05d: C(:,:) = scalar where C is full //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: done. - // Method 05d: C(:,:) = scalar ; no S, C is dense -// M: present +// C: full +// M: present, any sparsity structure // Mask_comp: false // Mask_struct: true or false // C_replace: false @@ -19,17 +18,17 @@ // A: scalar // S: none -// C can have any sparsity structure, but it must be entirely dense with -// all entries present. - #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "assign/GB_subassign_dense.h" #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_as__include.h" #endif +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 1 +#include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL #define GB_FREE_ALL ; @@ -50,13 +49,9 @@ GrB_Info GB_subassign_05d // check inputs //-------------------------------------------------------------------------- - ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M - - //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - GrB_Info info ; + GrB_Matrix S = NULL ; // not constructed + ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M ASSERT_MATRIX_OK (C, "C for subassign method_05d", GB0) ; ASSERT (!GB_ZOMBIES (C)) ; @@ -69,6 +64,13 @@ GrB_Info GB_subassign_05d ASSERT (GB_JUMBLED_OK (M)) ; ASSERT (!GB_PENDING (M)) ; + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + // quick return if work has already been done by GB_assign_prep if (C->iso) return (GrB_SUCCESS) ; @@ -76,9 +78,6 @@ GrB_Info GB_subassign_05d const size_t csize = C->type->size ; GB_GET_SCALAR ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - //-------------------------------------------------------------------------- // Method 05d: C(:,:) = scalar ; no S; C is dense //-------------------------------------------------------------------------- @@ -117,23 +116,7 @@ GrB_Info GB_subassign_05d // required. // C = x - switch (ccode) - { - case GB_BOOL_code : GB_WORKER (_bool ) - case GB_INT8_code : GB_WORKER (_int8 ) - case GB_INT16_code : GB_WORKER (_int16 ) - case GB_INT32_code : GB_WORKER (_int32 ) - case GB_INT64_code : GB_WORKER (_int64 ) - case GB_UINT8_code : GB_WORKER (_uint8 ) - case GB_UINT16_code : GB_WORKER (_uint16) - case GB_UINT32_code : GB_WORKER (_uint32) - case GB_UINT64_code : GB_WORKER (_uint64) - case GB_FP32_code : GB_WORKER (_fp32 ) - case GB_FP64_code : GB_WORKER (_fp64 ) - case GB_FC32_code : GB_WORKER (_fc32 ) - case GB_FC64_code : GB_WORKER (_fc64 ) - default: ; - } + #include "assign/factory/GB_assign_factory.c" } #endif @@ -153,6 +136,7 @@ GrB_Info GB_subassign_05d /* accum: */ NULL, /* A: */ NULL, /* scalar, scalar_type: */ cwork, C->type, + /* S: */ NULL, GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_05d, "subassign_05d", Werk) ; } @@ -167,8 +151,8 @@ GrB_Info GB_subassign_05d GB_BURBLE_MATRIX (M, "(generic C(:,:)=x assign) ") ; // Cx [pC] = cwork - #undef GB_COPY_scalar_to_C - #define GB_COPY_scalar_to_C(Cx,pC,cwork) \ + #undef GB_COPY_cwork_to_C + #define GB_COPY_cwork_to_C(Cx, pC, cwork, C_iso) \ memcpy (Cx + ((pC)*csize), cwork, csize) #include "assign/template/GB_subassign_05d_template.c" diff --git a/Source/assign/GB_subassign_05e.c b/Source/assign/GB_subassign_05e.c index ed7b55b461..aa7e7733df 100644 --- a/Source/assign/GB_subassign_05e.c +++ b/Source/assign/GB_subassign_05e.c @@ -2,13 +2,11 @@ // GB_subassign_05e: C(:,:) = scalar ; no S, C empty, M structural //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed. - // Method 05e: C(:,:) = scalar ; no S // M: present @@ -27,6 +25,8 @@ // C is always iso, and its iso value has been assigned by GB_assign_prep. #include "assign/GB_subassign_methods.h" +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 1 #include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL @@ -47,14 +47,11 @@ GrB_Info GB_subassign_05e // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; // not constructed ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M ASSERT (C->iso) ; - //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GrB_Info info ; ASSERT_MATRIX_OK (C, "C for subassign method_05e", GB0) ; ASSERT_MATRIX_OK (M, "M for subassign method_05e", GB0) ; ASSERT (GB_nnz (C) == 0) ; @@ -84,7 +81,8 @@ GrB_Info GB_subassign_05e // set C->iso = true OK GB_OK (GB_dup_worker (&C, true, M, false, C->type)) ; C->is_csc = C_is_csc ; - GB_cast_scalar (C->x, C->type->code, scalar, scalar_type->code, scalar_type->size) ; + GB_cast_scalar (C->x, C->type->code, scalar, scalar_type->code, + scalar_type->size) ; C->jumbled = M->jumbled ; // C is jumbled if M is jumbled ASSERT_MATRIX_OK (C, "C output for subassign method_05e", GB0) ; diff --git a/Source/assign/GB_subassign_06d.c b/Source/assign/GB_subassign_06d.c index 7bf55a7305..ca42f85270 100644 --- a/Source/assign/GB_subassign_06d.c +++ b/Source/assign/GB_subassign_06d.c @@ -2,13 +2,11 @@ // GB_subassign_06d: C(:,:) = A; C is full/bitmap, M and A are aliased //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: done. - // Method 06d: C(:,:) = A ; no S, C is dense, M and A are aliased // M: present, and aliased to A @@ -29,12 +27,15 @@ // C and A can have any sparsity structure. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "assign/GB_subassign_dense.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_as__include.h" #endif +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 0 +#include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL #define GB_FREE_ALL ; @@ -50,28 +51,31 @@ GrB_Info GB_subassign_06d { //-------------------------------------------------------------------------- - // get inputs + // check inputs //-------------------------------------------------------------------------- GrB_Info info ; - + GrB_Matrix S = NULL ; // not constructed ASSERT_MATRIX_OK (C, "C for subassign method_06d", GB0) ; ASSERT (!GB_ZOMBIES (C)) ; ASSERT (!GB_JUMBLED (C)) ; ASSERT (!GB_PENDING (C)) ; ASSERT (GB_IS_BITMAP (C) || GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A - ASSERT_MATRIX_OK (A, "A for subassign method_06d", GB0) ; ASSERT (!GB_ZOMBIES (A)) ; ASSERT (GB_JUMBLED_OK (A)) ; ASSERT (!GB_PENDING (A)) ; - const GB_Type_code ccode = C->type->code ; + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- int nthreads_max = GB_Context_nthreads_max ( ) ; double chunk = GB_Context_chunk ( ) ; + const GB_Type_code ccode = C->type->code ; + //-------------------------------------------------------------------------- // Method 06d: C(:,:) = A ; no S; C is dense, M and A are aliased //-------------------------------------------------------------------------- @@ -97,7 +101,13 @@ GrB_Info GB_subassign_06d ASSERT (Mask_struct) ; #define GB_ISO_ASSIGN + #undef GB_MASK_STRUCT + #define GB_MASK_STRUCT 1 + #undef GB_C_ISO + #define GB_C_ISO 1 #include "assign/template/GB_subassign_06d_template.c" + #undef GB_MASK_STRUCT + #undef GB_C_ISO info = GrB_SUCCESS ; } @@ -130,23 +140,7 @@ GrB_Info GB_subassign_06d if (C->type == A->type && ccode < GB_UDT_code) { // C = A - switch (ccode) - { - case GB_BOOL_code : GB_WORKER (_bool ) - case GB_INT8_code : GB_WORKER (_int8 ) - case GB_INT16_code : GB_WORKER (_int16 ) - case GB_INT32_code : GB_WORKER (_int32 ) - case GB_INT64_code : GB_WORKER (_int64 ) - case GB_UINT8_code : GB_WORKER (_uint8 ) - case GB_UINT16_code : GB_WORKER (_uint16) - case GB_UINT32_code : GB_WORKER (_uint32) - case GB_UINT64_code : GB_WORKER (_uint64) - case GB_FP32_code : GB_WORKER (_fp32 ) - case GB_FP64_code : GB_WORKER (_fp64 ) - case GB_FC32_code : GB_WORKER (_fc32 ) - case GB_FC64_code : GB_WORKER (_fc64 ) - default: ; - } + #include "assign/factory/GB_assign_factory.c" } } #endif @@ -167,6 +161,7 @@ GrB_Info GB_subassign_06d /* accum: */ NULL, /* A: */ A, /* scalar, scalar_type: */ NULL, NULL, + /* S: */ NULL, GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_06d, "subassign_06d", Werk) ; } @@ -185,10 +180,12 @@ GrB_Info GB_subassign_06d const GB_Type_code acode = A->type->code ; GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; - #define C_iso false #undef GB_AX_MASK #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (Ax, pA, asize) - + #undef GB_C_ISO + #define GB_C_ISO 0 + #undef GB_MASK_STRUCT + #define GB_MASK_STRUCT Mask_struct #include "assign/template/GB_subassign_06d_template.c" info = GrB_SUCCESS ; } diff --git a/Source/assign/GB_subassign_06n.c b/Source/assign/GB_subassign_06n.c index ccc75af498..afc271d613 100644 --- a/Source/assign/GB_subassign_06n.c +++ b/Source/assign/GB_subassign_06n.c @@ -2,13 +2,11 @@ // GB_subassign_06n: C(I,J) = A ; no S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 06n: C(I,J) = A ; no S // M: present @@ -30,23 +28,32 @@ // M and A are not bitmap: 06s is used instead, if M or A are bitmap. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL ; GrB_Info GB_subassign_06n ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp false const bool Mask_struct, + #define accum NULL const GrB_Matrix A, + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -55,6 +62,8 @@ GrB_Info GB_subassign_06n // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; // not constructed ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_IS_BITMAP (M)) ; // Method 06n is not used for M bitmap ASSERT (!GB_IS_BITMAP (A)) ; // Method 06n is not used for A bitmap @@ -65,393 +74,40 @@ GrB_Info GB_subassign_06n ASSERT_MATRIX_OK (M, "M input for 06n", GB0) ; ASSERT_MATRIX_OK (A, "A input for 06n", GB0) ; - //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_EMPTY_TASKLIST ; - GB_MATRIX_WAIT_IF_JUMBLED (C) ; - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - GB_MATRIX_WAIT_IF_JUMBLED (A) ; - - GB_GET_C ; // C must not be bitmap - int64_t zorig = C->nzombies ; - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - GB_GET_C_HYPER_HASH ; - GB_GET_MASK ; - GB_GET_A ; - const int64_t *restrict Ah = A->h ; - const int64_t Anvec = A->nvec ; - const bool A_is_hyper = (Ah != NULL) ; - GrB_BinaryOp accum = NULL ; - - GB_OK (GB_hyper_hash_build (A, Werk)) ; - const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; - const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; - const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; - const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; - - //-------------------------------------------------------------------------- - // Method 06n: C(I,J) = A ; no S - //-------------------------------------------------------------------------- - - // Time: O(nnz(M)*(log(a)+log(c)), where a and c are the # of entries in a - // vector of A and C, respectively. The entries in the intersection of M - // (where the entries are true) and the matrix addition C(I,J)+A must be - // examined. This method scans M, and searches for entries in A and C(I,J) - // using two binary searches. If M is very dense, this method can be - // slower than Method 06s. This method is selected if nnz (A) >= nnz (M). - - // Compare with Methods 05 and 07, which use a similar algorithmic outline - // and parallelization strategy. + GB_UNJUMBLE (C) ; + GB_UNJUMBLE (M) ; + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- - // Parallel: slice M into coarse/fine tasks (Method 05, 06n, 07) + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_ONE_SLICE (M) ; // M cannot be jumbled - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //------------------------------------------------------------------ - // get j, the kth vector of M - //------------------------------------------------------------------ - - int64_t j = GBH (Mh, k) ; - GB_GET_VECTOR (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; - int64_t mjnz = pM_end - pM ; - if (mjnz == 0) continue ; - - //------------------------------------------------------------------ - // get A(:,j) - //------------------------------------------------------------------ - - int64_t pA, pA_end ; - GB_LOOKUP_VECTOR (pA, pA_end, A, j) ; - int64_t ajnz = pA_end - pA ; - bool ajdense = (ajnz == Avlen) ; - int64_t pA_start = pA ; - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_jC (fine_task, taskid) ; - int64_t cjnz = pC_end - pC_start ; - if (cjnz == 0 && ajnz == 0) continue ; - bool cjdense = (cjnz == Cvlen) ; - - //------------------------------------------------------------------ - // C(I,jC) = A(:,j) ; no S - //------------------------------------------------------------------ - - if (cjdense && ajdense) - { - - //-------------------------------------------------------------- - // C(:,jC) and A(:,j) are both dense - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - if (GB_MCAST (Mx, pM, msize)) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - GB_iC_DENSE_LOOKUP ; - - // find iA in A(:,j) - // A(:,j) is dense; no need for binary search - pA = pA_start + iA ; - ASSERT (GBI (Ai, pA, Avlen) == iA) ; - // ----[C A 1] or [X A 1]----------------------- - // [C A 1]: action: ( =A ): copy A to C, no acc - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_matrix ; - } - } - - } - else if (cjdense) - { - - //-------------------------------------------------------------- - // C(:,jC) is dense, A(:,j) is sparse - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - if (GB_MCAST (Mx, pM, msize)) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - GB_iC_DENSE_LOOKUP ; - - // find iA in A(:,j) - bool aij_found ; - int64_t apright = pA_end - 1 ; - GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; - - if (!aij_found) - { - // C (iC,jC) is present but A (i,j) is not - // ----[C . 1] or [X . 1]--------------------------- - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still zombie - GB_DELETE_ENTRY ; - } - else - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): copy A to C, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_matrix ; - } - } - } - - } - else if (ajdense) - { - - //-------------------------------------------------------------- - // C(:,jC) is sparse, A(:,j) is dense - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - if (GB_MCAST (Mx, pM, msize)) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - - // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; - - // lookup iA in A(:,j) - pA = pA_start + iA ; - ASSERT (GBI (Ai, pA, Avlen) == iA) ; - - if (cij_found) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): copy A into C, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_matrix ; - } - else - { - // C (iC,jC) is not present, A (i,j) is present - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - } - - } - else - { - - //-------------------------------------------------------------- - // C(:,jC) and A(:,j) are both sparse - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - if (GB_MCAST (Mx, pM, msize)) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - - // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; - - // find iA in A(:,j) - bool aij_found ; - int64_t apright = pA_end - 1 ; - GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; - - if (cij_found && aij_found) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): copy A into C, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_matrix ; - } - else if (!cij_found && aij_found) - { - // C (iC,jC) is not present, A (i,j) is present - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - else if (cij_found && !aij_found) - { - // C (iC,jC) is present but A (i,j) is not - // ----[C . 1] or [X . 1]--------------------------- - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still zombie - GB_DELETE_ENTRY ; - } - } - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - zorig = C->nzombies ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //------------------------------------------------------------------ - // get j, the kth vector of M - //------------------------------------------------------------------ - - int64_t j = GBH (Mh, k) ; - GB_GET_VECTOR (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; - int64_t mjnz = pM_end - pM ; - if (mjnz == 0) continue ; - - //------------------------------------------------------------------ - // get A(:,j) - //------------------------------------------------------------------ - - int64_t pA, pA_end ; - GB_LOOKUP_VECTOR (pA, pA_end, A, j) ; - int64_t ajnz = pA_end - pA ; - if (ajnz == 0) continue ; - bool ajdense = (ajnz == Avlen) ; - int64_t pA_start = pA ; - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_jC (fine_task, taskid) ; - bool cjdense = ((pC_end - pC_start) == Cvlen) ; - - //------------------------------------------------------------------ - // C(I,jC) = A(:,j) - //------------------------------------------------------------------ - - if (!cjdense) - { - - //-------------------------------------------------------------- - // C(:,jC) is sparse; use binary search for C - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - if (GB_MCAST (Mx, pM, msize)) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - - // find iA in A(:,j) - if (ajdense) - { - // A(:,j) is dense; no need for binary search - pA = pA_start + iA ; - ASSERT (GBI (Ai, pA, Avlen) == iA) ; - } - else - { - // A(:,j) is sparse; use binary search - int64_t apright = pA_end - 1 ; - bool aij_found ; - GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; - if (!aij_found) continue ; - } - - // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; - if (!cij_found) - { - // C (iC,jC) is not present, A (i,j) is present - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - GB_PENDING_INSERT_aij ; - } - } - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ false, + Mask_struct, + /* accum: */ NULL, + A, + /* scalar, scalar_type: */ NULL, NULL, + /* S: */ NULL, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_06n, "subassign_06n", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 0 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_06n_template.c" } diff --git a/Source/assign/GB_subassign_06s_and_14.c b/Source/assign/GB_subassign_06s_and_14.c index a3f82ddc77..55dc1f4397 100644 --- a/Source/assign/GB_subassign_06s_and_14.c +++ b/Source/assign/GB_subassign_06s_and_14.c @@ -2,17 +2,16 @@ // GB_subassign_06s_and_14: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 06s: C(I,J) = A ; using S // Method 14: C(I,J) = A ; using S // M: present +// Mask_struct: true or false // Mask_comp: true or false // C_replace: false // accum: NULL @@ -23,12 +22,14 @@ // M, A: any sparsity structure. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_06s_and_14 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -40,9 +41,13 @@ GrB_Info GB_subassign_06s_and_14 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_struct, // if true, use the only structure of M const bool Mask_comp, // if true, !M, else use M + const bool Mask_struct, // if true, use the only structure of M + #define accum NULL const GrB_Matrix A, + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -51,500 +56,53 @@ GrB_Info GB_subassign_06s_and_14 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A + GB_UNJUMBLE (M) ; + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - GB_MATRIX_WAIT_IF_JUMBLED (A) ; - - ASSERT_MATRIX_OK (C, "C input for Method 06s/14", GB0) ; - ASSERT_MATRIX_OK (M, "M input for Method 06s/14", GB0) ; - ASSERT_MATRIX_OK (A, "A input for Method 06s/14", GB0) ; - ASSERT_MATRIX_OK (S, "S constructed for Method 06s/14", GB0) ; - - GB_GET_C ; // C must not be bitmap - GB_GET_MASK ; - GB_GET_MASK_HYPER_HASH ; - GB_GET_A ; - GB_GET_S ; - GrB_BinaryOp accum = NULL ; - - //-------------------------------------------------------------------------- - // Method 06s: C(I,J) = A ; using S - //-------------------------------------------------------------------------- - - // Time: O((nnz(A)+nnz(S))*log(m)) where m is the # of entries in a vector - // of M, not including the time to construct S=C(I,J). If A, S, and M - // are similar in sparsity, then this method can perform well. If M is - // very sparse, Method 06n should be used instead. Method 06s is selected - // if nnz (A) < nnz (M) or if M is bitmap. - - //-------------------------------------------------------------------------- - // Method 14: C(I,J) = A ; using S - //-------------------------------------------------------------------------- - - // Time: Close to optimal. Omega(nnz(S)+nnz(A)) is required, and the - // sparsity of !M cannot be exploited. The time taken is - // O((nnz(A)+nnz(S))*log(m)) where m is the # of entries in a vector of M. - - //-------------------------------------------------------------------------- - // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - if (A_is_bitmap) - { - // all of IxJ must be examined - GB_SUBASSIGN_IXJ_SLICE ; - } - else + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + Mask_comp, + Mask_struct, + /* accum: */ NULL, + A, + /* scalar, scalar_type: */ NULL, NULL, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_06s, "subassign_06s", + Werk) ; + if (info != GrB_NO_VALUE) { - // traverse all A+S - GB_SUBASSIGN_TWO_SLICE (A, S) ; - } - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase1: A is bitmap TODO: this is SLOW! for method 06s - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - - if (Sfound && !Afound) - { - // S (i,j) is present but A (i,j) is not - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[C . 1] or [X . 1]--------------------------- - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - else if (!Sfound && Afound) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - else if (Sfound && Afound) - { - // both S (i,j) and A (i,j) present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): A to C no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_noaccum_C_A_1_matrix ; - } - GB_NEXT (S) ; - } - } - } - GB_PHASE1_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase1: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // S (i,j) is present but A (i,j) is not - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[C . 1] or [X . 1]--------------------------- - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - else if (iA < iS) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (A) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): A to C no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_noaccum_C_A_1_matrix ; - } - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // while list S (:,j) has entries. List A (:,j) exhausted. - while (pS < pS_end) - { - // S (i,j) is present but A (i,j) is not - int64_t iS = GBI (Si, pS, Svlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[C . 1] or [X . 1]------------------------------- - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (A) ; - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase2: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - if (!Sfound && Afound) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - } - else if (Sfound) - { - // S (i,j) present - GB_NEXT (S) ; - } - } - } - GB_PHASE2_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase2: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // S (i,j) is present but A (i,j) is not - GB_NEXT (S) ; - } - else if (iA < iS) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - GB_NEXT (A) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - GB_NEXT (A) ; - } - } - - GB_PHASE2_TASK_WRAPUP ; - } + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 0 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_06s_template.c" } diff --git a/Source/assign/GB_subassign_07.c b/Source/assign/GB_subassign_07.c index bbb0e8c0cb..7fca3bf045 100644 --- a/Source/assign/GB_subassign_07.c +++ b/Source/assign/GB_subassign_07.c @@ -2,16 +2,15 @@ // GB_subassign_07: C(I,J) += scalar ; no S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 07: C(I,J) += scalar ; no S // M: present +// Mask_struct: true or false // Mask_comp: false // C_replace: false // accum: present @@ -22,25 +21,32 @@ // M: any sparsity #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL ; GrB_Info GB_subassign_07 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp false const bool Mask_struct, const GrB_BinaryOp accum, + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -49,238 +55,43 @@ GrB_Info GB_subassign_07 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; // not constructed ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M + GB_UNJUMBLE (C) ; + GB_UNJUMBLE (M) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_EMPTY_TASKLIST ; - GB_MATRIX_WAIT_IF_JUMBLED (C) ; - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - - GB_GET_C ; // C must not be bitmap - int64_t zorig = C->nzombies ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; - GB_GET_C_HYPER_HASH ; - GB_GET_MASK ; - GB_GET_ACCUM_SCALAR ; - - //-------------------------------------------------------------------------- - // Method 07: C(I,J) += scalar ; no S - //-------------------------------------------------------------------------- - - // Time: Close to Optimal: same as Method 05. - - // Method 05 and Method 07 are very similar. Also compare with Method 06n. - - //-------------------------------------------------------------------------- - // Parallel: slice M into coarse/fine tasks (Method 05, 06n, 07) - //-------------------------------------------------------------------------- - - GB_SUBASSIGN_ONE_SLICE (M) ; // M cannot be jumbled - - //-------------------------------------------------------------------------- - // phase 1: undelete zombies, update entries, and count pending tuples + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //------------------------------------------------------------------ - // get j, the kth vector of M - //------------------------------------------------------------------ - - int64_t j = GBH (Mh, k) ; - GB_GET_VECTOR (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; - int64_t mjnz = pM_end - pM ; - if (mjnz == 0) continue ; - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_jC (fine_task, taskid) ; - int64_t cjnz = pC_end - pC_start ; - bool cjdense = (cjnz == Cvlen) ; - - //------------------------------------------------------------------ - // C(I,jC) += scalar ; no S - //------------------------------------------------------------------ - - if (cjdense) - { - - //-------------------------------------------------------------- - // C(:,jC) is dense so the binary search of C is not needed - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - bool mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (mij) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - GB_iC_DENSE_LOOKUP ; - - // ----[C A 1] or [X A 1]------------------------------- - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_withaccum_C_A_1_scalar ; - } - } - - } - else - { - - //-------------------------------------------------------------- - // C(:,jC) is sparse; use binary search for C - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - bool mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (mij) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - - // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; - if (cij_found) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_withaccum_C_A_1_scalar ; - } - else - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - zorig = C->nzombies ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //------------------------------------------------------------------ - // get j, the kth vector of M - //------------------------------------------------------------------ - - int64_t j = GBH (Mh, k) ; - GB_GET_VECTOR (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; - int64_t mjnz = pM_end - pM ; - if (mjnz == 0) continue ; - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_jC (fine_task, taskid) ; - bool cjdense = ((pC_end - pC_start) == Cvlen) ; - - //------------------------------------------------------------------ - // C(I,jC) += scalar ; no S - //------------------------------------------------------------------ - - if (!cjdense) - { - - //-------------------------------------------------------------- - // C(:,jC) is sparse; use binary search for C - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - - //---------------------------------------------------------- - // update C(iC,jC), but only if M(iA,j) allows it - //---------------------------------------------------------- - - bool mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - if (mij) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - - // find C(iC,jC) in C(:,jC) - GB_iC_BINARY_SEARCH ; - if (!cij_found) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - GB_PENDING_INSERT (scalar) ; - } - } - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ false, + Mask_struct, + accum, + /* A: */ NULL, + scalar, scalar_type, + /* S: */ NULL, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_07, "subassign_07", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_07_template.c" } diff --git a/Source/assign/GB_subassign_08n.c b/Source/assign/GB_subassign_08n.c index d8abe5c704..e5f588de32 100644 --- a/Source/assign/GB_subassign_08n.c +++ b/Source/assign/GB_subassign_08n.c @@ -2,16 +2,15 @@ // GB_subassign_08n: C(I,J) += A ; no S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 08n: C(I,J) += A ; no S // M: present +// Mask_struct: true or false // Mask_comp: false // C_replace: false // accum: present @@ -23,84 +22,32 @@ // M, A: not bitmap; Method 08s is used instead if M or A are bitmap. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" - -//------------------------------------------------------------------------------ -// GB_PHASE1_ACTION -//------------------------------------------------------------------------------ - -// action to take for phase 1 when A(i,j) exists and M(i,j)=1 -#define GB_PHASE1_ACTION \ -{ \ - if (cjdense) \ - { \ - /* direct lookup of C(iC,jC) */ \ - GB_iC_DENSE_LOOKUP ; \ - /* ----[C A 1] or [X A 1]------------------------------- */ \ - /* [C A 1]: action: ( =C+A ): apply accum */ \ - /* [X A 1]: action: ( undelete ): zombie lives */ \ - GB_withaccum_C_A_1_matrix ; \ - } \ - else \ - { \ - /* binary search for C(iC,jC) in C(:,jC) */ \ - GB_iC_BINARY_SEARCH ; \ - if (cij_found) \ - { \ - /* ----[C A 1] or [X A 1]--------------------------- */ \ - /* [C A 1]: action: ( =C+A ): apply accum */ \ - /* [X A 1]: action: ( undelete ): zombie lives */ \ - GB_withaccum_C_A_1_matrix ; \ - } \ - else \ - { \ - /* ----[. A 1]-------------------------------------- */ \ - /* [. A 1]: action: ( insert ) */ \ - task_pending++ ; \ - } \ - } \ -} - -//------------------------------------------------------------------------------ -// GB_PHASE2_ACTION -//------------------------------------------------------------------------------ - -// action to take for phase 2 when A(i,j) exists and M(i,j)=1 -#define GB_PHASE2_ACTION \ -{ \ - ASSERT (!cjdense) ; \ - { \ - /* binary search for C(iC,jC) in C(:,jC) */ \ - GB_iC_BINARY_SEARCH ; \ - if (!cij_found) \ - { \ - /* ----[. A 1]-------------------------------------- */ \ - /* [. A 1]: action: ( insert ) */ \ - GB_PENDING_INSERT_aij ; \ - } \ - } \ -} - -//------------------------------------------------------------------------------ -// GB_subassign_08n: C(I,J) += A ; no S -//------------------------------------------------------------------------------ +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL ; GrB_Info GB_subassign_08n ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp false const bool Mask_struct, const GrB_BinaryOp accum, const GrB_Matrix A, + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -109,343 +56,47 @@ GrB_Info GB_subassign_08n // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; // not constructed ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_BITMAP (M)) ; // Method 08s is used if M is bitmap ASSERT (!GB_IS_BITMAP (A)) ; // Method 08s is used if A is bitmap ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A + GB_UNJUMBLE (C) ; + GB_UNJUMBLE (M) ; + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_EMPTY_TASKLIST ; - GB_MATRIX_WAIT_IF_JUMBLED (C) ; - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - GB_MATRIX_WAIT_IF_JUMBLED (A) ; - - GB_GET_C ; // C must not be bitmap - int64_t zorig = C->nzombies ; - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - GB_GET_C_HYPER_HASH ; - GB_GET_MASK ; - GB_GET_ACCUM_MATRIX ; - const int64_t *Ah = A->h ; - - //-------------------------------------------------------------------------- - // Method 08n: C(I,J) += A ; no S - //-------------------------------------------------------------------------- - - // Time: Close to optimal. Omega (sum_j (min (nnz (A(:,j)), nnz (M(:,j)))), - // since only the intersection of A.*M needs to be considered. If either - // M(:,j) or A(:,j) are very sparse compared to the other, then the shorter - // is traversed with a linear-time scan and a binary search is used for the - // other. If the number of nonzeros is comparable, a linear-time scan is - // used for both. Once two entries M(i,j)=1 and A(i,j) are found with the - // same index i, the entry A(i,j) is accumulated or inserted into C. - - // The algorithm is very much like the eWise multiplication of A.*M, so the - // parallel scheduling relies on GB_emult_08_phase0 and GB_ewise_slice. - - //-------------------------------------------------------------------------- - // Parallel: slice the eWiseMult of Z=A.*M (Method 08n only) - //-------------------------------------------------------------------------- - - // Method 08n only. If C is sparse, it is sliced for a fine task, so that - // it can do a binary search via GB_iC_BINARY_SEARCH. But if C(:,jC) is - // dense, C(:,jC) is not sliced, so the fine task must do a direct lookup - // via GB_iC_DENSE_LOOKUP. Otherwise a race condition will occur. - // The Z matrix is not constructed, except for its hyperlist (Zh_shallow) - // and mapping to A and M. - - // No matrix (C, M, or A) can be bitmap. C, M, A can be sparse/hyper/full, - // in any combination. - - int64_t Znvec ; - const int64_t *restrict Zh_shallow = NULL ; - GB_OK (GB_subassign_08n_slice ( - &TaskList, &TaskList_size, &ntasks, &nthreads, - &Znvec, &Zh_shallow, &Z_to_A, &Z_to_A_size, &Z_to_M, &Z_to_M_size, - C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - A, M, Werk)) ; - GB_ALLOCATE_NPENDING_WERK ; - - //-------------------------------------------------------------------------- - // phase 1: undelete zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //------------------------------------------------------------------ - // get A(:,j) and M(:,j) - //------------------------------------------------------------------ - - int64_t j = GBH (Zh_shallow, k) ; - GB_GET_EVEC (pA, pA_end, pA, pA_end, Ap, Ah, j, k, Z_to_A, Avlen) ; - GB_GET_EVEC (pM, pM_end, pB, pB_end, Mp, Mh, j, k, Z_to_M, Mvlen) ; - - //------------------------------------------------------------------ - // quick checks for empty intersection of A(:,j) and M(:,j) - //------------------------------------------------------------------ - - int64_t ajnz = pA_end - pA ; - int64_t mjnz = pM_end - pM ; - if (ajnz == 0 || mjnz == 0) continue ; - int64_t iA_first = GBI (Ai, pA, Avlen) ; - int64_t iA_last = GBI (Ai, pA_end-1, Avlen) ; - int64_t iM_first = GBI (Mi, pM, Mvlen) ; - int64_t iM_last = GBI (Mi, pM_end-1, Mvlen) ; - if (iA_last < iM_first || iM_last < iA_first) continue ; - int64_t pM_start = pM ; - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_jC (fine_task, taskid) ; - bool cjdense = (pC_end - pC_start == Cvlen) ; - - - //------------------------------------------------------------------ - // C(I,jC) += A(:,j) ; no S - //------------------------------------------------------------------ - - if (ajnz > 32 * mjnz) - { - - //-------------------------------------------------------------- - // A(:,j) is much denser than M(:,j) - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - if (GB_MCAST (Mx, pM, msize)) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - // find iA in A(:,j) - int64_t pright = pA_end - 1 ; - bool found ; - // FUTURE::: exploit dense A(:,j) - GB_BINARY_SEARCH (iA, Ai, pA, pright, found) ; - if (found) GB_PHASE1_ACTION ; - } - } - - } - else if (mjnz > 32 * ajnz) - { - - //-------------------------------------------------------------- - // M(:,j) is much denser than A(:,j) - //-------------------------------------------------------------- - - // FUTURE::: exploit dense mask - bool mjdense = false ; - - for ( ; pA < pA_end ; pA++) - { - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (mij) GB_PHASE1_ACTION ; - } - - } - else - { - - //---------------------------------------------------------- - // A(:,j) and M(:,j) have about the same # of entries - //---------------------------------------------------------- - - // linear-time scan of A(:,j) and M(:,j) - - while (pA < pA_end && pM < pM_end) - { - int64_t iA = GBI (Ai, pA, Avlen) ; - int64_t iM = GBI (Mi, pM, Mvlen) ; - if (iA < iM) - { - // A(i,j) exists but not M(i,j) - GB_NEXT (A) ; - } - else if (iM < iA) - { - // M(i,j) exists but not A(i,j) - GB_NEXT (M) ; - } - else - { - // both A(i,j) and M(i,j) exist - if (GB_MCAST (Mx, pM, msize)) GB_PHASE1_ACTION ; - GB_NEXT (A) ; - GB_NEXT (M) ; - } - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - GB_PENDING_CUMSUM ; - zorig = C->nzombies ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //------------------------------------------------------------------ - // get A(:,j) and M(:,j) - //------------------------------------------------------------------ - - int64_t j = GBH (Zh_shallow, k) ; - GB_GET_EVEC (pA, pA_end, pA, pA_end, Ap, Ah, j, k, Z_to_A, Avlen) ; - GB_GET_EVEC (pM, pM_end, pB, pB_end, Mp, Mh, j, k, Z_to_M, Mvlen) ; - - //------------------------------------------------------------------ - // quick checks for empty intersection of A(:,j) and M(:,j) - //------------------------------------------------------------------ - - int64_t ajnz = pA_end - pA ; - int64_t mjnz = pM_end - pM ; - if (ajnz == 0 || mjnz == 0) continue ; - int64_t iA_first = GBI (Ai, pA, Avlen) ; - int64_t iA_last = GBI (Ai, pA_end-1, Avlen) ; - int64_t iM_first = GBI (Mi, pM, Mvlen) ; - int64_t iM_last = GBI (Mi, pM_end-1, Mvlen) ; - if (iA_last < iM_first || iM_last < iA_first) continue ; - int64_t pM_start = pM ; - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_jC (fine_task, taskid) ; - bool cjdense = (pC_end - pC_start == Cvlen) ; - if (cjdense) continue ; - - //------------------------------------------------------------------ - // C(I,jC) += A(:,j) ; no S - //------------------------------------------------------------------ - - if (ajnz > 32 * mjnz) - { - - //-------------------------------------------------------------- - // A(:,j) is much denser than M(:,j) - //-------------------------------------------------------------- - - for ( ; pM < pM_end ; pM++) - { - if (GB_MCAST (Mx, pM, msize)) - { - int64_t iA = GBI (Mi, pM, Mvlen) ; - // find iA in A(:,j) - int64_t pright = pA_end - 1 ; - bool found ; - // FUTURE::: exploit dense A(:,j) - GB_BINARY_SEARCH (iA, Ai, pA, pright, found) ; - if (found) GB_PHASE2_ACTION ; - } - } - - } - else if (mjnz > 32 * ajnz) - { - - //-------------------------------------------------------------- - // M(:,j) is much denser than A(:,j) - //-------------------------------------------------------------- - - // FUTURE::: exploit dense mask - bool mjdense = false ; - - for ( ; pA < pA_end ; pA++) - { - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (mij) GB_PHASE2_ACTION ; - } - - } - else - { - - //---------------------------------------------------------- - // A(:,j) and M(:,j) have about the same # of entries - //---------------------------------------------------------- - - // linear-time scan of A(:,j) and M(:,j) - - while (pA < pA_end && pM < pM_end) - { - int64_t iA = GBI (Ai, pA, Avlen) ; - int64_t iM = GBI (Mi, pM, Mvlen) ; - if (iA < iM) - { - // A(i,j) exists but not M(i,j) - GB_NEXT (A) ; - } - else if (iM < iA) - { - // M(i,j) exists but not A(i,j) - GB_NEXT (M) ; - } - else - { - // both A(i,j) and M(i,j) exist - if (GB_MCAST (Mx, pM, msize)) GB_PHASE2_ACTION ; - GB_NEXT (A) ; - GB_NEXT (M) ; - } - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ false, + Mask_struct, + accum, + A, + /* scalar, scalar_type: */ NULL, NULL, + /* S: */ NULL, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_08n, "subassign_08n", + Werk) ; + if (info != GrB_NO_VALUE) + { + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 0 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_08n_template.c" } diff --git a/Source/assign/GB_subassign_08n_slice.c b/Source/assign/GB_subassign_08n_slice.c index e6a72fab0a..50d407c217 100644 --- a/Source/assign/GB_subassign_08n_slice.c +++ b/Source/assign/GB_subassign_08n_slice.c @@ -2,7 +2,7 @@ // GB_subassign_08n_slice: slice the entries and vectors for GB_subassign_08n //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -28,49 +28,27 @@ // does not need to consider the bitmap case for C, M, or A. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" // Npending is set to NULL by the GB_EMPTY_TASKLIST macro, but unused here. #include "include/GB_unused.h" +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 0 +#include "assign/include/GB_assign_shared_definitions.h" -GrB_Info GB_subassign_08n_slice -( - // output: - GB_task_struct **p_TaskList, // array of structs, of size max_ntasks - size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads to use - int64_t *p_Znvec, // # of vectors to compute in Z - const int64_t *restrict *Zh_handle, // Zh_shallow is A->h, M->h, or NULL - int64_t *restrict *Z_to_A_handle, // Z_to_A: size Znvec, or NULL - size_t *Z_to_A_size_handle, - int64_t *restrict *Z_to_M_handle, // Z_to_M: size Znvec, or NULL - size_t *Z_to_M_size_handle, - // input: - const GrB_Matrix C, // output matrix C - const GrB_Index *I, - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix A, // matrix to slice - const GrB_Matrix M, // matrix to slice - GB_Werk Werk -) +GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) { //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- + GrB_Matrix S = NULL ; // not constructed + GB_EMPTY_TASKLIST + ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_BITMAP (M)) ; // Method 08n is not used for M bitmap ASSERT (!GB_IS_BITMAP (A)) ; // Method 08n is not used for A bitmap - GB_EMPTY_TASKLIST ASSERT (p_TaskList != NULL) ; ASSERT (p_ntasks != NULL) ; ASSERT (p_nthreads != NULL) ; @@ -189,17 +167,22 @@ GrB_Info GB_subassign_08n_slice int64_t ajnz = pA_end - pA ; int64_t mjnz = pM_end - pM ; if (ajnz == 0 || mjnz == 0) continue ; - int64_t iA_first = GBI (Ai, pA, Avlen) ; - int64_t iA_last = GBI (Ai, pA_end-1, Avlen) ; - int64_t iM_first = GBI (Mi, pM, Mvlen) ; - int64_t iM_last = GBI (Mi, pM_end-1, Mvlen) ; + int64_t iA_first = GBI_A (Ai, pA, Avlen) ; + int64_t iA_last = GBI_A (Ai, pA_end-1, Avlen) ; + int64_t iM_first = GBI_M (Mi, pM, Mvlen) ; + int64_t iM_last = GBI_M (Mi, pM_end-1, Mvlen) ; if (iA_last < iM_first || iM_last < iA_first) continue ; //------------------------------------------------------------------ // get jC, the corresponding vector of C //------------------------------------------------------------------ - GB_LOOKUP_VECTOR_jC (false, 0) ; + // lookup jC in C + // jC = J [j] ; or J is ":" or jbegin:jend or jbegin:jinc:jend + int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; + int64_t pC_start, pC_end ; + GB_LOOKUP_VECTOR_C (jC, pC_start, pC_end) ; + bool cjdense = (pC_end - pC_start == Cvlen) ; //------------------------------------------------------------------ diff --git a/Source/assign/GB_subassign_08s_and_16.c b/Source/assign/GB_subassign_08s_and_16.c index 5fbefa28d1..114eea60f1 100644 --- a/Source/assign/GB_subassign_08s_and_16.c +++ b/Source/assign/GB_subassign_08s_and_16.c @@ -2,17 +2,16 @@ // GB_subassign_08s_and_16: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 08s: C(I,J) += A ; using S -// Method 16: C(I,J) += A ; using S +// Method 16: C(I,J) += A ; using S // M: present +// Mask_struct: true or false // Mask_comp: true or false // C_replace: false // accum: present @@ -23,12 +22,14 @@ // M, A: any sparsity structure. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_08s_and_16 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -40,10 +41,13 @@ GrB_Info GB_subassign_08s_and_16 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_struct, // if true, use the only structure of M const bool Mask_comp, // if true, !M, else use M + const bool Mask_struct, // if true, use the only structure of M const GrB_BinaryOp accum, const GrB_Matrix A, + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -52,470 +56,53 @@ GrB_Info GB_subassign_08s_and_16 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A + GB_UNJUMBLE (M) ; + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - GB_MATRIX_WAIT_IF_JUMBLED (A) ; - - GB_GET_C ; // C must not be bitmap - GB_GET_MASK ; - GB_GET_MASK_HYPER_HASH ; - GB_GET_S ; - GB_GET_ACCUM_MATRIX ; - - //-------------------------------------------------------------------------- - // Method 16: C(I,J) += A ; using S - //-------------------------------------------------------------------------- - - // Time: Close to optimal. All entries in A+S must be traversed. - - //-------------------------------------------------------------------------- - // Method 08s: C(I,J) += A ; using S + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - // Time: Only entries in A must be traversed, and the corresponding entries - // in C located. This method constructs S and traverses all of it in the - // worst case. Compare with method 08n, which does not construct S but - // instead uses a binary search for entries in C, but it only traverses - // entries in A.*M. - - //-------------------------------------------------------------------------- - // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) - //-------------------------------------------------------------------------- - - if (A_is_bitmap) - { - // all of IxJ must be examined - GB_SUBASSIGN_IXJ_SLICE ; - } - else + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + Mask_comp, + Mask_struct, + accum, + A, + /* scalar, scalar_type: */ NULL, NULL, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_08s, "subassign_08s", + Werk) ; + if (info != GrB_NO_VALUE) { - // traverse all A+S - GB_SUBASSIGN_TWO_SLICE (A, S) ; - } - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase1: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - - if (Sfound && !Afound) - { - // S (i,j) is present but A (i,j) is not - // ----[C . 1] or [X . 1]------------------------------- - // [C . 1]: action: ( C ): no change, with accum - // [X . 1]: action: ( X ): still a zombie - // ----[C . 0] or [X . 0]------------------------------- - // [C . 0]: action: ( C ): no change, with accum - // [X . 0]: action: ( X ): still a zombie - GB_NEXT (S) ; - } - else if (!Sfound && Afound) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - else if (Sfound && Afound) - { - // both S (i,j) and A (i,j) present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): A to C no accum - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_withaccum_C_A_1_matrix ; - } - GB_NEXT (S) ; - } - } - } - GB_PHASE1_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase1: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // S (i,j) is present but A (i,j) is not - // ----[C . 1] or [X . 1]------------------------------- - // [C . 1]: action: ( C ): no change, with accum - // [X . 1]: action: ( X ): still a zombie - // ----[C . 0] or [X . 0]------------------------------- - // [C . 0]: action: ( C ): no change, with accum - // [X . 0]: action: ( X ): still a zombie - GB_NEXT (S) ; - } - else if (iA < iS) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (A) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): A to C no accum - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_withaccum_C_A_1_matrix ; - } - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // ignore the remainder of S(:,j) - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (A) ; - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase2: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - if (!Sfound && Afound) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - } - else if (Sfound) - { - // S (i,j) present - GB_NEXT (S) ; - } - } - } - GB_PHASE2_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase2: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // S (i,j) is present but A (i,j) is not - GB_NEXT (S) ; - } - else if (iA < iS) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - GB_NEXT (A) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - GB_NEXT (A) ; - } - } - - GB_PHASE2_TASK_WRAPUP ; - } + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 0 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_08s_template.c" } diff --git a/Source/assign/GB_subassign_09.c b/Source/assign/GB_subassign_09.c index a59184f53e..c59ca3509e 100644 --- a/Source/assign/GB_subassign_09.c +++ b/Source/assign/GB_subassign_09.c @@ -2,16 +2,15 @@ // GB_subassign_09: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 09: C(I,J) = scalar ; using S // M: present +// Mask_struct: true or false // Mask_comp: false // C_replace: true // accum: NULL @@ -21,13 +20,15 @@ // C: not bitmap or full #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "include/GB_unused.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_09 ( GrB_Matrix C, // input: + #define C_replace true const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -39,9 +40,13 @@ GrB_Info GB_subassign_09 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp false const bool Mask_struct, + #define accum NULL + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -50,424 +55,51 @@ GrB_Info GB_subassign_09 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M + GB_UNJUMBLE (M) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - - GB_GET_C ; // C must not be bitmap - GB_GET_MASK ; - GB_GET_SCALAR ; - GB_GET_S ; - GrB_BinaryOp accum = NULL ; - - //-------------------------------------------------------------------------- - // Method 09: C(I,J) = scalar ; using S - //-------------------------------------------------------------------------- - - // Time: Optimal. All entries in M+S must be examined. All entries in S - // are modified: if M(i,j)=1 then S(i,j) is used to write to the - // corresponding entry in C. If M(i,j) is not present, or zero, then the - // entry in C is cleared (because of C_replace). If S(i,j) is not present, - // and M(i,j)=1, then the scalar is inserted into C. The only case that - // can be skipped is if neither S nor M is present. As a result, this - // method need not traverse all of IxJ. It can limit its traversal to the - // pattern of M+S. - - // Method 09 and Method 11 are very similar. - - //-------------------------------------------------------------------------- - // Parallel: M+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - if (M_is_bitmap) + info = GB_subassign_jit (C, + /* C_replace: */ true, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ false, + Mask_struct, + /* accum: */ NULL, + /* A: */ NULL, + scalar, scalar_type, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_09, "subassign_09", + Werk) ; + if (info != GrB_NO_VALUE) { - // all of IxJ must be examined - GB_SUBASSIGN_IXJ_SLICE ; - } - else - { - // traverse all M+S - GB_SUBASSIGN_TWO_SLICE (M, S) ; - } - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - if (M_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase1: M is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iM_start, iM_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iM_start:iM_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iM_start) ; - int64_t pM_start = j * Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iM_start:iM_end,j) and M(ditto,j) - //-------------------------------------------------------------- - - for (int64_t iM = iM_start ; iM < iM_end ; iM++) - { - - int64_t pM = pM_start + iM ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iM) ; - bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; - - if (Sfound && !mij) - { - // S (i,j) is present but M (i,j) is false - // ----[C A 0] or [X A 0]------------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - else if (!Sfound && mij) - { - // S (i,j) is not present, M (i,j) is true - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - task_pending++ ; - } - else if (Sfound && mij) - { - // S (i,j) present and M (i,j) is true - GB_C_S_LOOKUP ; - // ----[C A 1] or [X A 1]------------------------------- - // [C A 1]: action: ( =A ): copy A, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_scalar ; - GB_NEXT (S) ; - } - } - } - GB_PHASE1_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase1: M is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get S(:,j) and M(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and M(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and M (:,j) have entries - while (pS < pS_end && pM < pM_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iM = GBI (Mi, pM, Mvlen) ; - - if (iS < iM) - { - // S (i,j) is present but M (i,j) is not - // ----[C A 0] or [X A 0]------------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - else if (iM < iS) - { - // S (i,j) is not present, M (i,j) is present - if (GB_MCAST (Mx, pM, msize)) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (M) ; - } - else - { - // both S (i,j) and M (i,j) present - GB_C_S_LOOKUP ; - if (GB_MCAST (Mx, pM, msize)) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): copy A, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_scalar ; - } - else - { - // ----[C A 0] or [X A 0]--------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): now zombie - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - GB_NEXT (M) ; - } - } - - // while list S (:,j) has entries. List M (:,j) exhausted. - while (pS < pS_end) - { - // S (i,j) is present but M (i,j) is not - // ----[C A 0] or [X A 0]----------------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - - // while list M (:,j) has entries. List S (:,j) exhausted. - while (pM < pM_end) - { - // S (i,j) is not present, M (i,j) is present - if (GB_MCAST (Mx, pM, msize)) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (M) ; - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - if (M_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase2: M is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iM_start, iM_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iM_start:iM_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iM_start) ; - int64_t pM_start = j * Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iM_start:iM_end,j) and M(ditto,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - for (int64_t iM = iM_start ; iM < iM_end ; iM++) - { - int64_t pM = pM_start + iM ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iM) ; - bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; - - if (!Sfound && mij) - { - // S (i,j) is not present, M (i,j) is true - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iM, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - else if (Sfound) - { - // S (i,j) present - GB_NEXT (S) ; - } - } - } - GB_PHASE2_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase2: M is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get S(:,j) and M(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and M(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and M (:,j) have entries - while (pS < pS_end && pM < pM_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iM = GBI (Mi, pM, Mvlen) ; - - if (iS < iM) - { - // S (i,j) is present but M (i,j) is not - GB_NEXT (S) ; - } - else if (iM < iS) - { - // S (i,j) is not present, M (i,j) is present - if (GB_MCAST (Mx, pM, msize)) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iM, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - GB_NEXT (M) ; - } - else - { - // both S (i,j) and M (i,j) present - GB_NEXT (S) ; - GB_NEXT (M) ; - } - } - - // while list M (:,j) has entries. List S (:,j) exhausted. - while (pM < pM_end) - { - // S (i,j) is not present, M (i,j) is present - if (GB_MCAST (Mx, pM, msize)) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - int64_t iM = GBI (Mi, pM, Mvlen) ; - int64_t iC = GB_ijlist (I, iM, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - GB_NEXT (M) ; - } - } - - GB_PHASE2_TASK_WRAPUP ; - } + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_09_template.c" } diff --git a/Source/assign/GB_subassign_10_and_18.c b/Source/assign/GB_subassign_10_and_18.c index 1ee13359c4..ce6ab3e560 100644 --- a/Source/assign/GB_subassign_10_and_18.c +++ b/Source/assign/GB_subassign_10_and_18.c @@ -2,17 +2,16 @@ // GB_subassign_10_and_18: C(I,J) = A ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 10: C(I,J) = A ; using S // Method 18: C(I,J) = A ; using S // M: present +// Mask_struct: true or false // Mask_comp: true or false // C_replace: true // accum: NULL @@ -23,12 +22,14 @@ // M, A: any sparsity structure. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_10_and_18 ( GrB_Matrix C, // input: + #define C_replace true const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -40,9 +41,13 @@ GrB_Info GB_subassign_10_and_18 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_struct, // if true, use the only structure of M const bool Mask_comp, // if true, !M, else use M + const bool Mask_struct, // if true, use the only structure of M + #define accum NULL const GrB_Matrix A, + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -51,490 +56,53 @@ GrB_Info GB_subassign_10_and_18 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A + GB_UNJUMBLE (M) ; + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - GB_MATRIX_WAIT_IF_JUMBLED (A) ; - - GB_GET_C ; // C must not be bitmap - GB_GET_MASK ; - GB_GET_MASK_HYPER_HASH ; - GB_GET_A ; - GB_GET_S ; - GrB_BinaryOp accum = NULL ; - - //-------------------------------------------------------------------------- - // Method 10: C(I,J) = A ; using S - // Method 18: C(I,J) = A ; using S - //-------------------------------------------------------------------------- - - // Time: Optimal. Omega (nnz(A)+nnz(S)), since all entries in S+A must be - // traversed, and the corresponding entry in M (even if not present) - // determines the action to take. M can add a log(m) factor if sparse. - - //-------------------------------------------------------------------------- - // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - if (A_is_bitmap) - { - // all of IxJ must be examined - GB_SUBASSIGN_IXJ_SLICE ; - } - else + info = GB_subassign_jit (C, + /* C_replace: */ true, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + Mask_comp, + Mask_struct, + /* accum: */ NULL, + A, + /* scalar, scalar_type: */ NULL, NULL, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_10, "subassign_10", + Werk) ; + if (info != GrB_NO_VALUE) { - // traverse all A+S - GB_SUBASSIGN_TWO_SLICE (A, S) ; - } - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase1: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - - if (Sfound && !Afound) - { - // S (i,j) is present but A (i,j) is not - // ----[C . 1] or [X . 1]------------------------------- - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still zombie - // ----[C . 0] or [X . 0]------------------------------- - // [X . 0]: action: ( X ): still a zombie - // [C . 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - else if (!Sfound && Afound) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - else if (Sfound && Afound) - { - // both S (i,j) and A (i,j) present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - GB_C_S_LOOKUP ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): A to C no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_matrix ; - } - else - { - // ----[C A 0] or [X A 0]--------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): now zombie - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - } - } - GB_PHASE1_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase1: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // S (i,j) is present but A (i,j) is not - // ----[C . 1] or [X . 1]------------------------------- - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still zombie - // ----[C . 0] or [X . 0]------------------------------- - // [X . 0]: action: ( X ): still a zombie - // [C . 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - else if (iA < iS) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (A) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - GB_C_S_LOOKUP ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): A to C no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_matrix ; - } - else - { - // ----[C A 0] or [X A 0]--------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): now zombie - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // while list S (:,j) has entries. List A (:,j) exhausted. - while (pS < pS_end) - { - // ----[C . 1] or [X . 1]----------------------------------- - // S (i,j) is present but A (i,j) is not - // [C . 1]: action: ( delete ): becomes zombie - // [X . 1]: action: ( X ): still a zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (A) ; - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase2: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - if (!Sfound && Afound) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - } - else if (Sfound) - { - // S (i,j) present - GB_NEXT (S) ; - } - } - } - GB_PHASE2_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase2: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // S (i,j) is present but A (i,j) is not - GB_NEXT (S) ; - } - else if (iA < iS) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - GB_NEXT (A) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - GB_NEXT (A) ; - } - } - - GB_PHASE2_TASK_WRAPUP ; - } + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 0 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_10_template.c" } diff --git a/Source/assign/GB_subassign_11.c b/Source/assign/GB_subassign_11.c index 6879ccd84a..e228d157c3 100644 --- a/Source/assign/GB_subassign_11.c +++ b/Source/assign/GB_subassign_11.c @@ -2,16 +2,15 @@ // GB_subassign_11: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 11: C(I,J) += scalar ; using S // M: present +// Mask_struct: true or false // Mask_comp: false // C_replace: true // accum: present @@ -21,13 +20,15 @@ // C, M: not bitmap #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "include/GB_unused.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_11 ( GrB_Matrix C, // input: + #define C_replace true const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -39,10 +40,13 @@ GrB_Info GB_subassign_11 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp false const bool Mask_struct, const GrB_BinaryOp accum, + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -51,423 +55,51 @@ GrB_Info GB_subassign_11 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M + GB_UNJUMBLE (M) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - - GB_GET_C ; // C must not be bitmap - GB_GET_MASK ; - GB_GET_ACCUM_SCALAR ; - GB_GET_S ; - - //-------------------------------------------------------------------------- - // Method 11: C(I,J) += scalar ; using S - //-------------------------------------------------------------------------- - - // Time: Optimal. All entries in M+S must be examined. All entries in S - // are modified: if M(i,j)=1 then S(i,j) is used to write to the - // corresponding entry in C. If M(i,j) is not present, or zero, then the - // entry in C is cleared (because of C_replace). If S(i,j) is not present, - // and M(i,j)=1, then the scalar is inserted into C. The only case that - // can be skipped is if neither S nor M is present. As a result, this - // method need not traverse all of IxJ. It can limit its traversal to the - // pattern of M+S. - - // Method 09 and Method 11 are very similar. - - //-------------------------------------------------------------------------- - // Parallel: M+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - if (M_is_bitmap) + info = GB_subassign_jit (C, + /* C_replace: */ true, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ false, + Mask_struct, + accum, + /* A: */ NULL, + scalar, scalar_type, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_11, "subassign_11", + Werk) ; + if (info != GrB_NO_VALUE) { - // all of IxJ must be examined - GB_SUBASSIGN_IXJ_SLICE ; - } - else - { - // traverse all M+S - GB_SUBASSIGN_TWO_SLICE (M, S) ; - } - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - if (M_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase1: M is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iM_start, iM_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iM_start:iM_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iM_start) ; - int64_t pM_start = j * Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iM_start:iM_end,j) and M(ditto,j) - //-------------------------------------------------------------- - - for (int64_t iM = iM_start ; iM < iM_end ; iM++) - { - - int64_t pM = pM_start + iM ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iM) ; - bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; - - if (Sfound && !mij) - { - // S (i,j) is present but M (i,j) is false - // ----[C A 0] or [X A 0]------------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - else if (!Sfound && mij) - { - // S (i,j) is not present, M (i,j) is true - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - task_pending++ ; - } - else if (Sfound && mij) - { - // S (i,j) present and M (i,j) is true - GB_C_S_LOOKUP ; - // ----[C A 1] or [X A 1]------------------------------- - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_withaccum_C_A_1_scalar ; - GB_NEXT (S) ; - } - } - } - GB_PHASE1_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase1: M is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get S(:,j) and M(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and M(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and M (:,j) have entries - while (pS < pS_end && pM < pM_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iM = GBI (Mi, pM, Mvlen) ; - - if (iS < iM) - { - // S (i,j) is present but M (i,j) is not - // ----[C A 0] or [X A 0]------------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - else if (iM < iS) - { - // S (i,j) is not present, M (i,j) is present - if (GB_MCAST (Mx, pM, msize)) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (M) ; - } - else - { - // both S (i,j) and M (i,j) present - GB_C_S_LOOKUP ; - if (GB_MCAST (Mx, pM, msize)) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_withaccum_C_A_1_scalar ; - } - else - { - // ----[C A 0] or [X A 0]--------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): now zombie - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - GB_NEXT (M) ; - } - } - - // while list S (:,j) has entries. List M (:,j) exhausted. - while (pS < pS_end) - { - // S (i,j) is present but M (i,j) is not - // ----[C A 0] or [X A 0]----------------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - GB_NEXT (S) ; - } - - // while list M (:,j) has entries. List S (:,j) exhausted. - while (pM < pM_end) - { - // S (i,j) is not present, M (i,j) is present - if (GB_MCAST (Mx, pM, msize)) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (M) ; - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - if (M_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase2: M is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iM_start, iM_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iM_start:iM_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iM_start) ; - int64_t pM_start = j * Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iM_start:iM_end,j) and M(ditto,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - for (int64_t iM = iM_start ; iM < iM_end ; iM++) - { - int64_t pM = pM_start + iM ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iM) ; - bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; - - if (!Sfound && mij) - { - // S (i,j) is not present, M (i,j) is true - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iM, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - else if (Sfound) - { - // S (i,j) present - GB_NEXT (S) ; - } - } - } - GB_PHASE2_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase2: M is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get S(:,j) and M(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and M(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and M (:,j) have entries - while (pS < pS_end && pM < pM_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iM = GBI (Mi, pM, Mvlen) ; - - if (iS < iM) - { - // S (i,j) is present but M (i,j) is not - GB_NEXT (S) ; - } - else if (iM < iS) - { - // S (i,j) is not present, M (i,j) is present - if (GB_MCAST (Mx, pM, msize)) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iM, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - GB_NEXT (M) ; - } - else - { - // both S (i,j) and M (i,j) present - GB_NEXT (S) ; - GB_NEXT (M) ; - } - } - - // while list M (:,j) has entries. List S (:,j) exhausted. - while (pM < pM_end) - { - // S (i,j) is not present, M (i,j) is present - if (GB_MCAST (Mx, pM, msize)) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - int64_t iM = GBI (Mi, pM, Mvlen) ; - int64_t iC = GB_ijlist (I, iM, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - GB_NEXT (M) ; - } - } - - GB_PHASE2_TASK_WRAPUP ; - } + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_11_template.c" } diff --git a/Source/assign/GB_subassign_12_and_20.c b/Source/assign/GB_subassign_12_and_20.c index 9e3624227d..428bccf85e 100644 --- a/Source/assign/GB_subassign_12_and_20.c +++ b/Source/assign/GB_subassign_12_and_20.c @@ -2,17 +2,16 @@ // GB_subassign_12_and_20: C(I,J) += A ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 12: C(I,J) += A ; using S // Method 20: C(I,J) += A ; using S // M: present +// Mask_stuct: true or false // Mask_comp: true or false // C_replace: true // accum: present @@ -23,12 +22,14 @@ // M, A: any sparsity structure. #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_12_and_20 ( GrB_Matrix C, // input: + #define C_replace true const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -40,10 +41,13 @@ GrB_Info GB_subassign_12_and_20 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_struct, // if true, use the only structure of M const bool Mask_comp, // if true, !M, else use M + const bool Mask_struct, // if true, use the only structure of M const GrB_BinaryOp accum, const GrB_Matrix A, + #define scalar NULL + #define scalar_type NULL + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -52,500 +56,53 @@ GrB_Info GB_subassign_12_and_20 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A + GB_UNJUMBLE (M) ; + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - GB_MATRIX_WAIT_IF_JUMBLED (A) ; - - GB_GET_C ; // C must not be bitmap - GB_GET_MASK ; - GB_GET_MASK_HYPER_HASH ; - GB_GET_S ; - GB_GET_ACCUM_MATRIX ; - - //-------------------------------------------------------------------------- - // Method 12: C(I,J) += A ; using S - // Method 20: C(I,J) += A ; using S - //-------------------------------------------------------------------------- - - // Time: all entries in S+A must be traversed, so Omega(nnz(S)+nnz(A)) is - // required. All cases of the mask (0, 1, or not present) must be - // considered, because of the C_replace descriptor being true. - - //-------------------------------------------------------------------------- - // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + // via the JIT or PreJIT kernel //-------------------------------------------------------------------------- - if (A_is_bitmap) - { - // all of IxJ must be examined - GB_SUBASSIGN_IXJ_SLICE ; - } - else + info = GB_subassign_jit (C, + /* C_replace: */ true, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + Mask_comp, + Mask_struct, + accum, + A, + /* scalar, scalar_type: */ NULL, NULL, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_12, "subassign_12", + Werk) ; + if (info != GrB_NO_VALUE) { - // traverse all A+S - GB_SUBASSIGN_TWO_SLICE (A, S) ; - } - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase1: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - - if (Sfound && !Afound) - { - // S (i,j) is present but A (i,j) is not - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (!mij) - { - // ----[C . 0] or [X . 0]--------------------------- - // [X . 0]: action: ( X ): still a zombie - // [C . 0]: C_repl: action: ( delete ): now zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - else if (!Sfound && Afound) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - else if (Sfound && Afound) - { - // both S (i,j) and A (i,j) present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - GB_C_S_LOOKUP ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): A to C no accum - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_withaccum_C_A_1_matrix ; - } - else - { - // ----[C A 0] or [X A 0]--------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): now zombie - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - } - } - GB_PHASE1_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase1: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE1 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - // int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // S (i,j) is present but A (i,j) is not - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; - if (Mask_comp) mij = !mij ; - if (!mij) - { - // ----[C . 0] or [X . 0]--------------------------- - // [X . 0]: action: ( X ): still a zombie - // [C . 0]: C_repl: action: ( delete ): now zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - else if (iA < iS) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (A) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - GB_C_S_LOOKUP ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): A to C no accum - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_withaccum_C_A_1_matrix ; - } - else - { - // ----[C A 0] or [X A 0]--------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): now zombie - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // while list S (:,j) has entries. List A (:,j) exhausted. - while (pS < pS_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; - if (Mask_comp) mij = !mij ; - if (!mij) - { - // ----[C . 0] or [X . 0]------------------------------- - // [X . 0]: action: ( X ): still a zombie - // [C . 0]: C_repl: action: ( delete ): becomes zombie - GB_C_S_LOOKUP ; - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - task_pending++ ; - } - GB_NEXT (A) ; - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - if (A_is_bitmap) - { - - //---------------------------------------------------------------------- - // phase2: A is bitmap - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //-------------------------------------------------------------- - // get S(iA_start:iA_end,j) - //-------------------------------------------------------------- - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - int64_t pA_start = j * Avlen ; - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - int64_t pA = pA_start + iA ; - bool Sfound = (pS < pS_end) && (GBI (Si, pS, Svlen) == iA) ; - bool Afound = Ab [pA] ; - if (!Sfound && Afound) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - } - else if (Sfound) - { - // S (i,j) present - GB_NEXT (S) ; - } - } - } - GB_PHASE2_TASK_WRAPUP ; - } - - } - else - { - - //---------------------------------------------------------------------- - // phase2: A is hypersparse, sparse, or full - //---------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //------------------------------------------------------------------ - // get the task descriptor - //------------------------------------------------------------------ - - GB_GET_TASK_DESCRIPTOR_PHASE2 ; - - //------------------------------------------------------------------ - // compute all vectors in this task - //------------------------------------------------------------------ - - for (int64_t k = kfirst ; k <= klast ; k++) - { - - //-------------------------------------------------------------- - // get A(:,j) and S(:,j) - //-------------------------------------------------------------- - - int64_t j = GBH (Zh, k) ; - GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); - GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); - - //-------------------------------------------------------------- - // get M(:,j) - //-------------------------------------------------------------- - - int64_t pM_start, pM_end ; - GB_LOOKUP_VECTOR (pM_start, pM_end, M, j) ; - bool mjdense = (pM_end - pM_start) == Mvlen ; - - //-------------------------------------------------------------- - // do a 2-way merge of S(:,j) and A(:,j) - //-------------------------------------------------------------- - - // jC = J [j] ; or J is a colon expression - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - // while both list S (:,j) and A (:,j) have entries - while (pS < pS_end && pA < pA_end) - { - int64_t iS = GBI (Si, pS, Svlen) ; - int64_t iA = GBI (Ai, pA, Avlen) ; - - if (iS < iA) - { - // S (i,j) is present but A (i,j) is not - GB_NEXT (S) ; - } - else if (iA < iS) - { - // S (i,j) is not present, A (i,j) is present - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - GB_NEXT (A) ; - } - else - { - // both S (i,j) and A (i,j) present - GB_NEXT (S) ; - GB_NEXT (A) ; - } - } - - // while list A (:,j) has entries. List S (:,j) exhausted. - while (pA < pA_end) - { - // S (i,j) is not present, A (i,j) is present - int64_t iA = GBI (Ai, pA, Avlen) ; - GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; - if (Mask_comp) mij = !mij ; - if (mij) - { - // ----[. A 1]------------------------------------------ - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT_aij ; - } - GB_NEXT (A) ; - } - } - - GB_PHASE2_TASK_WRAPUP ; - } + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 0 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_12_template.c" } diff --git a/Source/assign/GB_subassign_13.c b/Source/assign/GB_subassign_13.c index 6e8d3a9e5d..00d4215527 100644 --- a/Source/assign/GB_subassign_13.c +++ b/Source/assign/GB_subassign_13.c @@ -2,16 +2,15 @@ // GB_subassign_13: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 13: C(I,J) = scalar ; using S // M: present +// Mask_struct: true or false // Mask_comp: true // C_replace: false // accum: NULL @@ -22,12 +21,14 @@ // M: not bitmap #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_13 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -39,9 +40,13 @@ GrB_Info GB_subassign_13 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp true const bool Mask_struct, + #define accum NULL + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -50,277 +55,51 @@ GrB_Info GB_subassign_13 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M + GB_UNJUMBLE (M) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - - GB_GET_C ; // C must not be bitmap - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - GB_GET_MASK ; - GB_GET_MASK_HYPER_HASH ; - GB_GET_SCALAR ; - GB_GET_S ; - GrB_BinaryOp accum = NULL ; - - //-------------------------------------------------------------------------- - // Method 13: C(I,J) = scalar ; using S - //-------------------------------------------------------------------------- - - // Time: Close to optimal; must visit all IxJ, so Omega(|I|*|J|) is - // required. The sparsity of !M cannot be exploited. - - // Methods 13, 15, 17, and 19 are very similar. - - //-------------------------------------------------------------------------- - // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) - //-------------------------------------------------------------------------- - - GB_SUBASSIGN_IXJ_SLICE ; - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) and M(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - GB_LOOKUP_VECTOR_FOR_IXJ (M, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) = scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - - //-------------------------------------------------------------- - // Get the indices at the top of each list. - //-------------------------------------------------------------- - - int64_t iS = (pS < pS_end) ? GBI (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI (Mi, pM, Mvlen) : INT64_MAX ; - - //-------------------------------------------------------------- - // find the smallest index of [iS iA iM] (always iA) - //-------------------------------------------------------------- - - int64_t i = iA ; - - //-------------------------------------------------------------- - // get M(i,j) - //-------------------------------------------------------------- - - bool mij ; - if (i == iM) - { - // mij = (bool) M [pM] - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - GB_NEXT (M) ; - } - else - { - // mij not present, implicitly false - ASSERT (i < iM) ; - mij = false ; - } - - // complement the mask entry mij since Mask_comp is true - mij = !mij ; - - //-------------------------------------------------------------- - // assign the entry - //-------------------------------------------------------------- - - if (i == iS) - { - ASSERT (i == iA) ; - { - // both S (i,j) and A (i,j) present - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): copy A, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_noaccum_C_A_1_scalar ; - } - GB_NEXT (S) ; - } - } - else - { - ASSERT (i == iA) ; - { - // S (i,j) is not present, A (i,j) is present - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) and M(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - GB_LOOKUP_VECTOR_FOR_IXJ (M, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) = scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - - //-------------------------------------------------------------- - // Get the indices at the top of each list. - //-------------------------------------------------------------- - - int64_t iS = (pS < pS_end) ? GBI (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI (Mi, pM, Mvlen) : INT64_MAX ; - - //-------------------------------------------------------------- - // find the smallest index of [iS iA iM] (always iA) - //-------------------------------------------------------------- - - int64_t i = iA ; - - //-------------------------------------------------------------- - // get M(i,j) - //-------------------------------------------------------------- - - bool mij ; - if (i == iM) - { - // mij = (bool) M [pM] - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - GB_NEXT (M) ; - } - else - { - // mij not present, implicitly false - ASSERT (i < iM) ; - mij = false ; - } - - // complement the mask entry mij since Mask_comp is true - mij = !mij ; - - //-------------------------------------------------------------- - // assign the entry - //-------------------------------------------------------------- - - if (i == iS) - { - ASSERT (i == iA) ; - { - GB_NEXT (S) ; - } - } - else - { - ASSERT (i == iA) ; - { - // S (i,j) is not present, A (i,j) is present - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - } - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ true, + Mask_struct, + /* accum: */ NULL, + /* A: */ NULL, + scalar, scalar_type, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_13, "subassign_13", + Werk) ; + if (info != GrB_NO_VALUE) + { + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_13_template.c" } diff --git a/Source/assign/GB_subassign_15.c b/Source/assign/GB_subassign_15.c index fd371c030e..b2d17e7b37 100644 --- a/Source/assign/GB_subassign_15.c +++ b/Source/assign/GB_subassign_15.c @@ -2,16 +2,15 @@ // GB_subassign_15: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 15: C(I,J) += scalar ; using S // M: present +// Mask_struct: true or false // Mask_comp: true // C_replace: false // accum: present @@ -22,12 +21,14 @@ // M: not bitmap #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_15 ( GrB_Matrix C, // input: + #define C_replace false const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -39,10 +40,13 @@ GrB_Info GB_subassign_15 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp true const bool Mask_struct, const GrB_BinaryOp accum, + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -51,276 +55,51 @@ GrB_Info GB_subassign_15 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M + GB_UNJUMBLE (M) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - - GB_GET_C ; // C must not be bitmap - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - GB_GET_MASK ; - GB_GET_MASK_HYPER_HASH ; - GB_GET_S ; - GB_GET_ACCUM_SCALAR ; - - //-------------------------------------------------------------------------- - // Method 15: C(I,J) += scalar ; using S - //-------------------------------------------------------------------------- - - // Time: Close to optimal; must visit all IxJ, so Omega(|I|*|J|) is - // required. The sparsity of !M cannot be exploited. - - // Methods 13, 15, 17, and 19 are very similar. - - //-------------------------------------------------------------------------- - // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) - //-------------------------------------------------------------------------- - - GB_SUBASSIGN_IXJ_SLICE ; - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) and M(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - GB_LOOKUP_VECTOR_FOR_IXJ (M, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) += scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - - //-------------------------------------------------------------- - // Get the indices at the top of each list. - //-------------------------------------------------------------- - - int64_t iS = (pS < pS_end) ? GBI (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI (Mi, pM, Mvlen) : INT64_MAX ; - - //-------------------------------------------------------------- - // find the smallest index of [iS iA iM] (always iA) - //-------------------------------------------------------------- - - int64_t i = iA ; - - //-------------------------------------------------------------- - // get M(i,j) - //-------------------------------------------------------------- - - bool mij ; - if (i == iM) - { - // mij = (bool) M [pM] - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - GB_NEXT (M) ; - } - else - { - // mij not present, implicitly false - ASSERT (i < iM) ; - mij = false ; - } - - // complement the mask entry mij since Mask_comp is true - mij = !mij ; - - //-------------------------------------------------------------- - // accumulate the entry - //-------------------------------------------------------------- - - if (i == iS) - { - ASSERT (i == iA) ; - { - // both S (i,j) and A (i,j) present - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_C_S_LOOKUP ; - GB_withaccum_C_A_1_scalar ; - } - GB_NEXT (S) ; - } - } - else - { - ASSERT (i == iA) ; - { - // S (i,j) is not present, A (i,j) is present - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) and M(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - GB_LOOKUP_VECTOR_FOR_IXJ (M, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) += scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - - //-------------------------------------------------------------- - // Get the indices at the top of each list. - //-------------------------------------------------------------- - - int64_t iS = (pS < pS_end) ? GBI (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI (Mi, pM, Mvlen) : INT64_MAX ; - - //-------------------------------------------------------------- - // find the smallest index of [iS iA iM] (always iA) - //-------------------------------------------------------------- - - int64_t i = iA ; - - //-------------------------------------------------------------- - // get M(i,j) - //-------------------------------------------------------------- - - bool mij ; - if (i == iM) - { - // mij = (bool) M [pM] - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - GB_NEXT (M) ; - } - else - { - // mij not present, implicitly false - ASSERT (i < iM) ; - mij = false ; - } - - // complement the mask entry mij since Mask_comp is true - mij = !mij ; - - //-------------------------------------------------------------- - // accumulate the entry - //-------------------------------------------------------------- - - if (i == iS) - { - ASSERT (i == iA) ; - { - GB_NEXT (S) ; - } - } - else - { - ASSERT (i == iA) ; - { - // S (i,j) is not present, A (i,j) is present - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - } - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + info = GB_subassign_jit (C, + /* C_replace: */ false, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ true, + Mask_struct, + accum, + /* A: */ NULL, + scalar, scalar_type, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_15, "subassign_15", + Werk) ; + if (info != GrB_NO_VALUE) + { + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_15_template.c" } diff --git a/Source/assign/GB_subassign_17.c b/Source/assign/GB_subassign_17.c index ee5a11a18c..dcaff67794 100644 --- a/Source/assign/GB_subassign_17.c +++ b/Source/assign/GB_subassign_17.c @@ -2,16 +2,15 @@ // GB_subassign_17: C(I,J) = scalar ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 17: C(I,J) = scalar ; using S // M: present +// Mask_struct: true or false // Mask_comp: true // C_replace: true // accum: NULL @@ -22,12 +21,14 @@ // M: not bitmap #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_17 ( GrB_Matrix C, // input: + #define C_replace true const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -39,9 +40,13 @@ GrB_Info GB_subassign_17 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp true const bool Mask_struct, + #define accum NULL + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -50,284 +55,51 @@ GrB_Info GB_subassign_17 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M + GB_UNJUMBLE (M) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - - GB_GET_C ; // C must not be bitmap - const int64_t Cnvec = C->nvec ; - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - GB_GET_MASK ; - GB_GET_MASK_HYPER_HASH ; - GB_GET_SCALAR ; - GB_GET_S ; - GrB_BinaryOp accum = NULL ; - - //-------------------------------------------------------------------------- - // Method 17: C(I,J) = scalar ; using S - //-------------------------------------------------------------------------- - - // Time: Close to optimal; must visit all IxJ, so Omega(|I|*|J|) is - // required. The sparsity of !M cannot be exploited. - - // Methods 13, 15, 17, and 19 are very similar. - - //-------------------------------------------------------------------------- - // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) - //-------------------------------------------------------------------------- - - GB_SUBASSIGN_IXJ_SLICE ; - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) and M(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - GB_LOOKUP_VECTOR_FOR_IXJ (M, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) = scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - - //-------------------------------------------------------------- - // Get the indices at the top of each list. - //-------------------------------------------------------------- - - int64_t iS = (pS < pS_end) ? GBI (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI (Mi, pM, Mvlen) : INT64_MAX ; - - //-------------------------------------------------------------- - // find the smallest index of [iS iA iM] (always iA) - //-------------------------------------------------------------- - - int64_t i = iA ; - - //-------------------------------------------------------------- - // get M(i,j) - //-------------------------------------------------------------- - - bool mij ; - if (i == iM) - { - // mij = (bool) M [pM] - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - GB_NEXT (M) ; - } - else - { - // mij not present, implicitly false - ASSERT (i < iM) ; - mij = false ; - } - - // complement the mask entry mij since Mask_comp is true - mij = !mij ; - - //-------------------------------------------------------------- - // assign the entry - //-------------------------------------------------------------- - - if (i == iS) - { - ASSERT (i == iA) ; - { - // both S (i,j) and A (i,j) present - GB_C_S_LOOKUP ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =A ): copy A, no accum - // [X A 1]: action: ( undelete ): zombie lives - GB_noaccum_C_A_1_scalar ; - } - else - { - // ----[C A 0] or [X A 0]--------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): zombie - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - } - else - { - ASSERT (i == iA) ; - { - // S (i,j) is not present, A (i,j) is present - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) and M(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - GB_LOOKUP_VECTOR_FOR_IXJ (M, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) = scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - - //-------------------------------------------------------------- - // Get the indices at the top of each list. - //-------------------------------------------------------------- - - int64_t iS = (pS < pS_end) ? GBI (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI (Mi, pM, Mvlen) : INT64_MAX ; - - //-------------------------------------------------------------- - // find the smallest index of [iS iA iM] (always iA) - //-------------------------------------------------------------- - - int64_t i = iA ; - - //-------------------------------------------------------------- - // get M(i,j) - //-------------------------------------------------------------- - - bool mij ; - if (i == iM) - { - // mij = (bool) M [pM] - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - GB_NEXT (M) ; - } - else - { - // mij not present, implicitly false - ASSERT (i < iM) ; - mij = false ; - } - - // complement the mask entry mij since Mask_comp is true - mij = !mij ; - - //-------------------------------------------------------------- - // assign the entry - //-------------------------------------------------------------- - - if (i == iS) - { - ASSERT (i == iA) ; - { - GB_NEXT (S) ; - } - } - else - { - ASSERT (i == iA) ; - { - // S (i,j) is not present, A (i,j) is present - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - } - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + info = GB_subassign_jit (C, + /* C_replace: */ true, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ true, + Mask_struct, + /* accum: */ NULL, + /* A: */ NULL, + scalar, scalar_type, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_17, "subassign_17", + Werk) ; + if (info != GrB_NO_VALUE) + { + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_17_template.c" } diff --git a/Source/assign/GB_subassign_19.c b/Source/assign/GB_subassign_19.c index cd65347c6f..5dc4cda964 100644 --- a/Source/assign/GB_subassign_19.c +++ b/Source/assign/GB_subassign_19.c @@ -2,16 +2,15 @@ // GB_subassign_19: C(I,J) += scalar ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // Method 19: C(I,J) += scalar ; using S // M: present +// Mask_struct: true or false // Mask_comp: true // C_replace: true // accum: present @@ -22,12 +21,14 @@ // M: not bitmap #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +#include "jitifyer/GB_stringify.h" +#define GB_FREE_ALL GB_Matrix_free (&S) ; GrB_Info GB_subassign_19 ( GrB_Matrix C, // input: + #define C_replace true const GrB_Index *I, const int64_t ni, const int64_t nI, @@ -39,10 +40,13 @@ GrB_Info GB_subassign_19 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, + #define Mask_comp true const bool Mask_struct, const GrB_BinaryOp accum, + #define A NULL const void *scalar, const GrB_Type scalar_type, + #define assign_kind GB_SUBASSIGN GB_Werk Werk ) { @@ -51,283 +55,51 @@ GrB_Info GB_subassign_19 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M + GB_UNJUMBLE (M) ; //-------------------------------------------------------------------------- // S = C(I,J) //-------------------------------------------------------------------------- - GB_EMPTY_TASKLIST ; + struct GB_Matrix_opaque S_header ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, true, Werk)) ; //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GB_MATRIX_WAIT_IF_JUMBLED (M) ; - - GB_GET_C ; // C must not be bitmap - const int64_t *restrict Ch = C->h ; - const int64_t *restrict Cp = C->p ; - const bool C_is_hyper = (Ch != NULL) ; - const int64_t Cnvec = C->nvec ; - GB_GET_MASK ; - GB_GET_MASK_HYPER_HASH ; - GB_GET_S ; - GB_GET_ACCUM_SCALAR ; - - //-------------------------------------------------------------------------- - // Method 19: C(I,J) += scalar ; using S - //-------------------------------------------------------------------------- - - // Time: Close to optimal; must visit all IxJ, so Omega(|I|*|J|) is - // required. The sparsity of !M cannot be exploited. - - // Methods 13, 15, 17, and 19 are very similar. - - //-------------------------------------------------------------------------- - // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) - //-------------------------------------------------------------------------- - - GB_SUBASSIGN_IXJ_SLICE ; - - //-------------------------------------------------------------------------- - // phase 1: create zombies, update entries, and count pending tuples - //-------------------------------------------------------------------------- - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(+:nzombies) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) and M(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - GB_LOOKUP_VECTOR_FOR_IXJ (M, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) += scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - - //-------------------------------------------------------------- - // Get the indices at the top of each list. - //-------------------------------------------------------------- - - int64_t iS = (pS < pS_end) ? GBI (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI (Mi, pM, Mvlen) : INT64_MAX ; - - //-------------------------------------------------------------- - // find the smallest index of [iS iA iM] (always iA) - //-------------------------------------------------------------- - - int64_t i = iA ; - - //-------------------------------------------------------------- - // get M(i,j) - //-------------------------------------------------------------- - - bool mij ; - if (i == iM) - { - // mij = (bool) M [pM] - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - GB_NEXT (M) ; - } - else - { - // mij not present, implicitly false - ASSERT (i < iM) ; - mij = false ; - } - - // complement the mask entry mij since Mask_comp is true - mij = !mij ; - - //-------------------------------------------------------------- - // accumulate the entry - //-------------------------------------------------------------- - - if (i == iS) - { - ASSERT (i == iA) ; - { - // both S (i,j) and A (i,j) present - GB_C_S_LOOKUP ; - if (mij) - { - // ----[C A 1] or [X A 1]--------------------------- - // [C A 1]: action: ( =C+A ): apply accum - // [X A 1]: action: ( undelete ): zombie lives - GB_withaccum_C_A_1_scalar ; - } - else - { - // ----[C A 0] or [X A 0]--------------------------- - // [X A 0]: action: ( X ): still a zombie - // [C A 0]: C_repl: action: ( delete ): zombie - GB_DELETE_ENTRY ; - } - GB_NEXT (S) ; - } - } - else - { - ASSERT (i == iA) ; - { - // S (i,j) is not present, A (i,j) is present - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - task_pending++ ; - } - } - } - } - } - - GB_PHASE1_TASK_WRAPUP ; - } - - //-------------------------------------------------------------------------- - // phase 2: insert pending tuples - //-------------------------------------------------------------------------- - - GB_PENDING_CUMSUM ; - - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ - reduction(&&:pending_sorted) - for (taskid = 0 ; taskid < ntasks ; taskid++) - { - - //---------------------------------------------------------------------- - // get the task descriptor - //---------------------------------------------------------------------- - - GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; - - //---------------------------------------------------------------------- - // compute all vectors in this task - //---------------------------------------------------------------------- - - for (int64_t j = kfirst ; j <= klast ; j++) - { - - //------------------------------------------------------------------ - // get jC, the corresponding vector of C - //------------------------------------------------------------------ - - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; - - //------------------------------------------------------------------ - // get S(iA_start:end,j) and M(iA_start:end,j) - //------------------------------------------------------------------ - - GB_LOOKUP_VECTOR_FOR_IXJ (S, iA_start) ; - GB_LOOKUP_VECTOR_FOR_IXJ (M, iA_start) ; - - //------------------------------------------------------------------ - // C(I(iA_start,iA_end-1),jC) += scalar - //------------------------------------------------------------------ - - for (int64_t iA = iA_start ; iA < iA_end ; iA++) - { - - //-------------------------------------------------------------- - // Get the indices at the top of each list. - //-------------------------------------------------------------- - - int64_t iS = (pS < pS_end) ? GBI (Si, pS, Svlen) : INT64_MAX ; - int64_t iM = (pM < pM_end) ? GBI (Mi, pM, Mvlen) : INT64_MAX ; - - //-------------------------------------------------------------- - // find the smallest index of [iS iA iM] (always iA) - //-------------------------------------------------------------- - - int64_t i = iA ; - - //-------------------------------------------------------------- - // get M(i,j) - //-------------------------------------------------------------- - - bool mij ; - if (i == iM) - { - // mij = (bool) M [pM] - mij = GBB (Mb, pM) && GB_MCAST (Mx, pM, msize) ; - GB_NEXT (M) ; - } - else - { - // mij not present, implicitly false - ASSERT (i < iM) ; - mij = false ; - } - - // complement the mask entry mij since Mask_comp is true - mij = !mij ; - - //-------------------------------------------------------------- - // accumulate the entry - //-------------------------------------------------------------- - - if (i == iS) - { - ASSERT (i == iA) ; - { - GB_NEXT (S) ; - } - } - else - { - ASSERT (i == iA) ; - { - // S (i,j) is not present, A (i,j) is present - if (mij) - { - // ----[. A 1]-------------------------------------- - // [. A 1]: action: ( insert ) - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; - GB_PENDING_INSERT (scalar) ; - } - } - } - } - } - - GB_PHASE2_TASK_WRAPUP ; + // via the JIT or PreJIT kernel + //-------------------------------------------------------------------------- + + info = GB_subassign_jit (C, + /* C_replace: */ true, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, + /* Mask_comp: */ true, + Mask_struct, + accum, + /* A: */ NULL, + scalar, scalar_type, + S, + GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_19, "subassign_19", + Werk) ; + if (info != GrB_NO_VALUE) + { + GB_FREE_ALL ; + return (info) ; } //-------------------------------------------------------------------------- - // finalize the matrix and return result + // via the generic kernel //-------------------------------------------------------------------------- - GB_SUBASSIGN_WRAPUP ; + GBURBLE ("(generic assign) ") ; + #define GB_GENERIC + #define GB_SCALAR_ASSIGN 1 + #include "assign/include/GB_assign_shared_definitions.h" + #include "assign/template/GB_subassign_19_template.c" } diff --git a/Source/assign/GB_subassign_22.c b/Source/assign/GB_subassign_22.c index 130d4337ea..67c6633559 100644 --- a/Source/assign/GB_subassign_22.c +++ b/Source/assign/GB_subassign_22.c @@ -2,13 +2,11 @@ // GB_subassign_22: C += scalar where C is full //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: done. - // Method 22: C += scalar, where C is full // M: NULL @@ -22,13 +20,16 @@ // C += scalar where C is full #include "assign/GB_subassign_dense.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "binaryop/GB_binop.h" #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_aop__include.h" #endif +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 1 +#include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL #define GB_FREE_ALL ; @@ -37,7 +38,7 @@ GrB_Info GB_subassign_22 // C += scalar where C is full ( GrB_Matrix C, // input/output matrix const void *scalar, // input scalar - const GrB_Type scalar_type, // type of the input scalar + const GrB_Type scalar_type, // type of the input scalar const GrB_BinaryOp accum, // operator to apply GB_Werk Werk ) @@ -48,6 +49,7 @@ GrB_Info GB_subassign_22 // C += scalar where C is full //-------------------------------------------------------------------------- GrB_Info info ; + GrB_Matrix S = NULL ; // not constructed ASSERT_MATRIX_OK (C, "C for C+=scalar", GB0) ; ASSERT (GB_IS_FULL (C)) ; ASSERT (!GB_PENDING (C)) ; @@ -59,6 +61,9 @@ GrB_Info GB_subassign_22 // C += scalar where C is full ASSERT_BINARYOP_OK (accum, "accum for C+=scalar", GB0) ; ASSERT (!GB_OP_IS_POSITIONAL (accum)) ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + //-------------------------------------------------------------------------- // get the operator //-------------------------------------------------------------------------- @@ -95,9 +100,6 @@ GrB_Info GB_subassign_22 // C += scalar where C is full // via the factory kernel //-------------------------------------------------------------------------- - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - info = GrB_NO_VALUE ; #ifndef GBCOMPACT @@ -153,6 +155,7 @@ GrB_Info GB_subassign_22 // C += scalar where C is full /* accum: */ accum, /* A: */ NULL, /* scalar, scalar_type: */ ywork, accum->ytype, + /* S: */ NULL, GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_22, "subassign_22", Werk) ; } @@ -170,7 +173,7 @@ GrB_Info GB_subassign_22 // C += scalar where C is full // C(i,j) = C(i,j) + y #undef GB_ACCUMULATE_scalar - #define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ + #define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ faccum (Cx +((pC)*csize), Cx +((pC)*csize), ywork) #include "assign/template/GB_subassign_22_template.c" diff --git a/Source/assign/GB_subassign_23.c b/Source/assign/GB_subassign_23.c index c4745a07a8..5f9af04419 100644 --- a/Source/assign/GB_subassign_23.c +++ b/Source/assign/GB_subassign_23.c @@ -2,13 +2,11 @@ // GB_subassign_23: C += A where C is full and A is any matrix //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: done. - // Method 23: C += A, where C is full // M: NULL @@ -27,13 +25,16 @@ // C and A can have any sparsity structure, but C must be as-if-full. #include "assign/GB_subassign_dense.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_aop__include.h" #endif #include "include/GB_unused.h" +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 0 +#include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL #define GB_FREE_ALL ; @@ -51,13 +52,10 @@ GrB_Info GB_subassign_23 // C += A; C is full // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; // not constructed ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Info info ; ASSERT_MATRIX_OK (C, "C for C+=A", GB0) ; ASSERT (!GB_PENDING (C)) ; ASSERT (!GB_JUMBLED (C)) ; @@ -78,6 +76,9 @@ GrB_Info GB_subassign_23 // C += A; C is full // get the operator //-------------------------------------------------------------------------- + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + if (accum->opcode == GB_FIRST_binop_code || C->iso) { // nothing to do @@ -95,9 +96,6 @@ GrB_Info GB_subassign_23 // C += A; C is full // via the factory kernel //-------------------------------------------------------------------------- - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - info = GrB_NO_VALUE ; #ifndef GBCOMPACT @@ -151,6 +149,7 @@ GrB_Info GB_subassign_23 // C += A; C is full /* accum: */ accum, /* A: */ A, /* scalar, scalar_type: */ NULL, NULL, + /* S: */ NULL, GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_23, "subassign_23", Werk) ; } @@ -184,7 +183,7 @@ GrB_Info GB_subassign_23 // C += A; C is full #define C_iso false #undef GB_ACCUMULATE_aij - #define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ + #define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ { \ /* Cx [pC] += (ytype) Ax [A_iso ? 0 : pA] */ \ if (A_iso) \ diff --git a/Source/assign/GB_subassign_24.c b/Source/assign/GB_subassign_24.c index a860a7e057..1b6c8b0eae 100644 --- a/Source/assign/GB_subassign_24.c +++ b/Source/assign/GB_subassign_24.c @@ -2,7 +2,7 @@ // GB_subassign_24: make a deep copy of a sparse or dense matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -36,14 +36,10 @@ GrB_Info GB_subassign_24 // C = A, copy A into an existing matrix C // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A ASSERT (!GB_is_shallow (C)) ; - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GrB_Info info ; ASSERT_MATRIX_OK (C, "C for GB_subassign_24", GB0) ; ASSERT (GB_ZOMBIES_OK (C)) ; ASSERT (GB_JUMBLED_OK (C)) ; @@ -58,7 +54,11 @@ GrB_Info GB_subassign_24 // C = A, copy A into an existing matrix C // delete any lingering zombies and assemble any pending tuples //-------------------------------------------------------------------------- + // A may remain jumbled GB_MATRIX_WAIT_IF_PENDING_OR_ZOMBIES (A) ; + ASSERT (!GB_ZOMBIES (A)) ; + ASSERT (GB_JUMBLED_OK (A)) ; + ASSERT (!GB_PENDING (A)) ; C->jumbled = false ; // prior contents of C are discarded const bool C_iso = A->iso ; // C is iso if A is iso diff --git a/Source/assign/GB_subassign_25.c b/Source/assign/GB_subassign_25.c index 1bc03e2fbc..13b5e737a5 100644 --- a/Source/assign/GB_subassign_25.c +++ b/Source/assign/GB_subassign_25.c @@ -2,13 +2,11 @@ // GB_subassign_25: C(:,:) = A; C empty, A full, M structural //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: done. - // Method 25: C(:,:) = A ; C is empty, M structural, A bitmap/as-if-full // M: present @@ -28,12 +26,15 @@ // C is iso if A is iso #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "assign/GB_subassign_dense.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_as__include.h" #endif +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 0 +#include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL #define GB_FREE_ALL ; @@ -52,15 +53,11 @@ GrB_Info GB_subassign_25 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; ASSERT (!GB_IS_BITMAP (M)) ; ASSERT (!GB_IS_FULL (M)) ; ASSERT (!GB_any_aliased (C, M)) ; // NO ALIAS of C==M ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A - //-------------------------------------------------------------------------- - // get inputs - //-------------------------------------------------------------------------- - - GrB_Info info ; ASSERT_MATRIX_OK (C, "C for subassign method_25", GB0) ; ASSERT (GB_nnz (C) == 0) ; ASSERT (!GB_ZOMBIES (C)) ; @@ -75,6 +72,13 @@ GrB_Info GB_subassign_25 ASSERT_MATRIX_OK (A, "A for subassign method_25", GB0) ; ASSERT (GB_IS_FULL (A) || GB_IS_BITMAP (A)) ; + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + const GB_Type_code ccode = C->type->code ; const GB_Type_code acode = A->type->code ; const size_t asize = A->type->size ; @@ -105,9 +109,6 @@ GrB_Info GB_subassign_25 // C = A for built-in types //-------------------------------------------------------------------------- - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - info = GrB_NO_VALUE ; if (C_iso) @@ -149,27 +150,10 @@ GrB_Info GB_subassign_25 // launch the switch factory //------------------------------------------------------------------ - // if (C->type == A->type && ccode < GB_UDT_code) - { + { // C = A - switch (ccode) - { - case GB_BOOL_code : GB_WORKER (_bool ) - case GB_INT8_code : GB_WORKER (_int8 ) - case GB_INT16_code : GB_WORKER (_int16 ) - case GB_INT32_code : GB_WORKER (_int32 ) - case GB_INT64_code : GB_WORKER (_int64 ) - case GB_UINT8_code : GB_WORKER (_uint8 ) - case GB_UINT16_code : GB_WORKER (_uint16) - case GB_UINT32_code : GB_WORKER (_uint32) - case GB_UINT64_code : GB_WORKER (_uint64) - case GB_FP32_code : GB_WORKER (_fp32 ) - case GB_FP64_code : GB_WORKER (_fp64 ) - case GB_FC32_code : GB_WORKER (_fc32 ) - case GB_FC64_code : GB_WORKER (_fc64 ) - default: ; - } + #include "assign/factory/GB_assign_factory.c" } } #endif @@ -190,6 +174,7 @@ GrB_Info GB_subassign_25 /* accum: */ NULL, /* A: */ A, /* scalar, scalar_type: */ NULL, NULL, + /* S: */ NULL, GB_SUBASSIGN, GB_JIT_KERNEL_SUBASSIGN_25, "subassign_25", Werk) ; } @@ -207,7 +192,7 @@ GrB_Info GB_subassign_25 const size_t csize = C->type->size ; GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; - #define C_iso false + // #define C_iso false #include "assign/template/GB_subassign_25_template.c" info = GrB_SUCCESS ; } diff --git a/Source/assign/GB_subassign_26.c b/Source/assign/GB_subassign_26.c index ccb0af221c..42c9fd5676 100644 --- a/Source/assign/GB_subassign_26.c +++ b/Source/assign/GB_subassign_26.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: needed. - // Method 26: C(:,j1:j2) = A ; append columns, no S // M: NULL @@ -22,7 +20,10 @@ // A: sparse #include "assign/GB_subassign_methods.h" +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 0 #include "assign/include/GB_assign_shared_definitions.h" + #undef GB_FREE_ALL #define GB_FREE_ALL ; #define GB_MEM_CHUNK (1024*1024) @@ -41,6 +42,7 @@ GrB_Info GB_subassign_26 // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; ASSERT (GB_IS_HYPERSPARSE (C)) ; ASSERT (GB_IS_SPARSE (A)) ; ASSERT (!GB_any_aliased (C, A)) ; // NO ALIAS of C==A @@ -54,9 +56,8 @@ GrB_Info GB_subassign_26 // get inputs //-------------------------------------------------------------------------- - GrB_Info info ; const size_t csize = C->type->size ; - int64_t cnvec = C->nvec ; + int64_t Cnvec = C->nvec ; int64_t cnz = C->nvals ; int64_t *restrict Ap = A->p ; @@ -82,7 +83,7 @@ GrB_Info GB_subassign_26 int64_t cnz_new = cnz + anz ; - if (cnvec + nJ > C->plen) + if (Cnvec + nJ > C->plen) { // double the size of C->h and C->p if needed int64_t plen_new = GB_IMIN (C->vdim, 2*(C->plen + nJ)) ; @@ -104,7 +105,7 @@ GrB_Info GB_subassign_26 // determine any parallelism to use //-------------------------------------------------------------------------- - ASSERT (cnvec == 0 || Ch [cnvec-1] == j1-1) ; + ASSERT (Cnvec == 0 || Ch [Cnvec-1] == j1-1) ; bool phase1_parallel = (nJ > GB_CHUNK_DEFAULT) ; bool phase2_parallel = (anz * (sizeof (int64_t) + csize) > GB_MEM_CHUNK) ; @@ -121,15 +122,15 @@ GrB_Info GB_subassign_26 // phase1: compute Cp, Ch, # of new nonempty vectors, and matrix properties //-------------------------------------------------------------------------- - int64_t anvec_nonempty = 0 ; + int64_t Anvec_nonempty = 0 ; #define COMPUTE_CP_AND_CH \ for (k = 0 ; k < nJ ; k++) \ { \ int64_t apk = Ap [k] ; \ int64_t anzk = Ap [k+1] - apk ; \ - Ch [cnvec + k] = j1 + k ; \ - Cp [cnvec + k] = cnz + apk ; \ - anvec_nonempty += (anzk > 0) ; \ + Ch [Cnvec + k] = j1 + k ; \ + Cp [Cnvec + k] = cnz + apk ; \ + Anvec_nonempty += (anzk > 0) ; \ } int nthreads = (phase1_parallel) ? @@ -139,7 +140,7 @@ GrB_Info GB_subassign_26 { // compute Cp and Ch in parallel #pragma omp parallel for num_threads(nthreads) schedule(static) \ - reduction(+:anvec_nonempty) + reduction(+:Anvec_nonempty) COMPUTE_CP_AND_CH ; } else @@ -150,7 +151,7 @@ GrB_Info GB_subassign_26 if (C->nvec_nonempty >= 0) { - C->nvec_nonempty += anvec_nonempty ; + C->nvec_nonempty += Anvec_nonempty ; } C->nvec += nJ ; Cp [C->nvec] = cnz_new ; diff --git a/Source/assign/GB_subassign_IxJ_slice.c b/Source/assign/GB_subassign_IxJ_slice.c index a73dad4cb9..20ed7a7b0c 100644 --- a/Source/assign/GB_subassign_IxJ_slice.c +++ b/Source/assign/GB_subassign_IxJ_slice.c @@ -2,11 +2,13 @@ // GB_subassign_IxJ_slice: slice IxJ for subassign //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ +// Slice IxJ for a scalar assignment method and for bitmap assignments. + // Construct a set of tasks to compute C(I,J)<...> = x or += x, for a subassign // method that performs scalar assignment, based on slicing the Cartesian // product IxJ. If enough tasks can be constructed by just slicing J, then all @@ -17,9 +19,6 @@ // fine. Each fine task computes a slice of C(I(iA_start:iA_end-1), jC) for a // single index jC = J(kfirst). -// This method is used by methods 01, 03, 13, 15, 17, 19, which are the 6 -// scalar assignment methods that must iterate over all IxJ. - // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== @@ -55,24 +54,7 @@ // GB_subassign_IxJ_slice //------------------------------------------------------------------------------ -GrB_Info GB_subassign_IxJ_slice -( - // output: - GB_task_struct **p_TaskList, // array of structs - size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads to use - // input: -// const GrB_Index *I, - const int64_t nI, -// const int Ikind, -// const int64_t Icolon [3], -// const GrB_Index *J, - const int64_t nJ, -// const int Jkind, -// const int64_t Jcolon [3], - GB_Werk Werk -) +GB_CALLBACK_SUBASSIGN_IXJ_SLICE_PROTO (GB_subassign_IxJ_slice) { //-------------------------------------------------------------------------- diff --git a/Source/assign/GB_subassign_IxJ_slice.h b/Source/assign/GB_subassign_IxJ_slice.h deleted file mode 100644 index 90e485be95..0000000000 --- a/Source/assign/GB_subassign_IxJ_slice.h +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_subassign_IxJ_slice.h: definitions for GB_subassign_IxJ_slice -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#ifndef GB_SUBASSIGN_IXJ_SLICE_H -#define GB_SUBASSIGN_IXJ_SLICE_H - -//------------------------------------------------------------------------------ -// GB_subassign_IxJ_slice -//------------------------------------------------------------------------------ - -// Slice IxJ for a scalar assignment method (Methods 01, 03, 13, 15, 17, 19), -// and for bitmap assignments (in GB_bitmap_assign_IxJ_template). - -GrB_Info GB_subassign_IxJ_slice -( - // output: - GB_task_struct **p_TaskList, // array of structs - size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads to use - // input: -// const GrB_Index *I, - const int64_t nI, -// const int Ikind, -// const int64_t Icolon [3], -// const GrB_Index *J, - const int64_t nJ, -// const int Jkind, -// const int64_t Jcolon [3], - GB_Werk Werk -) ; - -#endif - diff --git a/Source/assign/GB_subassign_dense.h b/Source/assign/GB_subassign_dense.h index 3486361708..b16bb2c6ea 100644 --- a/Source/assign/GB_subassign_dense.h +++ b/Source/assign/GB_subassign_dense.h @@ -2,7 +2,7 @@ // GB_subassign_dense.h: definitions for dense subassign methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GB_subassign_methods.h b/Source/assign/GB_subassign_methods.h index 10373961c8..0aebca90bb 100644 --- a/Source/assign/GB_subassign_methods.h +++ b/Source/assign/GB_subassign_methods.h @@ -10,26 +10,25 @@ #ifndef GB_SUBASSIGN_METHODS_H #define GB_SUBASSIGN_METHODS_H -#include "ewise/GB_add.h" +#include "add/GB_add.h" #include "ij/GB_ij.h" #include "pending/GB_Pending.h" -#include "assign/GB_subassign_IxJ_slice.h" #include "include/GB_unused.h" //------------------------------------------------------------------------------ // GB_subassign_symbolic: S = C(I,J) //------------------------------------------------------------------------------ -GrB_Info GB_subassign_symbolic // S = C(I,J), extracting the pattern not values +GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values ( // output - GrB_Matrix S, // output matrix, static header + GrB_Matrix S, // S = symbolic(C(I,J)), static header // inputs, not modified: - const GrB_Matrix C, // matrix to extract the pattern of - const GrB_Index *I, // index list for S = C(I,J), or GrB_ALL, etc. - const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for S = C(I,J), or GrB_ALL, etc. - const int64_t nj, // length of J, or special + const GrB_Matrix C, // matrix to extract the pattern of + const GrB_Index *I, // index list for S = C(I,J), or GrB_ALL, etc + const int64_t ni, // length of I, or special + const GrB_Index *J, // index list for S = C(I,J), or GrB_ALL, etc + const int64_t nj, // length of J, or special const bool S_must_not_be_jumbled, // if true, S cannot be jumbled GB_Werk Werk ) ; @@ -156,10 +155,12 @@ GrB_Info GB_subassign_05 GrB_Matrix C, // input: const GrB_Index *I, + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -193,10 +194,12 @@ GrB_Info GB_subassign_06n GrB_Matrix C, // input: const GrB_Index *I, + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -225,8 +228,8 @@ GrB_Info GB_subassign_06s_and_14 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_struct, // if true, use the only structure of M - const bool Mask_comp, // if true, !M, else use M + const bool Mask_comp, + const bool Mask_struct, const GrB_Matrix A, GB_Werk Werk ) ; @@ -240,10 +243,12 @@ GrB_Info GB_subassign_07 GrB_Matrix C, // input: const GrB_Index *I, + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -264,10 +269,12 @@ GrB_Info GB_subassign_08n GrB_Matrix C, // input: const GrB_Index *I, + const int64_t ni, const int64_t nI, const int Ikind, const int64_t Icolon [3], const GrB_Index *J, + const int64_t nj, const int64_t nJ, const int Jkind, const int64_t Jcolon [3], @@ -322,8 +329,8 @@ GrB_Info GB_subassign_10_and_18 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_struct, // if true, use the only structure of M - const bool Mask_comp, // if true, !M, else use M + const bool Mask_comp, + const bool Mask_struct, const GrB_Matrix A, GB_Werk Werk ) ; @@ -373,8 +380,8 @@ GrB_Info GB_subassign_12_and_20 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_struct, // if true, use the only structure of M - const bool Mask_comp, // if true, !M, else use M + const bool Mask_comp, + const bool Mask_struct, const GrB_BinaryOp accum, const GrB_Matrix A, GB_Werk Werk @@ -451,8 +458,8 @@ GrB_Info GB_subassign_08s_and_16 const int Jkind, const int64_t Jcolon [3], const GrB_Matrix M, - const bool Mask_struct, // if true, use the only structure of M - const bool Mask_comp, // if true, !M, else use M + const bool Mask_comp, + const bool Mask_struct, const GrB_BinaryOp accum, const GrB_Matrix A, GB_Werk Werk @@ -509,33 +516,6 @@ GrB_Info GB_subassign_19 GB_Werk Werk ) ; -//------------------------------------------------------------------------------ -// GB_subassign_one_slice -//------------------------------------------------------------------------------ - -// Slice A or M into fine/coarse tasks, for GB_subassign_05, 06n, and 07 - -GrB_Info GB_subassign_one_slice -( - // output: - GB_task_struct **p_TaskList, // array of structs - size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads to use - // input: - const GrB_Matrix C, // output matrix C - const GrB_Index *I, - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix A, // matrix to slice (M or A) - GB_Werk Werk -) ; - //------------------------------------------------------------------------------ // GB_subassign_08n_slice: slice the entries and vectors for GB_subassign_08n //------------------------------------------------------------------------------ diff --git a/Source/assign/GB_subassign_one_slice.c b/Source/assign/GB_subassign_one_slice.c index 8bc90a23b0..28985d0bab 100644 --- a/Source/assign/GB_subassign_one_slice.c +++ b/Source/assign/GB_subassign_one_slice.c @@ -2,7 +2,7 @@ // GB_subassign_one_slice: slice the entries and vectors for subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -26,6 +26,7 @@ // C: not bitmap #include "assign/GB_subassign_methods.h" +#define GB_GENERIC #include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_WORKSPACE @@ -45,26 +46,7 @@ // GB_subassign_one_slice //------------------------------------------------------------------------------ -GrB_Info GB_subassign_one_slice -( - // output: - GB_task_struct **p_TaskList, // array of structs - size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads to use - // input: - const GrB_Matrix C, // output matrix C - const GrB_Index *I, - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix M, // matrix to slice - GB_Werk Werk -) +GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) { //-------------------------------------------------------------------------- @@ -103,8 +85,8 @@ GrB_Info GB_subassign_one_slice // const int8_t *restrict Mb = M->b ; const int64_t *restrict Mi = M->i ; const int64_t mnz = GB_nnz_held (M) ; - const int64_t mnvec = M->nvec ; - const int64_t mvlen = M->vlen ; + const int64_t Mnvec = M->nvec ; + const int64_t Mvlen = M->vlen ; const int64_t *restrict Cp = C->p ; const int64_t *restrict Ch = C->h ; @@ -127,20 +109,21 @@ GrB_Info GB_subassign_one_slice int ntasks0 = (nthreads == 1) ? 1 : (32 * nthreads) ; GB_REALLOC_TASK_WORK (TaskList, ntasks0, max_ntasks) ; + GB_OK (GB_hyper_hash_build (C, Werk)) ; GB_GET_C_HYPER_HASH ; //-------------------------------------------------------------------------- // check for quick return for a single task //-------------------------------------------------------------------------- - if (mnvec == 0 || ntasks0 == 1) + if (Mnvec == 0 || ntasks0 == 1) { // construct a single coarse task that does all the work TaskList [0].kfirst = 0 ; - TaskList [0].klast = mnvec-1 ; + TaskList [0].klast = Mnvec-1 ; (*p_TaskList ) = TaskList ; (*p_TaskList_size) = TaskList_size ; - (*p_ntasks ) = (mnvec == 0) ? 0 : 1 ; + (*p_ntasks ) = (Mnvec == 0) ? 0 : 1 ; (*p_nthreads ) = 1 ; return (GrB_SUCCESS) ; } @@ -166,7 +149,7 @@ GrB_Info GB_subassign_one_slice GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - GB_p_slice (Coarse, Mp, mnvec, ntasks1, false) ; + GB_p_slice (Coarse, Mp, Mnvec, ntasks1, false) ; //-------------------------------------------------------------------------- // construct all tasks, both coarse and fine @@ -182,7 +165,7 @@ GrB_Info GB_subassign_one_slice int64_t k = Coarse [t] ; int64_t klast = Coarse [t+1] - 1 ; - if (k >= mnvec) + if (k >= Mnvec) { //------------------------------------------------------------------ @@ -238,10 +221,15 @@ GrB_Info GB_subassign_one_slice // get the vector of C //------------------------------------------------------------------ - ASSERT (k >= 0 && k < mnvec) ; - int64_t j = GBH (Mh, k) ; + ASSERT (k >= 0 && k < Mnvec) ; + int64_t j = GBH_M (Mh, k) ; ASSERT (j >= 0 && j < nJ) ; - GB_LOOKUP_VECTOR_jC (false, 0) ; + + // lookup jC in C + // jC = J [j] ; or J is ":" or jbegin:jend or jbegin:jinc:jend + int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; + int64_t pC_start, pC_end ; + GB_LOOKUP_VECTOR_C (jC, pC_start, pC_end) ; bool jC_dense = (pC_end - pC_start == Cvlen) ; @@ -249,7 +237,7 @@ GrB_Info GB_subassign_one_slice // determine the # of fine-grain tasks to create for vector k //------------------------------------------------------------------ - int64_t mknz = (Mp == NULL) ? mvlen : (Mp [k+1] - Mp [k]) ; + int64_t mknz = (Mp == NULL) ? Mvlen : (Mp [k+1] - Mp [k]) ; int nfine = ((double) mknz) / target_task_size ; nfine = GB_IMAX (nfine, 1) ; @@ -291,7 +279,7 @@ GrB_Info GB_subassign_one_slice // slice M(:,k) for this task int64_t p1, p2 ; GB_PARTITION (p1, p2, mknz, tfine, nfine) ; - int64_t pM_start = GBP (Mp, k, mvlen) ; + int64_t pM_start = GBP_M (Mp, k, Mvlen) ; int64_t pM = pM_start + p1 ; int64_t pM_end = pM_start + p2 ; TaskList [ntasks].pA = pM ; @@ -306,9 +294,9 @@ GrB_Info GB_subassign_one_slice else { // find where this task starts and ends in C(:,jC) - int64_t iM_start = GBI (Mi, pM, mvlen) ; + int64_t iM_start = GBI_M (Mi, pM, Mvlen) ; int64_t iC1 = GB_ijlist (I, iM_start, Ikind, Icolon) ; - int64_t iM_end = GBI (Mi, pM_end-1, mvlen) ; + int64_t iM_end = GBI_M (Mi, pM_end-1, Mvlen) ; int64_t iC2 = GB_ijlist (I, iM_end, Ikind, Icolon) ; // If I is an explicit list, it must be already sorted diff --git a/Source/assign/GB_subassign_scalar.c b/Source/assign/GB_subassign_scalar.c index 9822374edb..781db9035c 100644 --- a/Source/assign/GB_subassign_scalar.c +++ b/Source/assign/GB_subassign_scalar.c @@ -2,7 +2,7 @@ // GB_subassign_scalar: C(Rows,Cols) = accum (C(Rows,Cols),x) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GB_subassign_symbolic.c b/Source/assign/GB_subassign_symbolic.c index 78945e0d5d..4483c1a7a8 100644 --- a/Source/assign/GB_subassign_symbolic.c +++ b/Source/assign/GB_subassign_symbolic.c @@ -2,29 +2,30 @@ // GB_subassign_symbolic: S = C(I,J) //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ #include "assign/GB_subassign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" #include "extract/GB_subref.h" +#define GB_GENERIC +#include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL #define GB_FREE_ALL GB_phybix_free (S) ; -GrB_Info GB_subassign_symbolic +GrB_Info GB_subassign_symbolic // S = C(I,J), extracting pattern not values ( // output - GrB_Matrix S, // S = symbolic(C(I,J)), static header + GrB_Matrix S, // S = symbolic(C(I,J)), static header // inputs, not modified: - const GrB_Matrix C, // matrix to extract the pattern of - const GrB_Index *I, // index list for S = C(I,J), or GrB_ALL, etc. - const int64_t ni, // length of I, or special - const GrB_Index *J, // index list for S = C(I,J), or GrB_ALL, etc. - const int64_t nj, // length of J, or special - const bool S_must_not_be_jumbled, + const GrB_Matrix C, // matrix to extract the pattern of + const GrB_Index *I, // index list for S = C(I,J), or GrB_ALL, etc + const int64_t ni, // length of I, or special + const GrB_Index *J, // index list for S = C(I,J), or GrB_ALL, etc + const int64_t nj, // length of J, or special + const bool S_must_not_be_jumbled, // if true, S cannot be jumbled GB_Werk Werk ) { @@ -41,7 +42,7 @@ GrB_Info GB_subassign_symbolic // extract the pattern: S = C(I,J) for S_Extraction method, and quick mask //-------------------------------------------------------------------------- - // S is a sparse int64_t matrix. Its "values" are not numerical, but + // S is a matrix with int64_t type. Its "values" are not numerical, but // indices into C. For example, suppose 100 = I [5] and 200 = J [7]. Then // S(5,7) is the entry C(I(5),J(7)), and the value of S(5,7) is the // position in C that holds that particular entry C(100,200): @@ -64,9 +65,12 @@ GrB_Info GB_subassign_symbolic // S and C have the same CSR/CSC format. S can be jumbled. It is in // in the same hypersparse form as C (unless S is empty, in which case // it is always returned as hypersparse). This also checks I and J. - // S is not iso, even if C is iso. + // S is not iso, even if C is iso. S can be sparse, hypersparse, or full + // (not bitmap). GB_OK (GB_subref (S, false, C->is_csc, C, I, ni, J, nj, true, Werk)) ; - ASSERT (GB_JUMBLED_OK (S)) ; // GB_subref can return S as unsorted + ASSERT (GB_JUMBLED_OK (S)) ; // GB_subref can return S as jumbled + ASSERT (!GB_ZOMBIES (S)) ; + ASSERT (!GB_PENDING (S)) ; //-------------------------------------------------------------------------- // sort S and compute S->Y if requested @@ -74,7 +78,7 @@ GrB_Info GB_subassign_symbolic if (S_must_not_be_jumbled) { - GB_MATRIX_WAIT_IF_JUMBLED (S) ; // but the caller requires S sorted + GB_MATRIX_WAIT (S) ; // but the caller requires S unjumbled ASSERT (!GB_JUMBLED (S)) ; GB_OK (GB_hyper_hash_build (S, Werk)) ; // construct S->Y } @@ -110,16 +114,16 @@ GrB_Info GB_subassign_symbolic for (int64_t k = 0 ; k < S->nvec ; k++) { // prepare to iterate over the entries of vector S(:,jnew) - int64_t jnew = GBH (Sh, k) ; - int64_t pS_start = GBP (Sp, k, S->vlen) ; - int64_t pS_end = GBP (Sp, k+1, S->vlen) ; + int64_t jnew = GBH_S (Sh, k) ; + int64_t pS_start = GBP_S (Sp, k, S->vlen) ; + int64_t pS_end = GBP_S (Sp, k+1, S->vlen) ; // S (inew,jnew) corresponds to C (iC, jC) ; // jC = J [j] ; or J is a colon expression int64_t jC = GB_ijlist (J, jnew, Jkind, Jcolon) ; for (int64_t pS = pS_start ; pS < pS_end ; pS++) { // S (inew,jnew) is a pointer back into C (I(inew), J(jnew)) - int64_t inew = GBI (Si, pS, S->vlen) ; + int64_t inew = GBI_S (Si, pS, S->vlen) ; ASSERT (inew >= 0 && inew < nI) ; // iC = I [iA] ; or I is a colon expression int64_t iC = GB_ijlist (I, inew, Ikind, Icolon) ; @@ -134,7 +138,7 @@ GrB_Info GB_subassign_symbolic // assigned to C(iC,jC), and p = S(inew,jnew) gives the pointer // into C to where the entry (C(iC,jC) appears in C: ASSERT (pC_start <= p && p < pC_end) ; - ASSERT (iC == GB_UNFLIP (GBI (C->i, p, C->vlen))) ; + ASSERT (iC == GB_UNZOMBIE (GBI_C (C->i, p, C->vlen))) ; } } #endif diff --git a/Source/assign/GB_subassign_zombie.c b/Source/assign/GB_subassign_zombie.c index 24d516da48..54317e952d 100644 --- a/Source/assign/GB_subassign_zombie.c +++ b/Source/assign/GB_subassign_zombie.c @@ -2,13 +2,11 @@ // GB_subassign_zombie: C(I,J) = empty ; using S //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Method 00: C(I,J) = empty ; using S // M: NULL @@ -23,11 +21,12 @@ // C->iso is not affected. #include "assign/GB_subassign_methods.h" +#define GB_GENERIC +#define GB_SCALAR_ASSIGN 0 #include "assign/include/GB_assign_shared_definitions.h" #undef GB_FREE_ALL #define GB_FREE_ALL GB_Matrix_free (&S) ; -#include "matrix/GB_static_header.h" GrB_Info GB_subassign_zombie ( @@ -51,15 +50,15 @@ GrB_Info GB_subassign_zombie // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; + GrB_Matrix S = NULL ; ASSERT (!GB_IS_BITMAP (C)) ; ASSERT (!GB_IS_FULL (C)) ; //-------------------------------------------------------------------------- // S = C(I,J), but do not construct the S->H hyper_hash //-------------------------------------------------------------------------- - GrB_Info info ; struct GB_Matrix_opaque S_header ; - GrB_Matrix S = NULL ; GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_subassign_symbolic (S, C, I, ni, J, nj, false, Werk)) ; ASSERT (GB_JUMBLED_OK (S)) ; // S can be returned as jumbled @@ -108,7 +107,7 @@ GrB_Info GB_subassign_zombie if (!GB_IS_ZOMBIE (i)) { nzombies++ ; - Ci [pC] = GB_FLIP (i) ; + Ci [pC] = GB_ZOMBIE (i) ; } } diff --git a/Source/assign/GB_subassigner.c b/Source/assign/GB_subassigner.c index 4ca37c3cb0..9563a6cbef 100644 --- a/Source/assign/GB_subassigner.c +++ b/Source/assign/GB_subassigner.c @@ -2,7 +2,7 @@ // GB_subassigner: C(I,J)<#M> = accum (C(I,J), A) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -98,23 +98,23 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GrB_Info info ; ASSERT_MATRIX_OK (C, "C input for subassigner", GB0) ; + ASSERT (!GB_PENDING (A)) ; + ASSERT (!GB_ZOMBIES (A)) ; //-------------------------------------------------------------------------- // methods that rely on C and A being dense assume they are not jumbled //-------------------------------------------------------------------------- - ASSERT (!GB_PENDING (A)) ; - ASSERT (!GB_ZOMBIES (A)) ; if (GB_is_dense (A)) { // methods that rely on A being dense assume A is not jumbled - GB_MATRIX_WAIT_IF_JUMBLED (A) ; + GB_UNJUMBLE (A) ; } if (GB_is_dense (C) && !GB_PENDING_OR_ZOMBIES (C) && !GB_IS_BITMAP (C)) { - // C is dense or full - GB_MATRIX_WAIT_IF_JUMBLED (C) ; + // C is dense or full (as-if): if sparse, make sure it's unjumbled + GB_UNJUMBLE (C) ; } GBURBLE ("(pending: " GBd ") ", GB_Pending_n (C)) ; @@ -196,8 +196,11 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) //---------------------------------------------------------------------- // These methods could all tolerate C==M and C==A aliasing, assuming no - // binary search or if the binary search of C==M or C==A can be done - // with atomics. These are all the methods used by GB_accum_mask. + // binary search or if the binary search of C==M can be done with + // atomics. These are all the methods used by GB_accum_mask. They + // could also skip constructing the S matrix (Sp == Cp, Sh == Ch, Si == + // Ci except for zombies and changing zombies, and an implied Sx [p] == + // p even with zombies present). // M - - - A ? 06x: C(:,:) = A // M - - + A ? 08x: C(:,:) += A @@ -209,8 +212,9 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) // M c r + A ? 20x: C(:,:) += A //---------------------------------------------------------------------- - // FUTURE::: C += x C == M, update all values, C_replace ignored - // FUTURE::: C = A C == M, A dense, C_replace ignored + // FUTURE::: C += x C==M, update all values, C_replace ignored + // FUTURE::: C = A C==M, A dense, C_replace ignored + // FUTURE::: C += A C==M, no zombies or pending tuples added //---------------------------------------------------------------------- // For the single case C(I,J)=A, two methods can be used: 06n and 06s. @@ -231,7 +235,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) // sparsity (if present). GBURBLE ("Method: bitmap_subassign ") ; GB_OK (GB_bitmap_assign (C, C_replace, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, Mask_comp, Mask_struct, accum, A, scalar, scalar_type, GB_SUBASSIGN, Werk)) ; } @@ -347,7 +351,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 05: C(%s,%s) = scalar ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_05 (C, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, Mask_struct, scalar, scalar_type, Werk)) ; } break ; @@ -358,7 +362,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) GBURBLE ("Method 07: C(%s,%s) += scalar ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_07 (C, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, scalar_type, Werk)) ; } break ; @@ -382,7 +386,8 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) // Method 08n: C(I,J) += A ; no S GBURBLE ("Method 08n: C(%s,%s) += Z ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_08n (C, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, M, Mask_struct, accum, A, Werk)) ; } break ; @@ -394,7 +399,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) Istring, Jstring) ; GB_OK (GB_subassign_08s_and_16 (C, I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, - M, Mask_struct, false, accum, A, Werk)) ; + M, false, Mask_struct, accum, A, Werk)) ; } break ; @@ -421,7 +426,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) // Method 06n: C(I,J) = A ; no S GBURBLE ("Method 06n: C(%s,%s) = Z ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_06n (C, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, M, Mask_struct, A, Werk)) ; } break ; @@ -433,7 +438,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) Istring, Jstring) ; GB_OK (GB_subassign_06s_and_14 (C, I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, - M, Mask_struct, false, A, Werk)) ; + M, false, Mask_struct, A, Werk)) ; } break ; @@ -605,7 +610,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) Istring, Jstring) ; GB_OK (GB_subassign_10_and_18 (C, I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, - M, Mask_struct, true, A, Werk)) ; + M, true, Mask_struct, A, Werk)) ; } break ; @@ -616,7 +621,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) Istring, Jstring) ; GB_OK (GB_subassign_06s_and_14 (C, I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, - M, Mask_struct, true, A, Werk)) ; + M, true, Mask_struct, A, Werk)) ; } break ; @@ -627,7 +632,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) Istring, Jstring) ; GB_OK (GB_subassign_10_and_18 (C, I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, - M, Mask_struct, false, A, Werk)) ; + M, false, Mask_struct, A, Werk)) ; } break ; @@ -638,7 +643,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) Istring, Jstring) ; GB_OK (GB_subassign_12_and_20 (C, I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, - M, Mask_struct, true, accum, A, Werk)) ; + M, true, Mask_struct, accum, A, Werk)) ; } break ; @@ -649,7 +654,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) Istring, Jstring) ; GB_OK (GB_subassign_08s_and_16 (C, I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, - M, Mask_struct, true, accum, A, Werk)) ; + M, true, Mask_struct, accum, A, Werk)) ; } break ; @@ -660,7 +665,7 @@ GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) Istring, Jstring) ; GB_OK (GB_subassign_12_and_20 (C, I, ni, nI, Ikind, Icolon, J, nj, nJ, Jkind, Jcolon, - M, Mask_struct, false, accum, A, Werk)) ; + M, false, Mask_struct, accum, A, Werk)) ; } break ; diff --git a/Source/assign/GB_subassigner_method.c b/Source/assign/GB_subassigner_method.c index ba2b4a0d3c..d7a9d25b78 100644 --- a/Source/assign/GB_subassigner_method.c +++ b/Source/assign/GB_subassigner_method.c @@ -2,7 +2,7 @@ // GB_subassigner_method: determine method for GB_subassign //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GrB_Col_assign.c b/Source/assign/GrB_Col_assign.c index a01247ca1c..fa0210b40d 100644 --- a/Source/assign/GrB_Col_assign.c +++ b/Source/assign/GrB_Col_assign.c @@ -2,7 +2,7 @@ // GrB_Col_assign: C(Rows,col) = accum (C(Rows,col),u) //------------------------------------------------------------------------------ -// 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/Source/assign/GrB_Matrix_assign.c b/Source/assign/GrB_Matrix_assign.c index 7f5de36b0e..0db15b7561 100644 --- a/Source/assign/GrB_Matrix_assign.c +++ b/Source/assign/GrB_Matrix_assign.c @@ -2,7 +2,7 @@ // GrB_Matrix_assign: C(Rows,Cols) = accum (C(Rows,Cols),A) or A' //------------------------------------------------------------------------------ -// 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/Source/assign/GrB_Matrix_assign_scalar.c b/Source/assign/GrB_Matrix_assign_scalar.c index 003e75ba27..dc61d8f502 100644 --- a/Source/assign/GrB_Matrix_assign_scalar.c +++ b/Source/assign/GrB_Matrix_assign_scalar.c @@ -2,7 +2,7 @@ // GrB_Matrix_assign_[SCALAR]: assign a scalar to matrix, via scalar expansion //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -78,7 +78,7 @@ GB_ASSIGN_SCALAR (GrB, void * , UDT , ) #undef GB_FREE_ALL #define GB_FREE_ALL GB_Matrix_free (&S) ; -#include "matrix/GB_static_header.h" +#include "matrix/include/GB_static_header.h" GrB_Info GrB_Matrix_assign_Scalar // C(I,J) = accum (C(I,J),s) ( diff --git a/Source/assign/GrB_Row_assign.c b/Source/assign/GrB_Row_assign.c index bb41480f4c..476fe6420a 100644 --- a/Source/assign/GrB_Row_assign.c +++ b/Source/assign/GrB_Row_assign.c @@ -2,7 +2,7 @@ // GrB_Row_assign: C(row,Cols) = accum (C(row,Cols),u') //------------------------------------------------------------------------------ -// 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/Source/assign/GrB_Vector_assign.c b/Source/assign/GrB_Vector_assign.c index eee523b360..4b1fc7850d 100644 --- a/Source/assign/GrB_Vector_assign.c +++ b/Source/assign/GrB_Vector_assign.c @@ -2,7 +2,7 @@ // GrB_Vector_assign: w(Rows) = accum (w(Rows),u) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GrB_Vector_assign_scalar.c b/Source/assign/GrB_Vector_assign_scalar.c index 33ff589375..6d77de3c46 100644 --- a/Source/assign/GrB_Vector_assign_scalar.c +++ b/Source/assign/GrB_Vector_assign_scalar.c @@ -2,7 +2,7 @@ // GrB_Vector_assign_[SCALAR]: assign scalar to vector, via scalar expansion //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -70,7 +70,6 @@ GB_ASSIGN_SCALAR (GrB, void * , UDT , ) #undef GB_FREE_ALL #define GB_FREE_ALL GB_Matrix_free (&S) ; -#include "matrix/GB_static_header.h" GrB_Info GrB_Vector_assign_Scalar // w(I) = accum (w(I),s) ( diff --git a/Source/assign/GxB_Col_subassign.c b/Source/assign/GxB_Col_subassign.c index 71e893b2c8..47643ede63 100644 --- a/Source/assign/GxB_Col_subassign.c +++ b/Source/assign/GxB_Col_subassign.c @@ -2,7 +2,7 @@ // GxB_Col_subassign: C(Rows,col) = accum (C(Rows,col),u) //------------------------------------------------------------------------------ -// 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/Source/assign/GxB_Matrix_subassign.c b/Source/assign/GxB_Matrix_subassign.c index dee56b231d..40d3c6ff60 100644 --- a/Source/assign/GxB_Matrix_subassign.c +++ b/Source/assign/GxB_Matrix_subassign.c @@ -2,7 +2,7 @@ // GxB_Matrix_subassign: C(Rows,Cols) = accum (C(Rows,Cols),A) or A' //------------------------------------------------------------------------------ -// 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/Source/assign/GxB_Matrix_subassign_scalar.c b/Source/assign/GxB_Matrix_subassign_scalar.c index 79edc1468a..9234c53406 100644 --- a/Source/assign/GxB_Matrix_subassign_scalar.c +++ b/Source/assign/GxB_Matrix_subassign_scalar.c @@ -2,7 +2,7 @@ // GxB_Matrix_subassign_[SCALAR]: assign to submatrix, via scalar expansion //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -76,7 +76,6 @@ GB_ASSIGN_SCALAR (void * , UDT , ) #undef GB_FREE_ALL #define GB_FREE_ALL GB_Matrix_free (&S) ; -#include "matrix/GB_static_header.h" GrB_Info GxB_Matrix_subassign_Scalar // C(I,J) = accum (C(I,J),s) ( diff --git a/Source/assign/GxB_Row_subassign.c b/Source/assign/GxB_Row_subassign.c index 1f62f5c194..3fbf6d1b87 100644 --- a/Source/assign/GxB_Row_subassign.c +++ b/Source/assign/GxB_Row_subassign.c @@ -2,7 +2,7 @@ // GxB_Row_subassign: C(row,Cols) = accum (C(row,Cols),u') //------------------------------------------------------------------------------ -// 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/Source/assign/GxB_Vector_subassign.c b/Source/assign/GxB_Vector_subassign.c index a85f203c07..61c04fb979 100644 --- a/Source/assign/GxB_Vector_subassign.c +++ b/Source/assign/GxB_Vector_subassign.c @@ -2,7 +2,7 @@ // GxB_Vector_subassign: w(Rows) = accum (w(Rows),u) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/assign/GxB_Vector_subassign_scalar.c b/Source/assign/GxB_Vector_subassign_scalar.c index f93d3d0acd..63cb216473 100644 --- a/Source/assign/GxB_Vector_subassign_scalar.c +++ b/Source/assign/GxB_Vector_subassign_scalar.c @@ -2,7 +2,7 @@ // GxB_Vector_subassign_[SCALAR]: assign scalar to vector, via scalar expansion //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -73,7 +73,6 @@ GB_ASSIGN_SCALAR (void * , UDT , ) #undef GB_FREE_ALL #define GB_FREE_ALL GB_Matrix_free (&S) ; -#include "matrix/GB_static_header.h" GrB_Info GxB_Vector_subassign_Scalar // w(I) = accum (w(I),s) ( diff --git a/Source/assign/dodiff b/Source/assign/dodiff index 3c859c962f..97f35fc710 100755 --- a/Source/assign/dodiff +++ b/Source/assign/dodiff @@ -1,74 +1,103 @@ #!/bin/bash -# 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 echo "=======================================================================" echo "02 and 04:" echo "=======================================================================" diff *suba*02* *suba*04* +diff ../jit_kernels/template/*suba*02* ../jit_kernels/template/*suba*04* +diff template/*suba*02* template/*suba*04* echo "=======================================================================" echo "01 and 03:" echo "=======================================================================" diff *suba*01* *suba*03* +diff ../jit_kernels/template/*suba*01* ../jit_kernels/template/*suba*03* +diff template/*suba*01* template/*suba*03* echo "=======================================================================" echo "05 and 07:" echo "=======================================================================" diff *suba*05.c* *suba*07* +diff ../jit_kernels/template/*suba*05.c ../jit_kernels/template/*suba*07* +diff template/*suba*05_*.c* template/*suba*07* echo "=======================================================================" echo "09 and 11:" echo "=======================================================================" diff *suba*09* *suba*11* +diff ../jit_kernels/template/*suba*09* ../jit_kernels/template/*suba*11* +diff template/*suba*09* template/*suba*11* echo "=======================================================================" echo "13 and 15:" echo "=======================================================================" diff *suba*13* *suba*15* +diff ../jit_kernels/template/*suba*13* ../jit_kernels/template/*suba*15* +diff template/*suba*13* template/*suba*15* echo "=======================================================================" echo "13 and 17:" echo "=======================================================================" diff *suba*13* *suba*17* +diff ../jit_kernels/template/*suba*13* ../jit_kernels/template/*suba*17* +diff template/*suba*13* template/*suba*17* echo "=======================================================================" echo "13 and 19:" echo "=======================================================================" diff *suba*13* *suba*19* +diff ../jit_kernels/template/*suba*13* ../jit_kernels/template/*suba*19* +diff template/*suba*13* template/*suba*19* echo "=======================================================================" echo "15 and 19:" echo "=======================================================================" diff *suba*15* *suba*19* +diff ../jit_kernels/template/*suba*15* ../jit_kernels/template/*suba*19* +diff template/*suba*15* template/*suba*19* echo "=======================================================================" echo "15 and 17:" echo "=======================================================================" diff *suba*15* *suba*17* +diff ../jit_kernels/template/*suba*15* ../jit_kernels/template/*suba*17* +diff template/*suba*15* template/*suba*17* echo "=======================================================================" echo "17 and 19:" echo "=======================================================================" diff *suba*17* *suba*19* +diff ../jit_kernels/template/*suba*17* ../jit_kernels/template/*suba*19* +diff template/*suba*17* template/*suba*19* echo "=======================================================================" echo "06s/14 and 10/18:" echo "=======================================================================" diff *suba*06s* *suba*10* +diff ../jit_kernels/template/*suba*06s* ../jit_kernels/template/*suba*10* +diff template/*suba*06s* template/*suba*10* echo "=======================================================================" echo "10/18 and 12/20:" echo "=======================================================================" diff *suba*10* *suba*12* +diff ../jit_kernels/template/*suba*10* ../jit_kernels/template/*suba*12* +diff template/*suba*10* template/*suba*12* echo "=======================================================================" echo "06s/14 and 12/20:" echo "=======================================================================" diff *suba*06s* *suba*12* +diff ../jit_kernels/template/*suba*06s* ../jit_kernels/template/*suba*12* +diff template/*suba*06s* template/*suba*12* echo "=======================================================================" -echo "06s/14 and 08s/18:" +echo "06s/14 and 08s/16:" echo "=======================================================================" diff *suba*06s* *suba*08s* +diff ../jit_kernels/template/*suba*06s* ../jit_kernels/template/*suba*08s* +diff template/*suba*06s* template/*suba*08s* + diff --git a/Source/assign/factory/GB_assign_factory.c b/Source/assign/factory/GB_assign_factory.c new file mode 100644 index 0000000000..2f1d652c58 --- /dev/null +++ b/Source/assign/factory/GB_assign_factory.c @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// GB_assign_factory.c: switch factory for assign (a single type) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + + switch (ccode) + { + #ifndef GxB_NO_BOOL + case GB_BOOL_code: GB_WORKER (_bool ) + #endif + #ifndef GxB_NO_INT8 + case GB_INT8_code: GB_WORKER (_int8 ) + #endif + #ifndef GxB_NO_INT16 + case GB_INT16_code: GB_WORKER (_int16 ) + #endif + #ifndef GxB_NO_INT32 + case GB_INT32_code: GB_WORKER (_int32 ) + #endif + #ifndef GxB_NO_INT64 + case GB_INT64_code: GB_WORKER (_int64 ) + #endif + #ifndef GxB_NO_UINT8 + case GB_UINT8_code: GB_WORKER (_uint8 ) + #endif + #ifndef GxB_NO_UINT16 + case GB_UINT16_code: GB_WORKER (_uint16) + #endif + #ifndef GxB_NO_UINT32 + case GB_UINT32_code: GB_WORKER (_uint32) + #endif + #ifndef GxB_NO_UINT64 + case GB_UINT64_code: GB_WORKER (_uint64) + #endif + #ifndef GxB_NO_FP32 + case GB_FP32_code: GB_WORKER (_fp32 ) + #endif + #ifndef GxB_NO_FP64 + case GB_FP64_code: GB_WORKER (_fp64 ) + #endif + #ifndef GxB_NO_FC32 + case GB_FC32_code: GB_WORKER (_fc32 ) + #endif + #ifndef GxB_NO_FC64 + case GB_FC64_code: GB_WORKER (_fc64 ) + #endif + default: ; + } + diff --git a/Source/assign/factory/GB_bitmap_M_scatter_whole_template.c b/Source/assign/factory/GB_bitmap_M_scatter_whole_template.c new file mode 100644 index 0000000000..23d90598b5 --- /dev/null +++ b/Source/assign/factory/GB_bitmap_M_scatter_whole_template.c @@ -0,0 +1,46 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_M_scatter_whole_template: scatter M into/from the C bitmap +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This method only handles the full assign case, where there are no I and J +// index lists. The C and M matrices must have the same size. + +// C is bitmap. M is sparse or hypersparse, and may be jumbled. + +#define GB_NO_CNVALS + +{ + switch (operation) + { + + case GB_BITMAP_M_SCATTER_PLUS_2 : // Cb (i,j) += 2 + + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] += 2 + #include "template/GB_bitmap_assign_M_all_template.c" + break ; + + case GB_BITMAP_M_SCATTER_MINUS_2 : // Cb (i,j) -= 2 + + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] -= 2 + #include "template/GB_bitmap_assign_M_all_template.c" + break ; + + case GB_BITMAP_M_SCATTER_SET_2 : // Cb (i,j) = 2 + + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] = 2 + #include "template/GB_bitmap_assign_M_all_template.c" + break ; + + default: ; + } +} + +#undef GB_NO_CNVALS diff --git a/Source/assign/factory/GB_bitmap_assign_M_template.c b/Source/assign/factory/GB_bitmap_assign_M_template.c deleted file mode 100644 index a1a63e19ad..0000000000 --- a/Source/assign/factory/GB_bitmap_assign_M_template.c +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_bitmap_assign_M_template: traverse over M for bitmap assignment into C -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// This template traverses over all the entries of the mask matrix M, and -// operates on C(i,j) if the mask M(i,j) == 1, via the GB_MASK_WORK macro, -// where C(i,j) is at Cx [pC] and Cb [pC]. M is hypersparse or sparse. - -// M has alreadly been sliced for parallel work. The tasks are held in -// pstart_Mslice, kfirst_Mslice, klast_Mslice, M_ntasks, and the work is done -// by M_nthreads threads. - -// The work done by this kernel is independent of Mask_comp; both M and !M -// do the same work by scattering their entries into the C bitmap. - -// C is bitmap/full. M is sparse/hyper, and can be jumbled. -ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; -ASSERT (GB_IS_BITMAP (C) || GB_IS_FULL (C)) ; -ASSERT (GB_JUMBLED_OK (M)) ; - -switch (assign_kind) -{ - case GB_ROW_ASSIGN : - // row assignment: C(iC,J), where M is a row vector - #include "assign/factory/GB_bitmap_assign_M_row_template.c" - break ; - case GB_COL_ASSIGN : - // column assignment: C(I,jC), where M is a column vector - #include "assign/factory/GB_bitmap_assign_M_col_template.c" - break ; - case GB_ASSIGN : - // GrB_assign: C(I,J), where M is the same size as C - #include "assign/factory/GB_bitmap_assign_M_all_template.c" - break ; - #ifndef GB_NO_SUBASSIGN_CASE - case GB_SUBASSIGN : - // GxB_subassign: C(I,J), where M is the same size as C(I,J) and A - #include "assign/factory/GB_bitmap_assign_M_sub_template.c" - break ; - #endif - default: ; -} - diff --git a/Source/assign/include/GB_assign_shared_definitions.h b/Source/assign/include/GB_assign_shared_definitions.h index 94e8e5670c..da3983380c 100644 --- a/Source/assign/include/GB_assign_shared_definitions.h +++ b/Source/assign/include/GB_assign_shared_definitions.h @@ -2,7 +2,7 @@ // GB_assign_shared_definitions.h: definitions for GB_subassign kernels //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,15 +10,25 @@ // macros for the construction of the GB_subassign kernels #include "include/GB_kernel_shared_definitions.h" +#include "include/GB_cumsum1.h" -//------------------------------------------------------------------------------ +//============================================================================== // definitions redefined as needed -//------------------------------------------------------------------------------ +//============================================================================== #ifndef GB_FREE_WORKSPACE #define GB_FREE_WORKSPACE ; #endif +#undef GB_FREE_S +#ifdef GB_GENERIC +// generic kernels are inside their calling method, so they must free S +#define GB_FREE_S GB_Matrix_free (&S) +#else +// JIT, PreJIT, and factory kernels are passed S already construct +#define GB_FREE_S +#endif + #undef GB_FREE_ALL #define GB_FREE_ALL \ { \ @@ -30,32 +40,139 @@ GB_FREE_WORK (&Z_to_S, Z_to_S_size) ; \ GB_FREE_WORK (&Z_to_A, Z_to_A_size) ; \ GB_FREE_WORK (&Z_to_M, Z_to_M_size) ; \ - GB_Matrix_free (&S) ; \ + GB_FREE_S ; \ } -//------------------------------------------------------------------------------ +//============================================================================== // definitions done just once -//------------------------------------------------------------------------------ +//============================================================================== #ifndef GB_SUBASSIGN_SHARED_DEFINITIONS_H #define GB_SUBASSIGN_SHARED_DEFINITIONS_H +//------------------------------------------------------------------------------ +// matrix types and other properties +//------------------------------------------------------------------------------ + +// The JIT/PreJIT kernels and FactoryKernels define the GB_*_TYPE macros as +// real types. If not yet defined, the generic kernels use GB_void. + +#ifndef GB_C_TYPE +#define GB_C_TYPE GB_void +#endif + +#ifndef GB_A_TYPE +#define GB_A_TYPE GB_void +#endif + +#ifndef GB_M_TYPE +#define GB_M_TYPE GB_void +#endif + +#ifdef GB_GENERIC + #define GB_CAST_FUNCTION(f,zcode,xcode) \ + const GB_cast_function f = GB_cast_factory (zcode, xcode) ; +#else + #define GB_CAST_FUNCTION(f,zcode,xcode) +#endif + +#ifndef GB_SCALAR_ASSIGN +// currently needed for bitmap methods only +#define GB_SCALAR_ASSIGN (A == NULL) +#endif + +#ifndef GB_ASSIGN_KIND +#define GB_ASSIGN_KIND assign_kind +#endif + +#ifndef GB_I_KIND +#define GB_I_KIND Ikind +#endif + +#ifndef GB_J_KIND +#define GB_J_KIND Jkind +#endif + +#ifndef GB_MASK_COMP +#define GB_MASK_COMP Mask_comp +#endif + +#ifndef GB_MASK_STRUCT +#define GB_MASK_STRUCT Mask_struct +#endif + +#ifndef GB_C_IS_BITMAP +#define GB_C_IS_BITMAP C_is_bitmap +#endif +#ifndef GB_C_IS_FULL +#define GB_C_IS_FULL C_is_full +#endif +#ifndef GB_C_IS_SPARSE +#define GB_C_IS_SPARSE C_is_sparse +#endif +#ifndef GB_C_IS_HYPER +#define GB_C_IS_HYPER C_is_hyper +#endif +#ifndef GB_C_ISO +#define GB_C_ISO C_iso +#endif + +#ifndef GB_M_IS_BITMAP +#define GB_M_IS_BITMAP M_is_bitmap +#endif +#ifndef GB_M_IS_FULL +#define GB_M_IS_FULL M_is_full +#endif +#ifndef GB_M_IS_SPARSE +#define GB_M_IS_SPARSE M_is_sparse +#endif +#ifndef GB_M_IS_HYPER +#define GB_M_IS_HYPER M_is_hyper +#endif + +#ifndef GB_A_IS_BITMAP +#define GB_A_IS_BITMAP A_is_bitmap +#endif +#ifndef GB_A_IS_FULL +#define GB_A_IS_FULL A_is_full +#endif +#ifndef GB_A_IS_SPARSE +#define GB_A_IS_SPARSE A_is_sparse +#endif +#ifndef GB_A_IS_HYPER +#define GB_A_IS_HYPER A_is_hyper +#endif +#ifndef GB_A_ISO +#define GB_A_ISO A_iso +#endif + +#ifndef GB_S_IS_BITMAP +#define GB_S_IS_BITMAP S_is_bitmap +#endif +#ifndef GB_S_IS_FULL +#define GB_S_IS_FULL S_is_full +#endif +#ifndef GB_S_IS_SPARSE +#define GB_S_IS_SPARSE S_is_sparse +#endif +#ifndef GB_S_IS_HYPER +#define GB_S_IS_HYPER S_is_hyper +#endif + //------------------------------------------------------------------------------ // GB_EMPTY_TASKLIST: declare an empty TaskList //------------------------------------------------------------------------------ #define GB_EMPTY_TASKLIST \ GrB_Info info ; \ - int taskid, ntasks = 0, nthreads ; \ + int taskid, ntasks = 0, nthreads = 0 ; \ GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; \ GB_WERK_DECLARE (Npending, int64_t) ; \ int64_t *restrict Zh = NULL ; size_t Zh_size = 0 ; \ int64_t *restrict Z_to_X = NULL ; size_t Z_to_X_size = 0 ; \ int64_t *restrict Z_to_S = NULL ; size_t Z_to_S_size = 0 ; \ int64_t *restrict Z_to_A = NULL ; size_t Z_to_A_size = 0 ; \ - int64_t *restrict Z_to_M = NULL ; size_t Z_to_M_size = 0 ; \ - struct GB_Matrix_opaque S_header ; \ - GrB_Matrix S = NULL ; + int64_t *restrict Z_to_M = NULL ; size_t Z_to_M_size = 0 ; //------------------------------------------------------------------------------ // GB_GET_C: get the C matrix (cannot be bitmap) @@ -68,13 +185,13 @@ ASSERT (!GB_IS_BITMAP (C)) ; \ const bool C_iso = C->iso ; \ int64_t *restrict Ci = C->i ; \ - GB_void *restrict Cx = (C_iso) ? NULL : (GB_void *) C->x ; \ + GB_C_TYPE *restrict Cx = (GB_C_ISO) ? NULL : (GB_C_TYPE *) C->x ; \ const size_t csize = C->type->size ; \ const GB_Type_code ccode = C->type->code ; \ - const int64_t cvdim = C->vdim ; \ + const int64_t Cvdim = C->vdim ; \ const int64_t Cvlen = C->vlen ; \ int64_t nzombies = C->nzombies ; \ - const bool is_matrix = (cvdim > 1) ; + const bool is_matrix = (Cvdim > 1) ; #ifndef GB_DECLAREC #define GB_DECLAREC(cwork) GB_void cwork [GB_VLA(csize)] ; @@ -93,21 +210,18 @@ // M and A can be aliased, but both are const. -#define GB_GET_M \ +#define GB_GET_MASK \ ASSERT_MATRIX_OK (M, "mask M", GB0) ; \ const int64_t *Mp = M->p ; \ const int8_t *Mb = M->b ; \ const int64_t *Mh = M->h ; \ const int64_t *Mi = M->i ; \ - const GB_M_TYPE *Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; \ + const GB_M_TYPE *Mx = (GB_M_TYPE *) (GB_MASK_STRUCT ? NULL : (M->x)) ; \ const size_t msize = M->type->size ; \ - const size_t Mvlen = M->vlen ; - -#define GB_GET_MASK \ - GB_GET_M ; \ + const size_t Mvlen = M->vlen ; \ const int64_t Mnvec = M->nvec ; \ const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; \ - const bool M_is_bitmap = GB_IS_BITMAP (M) + const bool M_is_bitmap = GB_IS_BITMAP (M) ; #define GB_GET_MASK_HYPER_HASH \ GB_OK (GB_hyper_hash_build (M, Werk)) ; \ @@ -120,17 +234,20 @@ // GB_GET_ACCUM: get the accumulator op and its related typecasting functions //------------------------------------------------------------------------------ -#define GB_GET_ACCUM \ - ASSERT_BINARYOP_OK (accum, "accum for assign", GB0) ; \ - ASSERT (!GB_OP_IS_POSITIONAL (accum)) ; \ - const GxB_binary_function faccum = accum->binop_function ; \ - const GB_cast_function \ - cast_A_to_Y = GB_cast_factory (accum->ytype->code, acode), \ - cast_C_to_X = GB_cast_factory (accum->xtype->code, ccode), \ - cast_Z_to_C = GB_cast_factory (ccode, accum->ztype->code) ; \ - const size_t xsize = accum->xtype->size ; \ - const size_t ysize = accum->ytype->size ; \ - const size_t zsize = accum->ztype->size ; +#ifdef GB_GENERIC + #define GB_GET_ACCUM \ + ASSERT_BINARYOP_OK (accum, "accum for assign", GB0) ; \ + ASSERT (!GB_OP_IS_POSITIONAL (accum)) ; \ + const GxB_binary_function faccum = accum->binop_function ; \ + GB_CAST_FUNCTION (cast_A_to_Y, accum->ytype->code, acode) ; \ + GB_CAST_FUNCTION (cast_C_to_X, accum->xtype->code, ccode) ; \ + GB_CAST_FUNCTION (cast_Z_to_C, ccode, accum->ztype->code) ; \ + const size_t xsize = accum->xtype->size ; \ + const size_t ysize = accum->ytype->size ; \ + const size_t zsize = accum->ztype->size ; +#else + #define GB_GET_ACCUM +#endif #ifndef GB_DECLAREZ #define GB_DECLAREZ(zwork) GB_void zwork [GB_VLA(zsize)] ; @@ -148,6 +265,11 @@ // GB_GET_A: get the A matrix //------------------------------------------------------------------------------ +#ifndef GB_COPY_aij_to_cwork +#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) \ + cast_A_to_C (cwork, Ax + (A_iso ? 0 : ((pA)*asize)), asize) ; +#endif + #define GB_GET_A \ ASSERT_MATRIX_OK (A, "A for assign", GB0) ; \ const GrB_Type atype = A->type ; \ @@ -156,16 +278,16 @@ const int8_t *Ab = A->b ; \ const int64_t *Ai = A->i ; \ const int64_t Avlen = A->vlen ; \ - const GB_void *Ax = (GB_void *) A->x ; \ + const GB_A_TYPE *Ax = (GB_A_TYPE *) A->x ; \ const bool A_iso = A->iso ; \ const bool A_is_bitmap = GB_IS_BITMAP (A) ; \ const GB_Type_code acode = atype->code ; \ - const GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; \ GB_DECLAREC (cwork) ; \ - if (A_iso) \ + GB_CAST_FUNCTION (cast_A_to_C, ccode, acode) ; \ + if (GB_A_ISO) \ { \ /* cwork = (ctype) Ax [0], typecast iso value of A into cwork */ \ - cast_A_to_C (cwork, Ax, asize) ; \ + GB_COPY_aij_to_cwork (cwork, Ax, 0, true) ; \ } #ifndef GB_DECLAREA @@ -176,32 +298,48 @@ // GB_GET_SCALAR: get the scalar //------------------------------------------------------------------------------ +#ifndef GB_COPY_scalar_to_cwork +#define GB_COPY_scalar_to_cwork(cwork,scalar) \ + cast_A_to_C (cwork, scalar, asize) ; +#endif + #define GB_GET_SCALAR \ const GrB_Type atype = scalar_type ; \ ASSERT_TYPE_OK (atype, "atype for assign", GB0) ; \ const size_t asize = atype->size ; \ const GB_Type_code acode = atype->code ; \ - const GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; \ GB_DECLAREC (cwork) ; \ - cast_A_to_C (cwork, scalar, asize) ; + GB_CAST_FUNCTION (cast_A_to_C, ccode, acode) ; \ + GB_COPY_scalar_to_cwork (cwork, scalar) ; //------------------------------------------------------------------------------ // GB_GET_ACCUM_SCALAR: get the scalar and the accumulator //------------------------------------------------------------------------------ +#ifndef GB_COPY_scalar_to_ywork +#define GB_COPY_scalar_to_ywork(ywork,scalar) \ + cast_A_to_Y (ywork, scalar, asize) ; +#endif + #define GB_GET_ACCUM_SCALAR \ GB_GET_SCALAR ; \ GB_GET_ACCUM ; \ GB_DECLAREY (ywork) ; \ - cast_A_to_Y (ywork, scalar, asize) ; + GB_COPY_scalar_to_ywork (ywork, scalar) ; + +#ifndef GB_COPY_aij_to_ywork +#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) \ + cast_A_to_Y (ywork, Ax + (A_iso ? 0 : ((pA)*asize)), asize) ; +#endif #define GB_GET_ACCUM_MATRIX \ GB_GET_A ; \ GB_GET_ACCUM ; \ GB_DECLAREY (ywork) ; \ - if (A_iso) \ + if (GB_A_ISO) \ { \ - cast_A_to_Y (ywork, Ax, asize) ; \ + /* ywork = Ax [0], with typecasting */ \ + GB_COPY_aij_to_ywork (ywork, Ax, 0, true) ; \ } //------------------------------------------------------------------------------ @@ -246,9 +384,9 @@ #define GB_C_S_LOOKUP \ int64_t pC = Sx [pS] ; \ - int64_t iC = GBI (Ci, pC, Cvlen) ; \ + int64_t iC = GBI_C (Ci, pC, Cvlen) ; \ bool is_zombie = GB_IS_ZOMBIE (iC) ; \ - if (is_zombie) iC = GB_FLIP (iC) ; + if (is_zombie) iC = GB_DEZOMBIE (iC) ; //-------------------------------------------------------------------------- // C(:,jC) is dense: iC = I [iA], and then look up C(iC,jC) @@ -261,10 +399,10 @@ // This used for Methods 05, 06n, 07, and 08n, which do not use S. #define GB_iC_DENSE_LOOKUP \ - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; \ + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; \ int64_t pC = pC_start + iC ; \ bool is_zombie = (Ci != NULL) && GB_IS_ZOMBIE (Ci [pC]) ; \ - ASSERT (GB_IMPLIES (Ci != NULL, GB_UNFLIP (Ci [pC]) == iC)) ; + ASSERT (GB_IMPLIES (Ci != NULL, GB_UNZOMBIE (Ci [pC]) == iC)) ; //-------------------------------------------------------------------------- // get C(iC,jC) via binary search of C(:,jC) @@ -279,27 +417,19 @@ // search of any fine tasks conflict with each other. #define GB_iC_BINARY_SEARCH \ - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; \ + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; \ int64_t pC = pC_start ; \ int64_t pright = pC_end - 1 ; \ bool cij_found, is_zombie ; \ GB_BINARY_SEARCH_ZOMBIE (iC, Ci, pC, pright, cij_found, zorig, \ is_zombie) ; - //-------------------------------------------------------------------------- - // for a 2-way or 3-way merge - //-------------------------------------------------------------------------- - - // An entry S(i,j), A(i,j), or M(i,j) has been processed; - // move to the next one. - #define GB_NEXT(X) (p ## X)++ ; - //-------------------------------------------------------------------------- // basic operations //-------------------------------------------------------------------------- - #ifndef GB_COPY_scalar_to_C - #define GB_COPY_scalar_to_C(Cx,pC,cwork) \ + #ifndef GB_COPY_cwork_to_C + #define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) \ { \ /* C(iC,jC) = scalar, already typecasted into cwork */ \ if (!C_iso) \ @@ -310,7 +440,7 @@ #endif #ifndef GB_COPY_aij_to_C - #define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) \ + #define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) \ { \ /* C(iC,jC) = (ctype) A(i,j), with typecasting */ \ if (!C_iso) \ @@ -328,31 +458,8 @@ } #endif - #ifndef GB_COPY_aij_to_cwork - #define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) \ - { \ - /* cwork = (ctype) A(i,j), with typecasting */ \ - if (!C_iso) \ - { \ - cast_A_to_C (cwork, Ax +(A_iso ? 0: (pA)*asize), asize) ; \ - } \ - } - - #endif - - #ifndef GB_COPY_aij_to_ywork - #define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) \ - { \ - /* ywork = A(i,j), with typecasting */ \ - if (!C_iso) \ - { \ - cast_A_to_Y (ywork, Ax + (A_iso ? 0 : (pA*asize)), asize) ; \ - } \ - } - #endif - #ifndef GB_ACCUMULATE_scalar - #define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ + #define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ { \ if (!C_iso) \ { \ @@ -367,7 +474,7 @@ #endif #ifndef GB_ACCUMULATE_aij - #define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ + #define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ { \ /* Cx [pC] += (ytype) Ax [A_iso ? 0 : pA] */ \ if (!C_iso) \ @@ -400,7 +507,7 @@ /* turn C(iC,jC) into a zombie */ \ ASSERT (!GB_IS_FULL (C)) ; \ task_nzombies++ ; \ - Ci [pC] = GB_FLIP (iC) ; \ + Ci [pC] = GB_ZOMBIE (iC) ; \ } #define GB_UNDELETE \ @@ -434,7 +541,7 @@ // pending tuples inserted here, by GxB_subassign. // (2) zombie entries. These are entries that are still present in the - // pattern but marked for deletion (via GB_FLIP(i) for the row index). + // pattern but marked for deletion (via GB_ZOMBIE(i) for the row index). // For the current GxB_subassign, there are 16 cases to handle, // all combinations of the following options: @@ -721,18 +828,18 @@ // ( delete ): - // C(I(i),J(j)) becomes a zombie, by flipping its row - // index via the GB_FLIP function. + // C(I(i),J(j)) becomes a zombie, by changing its row + // index via the GB_ZOMBIE function. // ( undelete ): // C(I(i),J(j)) = A(i,j) was a zombie and is no longer a - // zombie. Its row index is restored with GB_FLIP. + // zombie. Its row index is restored with GB_DEZOMBIE. // ( X ): // C(I(i),J(j)) was a zombie, and still is a zombie. - // row index is < 0, and actual index is GB_FLIP(I(i)) + // row index is < 0, and actual index is GB_DEZOMBIE(I(i)) // ( C ): @@ -792,7 +899,7 @@ /* ----[X A 1] */ \ /* action: ( undelete ): bring a zombie back to life */ \ GB_UNDELETE ; \ - GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,GB_A_ISO,cwork,GB_C_ISO) ; \ } // [X A 1] scalar case @@ -801,7 +908,7 @@ /* ----[X A 1] */ \ /* action: ( undelete ): bring a zombie back to life */ \ GB_UNDELETE ; \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, GB_C_ISO) ; \ } // [C A 1] matrix case when accum is present @@ -817,7 +924,7 @@ { \ /* ----[C A 1] with accum */ \ /* action: ( =C+A ): apply the accumulator */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pA,GB_A_ISO,ywork,GB_C_ISO);\ } \ } @@ -834,7 +941,7 @@ { \ /* ----[C A 1] with accum, scalar expansion */ \ /* action: ( =C+A ): apply the accumulator */ \ - GB_ACCUMULATE_scalar (Cx,pC,ywork) ; \ + GB_ACCUMULATE_scalar (Cx,pC,ywork,GB_C_ISO) ; \ } \ } @@ -851,7 +958,7 @@ { \ /* ----[C A 1] no accum, scalar expansion */ \ /* action: ( =A ): copy A into C */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,GB_A_ISO,cwork,GB_C_ISO) ;\ } \ } @@ -868,7 +975,7 @@ { \ /* ----[C A 1] no accum, scalar expansion */ \ /* action: ( =A ): copy A into C */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, GB_C_ISO) ; \ } \ } @@ -895,14 +1002,12 @@ // Otherwise the matrix C would be left in an incoherent partial // state of computation. It's cleaner to just free it all. - // The action is done by GB_PENDING_INSERT in GB_Pending.h. - #if 0 #define GB_D_A_1_scalar \ { \ /* ----[. A 1] */ \ /* action: ( insert ) */ \ - GB_PENDING_INSERT (scalar) ; \ + GB_PENDING_INSERT_scalar ; \ } #define GB_D_A_1_matrix \ @@ -1061,7 +1166,7 @@ // this is the same as the C_A_0 action above. // This condition cannot occur if A is a dense matrix, nor for - // scalar expansion, but the existance of the entry A is not + // scalar expansion, but the existence of the entry A is not // relevant. // If C_replace is false, then the [C D 0] action does nothing. @@ -1133,7 +1238,7 @@ #define GB_SUBASSIGN_ONE_SLICE(M) \ GB_OK (GB_subassign_one_slice ( \ &TaskList, &TaskList_size, &ntasks, &nthreads, \ - C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, \ + C, I, nI, GB_I_KIND, Icolon, J, nJ, GB_J_KIND, Jcolon, \ M, Werk)) ; \ GB_ALLOCATE_NPENDING_WERK ; @@ -1167,14 +1272,12 @@ // GB_SUBASSIGN_IXJ_SLICE: slice IxJ for a scalar assignement method //------------------------------------------------------------------------------ -// Methods: 01, 03, 13, 15, 17, 19. All of these methods access the C matrix -// via S, not via binary search. +// Methods: 01, 02, 03, 04, 11, 06s_and_14, 08s_and_16, 09, 12_and_20, +// 10_and_18, 13, 15, 17, 19, and bitmap assignment. #define GB_SUBASSIGN_IXJ_SLICE \ - GB_OK (GB_subassign_IxJ_slice ( \ - &TaskList, &TaskList_size, &ntasks, &nthreads, \ - /* I, */ nI, /* Ikind, Icolon, J, */ nJ, /* Jkind, Jcolon, */ \ - Werk)) ; \ + GB_OK (GB_subassign_IxJ_slice (&TaskList, &TaskList_size, &ntasks, \ + &nthreads, nI, nJ, Werk)) ; \ GB_ALLOCATE_NPENDING_WERK ; //------------------------------------------------------------------------------ @@ -1200,6 +1303,9 @@ // GB_GET_MAPPED: get the content of a vector for a coarse/fine task //------------------------------------------------------------------------------ +// Used for the M, S, and A matrices. Note that the generic GBP macro is used, +// so this is not fully optimized for the JIT. + #define GB_GET_MAPPED(pX_start, pX_fini, pX, pX_end, Xp, j, k, Z_to_X, Xvlen) \ int64_t pX_start = -1, pX_fini = -1 ; \ if (fine_task) \ @@ -1223,6 +1329,9 @@ // GB_GET_EVEC: get the content of a vector for Method08n //------------------------------------------------------------------------------ +// Used for the M and A matrices. Note that the generic GBP macro is used, +// so this is not fully optimized for the JIT. + #define GB_GET_EVEC(pX_start, pX_fini, pX, pX_end, Xp, Xh, j,k,Z_to_X,Xvlen)\ int64_t pX_start = -1, pX_fini = -1 ; \ if (fine_task) \ @@ -1267,34 +1376,78 @@ GB_GET_IXJ_TASK_DESCRIPTOR (iQ_start, iQ_end) \ GB_START_PENDING_INSERTION ; -//-------------------------------------------------------------------------- -// GB_LOOKUP_VECTOR -//-------------------------------------------------------------------------- - -// Find pX_start and pX_end for the vector X (:,j) - -#define GB_LOOKUP_VECTOR(pX_start,pX_end,X,j) \ -{ \ - if (X ## _is_hyper) \ - { \ - 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 \ - { \ - pX_start = GBP (X ## p, j , X ## vlen) ; \ - pX_end = GBP (X ## p, j+1, X ## vlen) ; \ - } \ -} +//------------------------------------------------------------------------------ +// GB_LOOKUP_VECTOR_X: Find pX_start and pX_end for the vector X (:,j) +//------------------------------------------------------------------------------ + + // GB_LOOKUP_VECTOR_C: find pC_start and pC_end for C(:,j) + #define GB_LOOKUP_VECTOR_C(j,pC_start,pC_end) \ + { \ + if (GB_C_IS_HYPER) \ + { \ + GB_hyper_hash_lookup (Ch, Cnvec, Cp, C_Yp, \ + C_Yi, C_Yx, C_hash_bits, j, &pC_start, &pC_end) ; \ + } \ + else \ + { \ + pC_start = GBP_C (Cp, j , Cvlen) ; \ + pC_end = GBP_C (Cp, j+1, Cvlen) ; \ + } \ + } + + // GB_LOOKUP_VECTOR_M: find pM_start and pM_end for M(:,j) + #define GB_LOOKUP_VECTOR_M(j,pM_start,pM_end) \ + { \ + if (GB_M_IS_HYPER) \ + { \ + GB_hyper_hash_lookup (Mh, Mnvec, Mp, M_Yp, \ + M_Yi, M_Yx, M_hash_bits, j, &pM_start, &pM_end) ; \ + } \ + else \ + { \ + pM_start = GBP_M (Mp, j , Mvlen) ; \ + pM_end = GBP_M (Mp, j+1, Mvlen) ; \ + } \ + } + + // GB_LOOKUP_VECTOR_A: find pA_start and pA_end for A(:,j) + #define GB_LOOKUP_VECTOR_A(j,pA_start,pA_end) \ + { \ + if (GB_A_IS_HYPER) \ + { \ + GB_hyper_hash_lookup (Ah, Anvec, Ap, A_Yp, \ + A_Yi, A_Yx, A_hash_bits, j, &pA_start, &pA_end) ; \ + } \ + else \ + { \ + pA_start = GBP_A (Ap, j , Avlen) ; \ + pA_end = GBP_A (Ap, j+1, Avlen) ; \ + } \ + } + + // GB_LOOKUP_VECTOR_S: find pS_start and pS_end for S(:,j) + #define GB_LOOKUP_VECTOR_S(j,pS_start,pS_end) \ + { \ + if (GB_S_IS_HYPER) \ + { \ + GB_hyper_hash_lookup (Sh, Snvec, Sp, S_Yp, \ + S_Yi, S_Yx, S_hash_bits, j, &pS_start, &pS_end) ; \ + } \ + else \ + { \ + pS_start = GBP_S (Sp, j , Svlen) ; \ + pS_end = GBP_S (Sp, j+1, Svlen) ; \ + } \ + } //------------------------------------------------------------------------------ -// GB_LOOKUP_VECTOR_jC: get the vector C(:,jC) +// GB_LOOKUP_VECTOR_jC: get the vector C(:,jC) where jC = J [j] //------------------------------------------------------------------------------ -#define GB_LOOKUP_VECTOR_jC(fine_task,taskid) \ +#define GB_LOOKUP_VECTOR_jC \ /* lookup jC in C */ \ /* jC = J [j] ; or J is ":" or jbegin:jend or jbegin:jinc:jend */ \ - int64_t jC = GB_ijlist (J, j, Jkind, Jcolon) ; \ + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; \ int64_t pC_start, pC_end ; \ if (fine_task) \ { \ @@ -1303,34 +1456,57 @@ } \ else \ { \ - GB_LOOKUP_VECTOR (pC_start, pC_end, C, jC) ; \ + GB_LOOKUP_VECTOR_C (jC, pC_start, pC_end) ; \ } //------------------------------------------------------------------------------ -// GB_LOOKUP_VECTOR_FOR_IXJ: get the start of a vector for scalar assignment +// GB_LOOKUP_VECTOR_X_FOR_IXJ: get the start of a vector for scalar assignment //------------------------------------------------------------------------------ -// Find pX and pX_end for the vector X (iQ_start:iQ_end, j), for a scalar +// Find pX and pX_end for the vector X (iQ_start:end, j), for a scalar // assignment method, or a method iterating over all IxJ for a bitmap M or A. -#define GB_LOOKUP_VECTOR_FOR_IXJ(X,iQ_start) \ - int64_t p ## X, p ## X ## _end ; \ - GB_LOOKUP_VECTOR (p ## X, p ## X ## _end, X, j) ; \ - if (iQ_start != 0) \ - { \ - if (X ## i == NULL) \ +// Used for the M and S matrices. + + // lookup S (iQ_start:end, j) + #define GB_LOOKUP_VECTOR_S_FOR_IXJ(j,pS,pS_end,iQ_start) \ + int64_t pS, pS_end ; \ + GB_LOOKUP_VECTOR_S (j, pS, pS_end) ; \ + if (iQ_start != 0) \ { \ - /* X is full or bitmap */ \ - p ## X += iQ_start ; \ - } \ - else \ + if (Si == NULL) \ + { \ + /* S is full or bitmap */ \ + pS += iQ_start ; \ + } \ + else \ + { \ + /* S is sparse or hypersparse */ \ + int64_t pright = pS_end - 1 ; \ + bool found ; \ + GB_SPLIT_BINARY_SEARCH (iQ_start, Si, pS, pright, found) ; \ + } \ + } + + // lookup M (iQ_start:end, j) + #define GB_LOOKUP_VECTOR_M_FOR_IXJ(j,pM,pM_end,iQ_start) \ + int64_t pM, pM_end ; \ + GB_LOOKUP_VECTOR_M (j, pM, pM_end) ; \ + if (iQ_start != 0) \ { \ - /* X is sparse or hypersparse */ \ - int64_t pright = p ## X ## _end - 1 ; \ - bool found ; \ - GB_SPLIT_BINARY_SEARCH (iQ_start, X ## i, p ## X, pright, found) ;\ - } \ - } + if (Mi == NULL) \ + { \ + /* M is full or bitmap */ \ + pM += iQ_start ; \ + } \ + else \ + { \ + /* M is sparse or hypersparse */ \ + int64_t pright = pM_end - 1 ; \ + bool found ; \ + GB_SPLIT_BINARY_SEARCH (iQ_start, Mi, pM, pright, found) ; \ + } \ + } //------------------------------------------------------------------------------ // GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP @@ -1340,7 +1516,7 @@ #define GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP(i) \ bool mij ; \ - if (M_is_bitmap) \ + if (GB_M_IS_BITMAP) \ { \ /* M(:,j) is bitmap, no need for binary search */ \ int64_t pM = pM_start + i ; \ @@ -1385,18 +1561,21 @@ #define GB_PENDING_CUMSUM \ C->nzombies = nzombies ; \ - GB_cumsum (Npending, ntasks, NULL, 1, NULL) ; \ - int64_t nnew = Npending [ntasks] ; \ - if (nnew == 0) \ + /* cumsum Npending for each task, and get total from all tasks */ \ + GB_cumsum1 (Npending, ntasks) ; \ + int64_t total_new_npending = Npending [ntasks] ; \ + if (total_new_npending == 0) \ { \ /* no pending tuples, so skip phase 2 */ \ GB_FREE_ALL ; \ - ASSERT_MATRIX_OK (C, "C, no pending tuples ", GB_FLIP (GB0)) ; \ + ASSERT_MATRIX_OK (C, "C, no pending tuples ", GB_ZOMBIE (GB0)) ; \ return (GrB_SUCCESS) ; \ } \ - /* ensure that C->Pending is large enough to handle nnew more tuples */ \ - if (!GB_Pending_ensure (&(C->Pending), C_iso, atype, accum, is_matrix, \ - nnew, Werk)) \ + /* ensure C->Pending is large enough to handle total_new_npending */ \ + /* more tuples. The type of Pending->x is atype, the type of A or */ \ + /* the scalar. */ \ + if (!GB_Pending_ensure (&(C->Pending), GB_C_ISO, atype, accum, \ + is_matrix, total_new_npending, Werk)) \ { \ GB_FREE_ALL ; \ return (GrB_OUT_OF_MEMORY) ; \ @@ -1404,7 +1583,7 @@ GB_Pending Pending = C->Pending ; \ int64_t *restrict Pending_i = Pending->i ; \ int64_t *restrict Pending_j = Pending->j ; \ - GB_void *restrict Pending_x = Pending->x ; /* NULL if C is iso */ \ + GB_A_TYPE *restrict Pending_x = Pending->x ; /* NULL if C is iso */ \ int64_t npending_orig = Pending->n ; \ bool pending_sorted = Pending->sorted ; @@ -1416,25 +1595,52 @@ bool task_sorted = true ; \ int64_t ilast = -1 ; \ int64_t jlast = -1 ; \ - int64_t n = Npending [taskid] ; \ - int64_t task_pending = Npending [taskid+1] - n ; \ + int64_t my_npending = Npending [taskid] ; \ + int64_t task_pending = Npending [taskid+1] - my_npending ; \ if (task_pending == 0) continue ; \ - n += npending_orig ; + my_npending += npending_orig ; #define GB_GET_TASK_DESCRIPTOR_PHASE2 \ GB_GET_TASK_DESCRIPTOR ; \ GB_START_PENDING_INSERTION ; //------------------------------------------------------------------------------ -// GB_PENDING_INSERT: add (iC,jC,aij) or just (iC,aij) if Pending_j is NULL +// GB_PENDING_INSERT_*: add (iC,jC,aij) or just (iC,aij) if Pending_j is NULL //------------------------------------------------------------------------------ -// GB_PENDING_INSERT(aij) is used by GB_subassign_* to insert a pending tuple, +// GB_PENDING_INSERT_* is used by GB_subassign_* to insert a pending tuple, // in phase 2. The list has already been reallocated after phase 1 to hold all // the new pending tuples, so GB_Pending_realloc is not required. If C is iso, // Pending->x is NULL. -#define GB_PENDING_INSERT(aij) \ +// The type of Pending_x is always identical to the type of A, or the scalar, +// so no typecasting is required. + +// insert a scalar into Pending_x: +#undef GB_COPY_scalar_to_PENDING_X +#ifdef GB_GENERIC + #define GB_COPY_scalar_to_PENDING_X \ + { memcpy (Pending_x +(my_npending*asize), scalar, asize) ; } +#else + #define GB_COPY_scalar_to_PENDING_X \ + { Pending_x [my_npending] = (*((GB_A_TYPE *) scalar)) ; } +#endif + +// insert A(i,j) into Pending_x: +#undef GB_COPY_aij_to_PENDING_X +#ifdef GB_GENERIC + #define GB_COPY_aij_to_PENDING_X \ + { memcpy (Pending_x +(my_npending*asize), \ + (Ax + (GB_A_ISO ? 0 : ((pA)*asize))), asize) ; } +#else + #define GB_COPY_aij_to_PENDING_X \ + { Pending_x [my_npending] = Ax [GB_A_ISO ? 0 : (pA)] ; } +#endif + +#define GB_PENDING_INSERT_aij GB_PENDING_INSERT (GB_COPY_aij_to_PENDING_X) +#define GB_PENDING_INSERT_scalar GB_PENDING_INSERT (GB_COPY_scalar_to_PENDING_X) + +#define GB_PENDING_INSERT(copy_to_Pending_x) \ if (task_sorted) \ { \ if (!((jlast < jC) || (jlast == jC && ilast <= iC))) \ @@ -1442,24 +1648,20 @@ task_sorted = false ; \ } \ } \ - Pending_i [n] = iC ; \ - if (Pending_j != NULL) Pending_j [n] = jC ; \ - if (Pending_x != NULL) memcpy (Pending_x +(n*asize), (aij), asize) ; \ - n++ ; \ + Pending_i [my_npending] = iC ; \ + if (Pending_j != NULL) Pending_j [my_npending] = jC ; \ + if (Pending_x != NULL) copy_to_Pending_x ; \ + my_npending++ ; \ ilast = iC ; \ jlast = jC ; -// insert A(i,j) into the list of pending tuples -#define GB_PENDING_INSERT_aij \ - GB_PENDING_INSERT (Ax + (A_iso ? 0 : ((pA)*asize))) - //------------------------------------------------------------------------------ // GB_PHASE2_TASK_WRAPUP: wrapup for a task in phase 2 //------------------------------------------------------------------------------ #define GB_PHASE2_TASK_WRAPUP \ pending_sorted = pending_sorted && task_sorted ; \ - ASSERT (n == npending_orig + Npending [taskid+1]) ; + ASSERT (my_npending == npending_orig + Npending [taskid+1]) ; //------------------------------------------------------------------------------ // GB_SUBASSIGN_WRAPUP: finalize the subassign method after phase 2 @@ -1474,118 +1676,115 @@ { \ for (int taskid = 0 ; pending_sorted && taskid < ntasks ; taskid++) \ { \ - int64_t n = Npending [taskid] ; \ - int64_t task_pending = Npending [taskid+1] - n ; \ - n += npending_orig ; \ - if (task_pending > 0 && n > 0) \ + int64_t my_npending = Npending [taskid] ; \ + int64_t task_pending = Npending [taskid+1] - my_npending ; \ + my_npending += npending_orig ; \ + if (task_pending > 0 && my_npending > 0) \ { \ /* (i,j) is the first pending tuple for this task; check */ \ /* with the pending tuple just before it */ \ - ASSERT (n < npending_orig + nnew) ; \ - int64_t i = Pending_i [n] ; \ - int64_t j = (Pending_j != NULL) ? Pending_j [n] : 0 ; \ - int64_t ilast = Pending_i [n-1] ; \ - int64_t jlast = (Pending_j != NULL) ? Pending_j [n-1] : 0 ; \ + ASSERT (my_npending < npending_orig + total_new_npending) ; \ + int64_t i = Pending_i [my_npending] ; \ + int64_t j = (Pending_j != NULL) ? \ + Pending_j [my_npending] : 0 ; \ + int64_t ilast = Pending_i [my_npending-1] ; \ + int64_t jlast = (Pending_j != NULL) ? \ + Pending_j [my_npending-1] : 0 ; \ pending_sorted = pending_sorted && \ ((jlast < j) || (jlast == j && ilast <= i)) ; \ } \ } \ } \ - Pending->n += nnew ; \ + Pending->n += total_new_npending ; \ Pending->sorted = pending_sorted ; \ GB_FREE_ALL ; \ - ASSERT_MATRIX_OK (C, "C with pending tuples", GB_FLIP (GB0)) ; \ + ASSERT_MATRIX_OK (C, "C with pending tuples", GB_ZOMBIE (GB0)) ; \ return (GrB_SUCCESS) ; //============================================================================== // macros for bitmap_assign methods //============================================================================== -//------------------------------------------------------------------------------ -// burble -//------------------------------------------------------------------------------ - -#define GBURBLE_BITMAP_ASSIGN(method,M,Mask_comp,accum,Ikind,Jkind,akind) \ - GBURBLE ("Method:" method " ") ; \ - GB_assign_burble (C_replace, Ikind, Jkind, M, Mask_comp, \ - Mask_struct, accum, A, akind) ; +#define GB_FREE_ALL_FOR_BITMAP \ + GB_WERK_POP (A_ek_slicing, int64_t) ; \ + GB_WERK_POP (M_ek_slicing, int64_t) ; \ + GB_FREE_WORK (&TaskList_IxJ, TaskList_IxJ_size) ; //------------------------------------------------------------------------------ -// GB_GET_C_BITMAP: get the C matrix (must be bitmap) +// GB_GET_C_A_SCALAR_FOR_BITMAP: get the C and A matrices and the scalar //------------------------------------------------------------------------------ -// C must be a bitmap matrix +// C must be a bitmap matrix. Gets the C and A matrices, and the scalar, and +// declares workspace for M, A, and TaskList_IxJ. -#define GB_GET_C_BITMAP \ +#define GB_GET_C_A_SCALAR_FOR_BITMAP \ GrB_Info info ; \ - /* also get the max # of threads to use */ \ - int nthreads_max = GB_Context_nthreads_max ( ) ; \ - double chunk = GB_Context_chunk ( ) ; \ + /* workspace: */ \ + GB_WERK_DECLARE (M_ek_slicing, int64_t) ; \ + int M_ntasks = 0, M_nthreads = 0 ; \ + GB_task_struct *TaskList_IxJ = NULL ; size_t TaskList_IxJ_size = 0 ; \ + int ntasks_IxJ = 0, nthreads_IxJ = 0 ; \ + GB_WERK_DECLARE (A_ek_slicing, int64_t) ; \ + int A_ntasks = 0, A_nthreads = 0 ; \ + /* C matrix: */ \ ASSERT_MATRIX_OK (C, "C for bitmap assign", GB0) ; \ ASSERT (GB_IS_BITMAP (C)) ; \ int8_t *Cb = C->b ; \ const bool C_iso = C->iso ; \ - GB_void *Cx = (C_iso) ? NULL : (GB_void *) C->x ; \ + GB_C_TYPE *Cx = (GB_C_ISO) ? NULL : (GB_C_TYPE *) C->x ; \ const size_t csize = C->type->size ; \ const GB_Type_code ccode = C->type->code ; \ - const int64_t cvdim = C->vdim ; \ - const int64_t cvlen = C->vlen ; \ - const int64_t vlen = cvlen ; /* for GB_bitmap_assign_IxJ_template */ \ - const int64_t cnzmax = cvlen * cvdim ; \ - int64_t cnvals = C->nvals ; - -//------------------------------------------------------------------------------ -// GB_SLICE_M: slice the mask matrix M -//------------------------------------------------------------------------------ - -#define GB_SLICE_M \ - GB_GET_M \ - GB_WERK_DECLARE (M_ek_slicing, int64_t) ; \ - int M_ntasks, M_nthreads ; \ - GB_M_NHELD (M_nnz_held) ; \ - GB_SLICE_MATRIX_WORK (M, 8, M_nnz_held + M->nvec, M_nnz_held) ; - -//------------------------------------------------------------------------------ -// GB_GET_A_AND_SCALAR: get the A matrix or the scalar -//------------------------------------------------------------------------------ - -// ALIAS of C and A for bitmap methods: OK only for C(:,:)=A assignment. - -#define GB_GET_A_AND_SCALAR \ + const int64_t Cvdim = C->vdim ; \ + const int64_t Cvlen = C->vlen ; \ + const int64_t vlen = Cvlen ; /* for GB_bitmap_assign_IxJ_template */ \ + const int64_t cnzmax = Cvlen * Cvdim ; \ + int64_t cnvals = C->nvals ; \ + /* A matrix and scalar: */ \ const int64_t *Ap = NULL ; \ const int64_t *Ah = NULL ; \ const int8_t *Ab = NULL ; \ const int64_t *Ai = NULL ; \ - const GB_void *Ax = NULL ; \ - const bool A_iso = (A == NULL) ? false : A->iso ; \ - const GrB_Type atype = (A == NULL) ? scalar_type : A->type ; \ + const GB_A_TYPE *Ax = NULL ; \ + const bool A_iso = (GB_SCALAR_ASSIGN) ? false : A->iso ; \ + const GrB_Type atype = (GB_SCALAR_ASSIGN) ? scalar_type : A->type ; \ const size_t asize = atype->size ; \ const GB_Type_code acode = atype->code ; \ - if (A != NULL) \ + int64_t Avlen ; \ + if (!(GB_SCALAR_ASSIGN)) \ { \ ASSERT_MATRIX_OK (A, "A for bitmap assign/subassign", GB0) ; \ Ap = A->p ; \ Ah = A->h ; \ Ab = A->b ; \ Ai = A->i ; \ - Ax = (C_iso) ? NULL : (GB_void *) A->x ; \ + Ax = (GB_C_ISO) ? NULL : (GB_A_TYPE *) A->x ; \ + Avlen = A->vlen ; \ } \ - GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; \ GB_DECLAREC (cwork) ; \ - if (!C_iso) \ + GB_CAST_FUNCTION (cast_A_to_C, ccode, acode) ; \ + if (!GB_C_ISO) \ { \ - if (A == NULL) \ + if (GB_SCALAR_ASSIGN) \ { \ /* cwork = (ctype) scalar */ \ - cast_A_to_C (cwork, scalar, asize) ; \ + GB_COPY_scalar_to_cwork (cwork, scalar) ; \ } \ - else if (A_iso) \ + else if (GB_A_ISO) \ { \ /* cwork = (ctype) Ax [0], typecast iso value of A into cwork */\ - cast_A_to_C (cwork, Ax, asize) ; \ + GB_COPY_aij_to_cwork (cwork, Ax, 0, true) ; \ } \ } +//------------------------------------------------------------------------------ +// GB_SLICE_M_FOR_BITMAP: slice the mask matrix M +//------------------------------------------------------------------------------ + +#define GB_SLICE_M_FOR_BITMAP \ + GB_GET_MASK \ + GB_M_NHELD (M_nnz_held) ; \ + GB_SLICE_MATRIX_WORK (M, 8, M_nnz_held + Mnvec, M_nnz_held) ; + //------------------------------------------------------------------------------ // GB_GET_ACCUM_FOR_BITMAP: get accum op and its related typecasting functions //------------------------------------------------------------------------------ @@ -1593,15 +1792,17 @@ #define GB_GET_ACCUM_FOR_BITMAP \ GB_GET_ACCUM ; \ GB_DECLAREY (ywork) ; \ - if (!C_iso) \ + if (!GB_C_ISO) \ { \ - if (A == NULL) \ + if (GB_SCALAR_ASSIGN) \ { \ - cast_A_to_Y (ywork, scalar, asize) ; \ + /* ywork = (ytype) scalar */ \ + GB_COPY_scalar_to_ywork (ywork, scalar) ; \ } \ - else if (A_iso) \ + else if (GB_A_ISO) \ { \ - cast_A_to_Y (ywork, Ax, asize) ; \ + /* ywork = (ytype) Ax [0] */ \ + GB_COPY_aij_to_ywork (ywork, Ax, 0, true) ; \ } \ } diff --git a/Source/assign/include/GB_bitmap_scatter.h b/Source/assign/include/GB_bitmap_scatter.h index e6500db282..021ee23eb9 100644 --- a/Source/assign/include/GB_bitmap_scatter.h +++ b/Source/assign/include/GB_bitmap_scatter.h @@ -2,7 +2,7 @@ // GB_bitmap_scatter.h: definitions for GB_bitmap_assign* methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,7 +13,6 @@ #define GB_BITMAP_M_SCATTER_PLUS_2 0 #define GB_BITMAP_M_SCATTER_MINUS_2 1 #define GB_BITMAP_M_SCATTER_SET_2 2 -#define GB_BITMAP_M_SCATTER_MOD_2 3 #endif diff --git a/Source/assign/include/GB_index.h b/Source/assign/include/GB_index.h index f3ec1e18c4..ffe8c9acdd 100644 --- a/Source/assign/include/GB_index.h +++ b/Source/assign/include/GB_index.h @@ -2,7 +2,7 @@ // GB_index.h: definitions for index lists and types of assignments //------------------------------------------------------------------------------ -// 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/Source/assign/GB_bitmap_assign_fullM_accum.c b/Source/assign/template/GB_bitmap_assign_1_template.c similarity index 74% rename from Source/assign/GB_bitmap_assign_fullM_accum.c rename to Source/assign/template/GB_bitmap_assign_1_template.c index 06c6b8a313..78ceac9a8d 100644 --- a/Source/assign/GB_bitmap_assign_fullM_accum.c +++ b/Source/assign/template/GB_bitmap_assign_1_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_fullM_accum: assign to C bitmap, M is bitmap or full +// GB_bitmap_assign_1_template: C bitmap, M bitmap/full, with accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -28,58 +28,19 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign, row assign, col assign, or subassign -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted only if C_replace is true. #undef GB_FREE_ALL -#define GB_FREE_ALL ; - -GrB_Info GB_bitmap_assign_fullM_accum -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, // J index list - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix, which is present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued - const GrB_BinaryOp accum, // present here - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - const int assign_kind, // row assign, col assign, assign, or subassign - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP - GBURBLE_BITMAP_ASSIGN ("bit1", M, Mask_comp, accum, - Ikind, Jkind, assign_kind) ; - ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, M full, accum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, M full, accum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M full, accum", GB0) ; +{ //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_GET_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_GET_MASK GB_GET_ACCUM_FOR_BITMAP //-------------------------------------------------------------------------- @@ -87,13 +48,13 @@ GrB_Info GB_bitmap_assign_fullM_accum //-------------------------------------------------------------------------- #define GB_GET_MIJ(mij,pM) \ - bool mij = (GBB (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ Mask_comp ; + bool mij = (GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; //-------------------------------------------------------------------------- // assignment phase //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -114,7 +75,7 @@ GrB_Info GB_bitmap_assign_fullM_accum // else // if Cb(p) == 1: // Cx(p) += scalar // C(iC,jC) still present, updated - // if C FULL: no change, just cb = GBB (Cb,pC) + // FUTURE: if C FULL: Cb is effectively all 1's and stays that way #undef GB_IXJ_WORK #define GB_IXJ_WORK(pC,pA) \ @@ -127,33 +88,33 @@ GrB_Info GB_bitmap_assign_fullM_accum if (cb == 0) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else /* (cb == 1) */ \ { \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ } \ } - ASSERT (assign_kind == GB_ASSIGN || assign_kind == GB_SUBASSIGN) ; + ASSERT (GB_ASSIGN_KIND == GB_ASSIGN || GB_ASSIGN_KIND == GB_SUBASSIGN) ; - switch (assign_kind) + switch (GB_ASSIGN_KIND) { case GB_ASSIGN : // C(I,J) += scalar where M has the same size as C #undef GB_GET_pM #define GB_GET_pM pC - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" break ; case GB_SUBASSIGN : // C(I,J) += scalar where M has the same size as A #undef GB_GET_pM #define GB_GET_pM pA - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" break ; default: ; } @@ -181,7 +142,7 @@ GrB_Info GB_bitmap_assign_fullM_accum // else // if Cb(p) == 1: // Cx(p) += aij // C(iC,jC) still present, updated - // if C FULL: no change, just cb = GBB (Cb,pC) + // FUTURE: if C FULL: Cb is effectively all 1's and stays that way #define GB_AIJ_WORK(pC,pA) \ { \ @@ -193,43 +154,43 @@ GrB_Info GB_bitmap_assign_fullM_accum if (cb == 0) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else /* (cb == 1) */ \ { \ /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ } \ } \ } - switch (assign_kind) + switch (GB_ASSIGN_KIND) { case GB_ROW_ASSIGN : // C(i,J) += A where m is a 1-by-C->vdim row vector #undef GB_GET_pM #define GB_GET_pM jC - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" break ; case GB_COL_ASSIGN : // C(I,j) += A where m is a C->vlen-by-1 column vector #undef GB_GET_pM #define GB_GET_pM iC - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" break ; case GB_ASSIGN : // C(I,J) += A where M has the same size as C #undef GB_GET_pM #define GB_GET_pM pC - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" break ; case GB_SUBASSIGN : // C(I,J) += A where M has the same size as A #undef GB_GET_pM #define GB_GET_pM (iA + jA * nI) - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" break ; default: ; } @@ -241,9 +202,9 @@ GrB_Info GB_bitmap_assign_fullM_accum if (C_replace) { - // if C FULL: use two passes: first pass checks if any + // FUTURE: if C FULL: use two passes: first pass checks if any // entry must be deleted. If none: do nothing. Else: change C - // to full and do 2nd pass as below. + // to bitmap and do 2nd pass as below. // for row assign: for all entries in C(i,:) // for col assign: for all entries in C(:,j) @@ -260,7 +221,7 @@ GrB_Info GB_bitmap_assign_fullM_accum task_cnvals -= (cb == 1) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_template.c" + #include "template/GB_bitmap_assign_C_template.c" } //-------------------------------------------------------------------------- @@ -269,6 +230,7 @@ GrB_Info GB_bitmap_assign_fullM_accum C->nvals = cnvals ; ASSERT_MATRIX_OK (C, "final C for bitmap assign, M full, accum", GB0) ; + GB_FREE_ALL ; return (GrB_SUCCESS) ; } diff --git a/Source/assign/GB_bitmap_assign_fullM_accum_whole.c b/Source/assign/template/GB_bitmap_assign_1_whole_template.c similarity index 79% rename from Source/assign/GB_bitmap_assign_fullM_accum_whole.c rename to Source/assign/template/GB_bitmap_assign_1_whole_template.c index 4163b663bb..2b1bcc6b30 100644 --- a/Source/assign/GB_bitmap_assign_fullM_accum_whole.c +++ b/Source/assign/template/GB_bitmap_assign_1_whole_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_fullM_accum_whole: assign to C bitmap, M is bitmap or full +// GB_bitmap_assign_1_whole_template: C bitmap, M bitmap/full, with accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -28,50 +28,19 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign or subassign (same action) -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted only if C_replace is true. #undef GB_FREE_ALL -#define GB_FREE_ALL ; - -GrB_Info GB_bitmap_assign_fullM_accum_whole -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Matrix M, // mask matrix, which is present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued - const GrB_BinaryOp accum, // present here - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP - GBURBLE_BITMAP_ASSIGN ("bit1:whole", M, Mask_comp, accum, - GB_ALL, GB_ALL, GB_ASSIGN) ; - ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, M full, accum, whole", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, M full, accum, whole", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M full, accum, whole", - GB0) ; +{ //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_GET_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_GET_MASK GB_GET_ACCUM_FOR_BITMAP //-------------------------------------------------------------------------- @@ -79,13 +48,17 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole //-------------------------------------------------------------------------- #define GB_GET_MIJ(mij,pC) \ - bool mij = (GBB (Mb, pC) && GB_MCAST (Mx, pC, msize)) ^ Mask_comp ; + bool mij = (GBB_M (Mb, pC) && GB_MCAST (Mx, pC, msize)) ^ GB_MASK_COMP ; + + //-------------------------------------------------------------------------- + // slice + //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // assignment phase //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -93,7 +66,7 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole //---------------------------------------------------------------------- if (C_replace) - { + { //------------------------------------------------------------------ // C += scalar @@ -108,14 +81,14 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole if (cb == 0) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else /* (cb == 1) */ \ { \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ } \ else \ @@ -125,7 +98,7 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole task_cnvals -= (cb == 1) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -143,18 +116,18 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole if (Cb [pC]) \ { \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ else \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } @@ -180,18 +153,20 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole int8_t cb = Cb [pC] ; \ if (mij) \ { \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* mij true and A(i,j) present */ \ if (cb) \ { \ /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ + C_iso) ; \ } \ else \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ @@ -204,7 +179,7 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole task_cnvals -= (cb == 1) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -217,24 +192,24 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole #undef GB_CIJ_WORK #define GB_CIJ_WORK(pC) \ { \ - if (mij && GBB (Ab, pC)) \ + if (mij && GBB_A (Ab, pC)) \ { \ /* mij true and A(i,j) present */ \ if (Cb [pC]) \ { \ /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork,C_iso) ;\ } \ else \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ;\ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } @@ -256,33 +231,34 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole if (Cb [pC]) \ { \ /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pA,A_iso,ywork,C_iso) ; \ } \ else \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork,C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" // clear the mask and delete entries not assigned if (C_replace) { #undef GB_CIJ_WORK - #define GB_CIJ_WORK(pC) \ - { \ - if (!mij) \ - { \ - int8_t cb = Cb [pC] ; \ - Cb [pC] = 0 ; \ - task_cnvals -= (cb == 1) ; \ - } \ + #define GB_CIJ_WORK(pC) \ + { \ + if (!mij) \ + { \ + /* delete C(i,j) if present */ \ + int8_t cb = Cb [pC] ; \ + Cb [pC] = 0 ; \ + task_cnvals -= (cb == 1) ; \ + } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } } @@ -292,6 +268,7 @@ GrB_Info GB_bitmap_assign_fullM_accum_whole //-------------------------------------------------------------------------- C->nvals = cnvals ; + GB_FREE_ALL ; ASSERT_MATRIX_OK (C, "final C, bitmap assign, M full, accum, whole", GB0) ; return (GrB_SUCCESS) ; } diff --git a/Source/assign/GB_bitmap_assign_fullM_noaccum.c b/Source/assign/template/GB_bitmap_assign_2_template.c similarity index 70% rename from Source/assign/GB_bitmap_assign_fullM_noaccum.c rename to Source/assign/template/GB_bitmap_assign_2_template.c index 174df108d1..edaedd639c 100644 --- a/Source/assign/GB_bitmap_assign_fullM_noaccum.c +++ b/Source/assign/template/GB_bitmap_assign_2_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_fullM_noaccum: assign to C bitmap, M is bitmap or full +// GB_bitmap_assign_2_template: C bitmap, M bitmap/full, no accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -28,58 +28,20 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign, row assign, col assign, or subassign -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. #undef GB_FREE_ALL -#define GB_FREE_ALL ; - -GrB_Info GB_bitmap_assign_fullM_noaccum -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - const bool C_replace, // descriptor for C - // inputs: - const GrB_Index *I, // I index list - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, // J index list - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix, which is present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - const int assign_kind, // row assign, col assign, assign, or subassign - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP - GBURBLE_BITMAP_ASSIGN ("bit2", M, Mask_comp, NULL, - Ikind, Jkind, assign_kind) ; - ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, M full, noaccum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, M full, noaccum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M full, noaccum", GB0) ; +{ //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_GET_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_GET_MASK //-------------------------------------------------------------------------- // to get the effective value of the mask entry mij @@ -87,7 +49,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum #undef GB_GET_MIJ #define GB_GET_MIJ(mij,pM) \ - bool mij = (GBB (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ Mask_comp ; + bool mij = (GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; //-------------------------------------------------------------------------- // C_replace phase @@ -95,9 +57,9 @@ GrB_Info GB_bitmap_assign_fullM_noaccum if (C_replace) { - // if C FULL: use two passes: first pass checks if any + // FUTURE: if C FULL: use two passes: first pass checks if any // entry must be deleted. If none: do nothing. Else: change C - // to full and do 2nd pass as below. + // to bitmap and do 2nd pass as below. // for row assign: set Cb(i,:) to zero if mij == 0 // for col assign: set Cb(:,j) to zero if mij == 0 @@ -113,21 +75,21 @@ GrB_Info GB_bitmap_assign_fullM_noaccum task_cnvals -= (cb == 1) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_template.c" + #include "template/GB_bitmap_assign_C_template.c" } //-------------------------------------------------------------------------- // assignment phase //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- // scalar assignment: C(I,J) = scalar //---------------------------------------------------------------------- - // if C FULL: no change, just cb = GBB (CB,pC) + // FUTURE: if C FULL: Cb is effectively all 1's and stays that way // for all entries in IxJ #undef GB_IXJ_WORK @@ -139,27 +101,27 @@ GrB_Info GB_bitmap_assign_fullM_noaccum { \ int8_t cb = Cb [pC] ; \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals += (cb == 0) ; \ } \ } - ASSERT (assign_kind == GB_ASSIGN || assign_kind == GB_SUBASSIGN) ; + ASSERT (GB_ASSIGN_KIND == GB_ASSIGN || GB_ASSIGN_KIND == GB_SUBASSIGN) ; - switch (assign_kind) + switch (GB_ASSIGN_KIND) { case GB_ASSIGN : // C(I,J) = scalar where M has the same size as C #undef GB_GET_pM #define GB_GET_pM pC - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" break ; case GB_SUBASSIGN : // C(I,J) = scalar where M has the same size as A #undef GB_GET_pM #define GB_GET_pM pA - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" break ; default: ; } @@ -204,7 +166,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum { \ int8_t cb = Cb [pC] ; \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 4 ; \ task_cnvals += (cb == 0) ; \ } \ @@ -223,38 +185,38 @@ GrB_Info GB_bitmap_assign_fullM_noaccum } \ } - switch (assign_kind) + switch (GB_ASSIGN_KIND) { case GB_ROW_ASSIGN : // C(i,J) = A where m is a 1-by-C->vdim row vector #undef GB_GET_pM #define GB_GET_pM jC - #include "assign/factory/GB_bitmap_assign_A_template.c" - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" break ; case GB_COL_ASSIGN : // C(I,j) = A where m is a C->vlen-by-1 column vector #undef GB_GET_pM #define GB_GET_pM iC - #include "assign/factory/GB_bitmap_assign_A_template.c" - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" break ; case GB_ASSIGN : // C(I,J) = A where M has the same size as C #undef GB_GET_pM #define GB_GET_pM pC - #include "assign/factory/GB_bitmap_assign_A_template.c" - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" break ; case GB_SUBASSIGN : // C(I,J) = A where M has the same size as A #undef GB_GET_pM #define GB_GET_pM (iA + jA * nI) - #include "assign/factory/GB_bitmap_assign_A_template.c" - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" break ; default: ; @@ -266,6 +228,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum //-------------------------------------------------------------------------- C->nvals = cnvals ; + GB_FREE_ALL ; ASSERT_MATRIX_OK (C, "final C for bitmap assign, M full, noaccum", GB0) ; return (GrB_SUCCESS) ; } diff --git a/Source/assign/GB_bitmap_assign_fullM_noaccum_whole.c b/Source/assign/template/GB_bitmap_assign_2_whole_template.c similarity index 79% rename from Source/assign/GB_bitmap_assign_fullM_noaccum_whole.c rename to Source/assign/template/GB_bitmap_assign_2_whole_template.c index c4de958d9d..975a5cf1cb 100644 --- a/Source/assign/GB_bitmap_assign_fullM_noaccum_whole.c +++ b/Source/assign/template/GB_bitmap_assign_2_whole_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_fullM_noaccum_whole: assign to C bitmap, M is bitmap or full +// GB_bitmap_assign_2_whole_template: C bitmap, M bitmap/full, no accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -28,63 +28,33 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign or subassign (same action) -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. #undef GB_FREE_ALL -#define GB_FREE_ALL ; - -GrB_Info GB_bitmap_assign_fullM_noaccum_whole -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - const bool C_replace, // descriptor for C - // inputs: - const GrB_Matrix M, // mask matrix, which is present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP - GBURBLE_BITMAP_ASSIGN ("bit2:whole", M, Mask_comp, NULL, - GB_ALL, GB_ALL, GB_ASSIGN) ; - ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, M full, noaccum, whole", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, M full, noaccum, whole", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M full, noaccum, whole", - GB0) ; +{ //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_GET_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_GET_MASK //-------------------------------------------------------------------------- // to get the effective value of the mask entry mij //-------------------------------------------------------------------------- #define GB_GET_MIJ(mij,pM) \ - bool mij = (GBB (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ Mask_comp ; + bool mij = (GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize)) ^ GB_MASK_COMP ; //-------------------------------------------------------------------------- // assignment phase //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -105,7 +75,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole if (mij) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals += (cb == 0) ; \ } \ @@ -116,7 +86,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole task_cnvals -= (cb == 1) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -133,12 +103,12 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole { \ /* Cx [pC] = scalar */ \ int8_t cb = Cb [pC] ; \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals += (cb == 0) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } @@ -167,10 +137,10 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole #define GB_CIJ_WORK(pC) \ { \ int8_t cb = Cb [pC] ; \ - if (mij && GBB (Ab, pC)) \ + if (mij && GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pC, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals += (cb == 0) ; \ } \ @@ -181,7 +151,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole task_cnvals -= (cb == 1) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -197,10 +167,10 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole if (mij) \ { \ int8_t cb = Cb [pC] ; \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pC, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ;\ Cb [pC] = 1 ; \ task_cnvals += (cb == 0) ; \ } \ @@ -212,7 +182,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole } \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } else @@ -241,12 +211,12 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole if (mij) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork,C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" } else @@ -265,12 +235,12 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole { \ /* Cx [pC] = Ax [pA] */ \ int8_t cb = Cb [pC] ; \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork,C_iso) ; \ Cb [pC] = 4 ; /* keep this entry */ \ task_cnvals += (cb == 0) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" // delete entries where M(i,j)=1 but not assigned by A #undef GB_CIJ_WORK @@ -283,7 +253,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole task_cnvals -= (cb == 1) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } } @@ -293,6 +263,7 @@ GrB_Info GB_bitmap_assign_fullM_noaccum_whole //-------------------------------------------------------------------------- C->nvals = cnvals ; + GB_FREE_ALL ; ASSERT_MATRIX_OK (C, "final C bitmap assign, M full, noaccum, whole", GB0) ; return (GrB_SUCCESS) ; } diff --git a/Source/assign/GB_bitmap_assign_M_accum.c b/Source/assign/template/GB_bitmap_assign_3_template.c similarity index 70% rename from Source/assign/GB_bitmap_assign_M_accum.c rename to Source/assign/template/GB_bitmap_assign_3_template.c index 758b0259f2..6dd5fe4f93 100644 --- a/Source/assign/GB_bitmap_assign_M_accum.c +++ b/Source/assign/template/GB_bitmap_assign_3_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_M_accum: assign to C bitmap +// GB_bitmap_assign_3_template: C bitmap, M sparse/hyper, with accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -22,61 +22,19 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign, row assign, col assign, or subassign -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted only if C_replace is true. #undef GB_FREE_ALL -#define GB_FREE_ALL \ -{ \ - GB_WERK_POP (M_ek_slicing, int64_t) ; \ -} +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP -GrB_Info GB_bitmap_assign_M_accum -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, // J index list - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix, which is not NULL here -// const bool Mask_comp, // false here - const bool Mask_struct, // true if M is structural, false if valued - const GrB_BinaryOp accum, // present here - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - const int assign_kind, // row assign, col assign, assign, or subassign - GB_Werk Werk -) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GBURBLE_BITMAP_ASSIGN ("bit3", M, false, accum, - Ikind, Jkind, assign_kind) ; - ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, M, accum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, M, accum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M, accum", GB0) ; - //-------------------------------------------------------------------------- // get C, M, A, and accum //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_SLICE_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_SLICE_M_FOR_BITMAP GB_GET_ACCUM_FOR_BITMAP // if C FULL: if C_replace false, no deletion occurs @@ -86,14 +44,14 @@ GrB_Info GB_bitmap_assign_M_accum // do the assignment //-------------------------------------------------------------------------- - if (A == NULL && assign_kind == GB_SUBASSIGN) + if (GB_SCALAR_ASSIGN && GB_ASSIGN_KIND == GB_SUBASSIGN) { //---------------------------------------------------------------------- // scalar subassignment: C(I,J) += scalar //---------------------------------------------------------------------- - ASSERT (assign_kind == GB_SUBASSIGN) ; + ASSERT (GB_ASSIGN_KIND == GB_SUBASSIGN) ; int64_t keep = C_replace ? 3 : 1 ; // for all entries in the mask M: @@ -106,16 +64,16 @@ GrB_Info GB_bitmap_assign_M_accum if (cb == 0) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ task_cnvals++ ; \ } \ else /* (cb == 1) */ \ { \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_M_sub_template.c" + #include "template/GB_bitmap_assign_M_sub_template.c" if (C_replace) { @@ -127,7 +85,7 @@ GrB_Info GB_bitmap_assign_M_accum Cb [pC] = (cb == 3) ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } } @@ -139,23 +97,26 @@ GrB_Info GB_bitmap_assign_M_accum //---------------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, assign_kind, GB_BITMAP_M_SCATTER_PLUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] += 2 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_template.c" + #undef GB_NO_CNVALS + // the bitmap of C now contains: - // Cb (i,j) = 0: cij not present, mij zero - // Cb (i,j) = 1: cij present, mij zero - // Cb (i,j) = 2: cij not present, mij 1 - // Cb (i,j) = 3: cij present, mij 1 + // Cb (i,j) = 0: cij not present, mij zero, do not modify + // Cb (i,j) = 1: cij present, mij zero, do not modify + // Cb (i,j) = 2: cij not present, mij 1, can be modified + // Cb (i,j) = 3: cij present, mij 1, can be modified - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //------------------------------------------------------------------ // scalar assignment: C(I,J) += scalar //------------------------------------------------------------------ - ASSERT (assign_kind == GB_ASSIGN) ; + ASSERT (GB_ASSIGN_KIND == GB_ASSIGN) ; // for all entries in IxJ #undef GB_IXJ_WORK #define GB_IXJ_WORK(pC,ignore) \ @@ -164,17 +125,17 @@ GrB_Info GB_bitmap_assign_M_accum if (cb == 2) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 3 ; \ task_cnvals++ ; \ } \ else if (cb == 3) \ { \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } else @@ -201,17 +162,17 @@ GrB_Info GB_bitmap_assign_M_accum if (cb == 2) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 3 ; \ task_cnvals++ ; \ } \ else if (cb == 3) \ { \ /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" } //---------------------------------------------------------------------- @@ -235,15 +196,17 @@ GrB_Info GB_bitmap_assign_M_accum Cb [pC] = (cb == 3) ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_C_template.c" + #include "template/GB_bitmap_assign_C_template.c" } else { // clear M from C // Cb [pC] -= 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, assign_kind, GB_BITMAP_M_SCATTER_MINUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] -= 2 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_template.c" + #undef GB_NO_CNVALS } } diff --git a/Source/assign/GB_bitmap_assign_M_accum_whole.c b/Source/assign/template/GB_bitmap_assign_3_whole_template.c similarity index 80% rename from Source/assign/GB_bitmap_assign_M_accum_whole.c rename to Source/assign/template/GB_bitmap_assign_3_whole_template.c index 67eb2a28ab..41f4f4bef6 100644 --- a/Source/assign/GB_bitmap_assign_M_accum_whole.c +++ b/Source/assign/template/GB_bitmap_assign_3_whole_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_M_accum_whole: assign to C bitmap +// GB_bitmap_assign_3_whole_template: C bitmap, M sparse/hyper, with accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -22,60 +22,26 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign or subassign (same action) -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted only if C_replace is true. #undef GB_FREE_ALL -#define GB_FREE_ALL \ -{ \ - GB_WERK_POP (M_ek_slicing, int64_t) ; \ -} +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP -GrB_Info GB_bitmap_assign_M_accum_whole -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Matrix M, // mask matrix, which is not NULL here -// const bool Mask_comp, // false here - const bool Mask_struct, // true if M is structural, false if valued - const GrB_BinaryOp accum, // present here - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - GB_Werk Werk -) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GBURBLE_BITMAP_ASSIGN ("bit3:whole", M, false, accum, - GB_ALL, GB_ALL, GB_ASSIGN) ; - ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; - ASSERT (GB_JUMBLED_OK (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, M, accum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, M, accum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M, accum", GB0) ; - //-------------------------------------------------------------------------- // get C, M, A, and accum //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_SLICE_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_SLICE_M_FOR_BITMAP GB_GET_ACCUM_FOR_BITMAP //-------------------------------------------------------------------------- // do the assignment //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -90,8 +56,8 @@ GrB_Info GB_bitmap_assign_M_accum_whole //------------------------------------------------------------------ // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero @@ -111,19 +77,19 @@ GrB_Info GB_bitmap_assign_M_accum_whole break ; \ case 2: /* C(i,j) not present, M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ break ; \ case 3: /* C(i,j) present, M(i,j) = 1 */ \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ Cb [pC] = 1 ; \ break ; \ default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -140,18 +106,18 @@ GrB_Info GB_bitmap_assign_M_accum_whole { \ /* C(i,j) present, M(i,j) = 1 */ \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ else \ { \ /* C(i,j) not present, M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ } - #include "assign/factory/GB_bitmap_assign_M_all_template.c" + #include "template/GB_bitmap_assign_M_all_template.c" } } @@ -177,8 +143,8 @@ GrB_Info GB_bitmap_assign_M_accum_whole //-------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero @@ -197,10 +163,11 @@ GrB_Info GB_bitmap_assign_M_accum_whole task_cnvals-- ; \ break ; \ case 2: /* C(i,j) not present, M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ @@ -211,17 +178,18 @@ GrB_Info GB_bitmap_assign_M_accum_whole } \ break ; \ case 3: /* C(i,j) present, M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ + C_iso) ; \ } \ Cb [pC] = 1 ; \ break ; \ default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -234,26 +202,26 @@ GrB_Info GB_bitmap_assign_M_accum_whole #undef GB_MASK_WORK #define GB_MASK_WORK(pC) \ { \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* A(i,j) is present */ \ if (Cb [pC]) \ { \ /* C(i,j) present, M(i,j) = 1 */ \ /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pC, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork,C_iso) ;\ } \ else \ { \ /* C(i,j) not present, M(i,j) = 1 */ \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pC, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ } \ } - #include "assign/factory/GB_bitmap_assign_M_all_template.c" + #include "template/GB_bitmap_assign_M_all_template.c" } } @@ -265,8 +233,8 @@ GrB_Info GB_bitmap_assign_M_accum_whole //------------------------------------------------------------------ // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero @@ -284,7 +252,7 @@ GrB_Info GB_bitmap_assign_M_accum_whole { \ /* C(i,j) not present, M(i,j) = 1 */ \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 3 ; \ task_cnvals++ ; \ } \ @@ -292,10 +260,10 @@ GrB_Info GB_bitmap_assign_M_accum_whole { \ /* C(i,j) present, M(i,j) = 1 */ \ /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" if (C_replace) { @@ -307,14 +275,14 @@ GrB_Info GB_bitmap_assign_M_accum_whole Cb [pC] = (cb == 3) ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else { // clear the mask // Cb [pC] -= 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_MINUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_MINUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; } } diff --git a/Source/assign/GB_bitmap_assign_M_noaccum.c b/Source/assign/template/GB_bitmap_assign_4_template.c similarity index 70% rename from Source/assign/GB_bitmap_assign_M_noaccum.c rename to Source/assign/template/GB_bitmap_assign_4_template.c index 625127bcf3..dc40a2f293 100644 --- a/Source/assign/GB_bitmap_assign_M_noaccum.c +++ b/Source/assign/template/GB_bitmap_assign_4_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_M_noaccum: assign to C bitmap +// GB_bitmap_assign_4_template: C bitmap, M sparse/hyper, no accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -22,61 +22,20 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign, row assign, col assign, or subassign -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. #undef GB_FREE_ALL -#define GB_FREE_ALL \ -{ \ - GB_WERK_POP (M_ek_slicing, int64_t) ; \ -} +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP -GrB_Info GB_bitmap_assign_M_noaccum -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, // J index list - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix, which is not NULL here -// const bool Mask_comp, // false here - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - const int assign_kind, // row assign, col assign, assign, or subassign - GB_Werk Werk -) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GBURBLE_BITMAP_ASSIGN ("bit4", M, false, NULL, - Ikind, Jkind, assign_kind) ; - ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, M, noaccum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, M, noaccum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M, noaccum", GB0) ; - //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_SLICE_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_SLICE_M_FOR_BITMAP //-------------------------------------------------------------------------- // C(I,J) = A or scalar @@ -87,24 +46,26 @@ GrB_Info GB_bitmap_assign_M_noaccum //-------------------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, assign_kind, GB_BITMAP_M_SCATTER_PLUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; - - - // Cb (i,j) = 0: mij == 0, cij not present - // Cb (i,j) = 1: mij == 0, cij present - // Cb (i,j) = 2: mij == 1, cij not present, can be assigned - // Cb (i,j) = 3: mij == 1, cij present, can be assigned + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] += 2 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_template.c" + #undef GB_NO_CNVALS + + // the bitmap of C now contains: + // Cb (i,j) = 0: mij == 0, cij not present, do not modify + // Cb (i,j) = 1: mij == 0, cij present, do not modify + // Cb (i,j) = 2: mij == 1, cij not present, can be modified + // Cb (i,j) = 3: mij == 1, cij present, can be modified // below: - // Cb (i,j) = 4: mij == 1, cij present, has been assigned + // Cb (i,j) = 4: mij == 1, cij present, has been modified (and keep it) //-------------------------------------------------------------------------- // scatter A or the scalar into C(I,J) //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -114,7 +75,7 @@ GrB_Info GB_bitmap_assign_M_noaccum // if C FULL: if C_replace false, no deletion occurs // otherwise: convert C to bitmap - if (assign_kind == GB_SUBASSIGN) + if (GB_ASSIGN_KIND == GB_SUBASSIGN) { //------------------------------------------------------------------ @@ -129,7 +90,7 @@ GrB_Info GB_bitmap_assign_M_noaccum if (cb >= 2) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals += (cb == 2) ; \ } \ @@ -140,17 +101,17 @@ GrB_Info GB_bitmap_assign_M_noaccum task_cnvals-- ; \ } \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } - else // assign_kind == GB_ASSIGN + else // GB_ASSIGN_KIND == GB_ASSIGN { //------------------------------------------------------------------ // scalar assign: C(I,J) = scalar //------------------------------------------------------------------ - int keep = C_replace ? 4 : 1 ; + int8_t keep = C_replace ? 4 : 1 ; // for all IxJ #undef GB_IXJ_WORK @@ -160,12 +121,12 @@ GrB_Info GB_bitmap_assign_M_noaccum if (cb >= 2) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = keep ; \ task_cnvals += (cb == 2) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" if (C_replace) { @@ -177,16 +138,18 @@ GrB_Info GB_bitmap_assign_M_noaccum Cb [pC] = (cb == 4 || cb == 3) ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_C_template.c" + #include "template/GB_bitmap_assign_C_template.c" } else { // clear the mask // Cb [pC] %= 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, GB_ASSIGN, GB_BITMAP_M_SCATTER_MOD_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] &= 1 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_all_template.c" + #undef GB_NO_CNVALS + } } @@ -214,18 +177,18 @@ GrB_Info GB_bitmap_assign_M_noaccum if (cb >= 2) \ { \ /* Cx [pC] = Ax [pA] ; */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 4 ; \ task_cnvals += (cb == 2) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" //---------------------------------------------------------------------- // clear M from C and handle C_replace for row/col/assign //---------------------------------------------------------------------- - if (assign_kind == GB_SUBASSIGN) + if (GB_ASSIGN_KIND == GB_SUBASSIGN) { //------------------------------------------------------------------ @@ -242,7 +205,7 @@ GrB_Info GB_bitmap_assign_M_noaccum Cb [pC] = (cb == 4) ; \ task_cnvals -= (cb == 1 || cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } else @@ -255,7 +218,7 @@ GrB_Info GB_bitmap_assign_M_noaccum Cb [pC] = (cb == 4 || cb == 1) ; \ task_cnvals -= (cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } } @@ -279,7 +242,7 @@ GrB_Info GB_bitmap_assign_M_noaccum Cb [pC] = (cb == 4) ? 3 : 0 ; \ task_cnvals -= (cb == 1 || cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" // for all of C #undef GB_CIJ_WORK @@ -290,7 +253,7 @@ GrB_Info GB_bitmap_assign_M_noaccum Cb [pC] = (cb == 3) ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_C_template.c" + #include "template/GB_bitmap_assign_C_template.c" } else { @@ -303,15 +266,18 @@ GrB_Info GB_bitmap_assign_M_noaccum Cb [pC] = (cb == 4 || cb == 1) ; \ task_cnvals -= (cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" - // clear M from C + // clear M from C // Cb [pC] %= 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, - I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, assign_kind, GB_BITMAP_M_SCATTER_MOD_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] &= 1 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_template.c" + #undef GB_NO_CNVALS } + + #undef GB_NO_SUBASSIGN_CASE } } diff --git a/Source/assign/GB_bitmap_assign_M_noaccum_whole.c b/Source/assign/template/GB_bitmap_assign_4_whole_template.c similarity index 81% rename from Source/assign/GB_bitmap_assign_M_noaccum_whole.c rename to Source/assign/template/GB_bitmap_assign_4_whole_template.c index 4b152fe4db..7a05033aa9 100644 --- a/Source/assign/GB_bitmap_assign_M_noaccum_whole.c +++ b/Source/assign/template/GB_bitmap_assign_4_whole_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_M_noaccum_whole: assign to C bitmap +// GB_bitmap_assign_4_whole_template: C bitmap, M sparse/hyper, no accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -22,53 +22,20 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign or subassign (same action) -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. #undef GB_FREE_ALL -#define GB_FREE_ALL \ -{ \ - GB_WERK_POP (M_ek_slicing, int64_t) ; \ -} +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP -GrB_Info GB_bitmap_assign_M_noaccum_whole -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Matrix M, // mask matrix, which is not NULL here -// const bool Mask_comp, // false here - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - GB_Werk Werk -) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GBURBLE_BITMAP_ASSIGN ("bit4:whole", M, false, NULL, - GB_ALL, GB_ALL, GB_ASSIGN) ; - ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; - ASSERT (GB_JUMBLED_OK (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, M, noaccum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, M, noaccum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, M, noaccum", GB0) ; - //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_SLICE_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_SLICE_M_FOR_BITMAP //-------------------------------------------------------------------------- // C(I,J) = A or scalar @@ -78,7 +45,7 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole // scatter A or the scalar into C //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -89,8 +56,8 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole { // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero @@ -113,18 +80,18 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole break ; \ case 2: /* C(i,j) not present, M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ break ; \ case 3: /* C(i,j) present, M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -141,19 +108,18 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole { \ /* C(i,j) present, M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ } \ else \ { \ /* C(i,j) not present, M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ } - #include "assign/factory/GB_bitmap_assign_M_all_template.c" - + #include "template/GB_bitmap_assign_M_all_template.c" } } @@ -179,8 +145,8 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole //-------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero @@ -198,10 +164,11 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole task_cnvals-- ; \ break ; \ case 2: /* C(i,j) not present, M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ @@ -212,10 +179,11 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole } \ break ; \ case 3: /* C(i,j) present, M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ Cb [pC] = 1 ; \ } \ else \ @@ -228,7 +196,7 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -244,10 +212,10 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole if (Cb [pC]) \ { \ /* C(i,j) present, M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pC, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ;\ } \ else \ { \ @@ -259,17 +227,16 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole else \ { \ /* C(i,j) not present, M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pC, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ;\ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ } \ } - #include "assign/factory/GB_bitmap_assign_M_all_template.c" - + #include "template/GB_bitmap_assign_M_all_template.c" } } else @@ -279,6 +246,8 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole // C = A where A is sparse or hyper //------------------------------------------------------------------ + GB_A_NVALS (anz) ; + if (C_replace) { @@ -287,8 +256,8 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole //-------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero @@ -305,12 +274,12 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole { \ /* M(i,j)=1 and A(i,j) present */ \ /* Cx [pC] = Ax [pA] ; */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork,C_iso) ; \ Cb [pC] = 4 ; \ task_cnvals += (cb == 2) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" // clear the mask and delete entries not assigned #undef GB_CIJ_WORK @@ -320,10 +289,10 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole Cb [pC] = (cb == 4) ; \ task_cnvals -= (cb == 1 || cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } - else if (GB_nnz (A) == 0) + else if (anz == 0) { //-------------------------------------------------------------- @@ -340,7 +309,7 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole Cb [pC] = 0 ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_M_all_template.c" + #include "template/GB_bitmap_assign_M_all_template.c" } else @@ -351,8 +320,8 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole //-------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero @@ -369,12 +338,12 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole { \ /* M(i,j)=1 and A(i,j) present */ \ /* Cx [pC] = Ax [pA] ; */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork,C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals += (cb == 2) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" // clear the mask and delete entries not assigned #undef GB_MASK_WORK @@ -384,8 +353,7 @@ GrB_Info GB_bitmap_assign_M_noaccum_whole Cb [pC] = (cb == 1) ; \ task_cnvals -= (cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_M_all_template.c" - + #include "template/GB_bitmap_assign_M_all_template.c" } } } diff --git a/Source/assign/GB_bitmap_assign_noM_accum.c b/Source/assign/template/GB_bitmap_assign_5_template.c similarity index 72% rename from Source/assign/GB_bitmap_assign_noM_accum.c rename to Source/assign/template/GB_bitmap_assign_5_template.c index ef14dea4db..c1680868ca 100644 --- a/Source/assign/GB_bitmap_assign_noM_accum.c +++ b/Source/assign/template/GB_bitmap_assign_5_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_noM_accum: assign to C bitmap, mask M is not present +// GB_bitmap_assign_5_template: C bitmap, no M, with accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -29,72 +29,35 @@ // kind: assign, row assign, col assign, or subassign (all the same) // If Mask_comp is true, then an empty mask is complemented. This case has -// already been handled by GB_assign_prep, which calls -// GB_bitmap_assign_noM_noaccum, with a scalar (which is unused). +// already been handled by GB_assign_prep, which calls GB_bitmap_assign with a +// scalar (which is unused). -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted only if C_replace is true. #undef GB_FREE_ALL -#define GB_FREE_ALL ; - -GrB_Info GB_bitmap_assign_noM_accum -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, // J index list - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], -// const GrB_Matrix M, // mask matrix, not present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued - const GrB_BinaryOp accum, // present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - const int assign_kind, // row assign, col assign, assign, or subassign - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP - GBURBLE_BITMAP_ASSIGN ("bit5", NULL, Mask_comp, accum, - Ikind, Jkind, assign_kind) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, no M, accum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, no M, accum", GB0) ; +{ //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap TODO: C full is OK - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP GB_GET_ACCUM_FOR_BITMAP //-------------------------------------------------------------------------- // do the assignment //-------------------------------------------------------------------------- - if (!Mask_comp) + if (!GB_MASK_COMP) { //---------------------------------------------------------------------- // C(I,J) += A or += scalar //---------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //------------------------------------------------------------------ @@ -108,17 +71,17 @@ GrB_Info GB_bitmap_assign_noM_accum if (cb == 0) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else \ { \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } else @@ -142,19 +105,18 @@ GrB_Info GB_bitmap_assign_noM_accum if (cb == 0) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else \ { \ /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" } - } #if 0 @@ -180,7 +142,7 @@ GrB_Info GB_bitmap_assign_noM_accum Cb [pC] = 0 ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_C_template.c" + #include "template/GB_bitmap_assign_C_template.c" } #endif @@ -189,6 +151,7 @@ GrB_Info GB_bitmap_assign_noM_accum //-------------------------------------------------------------------------- C->nvals = cnvals ; + GB_FREE_ALL ; ASSERT_MATRIX_OK (C, "C for bitmap assign, no M, accum", GB0) ; return (GrB_SUCCESS) ; } diff --git a/Source/assign/GB_bitmap_assign_noM_accum_whole.c b/Source/assign/template/GB_bitmap_assign_5_whole_template.c similarity index 76% rename from Source/assign/GB_bitmap_assign_noM_accum_whole.c rename to Source/assign/template/GB_bitmap_assign_5_whole_template.c index e1c3c7307f..644d5666e6 100644 --- a/Source/assign/GB_bitmap_assign_noM_accum_whole.c +++ b/Source/assign/template/GB_bitmap_assign_5_whole_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_noM_accum_whole: assign to C bitmap, mask M is not present +// GB_bitmap_assign_5_whole_template: C bitmap, no M, with accum //------------------------------------------------------------------------------ -// 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,67 +32,38 @@ // already been handled by GB_assign_prep, which calls GB_clear, and thus // Mask_comp is always false in this method. -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted only if C_replace is true. #undef GB_FREE_ALL -#define GB_FREE_ALL ; - -GrB_Info GB_bitmap_assign_noM_accum_whole -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C -// const GrB_Matrix M, // mask matrix, not present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued - const GrB_BinaryOp accum, // present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP - GBURBLE_BITMAP_ASSIGN ("bit5:whole", NULL, Mask_comp, accum, - GB_ALL, GB_ALL, GB_ASSIGN) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, no M, accum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, no M, accum", GB0) ; +{ //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP GB_GET_ACCUM_FOR_BITMAP //-------------------------------------------------------------------------- // do the assignment //-------------------------------------------------------------------------- - if (!Mask_comp) + if (!GB_MASK_COMP) { //---------------------------------------------------------------------- // C += A or += scalar //---------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //------------------------------------------------------------------ // scalar assignment: C += scalar //------------------------------------------------------------------ - // TODO: can skip the test for C_iso in the macros below #undef GB_CIJ_WORK #define GB_CIJ_WORK(pC) \ { \ @@ -100,17 +71,17 @@ GrB_Info GB_bitmap_assign_noM_accum_whole if (cb == 0) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ } \ else \ { \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ } if (!C_iso) { - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } // free the bitmap or set it to all ones @@ -131,7 +102,6 @@ GrB_Info GB_bitmap_assign_noM_accum_whole // C += A where C is bitmap and A is full //-------------------------------------------------------------- - // TODO: can skip the test for C_iso in the macros below #undef GB_CIJ_WORK #define GB_CIJ_WORK(pC) \ { \ @@ -139,17 +109,17 @@ GrB_Info GB_bitmap_assign_noM_accum_whole if (cb == 0) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pC, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ; \ } \ else \ { \ /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pC, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork,C_iso) ; \ } \ } if (!C_iso) { - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } // free the bitmap or set it to all ones @@ -172,18 +142,18 @@ GrB_Info GB_bitmap_assign_noM_accum_whole if (cb == 0) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pC, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork,C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else \ { \ /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pC, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork,C_iso) ;\ } \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" C->nvals = cnvals ; } @@ -201,17 +171,17 @@ GrB_Info GB_bitmap_assign_noM_accum_whole if (cb == 0) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork,C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else \ { \ /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pA,A_iso,ywork,C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" C->nvals = cnvals ; } } @@ -232,6 +202,7 @@ GrB_Info GB_bitmap_assign_noM_accum_whole // return result //-------------------------------------------------------------------------- + GB_FREE_ALL ; ASSERT_MATRIX_OK (C, "C for bitmap assign, no M, accum, whole", GB0) ; return (GrB_SUCCESS) ; } diff --git a/Source/assign/GB_bitmap_assign_noM_noaccum.c b/Source/assign/template/GB_bitmap_assign_6_template.c similarity index 67% rename from Source/assign/GB_bitmap_assign_noM_noaccum.c rename to Source/assign/template/GB_bitmap_assign_6_template.c index 21638ae567..fcbe2cb736 100644 --- a/Source/assign/GB_bitmap_assign_noM_noaccum.c +++ b/Source/assign/template/GB_bitmap_assign_6_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_noM_noaccum: assign to C bitmap +// GB_bitmap_assign_6_template: C bitmap, no M, no accum //------------------------------------------------------------------------------ -// 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,57 +32,22 @@ // complemented. This case is handled by GB_assign_prep by calling this // method with no matrix A, but with a scalar (which is unused). However, // for GB_ASSIGN, C(I,J)=anything clears all of C, regardless of -// I and J. In that case, GB_assign_prep calls GB_clear instead. +// I and J. In that case, GB_assign_prep calls GB_clear instead of this +// method (see the dead code below). -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. #undef GB_FREE_ALL -#define GB_FREE_ALL ; - -GrB_Info GB_bitmap_assign_noM_noaccum -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, // J index list - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], -// const GrB_Matrix M, // mask matrix, not present here - const bool Mask_comp, // true for !M, false for M - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - const int assign_kind, // row assign, col assign, assign, or subassign - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP - GBURBLE_BITMAP_ASSIGN ("bit6", NULL, Mask_comp, NULL, - Ikind, Jkind, assign_kind) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign: noM, noaccum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign: noM, noaccum", GB0) ; +{ //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP //-------------------------------------------------------------------------- // C_replace phase @@ -90,9 +55,10 @@ GrB_Info GB_bitmap_assign_noM_noaccum if (C_replace) { - if (assign_kind == GB_ASSIGN) - { + if (GB_ASSIGN_KIND == GB_ASSIGN) + { // for assign: set all Cb(:,:) to zero + // (this is currently dead code; see note above) GB_memset (Cb, 0, cnzmax, nthreads_max) ; cnvals = 0 ; } @@ -101,14 +67,15 @@ GrB_Info GB_bitmap_assign_noM_noaccum // for row assign: set Cb(i,:) to zero // for col assign: set Cb(:,j) to zero // for subassign: set all Cb(I,J) to zero - #define NO_ASSIGN_CASE #define GB_CIJ_WORK(pC) \ { \ int8_t cb = Cb [pC] ; \ Cb [pC] = 0 ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_C_template.c" + #define GB_NO_ASSIGN_CASE + #include "template/GB_bitmap_assign_C_template.c" + #undef GB_NO_ASSIGN_CASE } } @@ -116,10 +83,10 @@ GrB_Info GB_bitmap_assign_noM_noaccum // assignment phase //-------------------------------------------------------------------------- - if (!Mask_comp) + if (!GB_MASK_COMP) { - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //------------------------------------------------------------------ @@ -132,11 +99,11 @@ GrB_Info GB_bitmap_assign_noM_noaccum { \ int8_t cb = Cb [pC] ; \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals += (cb == 0) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } else @@ -156,7 +123,7 @@ GrB_Info GB_bitmap_assign_noM_noaccum Cb [pC] = 0 ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } // for all entries aij in A (A hyper, sparse, bitmap, or full) @@ -167,12 +134,13 @@ GrB_Info GB_bitmap_assign_noM_noaccum { \ int8_t cb = Cb [pC] ; \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 1 ; \ } - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" - cnvals += GB_nnz (A) ; + GB_A_NVALS (anz) ; + cnvals += anz ; } } @@ -181,6 +149,7 @@ GrB_Info GB_bitmap_assign_noM_noaccum //-------------------------------------------------------------------------- C->nvals = cnvals ; + GB_FREE_ALL ; ASSERT_MATRIX_OK (C, "final C for bitmap assign: noM, noaccum", GB0) ; return (GrB_SUCCESS) ; } diff --git a/Source/assign/template/GB_bitmap_assign_6b_whole_template.c b/Source/assign/template/GB_bitmap_assign_6b_whole_template.c new file mode 100644 index 0000000000..6a8d90335a --- /dev/null +++ b/Source/assign/template/GB_bitmap_assign_6b_whole_template.c @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_6b_whole_template: C bitmap, no M, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#undef GB_FREE_ALL +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_GET_C_A_SCALAR_FOR_BITMAP + + //-------------------------------------------------------------------------- + // C = A, where C is bitmap and A is sparse/hyper + //-------------------------------------------------------------------------- + + GB_memset (Cb, 0, cnzmax, nthreads_max) ; + cnvals = 0 ; + #define GB_AIJ_WORK(pC,pA) \ + { \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_aij_to_C (Cx,pC,Ax,pA,A_iso,cwork,C_iso) ; \ + Cb [pC] = 1 ; \ + } + #include "template/GB_bitmap_assign_A_whole_template.c" + GB_A_NVALS (anz) ; + C->nvals = anz ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + ASSERT_MATRIX_OK (C, "final C bitmap assign_6b_whole", GB0) ; + return (GrB_SUCCESS) ; +} + diff --git a/Source/assign/GB_bitmap_assign_notM_accum.c b/Source/assign/template/GB_bitmap_assign_7_template.c similarity index 65% rename from Source/assign/GB_bitmap_assign_notM_accum.c rename to Source/assign/template/GB_bitmap_assign_7_template.c index e2f1a08c68..21a009c6ae 100644 --- a/Source/assign/GB_bitmap_assign_notM_accum.c +++ b/Source/assign/template/GB_bitmap_assign_7_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_notM_accum: assign to C bitmap +// GB_bitmap_assign_7_template: C bitmap, !M sparse/hyper, with accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -22,61 +22,19 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign, row assign, col assign, or subassign -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted only if C_replace is true. #undef GB_FREE_ALL -#define GB_FREE_ALL \ -{ \ - GB_WERK_POP (M_ek_slicing, int64_t) ; \ -} +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP -GrB_Info GB_bitmap_assign_notM_accum -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, // J index list - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix -// const bool Mask_comp, // true here, for !M only - const bool Mask_struct, // true if M is structural, false if valued - const GrB_BinaryOp accum, // present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - const int assign_kind, // row assign, col assign, assign, or subassign - GB_Werk Werk -) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GBURBLE_BITMAP_ASSIGN ("bit7", M, true, accum, - Ikind, Jkind, assign_kind) ; - ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, !M, accum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, !M, accum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, !M, accum", GB0) ; - //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_SLICE_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_SLICE_M_FOR_BITMAP GB_GET_ACCUM_FOR_BITMAP //-------------------------------------------------------------------------- @@ -84,15 +42,23 @@ GrB_Info GB_bitmap_assign_notM_accum //-------------------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, assign_kind, GB_BITMAP_M_SCATTER_PLUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] += 2 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_template.c" + #undef GB_NO_CNVALS + + // the bitmap of C now contains: + // Cb (i,j) = 0: mij == 0, cij not present, can be modified + // Cb (i,j) = 1: mij == 0, cij present, can be modified + // Cb (i,j) = 2: mij == 1, cij not present, do not modify + // Cb (i,j) = 3: mij == 1, cij present, do not modify //-------------------------------------------------------------------------- // do the assignment //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -106,17 +72,17 @@ GrB_Info GB_bitmap_assign_notM_accum if (cb == 0) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else if (cb == 1) \ { \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } else @@ -143,17 +109,17 @@ GrB_Info GB_bitmap_assign_notM_accum if (cb == 0) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else if (cb == 1) \ { \ /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" } //-------------------------------------------------------------------------- @@ -166,9 +132,11 @@ GrB_Info GB_bitmap_assign_notM_accum // 2 -> 0 // 3 -> 1 keep this entry // Cb [pC] -= 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, assign_kind, GB_BITMAP_M_SCATTER_MINUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] -= 2 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_template.c" + #undef GB_NO_CNVALS } else { @@ -182,7 +150,7 @@ GrB_Info GB_bitmap_assign_notM_accum task_cnvals -= (cb == 3) ; \ Cb [pC] = 0 ; \ } - #include "assign/factory/GB_bitmap_assign_M_template.c" + #include "template/GB_bitmap_assign_M_template.c" } //-------------------------------------------------------------------------- diff --git a/Source/assign/GB_bitmap_assign_notM_accum_whole.c b/Source/assign/template/GB_bitmap_assign_7_whole_template.c similarity index 82% rename from Source/assign/GB_bitmap_assign_notM_accum_whole.c rename to Source/assign/template/GB_bitmap_assign_7_whole_template.c index b46f817daf..6ec5e41e6f 100644 --- a/Source/assign/GB_bitmap_assign_notM_accum_whole.c +++ b/Source/assign/template/GB_bitmap_assign_7_whole_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_notM_accum_whole: assign to C bitmap +// GB_bitmap_assign_7_whole_template: C bitmap, !M sparse/hyper, with accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -22,53 +22,19 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign or subassign (same action) -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted only if C_replace is true. #undef GB_FREE_ALL -#define GB_FREE_ALL \ -{ \ - GB_WERK_POP (M_ek_slicing, int64_t) ; \ -} +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP -GrB_Info GB_bitmap_assign_notM_accum_whole -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Matrix M, // mask matrix -// const bool Mask_comp, // true here, for !M only - const bool Mask_struct, // true if M is structural, false if valued - const GrB_BinaryOp accum, // present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - GB_Werk Werk -) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GBURBLE_BITMAP_ASSIGN ("bit7:whole", M, true, accum, - GB_ALL, GB_ALL, GB_ASSIGN) ; - ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; - ASSERT (GB_JUMBLED_OK (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, !M, accum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, !M, accum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, !M, accum", GB0) ; - //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_SLICE_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_SLICE_M_FOR_BITMAP GB_GET_ACCUM_FOR_BITMAP //-------------------------------------------------------------------------- @@ -76,9 +42,8 @@ GrB_Info GB_bitmap_assign_notM_accum_whole //-------------------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero // Cb (i,j) = 1: cij present, mij zero @@ -89,7 +54,7 @@ GrB_Info GB_bitmap_assign_notM_accum_whole // do the assignment //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -110,13 +75,13 @@ GrB_Info GB_bitmap_assign_notM_accum_whole { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ break ; \ case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ /* clear the mask from C */ \ @@ -130,7 +95,7 @@ GrB_Info GB_bitmap_assign_notM_accum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -147,13 +112,13 @@ GrB_Info GB_bitmap_assign_notM_accum_whole { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ /* Cx [pC] += scalar */ \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ break ; \ case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ /* clear the mask from C */ \ @@ -166,7 +131,7 @@ GrB_Info GB_bitmap_assign_notM_accum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } @@ -197,19 +162,21 @@ GrB_Info GB_bitmap_assign_notM_accum_whole switch (Cb [pC]) \ { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ + C_iso) ; \ } \ break ; \ case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ @@ -224,7 +191,7 @@ GrB_Info GB_bitmap_assign_notM_accum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -240,19 +207,21 @@ GrB_Info GB_bitmap_assign_notM_accum_whole switch (Cb [pC]) \ { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] += Ax [pC] */ \ - GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork) ; \ + GB_ACCUMULATE_aij (Cx,pC,Ax,pC,A_iso,ywork, \ + C_iso) ; \ } \ Cb [pC] = 1 ; \ break ; \ @@ -267,7 +236,7 @@ GrB_Info GB_bitmap_assign_notM_accum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } @@ -286,17 +255,17 @@ GrB_Info GB_bitmap_assign_notM_accum_whole if (cb == 0) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ else if (cb == 1) \ { \ /* Cx [pC] += Ax [pA] */ \ - GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork) ; \ + GB_ACCUMULATE_aij (Cx, pC, Ax, pA, A_iso, ywork, C_iso) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" if (C_replace) { @@ -308,14 +277,14 @@ GrB_Info GB_bitmap_assign_notM_accum_whole Cb [pC] = 0 ; \ task_cnvals -= (cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_M_all_template.c" + #include "template/GB_bitmap_assign_M_all_template.c" } else { // clear the mask // Cb [pC] -= 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_MINUS_2, + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_MINUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; } } diff --git a/Source/assign/GB_bitmap_assign_notM_noaccum.c b/Source/assign/template/GB_bitmap_assign_8_template.c similarity index 67% rename from Source/assign/GB_bitmap_assign_notM_noaccum.c rename to Source/assign/template/GB_bitmap_assign_8_template.c index 7f1deaa0aa..dcc6bfd674 100644 --- a/Source/assign/GB_bitmap_assign_notM_noaccum.c +++ b/Source/assign/template/GB_bitmap_assign_8_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_notM_noaccum: assign to C bitmap +// GB_bitmap_assign_8_template: C bitmap, !M sparse/hyper, no accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -22,82 +22,43 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign, row assign, col assign, or subassign -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. #undef GB_FREE_ALL -#define GB_FREE_ALL \ -{ \ - GB_WERK_POP (M_ek_slicing, int64_t) ; \ -} +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP -GrB_Info GB_bitmap_assign_notM_noaccum -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Index *I, // I index list - const int64_t nI, - const int Ikind, - const int64_t Icolon [3], - const GrB_Index *J, // J index list - const int64_t nJ, - const int Jkind, - const int64_t Jcolon [3], - const GrB_Matrix M, // mask matrix -// const bool Mask_comp, // true here, for !M only - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - const int assign_kind, // row assign, col assign, assign, or subassign - GB_Werk Werk -) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GBURBLE_BITMAP_ASSIGN ("bit8", M, true, NULL, - Ikind, Jkind, assign_kind) ; - ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, !M, noaccum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, !M, noaccum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, !M, noaccum", GB0) ; - //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_SLICE_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_SLICE_M_FOR_BITMAP //-------------------------------------------------------------------------- // scatter M into the bitmap of C //-------------------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, assign_kind, GB_BITMAP_M_SCATTER_PLUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; - - // Cb (i,j) = 0: cij not present, mij zero: can be modified - // Cb (i,j) = 1: cij present, mij zero: can be modified, - // but delete if aij not present - // Cb (i,j) = 2: cij not present, mij == 1: do not modify - // Cb (i,j) = 3: cij present, mij == 1: do not modify + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] += 2 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_template.c" + #undef GB_NO_CNVALS + + // the bitmap of C now contains: + // Cb (i,j) = 0: mij == 0, cij not present, do not modify + // Cb (i,j) = 1: mij == 0, cij present, do not modify + // Cb (i,j) = 2: mij == 1, cij not present, can be modified + // Cb (i,j) = 3: mij == 1, cij present, can be modified //-------------------------------------------------------------------------- // assign A into C //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -111,7 +72,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum if (cb <= 1) \ { \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals += (cb == 0) ; \ } \ @@ -127,7 +88,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum Cb [pC] = (cb == 3) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } else @@ -154,12 +115,12 @@ GrB_Info GB_bitmap_assign_notM_noaccum if (cb <= 1) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 4 ; \ task_cnvals += (cb == 0) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_template.c" + #include "template/GB_bitmap_assign_A_template.c" //---------------------------------------------------------------------- // handle entries in IxJ @@ -175,7 +136,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum Cb [pC] = (cb == 4) ; \ task_cnvals -= (cb == 1 || cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } else { @@ -187,7 +148,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum Cb [pC] = (cb == 4 || cb == 3) ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } } @@ -195,7 +156,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum // handle entries outside of IxJ //-------------------------------------------------------------------------- - if (assign_kind == GB_SUBASSIGN) + if (GB_ASSIGN_KIND == GB_SUBASSIGN) { // see above. no more work to do } @@ -211,16 +172,20 @@ GrB_Info GB_bitmap_assign_notM_noaccum Cb [pC] = (cb == 1) ; \ task_cnvals -= (cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_C_template.c" + #include "template/GB_bitmap_assign_C_template.c" } else { // clear M from C // Cb [pC] %= 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, - M, Mask_struct, assign_kind, GB_BITMAP_M_SCATTER_MOD_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + #undef GB_MASK_WORK + #define GB_MASK_WORK(pC) Cb [pC] &= 1 + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_M_template.c" + #undef GB_NO_CNVALS + } + #undef GB_NO_SUBASSIGN_CASE } //-------------------------------------------------------------------------- diff --git a/Source/assign/GB_bitmap_assign_notM_noaccum_whole.c b/Source/assign/template/GB_bitmap_assign_8_whole_template.c similarity index 83% rename from Source/assign/GB_bitmap_assign_notM_noaccum_whole.c rename to Source/assign/template/GB_bitmap_assign_8_whole_template.c index 2b05ac6b4c..9714a6690a 100644 --- a/Source/assign/GB_bitmap_assign_notM_noaccum_whole.c +++ b/Source/assign/template/GB_bitmap_assign_8_whole_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_bitmap_assign_notM_noaccum_whole: assign to C bitmap +// GB_bitmap_assign_8_whole_template: C bitmap, !M sparse/hyper, no accum //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -22,61 +22,28 @@ // A: matrix (hyper, sparse, bitmap, or full), or scalar // kind: assign or subassign (same action) -// JIT: needed. - -#include "assign/GB_bitmap_assign_methods.h" -#include "assign/include/GB_assign_shared_definitions.h" +// If C were full: entries can be deleted if C_replace is true, +// or if A is not full and missing at least one entry. #undef GB_FREE_ALL -#define GB_FREE_ALL \ -{ \ - GB_WERK_POP (M_ek_slicing, int64_t) ; \ -} +#define GB_FREE_ALL GB_FREE_ALL_FOR_BITMAP -GrB_Info GB_bitmap_assign_notM_noaccum_whole -( - // input/output: - GrB_Matrix C, // input/output matrix in bitmap format - // inputs: - const bool C_replace, // descriptor for C - const GrB_Matrix M, // mask matrix -// const bool Mask_comp, // true here, for !M only - const bool Mask_struct, // true if M is structural, false if valued -// const GrB_BinaryOp accum, // not present - const GrB_Matrix A, // input matrix, not transposed - const void *scalar, // input scalar - const GrB_Type scalar_type, // type of input scalar - GB_Werk Werk -) { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - GBURBLE_BITMAP_ASSIGN ("bit8:whole", M, true, NULL, - GB_ALL, GB_ALL, GB_ASSIGN) ; - ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; - ASSERT_MATRIX_OK (C, "C for bitmap assign, !M, noaccum", GB0) ; - ASSERT_MATRIX_OK (M, "M for bitmap assign, !M, noaccum", GB0) ; - ASSERT_MATRIX_OK_OR_NULL (A, "A for bitmap assign, !M, noaccum", GB0) ; - //-------------------------------------------------------------------------- // get inputs //-------------------------------------------------------------------------- - GB_GET_C_BITMAP ; // C must be bitmap - GB_SLICE_M - GB_GET_A_AND_SCALAR + GB_GET_C_A_SCALAR_FOR_BITMAP + GB_SLICE_M_FOR_BITMAP //-------------------------------------------------------------------------- // scatter M into the bitmap of C //-------------------------------------------------------------------------- // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter_whole (C, - M, Mask_struct, GB_BITMAP_M_SCATTER_PLUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + GB_bitmap_M_scatter_whole (C, M, GB_MASK_STRUCT, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero // Cb (i,j) = 1: cij present, mij zero @@ -87,7 +54,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole // do the assignment //-------------------------------------------------------------------------- - if (A == NULL) + if (GB_SCALAR_ASSIGN) { //---------------------------------------------------------------------- @@ -108,13 +75,13 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ break ; \ case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ /* clear the mask from C */ \ @@ -128,7 +95,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -145,13 +112,13 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ /* Cx [pC] = scalar */ \ - GB_COPY_scalar_to_C (Cx, pC, cwork) ; \ + GB_COPY_cwork_to_C (Cx, pC, cwork, C_iso) ; \ break ; \ case 2: /* C(i,j) not present, !M(i,j) = 0 */ \ /* clear the mask from C */ \ @@ -164,7 +131,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } @@ -195,19 +162,21 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole switch (Cb [pC]) \ { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ } \ else \ { \ @@ -228,7 +197,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else @@ -244,19 +213,21 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole switch (Cb [pC]) \ { \ case 0: /* C(i,j) not present, !M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ Cb [pC] = 1 ; \ task_cnvals++ ; \ } \ break ; \ case 1: /* C(i,j) present, !M(i,j) = 1 */ \ - if (GBB (Ab, pC)) \ + if (GBB_A (Ab, pC)) \ { \ /* Cx [pC] = Ax [pC] */ \ - GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork) ; \ + GB_COPY_aij_to_C (Cx,pC,Ax,pC,A_iso,cwork, \ + C_iso) ; \ } \ else \ { \ @@ -276,7 +247,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole default: ; \ } \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } @@ -295,12 +266,12 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole if (cb <= 1) \ { \ /* Cx [pC] = Ax [pA] */ \ - GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork) ; \ + GB_COPY_aij_to_C (Cx, pC, Ax, pA, A_iso, cwork, C_iso) ; \ Cb [pC] = 4 ; \ task_cnvals += (cb == 0) ; \ } \ } - #include "assign/factory/GB_bitmap_assign_A_whole_template.c" + #include "template/GB_bitmap_assign_A_whole_template.c" // clear the mask and delete entries not assigned if (C_replace) @@ -312,7 +283,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole Cb [pC] = (cb == 4) ; \ task_cnvals -= (cb == 1 || cb == 3) ; \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } else { @@ -323,7 +294,7 @@ GrB_Info GB_bitmap_assign_notM_noaccum_whole Cb [pC] = (cb == 4 || cb == 3) ; \ task_cnvals -= (cb == 1) ; \ } - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } } } diff --git a/Source/assign/factory/GB_bitmap_assign_A_template.c b/Source/assign/template/GB_bitmap_assign_A_template.c similarity index 68% rename from Source/assign/factory/GB_bitmap_assign_A_template.c rename to Source/assign/template/GB_bitmap_assign_A_template.c index 387d0de632..e9b2e8cbdf 100644 --- a/Source/assign/factory/GB_bitmap_assign_A_template.c +++ b/Source/assign/template/GB_bitmap_assign_A_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_A_template: traverse over A for bitmap assignment into C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -11,20 +11,35 @@ // the corresponding entry in C(i,j), using the GB_AIJ_WORK macro. A can be // hypersparse, sparse, bitmap, or full. It is not a scalar. The matrix // C must be bitmap or full. +// +// The workspace must already be declared as follows: +// +// GB_WERK_DECLARE (A_ek_slicing, int64_t) ; +// int A_ntasks = 0, A_nthreads = 0 ; +// +// The workspace is allocated and tasks are computed, if not already done. +// It is not freed, so it can be used for subsequent uses of this template. +// To free the workspace, the method that uses this template must do: +// +// GB_WERK_POP (A_ek_slicing, int64_t) ; { //-------------------------------------------------------------------------- - // matrix assignment: slice the entries of A for each task + // slice the matrix A //-------------------------------------------------------------------------- - GB_WERK_DECLARE (A_ek_slicing, int64_t) ; - int A_ntasks, A_nthreads ; - GB_A_NHELD (A_nnz_held) ; - GB_SLICE_MATRIX_WORK (A, 8, A_nnz_held + A->nvec, A_nnz_held) ; + if (A_ek_slicing == NULL) + { + GB_A_NHELD (A_nnz_held) ; + GB_SLICE_MATRIX_WORK (A, 8, A_nnz_held + A->nvec, A_nnz_held) ; + } + const int64_t *restrict kfirst_Aslice = A_ek_slicing ; + const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; + const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; //-------------------------------------------------------------------------- - // traverse of the entries of the matrix A + // traverse the entries of the matrix A //-------------------------------------------------------------------------- int tid ; @@ -50,22 +65,21 @@ //------------------------------------------------------------------ int64_t jA = GBH_A (Ah, k) ; - int64_t pA_start, pA_end ; - GB_get_pA (&pA_start, &pA_end, tid, k, kfirst, - klast, pstart_Aslice, Ap, nI) ; + GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, + GBP_A (Ap, k, nI), GBP_A (Ap, k+1, nI)) ; //------------------------------------------------------------------ // traverse over A(:,jA), the kth vector of A //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, jA, Jkind, Jcolon) ; - int64_t pC0 = jC * cvlen ; // first entry in C(:,jC) + int64_t jC = GB_ijlist (J, jA, GB_J_KIND, Jcolon) ; + int64_t pC0 = jC * Cvlen ; // first entry in C(:,jC) for (int64_t pA = pA_start ; pA < pA_end ; pA++) { if (!GBB_A (Ab, pA)) continue ; int64_t iA = GBI_A (Ai, pA, nI) ; - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; int64_t pC = iC + pC0 ; // operate on C(iC,jC) at pC, and A(iA,jA) at pA. The mask // can be accessed at pC if M is bitmap or full. A has any @@ -75,13 +89,9 @@ GB_AIJ_WORK (pC, pA) ; } } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } - - //-------------------------------------------------------------------------- - // free workspace - //-------------------------------------------------------------------------- - - GB_WERK_POP (A_ek_slicing, int64_t) ; } diff --git a/Source/assign/factory/GB_bitmap_assign_A_whole_template.c b/Source/assign/template/GB_bitmap_assign_A_whole_template.c similarity index 65% rename from Source/assign/factory/GB_bitmap_assign_A_whole_template.c rename to Source/assign/template/GB_bitmap_assign_A_whole_template.c index 3914eec391..7817a0e20d 100644 --- a/Source/assign/factory/GB_bitmap_assign_A_whole_template.c +++ b/Source/assign/template/GB_bitmap_assign_A_whole_template.c @@ -2,29 +2,44 @@ // GB_bitmap_assign_A_whole_template: traverse A for bitmap assignment into C //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ // This template traverses over all the entries of the matrix A and operates on // the corresponding entry in C(i,j), using the GB_AIJ_WORK macro. A can be -// hypersparse or sparse, not bitmap or full. It is not a scalar. +// hypersparse or sparse (not bitmap or full). It is not a scalar. The matrix +// C must be bitmap or full. +// +// The workspace must already be declared as follows: +// +// GB_WERK_DECLARE (A_ek_slicing, int64_t) ; +// int A_ntasks = 0, A_nthreads = 0 ; +// +// The workspace is allocated and tasks are computed, if not already done. +// It is not freed, so it can be used for subsequent uses of this template. +// To free the workspace, the method that uses this template must do: +// +// GB_WERK_POP (A_ek_slicing, int64_t) ; { //-------------------------------------------------------------------------- - // matrix assignment: slice the entries of A for each task + // slice the matrix A //-------------------------------------------------------------------------- - GB_WERK_DECLARE (A_ek_slicing, int64_t) ; - const int64_t avlen = A->vlen ; - int A_ntasks, A_nthreads ; - GB_A_NHELD (A_nnz_held) ; - GB_SLICE_MATRIX_WORK (A, 8, A_nnz_held + A->nvec, A_nnz_held) ; + if (A_ek_slicing == NULL) + { + GB_A_NHELD (A_nnz_held) ; + GB_SLICE_MATRIX_WORK (A, 8, A_nnz_held + A->nvec, A_nnz_held) ; + } + const int64_t *restrict kfirst_Aslice = A_ek_slicing ; + const int64_t *restrict klast_Aslice = A_ek_slicing + A_ntasks ; + const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2 ; //-------------------------------------------------------------------------- - // traverse of the entries of the matrix A + // traverse the entries of the matrix A //-------------------------------------------------------------------------- int tid ; @@ -50,15 +65,14 @@ //------------------------------------------------------------------ int64_t j = GBH_A (Ah, k) ; - int64_t pA_start, pA_end ; - GB_get_pA (&pA_start, &pA_end, tid, k, kfirst, - klast, pstart_Aslice, Ap, avlen) ; + GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, + GBP_A (Ap, k, Avlen), GBP_A (Ap, k+1, Avlen)) ; //------------------------------------------------------------------ // traverse over A(:,j), the kth vector of A //------------------------------------------------------------------ - int64_t pC0 = j * cvlen ; // first entry in C(:,j) + int64_t pC0 = j * Cvlen ; // first entry in C(:,j) for (int64_t pA = pA_start ; pA < pA_end ; pA++) { @@ -70,13 +84,9 @@ GB_AIJ_WORK (pC, pA) ; } } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } - - //-------------------------------------------------------------------------- - // free workspace - //-------------------------------------------------------------------------- - - GB_WERK_POP (A_ek_slicing, int64_t) ; } diff --git a/Source/assign/factory/GB_bitmap_assign_C_template.c b/Source/assign/template/GB_bitmap_assign_C_template.c similarity index 85% rename from Source/assign/factory/GB_bitmap_assign_C_template.c rename to Source/assign/template/GB_bitmap_assign_C_template.c index 264f761457..20f6657fe3 100644 --- a/Source/assign/factory/GB_bitmap_assign_C_template.c +++ b/Source/assign/template/GB_bitmap_assign_C_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_C_template: iterate over a bitmap matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,21 +31,23 @@ { // iterate over all of C(iC,:) const int64_t iC = I [0] ; - const int nthreads = GB_nthreads (cvdim, chunk, nthreads_max) ; + const int nthreads = GB_nthreads (Cvdim, chunk, nthreads_max) ; int tid ; #pragma omp parallel for num_threads(nthreads) schedule(static) \ reduction(+:cnvals) for (tid = 0 ; tid < nthreads ; tid++) { int64_t jC_start, jC_end, task_cnvals = 0 ; - GB_PARTITION (jC_start, jC_end, cvdim, tid, nthreads) ; + GB_PARTITION (jC_start, jC_end, Cvdim, tid, nthreads) ; for (int64_t jC = jC_start ; jC < jC_end ; jC++) { - int64_t pC = iC + jC * cvlen ; + int64_t pC = iC + jC * Cvlen ; GB_GET_MIJ (mij, jC) ; // mij = Mask (jC) GB_CIJ_WORK (pC) ; // operate on C(iC,jC) } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } } break ; @@ -58,22 +60,24 @@ { // iterate over all of C(:,jC) const int64_t jC = J [0] ; - const int64_t pC0 = jC * cvlen ; - const int nthreads = GB_nthreads (cvlen, chunk, nthreads_max) ; + const int64_t pC0 = jC * Cvlen ; + const int nthreads = GB_nthreads (Cvlen, chunk, nthreads_max) ; int tid ; #pragma omp parallel for num_threads(nthreads) schedule(static) \ reduction(+:cnvals) for (tid = 0 ; tid < nthreads ; tid++) { int64_t iC_start, iC_end, task_cnvals = 0 ; - GB_PARTITION (iC_start, iC_end, cvlen, tid, nthreads) ; + GB_PARTITION (iC_start, iC_end, Cvlen, tid, nthreads) ; for (int64_t iC = iC_start ; iC < iC_end ; iC++) { int64_t pC = iC + pC0 ; GB_GET_MIJ (mij, iC) ; // mij = Mask (iC) GB_CIJ_WORK (pC) ; // operate on C(iC,jC) } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } } break ; @@ -86,7 +90,7 @@ case GB_ASSIGN : { // iterate over all of C(:,:). - #include "assign/factory/GB_bitmap_assign_C_whole_template.c" + #include "template/GB_bitmap_assign_C_whole_template.c" } break ; #endif @@ -105,7 +109,7 @@ GB_GET_MIJ (mij, pA) ; /* mij = Mask (pA) */ \ GB_CIJ_WORK (pC) ; /* operate on C(iC,jC) */ \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } break ; #endif @@ -114,5 +118,3 @@ } } -#undef GB_NO_ASSIGN_CASE -#undef GB_NO_SUBASSIGN_CASE diff --git a/Source/assign/factory/GB_bitmap_assign_C_whole_template.c b/Source/assign/template/GB_bitmap_assign_C_whole_template.c similarity index 88% rename from Source/assign/factory/GB_bitmap_assign_C_whole_template.c rename to Source/assign/template/GB_bitmap_assign_C_whole_template.c index 4968d46e0e..b48926b34c 100644 --- a/Source/assign/factory/GB_bitmap_assign_C_whole_template.c +++ b/Source/assign/template/GB_bitmap_assign_C_whole_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_C_whole_template: iterate over a bitmap matrix C //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -31,11 +31,14 @@ GB_PARTITION (pC_start, pC_end, cnzmax, tid, nthreads) ; for (int64_t pC = pC_start ; pC < pC_end ; pC++) { - // int64_t iC = pC % cvlen ; - // int64_t jC = pC / cvlen ; + // int64_t iC = pC % Cvlen ; + // int64_t jC = pC / Cvlen ; GB_GET_MIJ (mij, pC) ; // mij = Mask (pC) GB_CIJ_WORK (pC) ; // operate on C(iC,jC) } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } } + diff --git a/Source/assign/factory/GB_bitmap_assign_IxJ_template.c b/Source/assign/template/GB_bitmap_assign_IxJ_template.c similarity index 69% rename from Source/assign/factory/GB_bitmap_assign_IxJ_template.c rename to Source/assign/template/GB_bitmap_assign_IxJ_template.c index 6986d0a102..f8f52ec745 100644 --- a/Source/assign/factory/GB_bitmap_assign_IxJ_template.c +++ b/Source/assign/template/GB_bitmap_assign_IxJ_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_IxJ_template: iterate over all of C(I,J) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,34 +15,48 @@ // For bitmap assignent, C(I,J)=A is being computed. For bitmap extraction, // C=A(I,J) so the roles of A and C are swapped (see GB_bitmap_subref.c). +// The workspace must already have been declared as follow: +// +// GB_task_struct *TaskList_IxJ = NULL ; size_t TaskList_IxJ_size = 0 ; +// int ntasks_IxJ = 0, nthreads_IxJ = 0 ; + +// This template is used in the GB_bitmap_assign_* methods, and +// GB_bitmap_subref. vlen = C->vlen must be assigned. + +// The workspace is allocated and tasks are computed, if not already done. +// It is not freed, so it can be used for subsequent uses of this template. +// To free the workspace, the method that uses this template must do: +// +// GB_FREE_WORK (&TaskList_IxJ, TaskList_IxJ_size) ; + { //-------------------------------------------------------------------------- - // create the tasks to iterate over IxJ + // slice IxJ //-------------------------------------------------------------------------- - int ntasks = 0, nthreads ; - GB_task_struct *TaskList = NULL ; size_t TaskList_size = 0 ; - GB_OK (GB_subassign_IxJ_slice (&TaskList, &TaskList_size, &ntasks, - &nthreads, /* I, */ nI, /* Ikind, Icolon, J, */ nJ, - /* Jkind, Jcolon, */ Werk)) ; + if (TaskList_IxJ == NULL) + { + GB_OK (GB_subassign_IxJ_slice (&TaskList_IxJ, &TaskList_IxJ_size, + &ntasks_IxJ, &nthreads_IxJ, nI, nJ, Werk)) ; + } //-------------------------------------------------------------------------- // iterate over all IxJ //-------------------------------------------------------------------------- int taskid ; - #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + #pragma omp parallel for num_threads(nthreads_IxJ) schedule(dynamic,1) \ reduction(+:cnvals) - for (taskid = 0 ; taskid < ntasks ; taskid++) + for (taskid = 0 ; taskid < ntasks_IxJ ; taskid++) { //---------------------------------------------------------------------- // get the task descriptor //---------------------------------------------------------------------- - int64_t kfirst = TaskList [taskid].kfirst ; - int64_t klast = TaskList [taskid].klast ; + int64_t kfirst = TaskList_IxJ [taskid].kfirst ; + int64_t klast = TaskList_IxJ [taskid].klast ; int64_t task_cnvals = 0 ; bool fine_task = (klast == -1) ; int64_t iA_start = 0, iA_end = nI ; @@ -50,8 +64,8 @@ { // a fine task operates on a slice of a single vector klast = kfirst ; - iA_start = TaskList [taskid].pA ; - iA_end = TaskList [taskid].pA_end ; + iA_start = TaskList_IxJ [taskid].pA ; + iA_end = TaskList_IxJ [taskid].pA_end ; } //---------------------------------------------------------------------- @@ -65,7 +79,7 @@ // get jC, the corresponding vector of C //------------------------------------------------------------------ - int64_t jC = GB_ijlist (J, jA, Jkind, Jcolon) ; + int64_t jC = GB_ijlist (J, jA, GB_J_KIND, Jcolon) ; int64_t pC0 = jC * vlen ; // first entry in C(:,jC) int64_t pA0 = jA * nI ; // first entry in A(:,jA) @@ -75,7 +89,7 @@ for (int64_t iA = iA_start ; iA < iA_end ; iA++) { - int64_t iC = GB_ijlist (I, iA, Ikind, Icolon) ; + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; int64_t pC = iC + pC0 ; int64_t pA = iA + pA0 ; // operate on C(iC,jC) at pC (if C is bitmap or full) @@ -85,13 +99,9 @@ GB_IXJ_WORK (pC, pA) ; } } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } - - //-------------------------------------------------------------------------- - // free workpace - //-------------------------------------------------------------------------- - - GB_FREE_WORK (&TaskList, TaskList_size) ; } diff --git a/Source/assign/factory/GB_bitmap_assign_M_all_template.c b/Source/assign/template/GB_bitmap_assign_M_all_template.c similarity index 84% rename from Source/assign/factory/GB_bitmap_assign_M_all_template.c rename to Source/assign/template/GB_bitmap_assign_M_all_template.c index 14a3833559..3d1a1ac552 100644 --- a/Source/assign/factory/GB_bitmap_assign_M_all_template.c +++ b/Source/assign/template/GB_bitmap_assign_M_all_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_all_template: traverse M for GB_ASSIGN //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -14,6 +14,10 @@ // C is bitmap/full. M is sparse/hyper, and can be jumbled. { + ASSERT (GB_IS_BITMAP (C) || GB_IS_FULL (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT (GB_JUMBLED_OK (M)) ; + const int64_t *restrict kfirst_Mslice = M_ek_slicing ; const int64_t *restrict klast_Mslice = M_ek_slicing + M_ntasks ; const int64_t *restrict pstart_Mslice = M_ek_slicing + M_ntasks * 2 ; @@ -39,9 +43,8 @@ //------------------------------------------------------------------ int64_t jM = GBH_M (Mh, k) ; - int64_t pM_start, pM_end ; - GB_get_pA (&pM_start, &pM_end, tid, k, kfirst, - klast, pstart_Mslice, Mp, Mvlen) ; + GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, pstart_Mslice, + Mp [k], Mp [k+1]) ; //------------------------------------------------------------------ // traverse over M(:,jM), the kth vector of M @@ -56,12 +59,14 @@ if (mij) { int64_t iC = Mi [pM] ; - int64_t pC = iC + jC * cvlen ; + int64_t pC = iC + jC * Cvlen ; GB_MASK_WORK (pC) ; } } } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } } diff --git a/Source/assign/factory/GB_bitmap_assign_M_col_template.c b/Source/assign/template/GB_bitmap_assign_M_col_template.c similarity index 84% rename from Source/assign/factory/GB_bitmap_assign_M_col_template.c rename to Source/assign/template/GB_bitmap_assign_M_col_template.c index 807683d74b..bdce18551c 100644 --- a/Source/assign/factory/GB_bitmap_assign_M_col_template.c +++ b/Source/assign/template/GB_bitmap_assign_M_col_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_col_template: traverse M for GB_COL_ASSIGN //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,10 @@ // C is bitmap/full. M is sparse/hyper, and can be jumbled. { + ASSERT (GB_IS_BITMAP (C) || GB_IS_FULL (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT (GB_JUMBLED_OK (M)) ; + const int64_t *restrict kfirst_Mslice = M_ek_slicing ; const int64_t *restrict klast_Mslice = M_ek_slicing + M_ntasks ; const int64_t *restrict pstart_Mslice = M_ek_slicing + M_ntasks * 2 ; @@ -40,9 +44,8 @@ ASSERT (k == 0) ; ASSERT (GBH_M (Mh, k) == 0) ; - int64_t pM_start, pM_end ; - GB_get_pA (&pM_start, &pM_end, tid, k, kfirst, - klast, pstart_Mslice, Mp, Mvlen) ; + GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, pstart_Mslice, + Mp [k], Mp [k+1]) ; //------------------------------------------------------------------ // traverse over M(:,0), the kth vector of M @@ -55,12 +58,14 @@ if (mij) { int64_t iC = Mi [pM] ; - int64_t pC = iC + jC * cvlen ; + int64_t pC = iC + jC * Cvlen ; GB_MASK_WORK (pC) ; } } } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } } diff --git a/Source/assign/factory/GB_bitmap_assign_M_row_template.c b/Source/assign/template/GB_bitmap_assign_M_row_template.c similarity index 84% rename from Source/assign/factory/GB_bitmap_assign_M_row_template.c rename to Source/assign/template/GB_bitmap_assign_M_row_template.c index 64414c672a..487cb31cd6 100644 --- a/Source/assign/factory/GB_bitmap_assign_M_row_template.c +++ b/Source/assign/template/GB_bitmap_assign_M_row_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_row_template: traverse M for GB_ROW_ASSIGN //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -13,6 +13,9 @@ // C is bitmap/full. M is sparse/hyper, and can be jumbled. { + ASSERT (GB_IS_BITMAP (C) || GB_IS_FULL (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT (GB_JUMBLED_OK (M)) ; const int64_t *restrict kfirst_Mslice = M_ek_slicing ; const int64_t *restrict klast_Mslice = M_ek_slicing + M_ntasks ; @@ -41,9 +44,8 @@ //------------------------------------------------------------------ int64_t jM = GBH_M (Mh, k) ; - int64_t pM_start, pM_end ; - GB_get_pA (&pM_start, &pM_end, tid, k, kfirst, - klast, pstart_Mslice, Mp, Mvlen) ; + GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, pstart_Mslice, + Mp [k], Mp [k+1]) ; //------------------------------------------------------------------ // traverse over M(0,jM), the kth vector of M @@ -59,12 +61,14 @@ if (mij) { int64_t jC = jM ; - int64_t pC = iC + jC * cvlen ; + int64_t pC = iC + jC * Cvlen ; GB_MASK_WORK (pC) ; } } } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } } diff --git a/Source/assign/factory/GB_bitmap_assign_M_sub_template.c b/Source/assign/template/GB_bitmap_assign_M_sub_template.c similarity index 82% rename from Source/assign/factory/GB_bitmap_assign_M_sub_template.c rename to Source/assign/template/GB_bitmap_assign_M_sub_template.c index 86606060cc..f81ef6f1a4 100644 --- a/Source/assign/factory/GB_bitmap_assign_M_sub_template.c +++ b/Source/assign/template/GB_bitmap_assign_M_sub_template.c @@ -2,7 +2,7 @@ // GB_bitmap_assign_M_sub_template: traverse M for GB_SUBASSIGN //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,6 +15,10 @@ // C is bitmap/full. M is sparse/hyper, and can be jumbled. { + ASSERT (GB_IS_BITMAP (C) || GB_IS_FULL (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT (GB_JUMBLED_OK (M)) ; + const int64_t *restrict kfirst_Mslice = M_ek_slicing ; const int64_t *restrict klast_Mslice = M_ek_slicing + M_ntasks ; const int64_t *restrict pstart_Mslice = M_ek_slicing + M_ntasks * 2 ; @@ -40,9 +44,8 @@ //------------------------------------------------------------------ int64_t jM = GBH_M (Mh, k) ; - int64_t pM_start, pM_end ; - GB_get_pA (&pM_start, &pM_end, tid, k, kfirst, - klast, pstart_Mslice, Mp, Mvlen) ; + GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, pstart_Mslice, + Mp [k], Mp [k+1]) ; //------------------------------------------------------------------ // traverse over M(:,jM), the kth vector of M @@ -50,7 +53,7 @@ // for subassign, M has same size as C(I,J) and A. int64_t jC = GB_ijlist (J, jM, Jkind, Jcolon) ; - int64_t pC0 = jC * cvlen ; + int64_t pC0 = jC * Cvlen ; for (int64_t pM = pM_start ; pM < pM_end ; pM++) { @@ -58,13 +61,15 @@ if (mij) { int64_t iM = Mi [pM] ; - int64_t iC = GB_ijlist (I, iM, Ikind, Icolon) ; + int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; int64_t pC = iC + pC0 ; - GB_MASK_WORK (pC) ; // operate on Cx [pC] + GB_MASK_WORK (pC) ; } } } + #ifndef GB_NO_CNVALS cnvals += task_cnvals ; + #endif } } diff --git a/Source/assign/template/GB_bitmap_assign_M_template.c b/Source/assign/template/GB_bitmap_assign_M_template.c new file mode 100644 index 0000000000..234e055606 --- /dev/null +++ b/Source/assign/template/GB_bitmap_assign_M_template.c @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_assign_M_template: traverse over M for bitmap assignment into C +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This template traverses over all the entries of the mask matrix M, and +// operates on C(i,j) if the mask M(i,j) == 1, via the GB_MASK_WORK macro, +// where C(i,j) is at Cx [pC] and Cb [pC]. M is hypersparse or sparse. + +// M has alreadly been sliced for parallel work. The tasks are held in +// pstart_Mslice, kfirst_Mslice, klast_Mslice, M_ntasks, and the work is done +// by M_nthreads threads. + +// The work done by this kernel is independent of Mask_comp; both M and !M +// do the same work by scattering their entries into the C bitmap. + +// C is bitmap/full. M is sparse/hyper, and can be jumbled. + +{ + ASSERT (GB_IS_BITMAP (C) || GB_IS_FULL (C)) ; + ASSERT (GB_IS_HYPERSPARSE (M) || GB_IS_SPARSE (M)) ; + ASSERT (GB_JUMBLED_OK (M)) ; + + switch (assign_kind) + { + + case GB_ROW_ASSIGN : + // row assignment: C(iC,J), where M is a row vector + #include "template/GB_bitmap_assign_M_row_template.c" + break ; + + case GB_COL_ASSIGN : + // column assignment: C(I,jC), where M is a column vector + #include "template/GB_bitmap_assign_M_col_template.c" + break ; + + #ifndef GB_NO_ASSIGN_CASE + case GB_ASSIGN : + // GrB_assign: C(I,J), where M is the same size as C + #include "template/GB_bitmap_assign_M_all_template.c" + break ; + #endif + + #ifndef GB_NO_SUBASSIGN_CASE + case GB_SUBASSIGN : + // GxB_subassign: C(I,J), where M is same size as C(I,J) and A + #include "template/GB_bitmap_assign_M_sub_template.c" + break ; + #endif + + default: ; + } +} + diff --git a/Source/assign/template/GB_subassign_01_template.c b/Source/assign/template/GB_subassign_01_template.c new file mode 100644 index 0000000000..1e6bf59d6e --- /dev/null +++ b/Source/assign/template/GB_subassign_01_template.c @@ -0,0 +1,186 @@ +//------------------------------------------------------------------------------ +// GB_subassign_01_template: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 01: C(I,J) = scalar ; using S + +// M: NULL +// Mask_comp: false +// C_replace: false +// accum: NULL +// A: scalar +// S: constructed + +// C: not bitmap + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + const int64_t Cnvec = C->nvec ; + GB_GET_SCALAR ; + GB_GET_S ; + + //-------------------------------------------------------------------------- + // Method 01: C(I,J) = scalar ; using S + //-------------------------------------------------------------------------- + + // Time: Optimal; must visit all IxJ, so Omega(|I|*|J|) is required. + + // Entries in S are found and the corresponding entry in C replaced with + // the scalar. The traversal of S is identical to the traversal of M in + // Method 4. + + // Method 01 and Method 03 are very similar. + + //-------------------------------------------------------------------------- + // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_IXJ_SLICE ; + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) = scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + bool found = (pS < pS_end) && (GBI_S (Si, pS, Svlen) == iA) ; + if (!found) + { + // ----[. A 1]---------------------------------------------- + // S (i,j) is not present, the scalar is present + // [. A 1]: action: ( insert ) + task_pending++ ; + } + else + { + // ----[C A 1] or [X A 1]----------------------------------- + // both S (i,j) and A (i,j) present + // [C A 1]: action: ( =A ): scalar to C, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_noaccum_C_A_1_scalar ; + pS++ ; // go to the next entry in S(:,j) + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) = scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + bool found = (pS < pS_end) && (GBI_S (Si, pS, Svlen) == iA) ; + if (!found) + { + // ----[. A 1]---------------------------------------------- + // S (i,j) is not present, the scalar is present + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + else + { + // both S (i,j) and A (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_02_template.c b/Source/assign/template/GB_subassign_02_template.c new file mode 100644 index 0000000000..ba2997ae98 --- /dev/null +++ b/Source/assign/template/GB_subassign_02_template.c @@ -0,0 +1,393 @@ +//------------------------------------------------------------------------------ +// GB_subassign_02_template: C(I,J) = A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 02: C(I,J) = A ; using S + +// M: NULL +// Mask_comp: false +// C_replace: false +// accum: NULL +// A: matrix +// S: constructed + +// C: not bitmap or full: use GB_bitmap_assign instead +// A: any sparsity structure. + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + GB_GET_A ; + GB_GET_S ; + + //-------------------------------------------------------------------------- + // Method 02: C(I,J) = A ; using S + //-------------------------------------------------------------------------- + + // Time: Optimal. All entries in A+S must be examined, so the work is + // Omega (nnz(A)+nnz(S)). + + // Method 02 and Method 04 are somewhat similar. They differ on how C is + // modified when the entry is present in S but not A. + + //-------------------------------------------------------------------------- + // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + // all of IxJ must be examined + GB_SUBASSIGN_IXJ_SLICE ; + } + else + { + // traverse all A+S + GB_SUBASSIGN_TWO_SLICE (A, S) ; + } + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase1: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + if (Sfound && !Afound) + { + // ----[C . 1] or [X . 1]------------------------------- + // S (i,j) is present but A (i,j) is not + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still a zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + else if (!Sfound && Afound) + { + // ----[. A 1]------------------------------------------ + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + task_pending++ ; + } + else if (Sfound && Afound) + { + // ----[C A 1] or [X A 1]------------------------------- + // both S (i,j) and A (i,j) present + // [C A 1]: action: ( =A ): copy A into C, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_noaccum_C_A_1_matrix ; + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE1_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase1: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // ----[C . 1] or [X . 1]------------------------------- + // S (i,j) is present but A (i,j) is not + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still a zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // ----[. A 1]------------------------------------------ + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + task_pending++ ; + pA++ ; // go to the next entry in A(:,j) + } + else + { + // ----[C A 1] or [X A 1]------------------------------- + // both S (i,j) and A (i,j) present + // [C A 1]: action: ( =A ): copy A into C, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_noaccum_C_A_1_matrix ; + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // while list S (:,j) has entries. List A (:,j) exhausted. + while (pS < pS_end) + { + // ----[C . 1] or [X . 1]----------------------------------- + // S (i,j) is present but A (i,j) is not + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still a zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + + // List A (:,j) has entries. List S (:,j) exhausted. + task_pending += (pA_end - pA) ; + } + + GB_PHASE1_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase2: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + if (!Sfound && Afound) + { + // ----[. A 1]------------------------------------------ + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + pA++ ; // go to the next entry in A(:,j) + } + else if (Sfound) + { + // S (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE2_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase2: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // ----[. A 1]------------------------------------------ + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + pA++ ; // go to the next entry in A(:,j) + } + else + { + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // ignore the remainder of S (:,j) + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // ----[. A 1]---------------------------------------------- + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + pA++ ; // go to the next entry in A(:,j) + } + } + GB_PHASE2_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_03_template.c b/Source/assign/template/GB_subassign_03_template.c new file mode 100644 index 0000000000..c626abc2d2 --- /dev/null +++ b/Source/assign/template/GB_subassign_03_template.c @@ -0,0 +1,185 @@ +//------------------------------------------------------------------------------ +// GB_subassign_02_template: C(I,J) += scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 03: C(I,J) += scalar ; using S + +// M: NULL +// Mask_comp: false +// C_replace: false +// accum: present +// A: scalar +// S: constructed + +// C: not bitmap + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + const int64_t Cnvec = C->nvec ; + GB_GET_S ; + GB_GET_ACCUM_SCALAR ; + + //-------------------------------------------------------------------------- + // Method 03: C(I,J) += scalar ; using S + //-------------------------------------------------------------------------- + + // Time: Optimal; must visit all IxJ, so Omega(|I|*|J|) is required. + + // Entries in S are found and the corresponding entry in C replaced with + // the scalar. + + // Method 01 and Method 03 are very similar. + + //-------------------------------------------------------------------------- + // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_IXJ_SLICE ; + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) += scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + bool found = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + if (!found) + { + // ----[. A 1]---------------------------------------------- + // S (i,j) is not present, the scalar is present + // [. A 1]: action: ( insert ) + task_pending++ ; + } + else + { + // ----[C A 1] or [X A 1]----------------------------------- + // both S (i,j) and A (i,j) present + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_withaccum_C_A_1_scalar ; + pS++ ; // go to the next entry in S(:,j) + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) += scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + bool found = (pS < pS_end) && (GBI_S (Si, pS, Svlen) == iA) ; + if (!found) + { + // ----[. A 1]---------------------------------------------- + // S (i,j) is not present, the scalar is present + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + else + { + // both S (i,j) and A (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_04_template.c b/Source/assign/template/GB_subassign_04_template.c new file mode 100644 index 0000000000..cf86c99038 --- /dev/null +++ b/Source/assign/template/GB_subassign_04_template.c @@ -0,0 +1,386 @@ +//------------------------------------------------------------------------------ +// GB_subassign_02_template: C(I,J) += A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 04: C(I,J) += A ; using S + +// M: NULL +// Mask_comp: false +// C_replace: false +// accum: present +// A: matrix +// S: constructed + +// C: not bitmap: use GB_bitmap_assign instead +// A: any sparsity structure. + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + GB_GET_S ; + GB_GET_ACCUM_MATRIX ; + + //-------------------------------------------------------------------------- + // Method 04: C(I,J) += A ; using S + //-------------------------------------------------------------------------- + + // Time: Close to Optimal. Every entry in A must be visited, and the + // corresponding entry in S must then be found. Time for this phase is + // Omega(nnz(A)), but S has already been constructed, in Omega(nnz(S)) + // time. This method simply traverses all of A+S (like GB_add for + // computing A+S), the same as Method 02. Time taken is O(nnz(A)+nnz(S)). + // The only difference is that the traversal of A+S can terminate if A is + // exhausted. Entries in S but not A do not actually require any work + // (unlike Method 02, which must visit all entries in A+S). + + // Method 02 and Method 04 are somewhat similar. They differ on how C is + // modified when the entry is present in S but not A. + + // Compare with Method 16, which computes C(I,J) += A, using S. + + //-------------------------------------------------------------------------- + // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + // all of IxJ must be examined + GB_SUBASSIGN_IXJ_SLICE ; + } + else + { + // traverse all A+S + GB_SUBASSIGN_TWO_SLICE (A, S) ; + } + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase1: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + if (Sfound && !Afound) + { + // ----[C . 1] or [X . 1]------------------------------- + // S (i,j) is present but A (i,j) is not + // [C . 1]: action: ( C ): no change, with accum + // [X . 1]: action: ( X ): still a zombie + pS++ ; // go to the next entry in S(:,j) + } + else if (!Sfound && Afound) + { + // ----[. A 1]------------------------------------------ + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + task_pending++ ; + } + else if (Sfound && Afound) + { + // ----[C A 1] or [X A 1]------------------------------- + // both S (i,j) and A (i,j) present + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_withaccum_C_A_1_matrix ; + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE1_TASK_WRAPUP ; + } + } + else + { + + //---------------------------------------------------------------------- + // phase1: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // ----[C . 1] or [X . 1]------------------------------- + // S (i,j) is present but A (i,j) is not + // [C . 1]: action: ( C ): no change, with accum + // [X . 1]: action: ( X ): still a zombie + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // ----[. A 1]------------------------------------------ + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + task_pending++ ; + pA++ ; // go to the next entry in A(:,j) + } + else + { + // ----[C A 1] or [X A 1]------------------------------- + // both S (i,j) and A (i,j) present + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_withaccum_C_A_1_matrix ; + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // ignore the remainder of S (:,j) + + // List A (:,j) has entries. List S (:,j) exhausted. + task_pending += (pA_end - pA) ; + } + + GB_PHASE1_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase2: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + if (!Sfound && Afound) + { + // ----[. A 1]------------------------------------------ + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + pA++ ; // go to the next entry in A(:,j) + } + else if (Sfound) + { + // S (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE2_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase2: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // ----[. A 1]------------------------------------------ + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + pA++ ; // go to the next entry in A(:,j) + } + else + { + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // ignore the remainder of S (:,j) + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // ----[. A 1]---------------------------------------------- + // S (i,j) is not present, A (i,j) is present + // [. A 1]: action: ( insert ) + int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + pA++ ; // go to the next entry in A(:,j) + } + } + GB_PHASE2_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_05_template.c b/Source/assign/template/GB_subassign_05_template.c new file mode 100644 index 0000000000..1a3bf494b8 --- /dev/null +++ b/Source/assign/template/GB_subassign_05_template.c @@ -0,0 +1,260 @@ +//------------------------------------------------------------------------------ +// GB_subassign_05_template: C(I,J) = scalar ; no S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 05: C(I,J) = scalar ; no S + +// M: present +// Mask_comp: false +// C_replace: false +// accum: NULL +// A: scalar +// S: none + +// C: not bitmap +// M: any sparsity + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + int64_t zorig = C->nzombies ; + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + const int64_t Cnvec = C->nvec ; + GB_GET_C_HYPER_HASH ; + GB_GET_MASK ; + GB_GET_SCALAR ; + + //-------------------------------------------------------------------------- + // Method 05: C(I,J) = scalar ; no S + //-------------------------------------------------------------------------- + + // Time: Close to Optimal: the method must iterate over all entries in M, + // so the time is Omega(nnz(M)). For each entry M(i,j)=1, the + // corresponding entry in C must be found and updated (inserted or + // modified). This method does this with a binary search of C(:,jC) or a + // direct lookup if C(:,jC) is dense. The time is thus O(nnz(M)*log(n)) in + // the worst case, usually less than that since C(:,jC) often has O(1) + // entries. An additional time of O(|J|*log(Cnvec)) is added if C is + // hypersparse. There is no equivalent method that computes + // C(I,J)=scalar using the matrix S. + + // Method 05 and Method 07 are very similar. Also compare with Method 06n. + + //-------------------------------------------------------------------------- + // Parallel: slice M into coarse/fine tasks (Method 05, 06n, 07) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_ONE_SLICE (M) ; // M cannot be jumbled + + //-------------------------------------------------------------------------- + // phase 1: undelete zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //------------------------------------------------------------------ + // get j, the kth vector of M + //------------------------------------------------------------------ + + int64_t j = GBH_M (Mh, k) ; + GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t mjnz = pM_end - pM ; + if (mjnz == 0) continue ; + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_jC ; + int64_t cjnz = pC_end - pC_start ; + bool cjdense = (cjnz == Cvlen) ; + + //------------------------------------------------------------------ + // C(I,jC) = scalar ; no S + //------------------------------------------------------------------ + + if (cjdense) + { + + //-------------------------------------------------------------- + // C(:,jC) is dense so the binary search of C is not needed + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + if (mij) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + GB_iC_DENSE_LOOKUP ; + + // ----[C A 1] or [X A 1]------------------------------- + // [C A 1]: action: ( =A ): copy A into C, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_scalar ; + } + } + + } + else + { + + //-------------------------------------------------------------- + // C(:,jC) is sparse; use binary search for C + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + if (mij) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + + // find C(iC,jC) in C(:,jC) + GB_iC_BINARY_SEARCH ; + if (cij_found) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): copy A into C, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_scalar ; + } + else + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + zorig = C->nzombies ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //------------------------------------------------------------------ + // get j, the kth vector of M + //------------------------------------------------------------------ + + int64_t j = GBH_M (Mh, k) ; + GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t mjnz = pM_end - pM ; + if (mjnz == 0) continue ; + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_jC ; + bool cjdense = ((pC_end - pC_start) == Cvlen) ; + + //------------------------------------------------------------------ + // C(I,jC) = scalar ; no S + //------------------------------------------------------------------ + + if (!cjdense) + { + + //-------------------------------------------------------------- + // C(:,jC) is sparse; use binary search for C + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + if (mij) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + + // find C(iC,jC) in C(:,jC) + GB_iC_BINARY_SEARCH ; + if (!cij_found) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + GB_PENDING_INSERT_scalar ; + } + } + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_05d_template.c b/Source/assign/template/GB_subassign_05d_template.c index 9df614bb80..ea8bc701e0 100644 --- a/Source/assign/template/GB_subassign_05d_template.c +++ b/Source/assign/template/GB_subassign_05d_template.c @@ -2,12 +2,25 @@ // GB_subassign_05d_template: C = x where C is full //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -#undef GB_FREE_ALL +// Method 05d: C(:,:) = scalar ; no S, C is dense + +// M: present, can be sparse, hypersparse, bitmap, or full +// Mask_comp: false +// Mask_struct: true or false +// C_replace: false +// accum: NULL +// A: scalar +// S: none + +// C can have any sparsity structure, but it must be entirely dense with +// all entries present. + +#undef GB_FREE_ALL #define GB_FREE_ALL \ { \ GB_WERK_POP (M_ek_slicing, int64_t) ; \ @@ -32,21 +45,17 @@ ASSERT (GB_JUMBLED_OK (M)) ; ASSERT (!C->iso) ; - #ifdef GB_JIT_KERNEL - #define Mask_struct GB_MASK_STRUCT - #else - const size_t msize = M->type->size ; - #endif - const int64_t *restrict Mp = M->p ; const int8_t *restrict Mb = M->b ; const int64_t *restrict Mh = M->h ; const int64_t *restrict Mi = M->i ; - const GB_M_TYPE *restrict Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; + const GB_M_TYPE *restrict + Mx = (GB_M_TYPE *) (GB_MASK_STRUCT ? NULL : (M->x)) ; const size_t Mvlen = M->vlen ; + const size_t msize = M->type->size ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; - const int64_t cvlen = C->vlen ; + const int64_t Cvlen = C->vlen ; //-------------------------------------------------------------------------- // C = x @@ -78,20 +87,22 @@ GBP_M (Mp, k, Mvlen), GBP_M (Mp, k+1, Mvlen)) ; // pC_start points to the start of C(:,j) - int64_t pC_start = j * cvlen ; + int64_t pC_start = j * Cvlen ; //------------------------------------------------------------------ // C = x //------------------------------------------------------------------ - if (Mx == NULL && Mb == NULL) + if (Mx == NULL && Mb == NULL) // FIXME +// if (GB_MASK_STRUCT && !GB_M_IS_BITMAP) <--- use this instead { + // mask is structural and not bitmap GB_PRAGMA_SIMD_VECTORIZE for (int64_t pM = pM_start ; pM < pM_end ; pM++) { int64_t pC = pC_start + GBI_M (Mi, pM, Mvlen) ; // Cx [pC] = cwork - GB_COPY_scalar_to_C (Cx, pC, cwork) ; + GB_COPY_cwork_to_C (Cx, pC, cwork, false) ; } } else @@ -103,7 +114,7 @@ { int64_t pC = pC_start + GBI_M (Mi, pM, Mvlen) ; // Cx [pC] = cwork - GB_COPY_scalar_to_C (Cx, pC, cwork) ; + GB_COPY_cwork_to_C (Cx, pC, cwork, false) ; } } } @@ -113,6 +124,6 @@ GB_FREE_ALL ; } -#undef GB_FREE_ALL +#undef GB_FREE_ALL #define GB_FREE_ALL ; diff --git a/Source/assign/template/GB_subassign_06d_template.c b/Source/assign/template/GB_subassign_06d_template.c index db5b4cb6b5..485bcb8d5a 100644 --- a/Source/assign/template/GB_subassign_06d_template.c +++ b/Source/assign/template/GB_subassign_06d_template.c @@ -2,11 +2,30 @@ // GB_subassign_06d_template: C = A //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ +// Method 06d: C(:,:) = A ; no S, C is dense, M and A are aliased + +// M: present, and aliased to A +// Mask_comp: false +// Mask_struct: true or false +// C_replace: false +// accum: NULL +// A: matrix, and aliased to M +// S: none + +// C must be bitmap or full. No entries are deleted and thus no zombies +// are introduced into C. C can be hypersparse, sparse, bitmap, or full, and +// its sparsity structure does not change. If C is hypersparse, sparse, or +// full, then the pattern does not change (all entries are present, and this +// does not change), and these cases can all be treated the same (as if full). +// If C is bitmap, new entries can be inserted into the bitmap C->b. + +// C and A can have any sparsity structure. + #undef GB_FREE_ALL #define GB_FREE_ALL \ { \ @@ -19,22 +38,17 @@ // get the inputs //-------------------------------------------------------------------------- - #ifdef GB_JIT_KERNEL - #define Mask_struct GB_MASK_STRUCT - #define C_is_bitmap GB_C_IS_BITMAP - #define A_is_bitmap GB_A_IS_BITMAP - #define A_is_full GB_A_IS_FULL - #define A_iso GB_A_ISO - #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (((GB_M_TYPE *) Ax), pA, asize) - #else const bool C_is_bitmap = GB_IS_BITMAP (C) ; const bool A_is_bitmap = GB_IS_BITMAP (A) ; const bool A_is_full = GB_IS_FULL (A) ; const bool A_iso = A->iso ; const size_t asize = A->type->size ; + + #ifndef GB_AX_MASK + #define GB_AX_MASK(Ax,pA,asize) GB_MCAST (((GB_M_TYPE *) Ax), pA, asize) #endif - ASSERT (C_is_bitmap || GB_IS_FULL (C)) ; + ASSERT (GB_C_IS_BITMAP || GB_IS_FULL (C)) ; //-------------------------------------------------------------------------- // Parallel: slice A into equal-sized chunks @@ -45,7 +59,7 @@ int A_ntasks, A_nthreads ; double work = anz + A->nvec ; chunk = 32 * chunk ; // method 06d needs a larger chunk - if (A_is_bitmap || A_is_full) + if (GB_A_IS_BITMAP || GB_A_IS_FULL) { // no need to construct tasks A_nthreads = GB_nthreads (work, chunk, nthreads_max) ; @@ -70,11 +84,14 @@ const int8_t *restrict Ab = A->b ; const int64_t avlen = A->vlen ; - // since A is the mask, if A->iso is true, Mask_struct has been set true - ASSERT (GB_IMPLIES (A_iso, Mask_struct)) ; + // since A is the mask, if A->iso is true, GB_MASK_STRUCT has been set true + ASSERT (GB_IMPLIES (GB_A_ISO, GB_MASK_STRUCT)) ; int8_t *restrict Cb = C->b ; - const int64_t cvlen = C->vlen ; + const int64_t Cvlen = C->vlen ; + #ifndef GB_JIT_KERNEL + bool C_iso = C->iso ; + #endif #ifdef GB_ISO_ASSIGN // C is iso, and A is either iso or effectively iso (with a single entry @@ -82,13 +99,13 @@ // directly, and it is not needed for any kernel (generic, factor, or JIT). ASSERT (C->iso) ; GB_A_NVALS (e) ; - ASSERT (A_iso || (e == 1 && !A_is_bitmap)) ; - ASSERT (Mask_struct) ; + ASSERT (GB_A_ISO || (e == 1 && !GB_A_IS_BITMAP)) ; + ASSERT (GB_MASK_STRUCT) ; #else const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; GB_DECLAREC (cwork) ; - if (A_iso) + if (GB_A_ISO) { // get the iso value of A and typecast to C->type // cwork = (ctype) Ax [0] @@ -102,15 +119,15 @@ int64_t cnvals = C->nvals ; // for C bitmap - // future:: divide this template into sub-template (Mask_struct, etc) - if (Mask_struct) + // future:: divide this template into sub-template (GB_MASK_STRUCT, etc) + if (GB_MASK_STRUCT) { //---------------------------------------------------------------------- // C = A where A can be iso or non-iso; mask is structural //---------------------------------------------------------------------- - if (A_is_full) + if (GB_A_IS_FULL) { //------------------------------------------------------------------ @@ -125,26 +142,26 @@ for (p = 0 ; p < anz ; p++) { // Cx [p] = Ax [p] - GB_COPY_aij_to_C (Cx, p, Ax, p, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, p, GB_A_ISO, cwork, GB_C_ISO) ; } } #endif - if (C_is_bitmap) + if (GB_C_IS_BITMAP) { GB_memset (Cb, 1, anz, A_nthreads) ; cnvals = anz ; } } - else if (A_is_bitmap) + else if (GB_A_IS_BITMAP) { //------------------------------------------------------------------ // A is bitmap //------------------------------------------------------------------ - if (C_is_bitmap) + if (GB_C_IS_BITMAP) { //-------------------------------------------------------------- @@ -164,7 +181,8 @@ { // Cx [p] = Ax [p] #ifndef GB_ISO_ASSIGN - GB_COPY_aij_to_C (Cx, p, Ax, p, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, p, + GB_A_ISO, cwork, GB_C_ISO) ; #endif task_cnvals += (Cb [p] == 0) ; Cb [p] = 1 ; @@ -193,7 +211,8 @@ // Cx [p] = Ax [p] if (Ab [p]) { - GB_COPY_aij_to_C (Cx, p, Ax, p, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, p, + GB_A_ISO, cwork, GB_C_ISO) ; } } } @@ -213,7 +232,7 @@ const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2; int taskid ; - if (C_is_bitmap) + if (GB_C_IS_BITMAP) { //-------------------------------------------------------------- @@ -237,7 +256,7 @@ kfirst, klast, pstart_Aslice, GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; // pC is the start of C(:,j) - int64_t pC = j * cvlen ; + int64_t pC = j * Cvlen ; // C=A(:,j) with C bitmap, A sparse GB_PRAGMA_SIMD_REDUCTION (+,task_cnvals) for (int64_t pA = pA_start ; pA < pA_end ; pA++) @@ -245,7 +264,8 @@ int64_t p = pC + Ai [pA] ; // Cx [p] = Ax [pA] #ifndef GB_ISO_ASSIGN - GB_COPY_aij_to_C (Cx, p, Ax, pA, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, pA, + GB_A_ISO, cwork, GB_C_ISO) ; #endif task_cnvals += (Cb [p] == 0) ; Cb [p] = 1 ; @@ -280,14 +300,15 @@ kfirst, klast, pstart_Aslice, GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; // pC is the start of C(:,j) - int64_t pC = j * cvlen ; + int64_t pC = j * Cvlen ; // C=A(:,j) with C full, A sparse GB_PRAGMA_SIMD_VECTORIZE for (int64_t pA = pA_start ; pA < pA_end ; pA++) { int64_t p = pC + Ai [pA] ; // Cx [p] = Ax [pA] - GB_COPY_aij_to_C (Cx, p, Ax, pA, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, pA, + GB_A_ISO, cwork, GB_C_ISO) ; } } } @@ -305,14 +326,16 @@ // C = A where A must be non-iso, and the mask is valued //---------------------------------------------------------------------- - if (A_is_full) + ASSERT (!GB_A_ISO) ; + + if (GB_A_IS_FULL) { //------------------------------------------------------------------ // A is full: all entries present //------------------------------------------------------------------ - if (C_is_bitmap) + if (GB_C_IS_BITMAP) { //-------------------------------------------------------------- @@ -331,7 +354,8 @@ if (GB_AX_MASK (Ax, p, asize)) { // Cx [p] = Ax [p] - GB_COPY_aij_to_C (Cx, p, Ax, p, false, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, p, + false, cwork, GB_C_ISO) ; task_cnvals += (Cb [p] == 0) ; Cb [p] = 1 ; } @@ -355,20 +379,21 @@ if (GB_AX_MASK (Ax, p, asize)) { // Cx [p] = Ax [p] - GB_COPY_aij_to_C (Cx, p, Ax, p, false, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, p, + false, cwork, GB_C_ISO) ; } } } } - else if (A_is_bitmap) + else if (GB_A_IS_BITMAP) { //------------------------------------------------------------------ // A is bitmap //------------------------------------------------------------------ - if (C_is_bitmap) + if (GB_C_IS_BITMAP) { //------------------------------------------------------------- @@ -387,7 +412,8 @@ if (Ab [p] && GB_AX_MASK (Ax, p, asize)) { // Cx [p] = Ax [p] - GB_COPY_aij_to_C (Cx, p, Ax, p, false, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, p, + false, cwork, GB_C_ISO) ; task_cnvals += (Cb [p] == 0) ; Cb [p] = 1 ; } @@ -411,7 +437,8 @@ if (Ab [p] && GB_AX_MASK (Ax, p, asize)) { // Cx [p] = Ax [p] - GB_COPY_aij_to_C (Cx, p, Ax, p, false, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, p, + false, cwork, GB_C_ISO) ; } } } @@ -429,7 +456,7 @@ const int64_t *restrict pstart_Aslice = A_ek_slicing + A_ntasks * 2; int taskid ; - if (C_is_bitmap) + if (GB_C_IS_BITMAP) { //-------------------------------------------------------------- @@ -453,7 +480,7 @@ kfirst, klast, pstart_Aslice, GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; // pC is the start of C(:,j) - int64_t pC = j * cvlen ; + int64_t pC = j * Cvlen ; // C=A(:,j) with C bitmap, A sparse GB_PRAGMA_SIMD_REDUCTION (+,task_cnvals) for (int64_t pA = pA_start ; pA < pA_end ; pA++) @@ -462,7 +489,8 @@ { int64_t p = pC + Ai [pA] ; // Cx [p] = Ax [pA] - GB_COPY_aij_to_C (Cx, p, Ax, pA, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, pA, + GB_A_ISO, cwork, GB_C_ISO) ; task_cnvals += (Cb [p] == 0) ; Cb [p] = 1 ; } @@ -495,7 +523,7 @@ kfirst, klast, pstart_Aslice, GBP_A (Ap, k, avlen), GBP_A (Ap, k+1, avlen)) ; // pC is the start of C(:,j) - int64_t pC = j * cvlen ; + int64_t pC = j * Cvlen ; // C=A(:,j) with C full, A sparse GB_PRAGMA_SIMD_VECTORIZE for (int64_t pA = pA_start ; pA < pA_end ; pA++) @@ -504,7 +532,8 @@ { int64_t p = pC + Ai [pA] ; // Cx [p] = Ax [pA] - GB_COPY_aij_to_C (Cx, p, Ax, pA, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, p, Ax, pA, + GB_A_ISO, cwork, GB_C_ISO) ; } } } @@ -518,7 +547,7 @@ // log the number of entries in the C bitmap //-------------------------------------------------------------------------- - if (C_is_bitmap) + if (GB_C_IS_BITMAP) { C->nvals = cnvals ; } diff --git a/Source/assign/template/GB_subassign_06n_template.c b/Source/assign/template/GB_subassign_06n_template.c new file mode 100644 index 0000000000..73ea5938e7 --- /dev/null +++ b/Source/assign/template/GB_subassign_06n_template.c @@ -0,0 +1,416 @@ +//------------------------------------------------------------------------------ +// GB_subassign_06n_template: C(I,J) = A ; no S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 06n: C(I,J) = A ; no S + +// M: present +// Mask_comp: false +// C_replace: false +// accum: NULL +// A: matrix +// S: none (see also GB_subassign_06s) + +// FULL: if A and C are dense, then C remains dense. + +// If A is sparse and C dense, C will likely become sparse, except if M(i,j)=0 +// wherever A(i,j) is not present. So if M==A is aliased and A is sparse, then +// C remains dense. Need C(I,J)=A kernel. Then in that case, if C +// is dense it remains dense, even if A is sparse. If that change is made, +// this kernel can start with converting C to sparse if A is sparse. + +// C is not bitmap: GB_bitmap_assign is used if C is bitmap. +// M and A are not bitmap: 06s is used instead, if M or A are bitmap. + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + int64_t zorig = C->nzombies ; + const int64_t Cnvec = C->nvec ; + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + GB_GET_C_HYPER_HASH ; + GB_GET_MASK ; + GB_GET_A ; + const int64_t *restrict Ah = A->h ; + const int64_t Anvec = A->nvec ; + const bool A_is_hyper = (Ah != NULL) ; + + GB_OK (GB_hyper_hash_build (A, Werk)) ; + const int64_t *restrict A_Yp = (A->Y == NULL) ? NULL : A->Y->p ; + const int64_t *restrict A_Yi = (A->Y == NULL) ? NULL : A->Y->i ; + const int64_t *restrict A_Yx = (A->Y == NULL) ? NULL : A->Y->x ; + const int64_t A_hash_bits = (A->Y == NULL) ? 0 : (A->Y->vdim - 1) ; + + //-------------------------------------------------------------------------- + // Method 06n: C(I,J) = A ; no S + //-------------------------------------------------------------------------- + + // Time: O(nnz(M)*(log(a)+log(c)), where a and c are the # of entries in a + // vector of A and C, respectively. The entries in the intersection of M + // (where the entries are true) and the matrix addition C(I,J)+A must be + // examined. This method scans M, and searches for entries in A and C(I,J) + // using two binary searches. If M is very dense, this method can be + // slower than Method 06s. This method is selected if nnz (A) >= nnz (M). + + // Compare with Methods 05 and 07, which use a similar algorithmic outline + // and parallelization strategy. + + //-------------------------------------------------------------------------- + // Parallel: slice M into coarse/fine tasks (Method 05, 06n, 07) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_ONE_SLICE (M) ; // M cannot be jumbled + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //------------------------------------------------------------------ + // get j, the kth vector of M + //------------------------------------------------------------------ + + int64_t j = GBH_M (Mh, k) ; + GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t mjnz = pM_end - pM ; + if (mjnz == 0) continue ; + + //------------------------------------------------------------------ + // get A(:,j) + //------------------------------------------------------------------ + + int64_t pA, pA_end ; + GB_LOOKUP_VECTOR_A (j, pA, pA_end) ; + int64_t ajnz = pA_end - pA ; + bool ajdense = (ajnz == Avlen) ; + int64_t pA_start = pA ; + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_jC ; + int64_t cjnz = pC_end - pC_start ; + if (cjnz == 0 && ajnz == 0) continue ; + bool cjdense = (cjnz == Cvlen) ; + + //------------------------------------------------------------------ + // C(I,jC) = A(:,j) ; no S + //------------------------------------------------------------------ + + if (cjdense && ajdense) + { + + //-------------------------------------------------------------- + // C(:,jC) and A(:,j) are both dense + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + if (GB_MCAST (Mx, pM, msize)) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + GB_iC_DENSE_LOOKUP ; + + // find iA in A(:,j) + // A(:,j) is dense; no need for binary search + pA = pA_start + iA ; + ASSERT (GBI_A (Ai, pA, Avlen) == iA) ; + // ----[C A 1] or [X A 1]----------------------- + // [C A 1]: action: ( =A ): copy A to C, no acc + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_matrix ; + } + } + + } + else if (cjdense) + { + + //-------------------------------------------------------------- + // C(:,jC) is dense, A(:,j) is sparse + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + if (GB_MCAST (Mx, pM, msize)) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + GB_iC_DENSE_LOOKUP ; + + // find iA in A(:,j) + bool aij_found ; + int64_t apright = pA_end - 1 ; + GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; + + if (!aij_found) + { + // C (iC,jC) is present but A (i,j) is not + // ----[C . 1] or [X . 1]--------------------------- + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still zombie + GB_DELETE_ENTRY ; + } + else + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): copy A to C, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_matrix ; + } + } + } + + } + else if (ajdense) + { + + //-------------------------------------------------------------- + // C(:,jC) is sparse, A(:,j) is dense + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + if (GB_MCAST (Mx, pM, msize)) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + + // find C(iC,jC) in C(:,jC) + GB_iC_BINARY_SEARCH ; + + // lookup iA in A(:,j) + pA = pA_start + iA ; + ASSERT (GBI_A (Ai, pA, Avlen) == iA) ; + + if (cij_found) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): copy A into C, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_matrix ; + } + else + { + // C (iC,jC) is not present, A (i,j) is present + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + } + + } + else + { + + //-------------------------------------------------------------- + // C(:,jC) and A(:,j) are both sparse + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + if (GB_MCAST (Mx, pM, msize)) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + + // find C(iC,jC) in C(:,jC) + GB_iC_BINARY_SEARCH ; + + // find iA in A(:,j) + bool aij_found ; + int64_t apright = pA_end - 1 ; + GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; + + if (cij_found && aij_found) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): copy A into C, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_matrix ; + } + else if (!cij_found && aij_found) + { + // C (iC,jC) is not present, A (i,j) is present + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + else if (cij_found && !aij_found) + { + // C (iC,jC) is present but A (i,j) is not + // ----[C . 1] or [X . 1]--------------------------- + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still zombie + GB_DELETE_ENTRY ; + } + } + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + zorig = C->nzombies ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //------------------------------------------------------------------ + // get j, the kth vector of M + //------------------------------------------------------------------ + + int64_t j = GBH_M (Mh, k) ; + GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t mjnz = pM_end - pM ; + if (mjnz == 0) continue ; + + //------------------------------------------------------------------ + // get A(:,j) + //------------------------------------------------------------------ + + int64_t pA, pA_end ; + GB_LOOKUP_VECTOR_A (j, pA, pA_end) ; + int64_t ajnz = pA_end - pA ; + if (ajnz == 0) continue ; + bool ajdense = (ajnz == Avlen) ; + int64_t pA_start = pA ; + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_jC ; + bool cjdense = ((pC_end - pC_start) == Cvlen) ; + + //------------------------------------------------------------------ + // C(I,jC) = A(:,j) + //------------------------------------------------------------------ + + if (!cjdense) + { + + //-------------------------------------------------------------- + // C(:,jC) is sparse; use binary search for C + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + if (GB_MCAST (Mx, pM, msize)) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + + // find iA in A(:,j) + if (ajdense) + { + // A(:,j) is dense; no need for binary search + pA = pA_start + iA ; + ASSERT (GBI_A (Ai, pA, Avlen) == iA) ; + } + else + { + // A(:,j) is sparse; use binary search + int64_t apright = pA_end - 1 ; + bool aij_found ; + GB_BINARY_SEARCH (iA, Ai, pA, apright, aij_found) ; + if (!aij_found) continue ; + } + + // find C(iC,jC) in C(:,jC) + GB_iC_BINARY_SEARCH ; + if (!cij_found) + { + // C (iC,jC) is not present, A (i,j) is present + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + GB_PENDING_INSERT_aij ; + } + } + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_06s_template.c b/Source/assign/template/GB_subassign_06s_template.c new file mode 100644 index 0000000000..956ffc3368 --- /dev/null +++ b/Source/assign/template/GB_subassign_06s_template.c @@ -0,0 +1,502 @@ +//------------------------------------------------------------------------------ +// GB_subassign_06s_template: C(I,J) = A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 06s: C(I,J) = A ; using S +// Method 14: C(I,J) = A ; using S + +// M: present +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: false +// accum: NULL +// A: matrix +// S: constructed + +// C: not bitmap or full: use GB_bitmap_assign instead +// M, A: any sparsity structure. + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + GB_GET_MASK ; + GB_GET_MASK_HYPER_HASH ; + GB_GET_A ; + GB_GET_S ; + + //-------------------------------------------------------------------------- + // Method 06s: C(I,J) = A ; using S + //-------------------------------------------------------------------------- + + // Time: O((nnz(A)+nnz(S))*log(m)) where m is the # of entries in a vector + // of M, not including the time to construct S=C(I,J). If A, S, and M + // are similar in sparsity, then this method can perform well. If M is + // very sparse, Method 06n should be used instead. Method 06s is selected + // if nnz (A) < nnz (M) or if M is bitmap. + + //-------------------------------------------------------------------------- + // Method 14: C(I,J) = A ; using S + //-------------------------------------------------------------------------- + + // Time: Close to optimal. Omega(nnz(S)+nnz(A)) is required, and the + // sparsity of !M cannot be exploited. The time taken is + // O((nnz(A)+nnz(S))*log(m)) where m is the # of entries in a vector of M. + + //-------------------------------------------------------------------------- + // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + // all of IxJ must be examined + GB_SUBASSIGN_IXJ_SLICE ; + } + else + { + // traverse all A+S + GB_SUBASSIGN_TWO_SLICE (A, S) ; + } + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase1: A is bitmap TODO: this is SLOW! for method 06s + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + + if (Sfound && !Afound) + { + // S (i,j) is present but A (i,j) is not + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[C . 1] or [X . 1]--------------------------- + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + else if (!Sfound && Afound) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + else if (Sfound && Afound) + { + // both S (i,j) and A (i,j) present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): A to C no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_noaccum_C_A_1_matrix ; + } + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE1_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase1: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // S (i,j) is present but A (i,j) is not + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[C . 1] or [X . 1]--------------------------- + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pA++ ; // go to the next entry in A(:,j) + } + else + { + // both S (i,j) and A (i,j) present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): A to C no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_noaccum_C_A_1_matrix ; + } + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // while list S (:,j) has entries. List A (:,j) exhausted. + while (pS < pS_end) + { + // S (i,j) is present but A (i,j) is not + int64_t iS = GBI_S (Si, pS, Svlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[C . 1] or [X . 1]------------------------------- + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // S (i,j) is not present, A (i,j) is present + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pA++ ; // go to the next entry in A(:,j) + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase2: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + if (!Sfound && Afound) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + } + else if (Sfound) + { + // S (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE2_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase2: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // S (i,j) is present but A (i,j) is not + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + pA++ ; // go to the next entry in A(:,j) + } + else + { + // both S (i,j) and A (i,j) present + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // S (i,j) is not present, A (i,j) is present + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + pA++ ; // go to the next entry in A(:,j) + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_07_template.c b/Source/assign/template/GB_subassign_07_template.c new file mode 100644 index 0000000000..9a86e3dc0d --- /dev/null +++ b/Source/assign/template/GB_subassign_07_template.c @@ -0,0 +1,252 @@ +//------------------------------------------------------------------------------ +// GB_subassign_07_template: C(I,J) += scalar ; no S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 07: C(I,J) += scalar ; no S + +// M: present +// Mask_struct: true or false +// Mask_comp: false +// C_replace: false +// accum: present +// A: scalar +// S: none + +// C: not bitmap +// M: any sparsity + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + int64_t zorig = C->nzombies ; + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + const int64_t Cnvec = C->nvec ; + GB_GET_C_HYPER_HASH ; + GB_GET_MASK ; + GB_GET_ACCUM_SCALAR ; + + //-------------------------------------------------------------------------- + // Method 07: C(I,J) += scalar ; no S + //-------------------------------------------------------------------------- + + // Time: Close to Optimal: same as Method 05. + + // Method 05 and Method 07 are very similar. Also compare with Method 06n. + + //-------------------------------------------------------------------------- + // Parallel: slice M into coarse/fine tasks (Method 05, 06n, 07) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_ONE_SLICE (M) ; // M cannot be jumbled + + //-------------------------------------------------------------------------- + // phase 1: undelete zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //------------------------------------------------------------------ + // get j, the kth vector of M + //------------------------------------------------------------------ + + int64_t j = GBH_M (Mh, k) ; + GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t mjnz = pM_end - pM ; + if (mjnz == 0) continue ; + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_jC ; + int64_t cjnz = pC_end - pC_start ; + bool cjdense = (cjnz == Cvlen) ; + + //------------------------------------------------------------------ + // C(I,jC) += scalar ; no S + //------------------------------------------------------------------ + + if (cjdense) + { + + //-------------------------------------------------------------- + // C(:,jC) is dense so the binary search of C is not needed + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + if (mij) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + GB_iC_DENSE_LOOKUP ; + + // ----[C A 1] or [X A 1]------------------------------- + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_withaccum_C_A_1_scalar ; + } + } + + } + else + { + + //-------------------------------------------------------------- + // C(:,jC) is sparse; use binary search for C + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + if (mij) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + + // find C(iC,jC) in C(:,jC) + GB_iC_BINARY_SEARCH ; + if (cij_found) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_withaccum_C_A_1_scalar ; + } + else + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + zorig = C->nzombies ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //------------------------------------------------------------------ + // get j, the kth vector of M + //------------------------------------------------------------------ + + int64_t j = GBH_M (Mh, k) ; + GB_GET_VECTOR_M (pM, pM_end, pA, pA_end, Mp, k, Mvlen) ; + int64_t mjnz = pM_end - pM ; + if (mjnz == 0) continue ; + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_jC ; + bool cjdense = ((pC_end - pC_start) == Cvlen) ; + + //------------------------------------------------------------------ + // C(I,jC) += scalar ; no S + //------------------------------------------------------------------ + + if (!cjdense) + { + + //-------------------------------------------------------------- + // C(:,jC) is sparse; use binary search for C + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + + //---------------------------------------------------------- + // update C(iC,jC), but only if M(iA,j) allows it + //---------------------------------------------------------- + + bool mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + if (mij) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + + // find C(iC,jC) in C(:,jC) + GB_iC_BINARY_SEARCH ; + if (!cij_found) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + GB_PENDING_INSERT_scalar ; + } + } + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_08n_template.c b/Source/assign/template/GB_subassign_08n_template.c new file mode 100644 index 0000000000..e15dd2b2ef --- /dev/null +++ b/Source/assign/template/GB_subassign_08n_template.c @@ -0,0 +1,410 @@ +//------------------------------------------------------------------------------ +// GB_subassign_08n_template: C(I,J) += A ; no S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 08n: C(I,J) += A ; no S + +// M: present +// Mask_struct: true or false +// Mask_comp: false +// C_replace: false +// accum: present +// A: matrix +// S: none + +// C not bitmap; C can be full since no zombies are inserted in that case. +// If C is bitmap, then GB_bitmap_assign_M_accum is used instead. +// M, A: not bitmap; Method 08s is used instead if M or A are bitmap. + +//------------------------------------------------------------------------------ +// GB_PHASE1_ACTION +//------------------------------------------------------------------------------ + +// action to take for phase 1 when A(i,j) exists and M(i,j)=1 +#define GB_PHASE1_ACTION \ +{ \ + if (cjdense) \ + { \ + /* direct lookup of C(iC,jC) */ \ + GB_iC_DENSE_LOOKUP ; \ + /* ----[C A 1] or [X A 1]------------------------------- */ \ + /* [C A 1]: action: ( =C+A ): apply accum */ \ + /* [X A 1]: action: ( undelete ): zombie lives */ \ + GB_withaccum_C_A_1_matrix ; \ + } \ + else \ + { \ + /* binary search for C(iC,jC) in C(:,jC) */ \ + GB_iC_BINARY_SEARCH ; \ + if (cij_found) \ + { \ + /* ----[C A 1] or [X A 1]--------------------------- */ \ + /* [C A 1]: action: ( =C+A ): apply accum */ \ + /* [X A 1]: action: ( undelete ): zombie lives */ \ + GB_withaccum_C_A_1_matrix ; \ + } \ + else \ + { \ + /* ----[. A 1]-------------------------------------- */ \ + /* [. A 1]: action: ( insert ) */ \ + task_pending++ ; \ + } \ + } \ +} + +//------------------------------------------------------------------------------ +// GB_PHASE2_ACTION +//------------------------------------------------------------------------------ + +// action to take for phase 2 when A(i,j) exists and M(i,j)=1 +#define GB_PHASE2_ACTION \ +{ \ + ASSERT (!cjdense) ; \ + { \ + /* binary search for C(iC,jC) in C(:,jC) */ \ + GB_iC_BINARY_SEARCH ; \ + if (!cij_found) \ + { \ + /* ----[. A 1]-------------------------------------- */ \ + /* [. A 1]: action: ( insert ) */ \ + GB_PENDING_INSERT_aij ; \ + } \ + } \ +} + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + int64_t zorig = C->nzombies ; + const int64_t Cnvec = C->nvec ; + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + GB_GET_C_HYPER_HASH ; + GB_GET_MASK ; + GB_GET_ACCUM_MATRIX ; + const int64_t *Ah = A->h ; + + //-------------------------------------------------------------------------- + // Method 08n: C(I,J) += A ; no S + //-------------------------------------------------------------------------- + + // Time: Close to optimal. Omega (sum_j (min (nnz (A(:,j)), nnz (M(:,j)))), + // since only the intersection of A.*M needs to be considered. If either + // M(:,j) or A(:,j) are very sparse compared to the other, then the shorter + // is traversed with a linear-time scan and a binary search is used for the + // other. If the number of nonzeros is comparable, a linear-time scan is + // used for both. Once two entries M(i,j)=1 and A(i,j) are found with the + // same index i, the entry A(i,j) is accumulated or inserted into C. + + // The algorithm is very much like the eWise multiplication of A.*M, so the + // parallel scheduling relies on GB_emult_08_phase0 and GB_ewise_slice. + + //-------------------------------------------------------------------------- + // Parallel: slice the eWiseMult of Z=A.*M (Method 08n only) + //-------------------------------------------------------------------------- + + // Method 08n only. If C is sparse, it is sliced for a fine task, so that + // it can do a binary search via GB_iC_BINARY_SEARCH. But if C(:,jC) is + // dense, C(:,jC) is not sliced, so the fine task must do a direct lookup + // via GB_iC_DENSE_LOOKUP. Otherwise a race condition will occur. + // The Z matrix is not constructed, except for its hyperlist (Zh_shallow) + // and mapping to A and M. + + // No matrix (C, M, or A) can be bitmap. C, M, A can be sparse/hyper/full, + // in any combination. + + int64_t Znvec ; + const int64_t *restrict Zh_shallow = NULL ; + GB_OK (GB_subassign_08n_slice ( + &TaskList, &TaskList_size, &ntasks, &nthreads, + &Znvec, &Zh_shallow, &Z_to_A, &Z_to_A_size, &Z_to_M, &Z_to_M_size, + C, I, nI, GB_I_KIND, Icolon, J, nJ, GB_J_KIND, Jcolon, + A, M, Werk)) ; + GB_ALLOCATE_NPENDING_WERK ; + + //-------------------------------------------------------------------------- + // phase 1: undelete zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //------------------------------------------------------------------ + // get A(:,j) and M(:,j) + //------------------------------------------------------------------ + + int64_t j = GBH (Zh_shallow, k) ; + GB_GET_EVEC (pA, pA_end, pA, pA_end, Ap, Ah, j, k, Z_to_A, Avlen) ; + GB_GET_EVEC (pM, pM_end, pB, pB_end, Mp, Mh, j, k, Z_to_M, Mvlen) ; + + //------------------------------------------------------------------ + // quick checks for empty intersection of A(:,j) and M(:,j) + //------------------------------------------------------------------ + + int64_t ajnz = pA_end - pA ; + int64_t mjnz = pM_end - pM ; + if (ajnz == 0 || mjnz == 0) continue ; + int64_t iA_first = GBI_A (Ai, pA, Avlen) ; + int64_t iA_last = GBI_A (Ai, pA_end-1, Avlen) ; + int64_t iM_first = GBI_M (Mi, pM, Mvlen) ; + int64_t iM_last = GBI_M (Mi, pM_end-1, Mvlen) ; + if (iA_last < iM_first || iM_last < iA_first) continue ; + int64_t pM_start = pM ; + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_jC ; + bool cjdense = (pC_end - pC_start == Cvlen) ; + + //------------------------------------------------------------------ + // C(I,jC) += A(:,j) ; no S + //------------------------------------------------------------------ + + if (ajnz > 32 * mjnz) + { + + //-------------------------------------------------------------- + // A(:,j) is much denser than M(:,j) + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + if (GB_MCAST (Mx, pM, msize)) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + // find iA in A(:,j) + int64_t pright = pA_end - 1 ; + bool found ; + // FUTURE::: exploit dense A(:,j) + GB_BINARY_SEARCH (iA, Ai, pA, pright, found) ; + if (found) GB_PHASE1_ACTION ; + } + } + + } + else if (mjnz > 32 * ajnz) + { + + //-------------------------------------------------------------- + // M(:,j) is much denser than A(:,j) + //-------------------------------------------------------------- + + // FUTURE::: exploit dense mask + bool mjdense = false ; + + for ( ; pA < pA_end ; pA++) + { + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (mij) GB_PHASE1_ACTION ; + } + + } + else + { + + //---------------------------------------------------------- + // A(:,j) and M(:,j) have about the same # of entries + //---------------------------------------------------------- + + // linear-time scan of A(:,j) and M(:,j) + + while (pA < pA_end && pM < pM_end) + { + int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iM = GBI_M (Mi, pM, Mvlen) ; + if (iA < iM) + { + // A(i,j) exists but not M(i,j) + pA++ ; // go to the next entry in A(:,j) + } + else if (iM < iA) + { + // M(i,j) exists but not A(i,j) + pM++ ; // go to the next entry in M(:,j) + } + else + { + // both A(i,j) and M(i,j) exist + if (GB_MCAST (Mx, pM, msize)) GB_PHASE1_ACTION ; + pA++ ; // go to the next entry in A(:,j) + pM++ ; // go to the next entry in M(:,j) + } + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + zorig = C->nzombies ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //------------------------------------------------------------------ + // get A(:,j) and M(:,j) + //------------------------------------------------------------------ + + int64_t j = GBH (Zh_shallow, k) ; + GB_GET_EVEC (pA, pA_end, pA, pA_end, Ap, Ah, j, k, Z_to_A, Avlen) ; + GB_GET_EVEC (pM, pM_end, pB, pB_end, Mp, Mh, j, k, Z_to_M, Mvlen) ; + + //------------------------------------------------------------------ + // quick checks for empty intersection of A(:,j) and M(:,j) + //------------------------------------------------------------------ + + int64_t ajnz = pA_end - pA ; + int64_t mjnz = pM_end - pM ; + if (ajnz == 0 || mjnz == 0) continue ; + int64_t iA_first = GBI_A (Ai, pA, Avlen) ; + int64_t iA_last = GBI_A (Ai, pA_end-1, Avlen) ; + int64_t iM_first = GBI_M (Mi, pM, Mvlen) ; + int64_t iM_last = GBI_M (Mi, pM_end-1, Mvlen) ; + if (iA_last < iM_first || iM_last < iA_first) continue ; + int64_t pM_start = pM ; + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_jC ; + bool cjdense = (pC_end - pC_start == Cvlen) ; + if (cjdense) continue ; + + //------------------------------------------------------------------ + // C(I,jC) += A(:,j) ; no S + //------------------------------------------------------------------ + + if (ajnz > 32 * mjnz) + { + + //-------------------------------------------------------------- + // A(:,j) is much denser than M(:,j) + //-------------------------------------------------------------- + + for ( ; pM < pM_end ; pM++) + { + if (GB_MCAST (Mx, pM, msize)) + { + int64_t iA = GBI_M (Mi, pM, Mvlen) ; + // find iA in A(:,j) + int64_t pright = pA_end - 1 ; + bool found ; + // FUTURE::: exploit dense A(:,j) + GB_BINARY_SEARCH (iA, Ai, pA, pright, found) ; + if (found) GB_PHASE2_ACTION ; + } + } + + } + else if (mjnz > 32 * ajnz) + { + + //-------------------------------------------------------------- + // M(:,j) is much denser than A(:,j) + //-------------------------------------------------------------- + + // FUTURE::: exploit dense mask + bool mjdense = false ; + + for ( ; pA < pA_end ; pA++) + { + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (mij) GB_PHASE2_ACTION ; + } + + } + else + { + + //---------------------------------------------------------- + // A(:,j) and M(:,j) have about the same # of entries + //---------------------------------------------------------- + + // linear-time scan of A(:,j) and M(:,j) + + while (pA < pA_end && pM < pM_end) + { + int64_t iA = GBI_A (Ai, pA, Avlen) ; + int64_t iM = GBI_M (Mi, pM, Mvlen) ; + if (iA < iM) + { + // A(i,j) exists but not M(i,j) + pA++ ; // go to the next entry in A(:,j) + } + else if (iM < iA) + { + // M(i,j) exists but not A(i,j) + pM++ ; // go to the next entry in M(:,j) + } + else + { + // both A(i,j) and M(i,j) exist + if (GB_MCAST (Mx, pM, msize)) GB_PHASE2_ACTION ; + pA++ ; // go to the next entry in A(:,j) + pM++ ; // go to the next entry in M(:,j) + } + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_08s_template.c b/Source/assign/template/GB_subassign_08s_template.c new file mode 100644 index 0000000000..184909b87e --- /dev/null +++ b/Source/assign/template/GB_subassign_08s_template.c @@ -0,0 +1,478 @@ +//------------------------------------------------------------------------------ +// GB_subassign_08s_template: C(I,J) += A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 08s: C(I,J) += A ; using S +// Method 16: C(I,J) += A ; using S + +// M: present +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: false +// accum: present +// A: matrix +// S: constructed + +// C: not bitmap: use GB_bitmap_assign instead +// M, A: any sparsity structure. + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + GB_GET_MASK ; + GB_GET_MASK_HYPER_HASH ; + GB_GET_S ; + GB_GET_ACCUM_MATRIX ; + + //-------------------------------------------------------------------------- + // Method 16: C(I,J) += A ; using S + //-------------------------------------------------------------------------- + + // Time: Close to optimal. All entries in A+S must be traversed. + + //-------------------------------------------------------------------------- + // Method 08s: C(I,J) += A ; using S + //-------------------------------------------------------------------------- + + // Time: Only entries in A must be traversed, and the corresponding entries + // in C located. This method constructs S and traverses all of it in the + // worst case. Compare with method 08n, which does not construct S but + // instead uses a binary search for entries in C, but it only traverses + // entries in A.*M. + + //-------------------------------------------------------------------------- + // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + // all of IxJ must be examined + GB_SUBASSIGN_IXJ_SLICE ; + } + else + { + // traverse all A+S + GB_SUBASSIGN_TWO_SLICE (A, S) ; + } + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase1: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + + if (Sfound && !Afound) + { + // S (i,j) is present but A (i,j) is not + // ----[C . 1] or [X . 1]------------------------------- + // [C . 1]: action: ( C ): no change, with accum + // [X . 1]: action: ( X ): still a zombie + // ----[C . 0] or [X . 0]------------------------------- + // [C . 0]: action: ( C ): no change, with accum + // [X . 0]: action: ( X ): still a zombie + pS++ ; // go to the next entry in S(:,j) + } + else if (!Sfound && Afound) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + else if (Sfound && Afound) + { + // both S (i,j) and A (i,j) present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): A to C no accum + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_withaccum_C_A_1_matrix ; + } + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE1_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase1: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // S (i,j) is present but A (i,j) is not + // ----[C . 1] or [X . 1]------------------------------- + // [C . 1]: action: ( C ): no change, with accum + // [X . 1]: action: ( X ): still a zombie + // ----[C . 0] or [X . 0]------------------------------- + // [C . 0]: action: ( C ): no change, with accum + // [X . 0]: action: ( X ): still a zombie + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pA++ ; // go to the next entry in A(:,j) + } + else + { + // both S (i,j) and A (i,j) present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): A to C no accum + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_withaccum_C_A_1_matrix ; + } + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // ignore the remainder of S(:,j) + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // S (i,j) is not present, A (i,j) is present + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pA++ ; // go to the next entry in A(:,j) + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase2: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + if (!Sfound && Afound) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + } + else if (Sfound) + { + // S (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE2_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase2: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // S (i,j) is present but A (i,j) is not + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + pA++ ; // go to the next entry in A(:,j) + } + else + { + // both S (i,j) and A (i,j) present + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // S (i,j) is not present, A (i,j) is present + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + pA++ ; // go to the next entry in A(:,j) + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_09_template.c b/Source/assign/template/GB_subassign_09_template.c new file mode 100644 index 0000000000..79abb6d03e --- /dev/null +++ b/Source/assign/template/GB_subassign_09_template.c @@ -0,0 +1,431 @@ +//------------------------------------------------------------------------------ +// GB_subassign_09_template: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 09: C(I,J) = scalar ; using S + +// M: present +// Mask_struct: true or false +// Mask_comp: false +// C_replace: true +// accum: NULL +// A: scalar +// S: constructed + +// C: not bitmap or full + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + GB_GET_MASK ; + GB_GET_SCALAR ; + GB_GET_S ; + + //-------------------------------------------------------------------------- + // Method 09: C(I,J) = scalar ; using S + //-------------------------------------------------------------------------- + + // Time: Optimal. All entries in M+S must be examined. All entries in S + // are modified: if M(i,j)=1 then S(i,j) is used to write to the + // corresponding entry in C. If M(i,j) is not present, or zero, then the + // entry in C is cleared (because of C_replace). If S(i,j) is not present, + // and M(i,j)=1, then the scalar is inserted into C. The only case that + // can be skipped is if neither S nor M is present. As a result, this + // method need not traverse all of IxJ. It can limit its traversal to the + // pattern of M+S. + + // Method 09 and Method 11 are very similar. + + //-------------------------------------------------------------------------- + // Parallel: M+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + //-------------------------------------------------------------------------- + + if (GB_M_IS_BITMAP) + { + // all of IxJ must be examined + GB_SUBASSIGN_IXJ_SLICE ; + } + else + { + // traverse all M+S + GB_SUBASSIGN_TWO_SLICE (M, S) ; + } + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + if (GB_M_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase1: M is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iM_start, iM_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iM_start:iM_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iM_start) ; + int64_t pM_start = j * Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iM_start:iM_end,j) and M(ditto,j) + //-------------------------------------------------------------- + + for (int64_t iM = iM_start ; iM < iM_end ; iM++) + { + + int64_t pM = pM_start + iM ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iM) ; + bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; + + if (Sfound && !mij) + { + // S (i,j) is present but M (i,j) is false + // ----[C A 0] or [X A 0]------------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + else if (!Sfound && mij) + { + // S (i,j) is not present, M (i,j) is true + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + task_pending++ ; + } + else if (Sfound && mij) + { + // S (i,j) present and M (i,j) is true + GB_C_S_LOOKUP ; + // ----[C A 1] or [X A 1]------------------------------- + // [C A 1]: action: ( =A ): copy A, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_scalar ; + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE1_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase1: M is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get S(:,j) and M(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and M(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and M (:,j) have entries + while (pS < pS_end && pM < pM_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iM = GBI_M (Mi, pM, Mvlen) ; + + if (iS < iM) + { + // S (i,j) is present but M (i,j) is not + // ----[C A 0] or [X A 0]------------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + else if (iM < iS) + { + // S (i,j) is not present, M (i,j) is present + if (GB_MCAST (Mx, pM, msize)) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pM++ ; // go to the next entry in M(:,j) + } + else + { + // both S (i,j) and M (i,j) present + GB_C_S_LOOKUP ; + if (GB_MCAST (Mx, pM, msize)) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): copy A, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_scalar ; + } + else + { + // ----[C A 0] or [X A 0]--------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): now zombie + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + pM++ ; // go to the next entry in M(:,j) + } + } + + // while list S (:,j) has entries. List M (:,j) exhausted. + while (pS < pS_end) + { + // S (i,j) is present but M (i,j) is not + // ----[C A 0] or [X A 0]----------------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + + // while list M (:,j) has entries. List S (:,j) exhausted. + while (pM < pM_end) + { + // S (i,j) is not present, M (i,j) is present + if (GB_MCAST (Mx, pM, msize)) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pM++ ; // go to the next entry in M(:,j) + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + if (GB_M_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase2: M is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iM_start, iM_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iM_start:iM_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iM_start) ; + int64_t pM_start = j * Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iM_start:iM_end,j) and M(ditto,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + for (int64_t iM = iM_start ; iM < iM_end ; iM++) + { + int64_t pM = pM_start + iM ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iM) ; + bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; + + if (!Sfound && mij) + { + // S (i,j) is not present, M (i,j) is true + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + else if (Sfound) + { + // S (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE2_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase2: M is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get S(:,j) and M(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and M(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and M (:,j) have entries + while (pS < pS_end && pM < pM_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iM = GBI_M (Mi, pM, Mvlen) ; + + if (iS < iM) + { + // S (i,j) is present but M (i,j) is not + pS++ ; // go to the next entry in S(:,j) + } + else if (iM < iS) + { + // S (i,j) is not present, M (i,j) is present + if (GB_MCAST (Mx, pM, msize)) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + pM++ ; // go to the next entry in M(:,j) + } + else + { + // both S (i,j) and M (i,j) present + pS++ ; // go to the next entry in S(:,j) + pM++ ; // go to the next entry in M(:,j) + } + } + + // while list M (:,j) has entries. List S (:,j) exhausted. + while (pM < pM_end) + { + // S (i,j) is not present, M (i,j) is present + if (GB_MCAST (Mx, pM, msize)) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + int64_t iM = GBI_M (Mi, pM, Mvlen) ; + int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + pM++ ; // go to the next entry in M(:,j) + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_10_template.c b/Source/assign/template/GB_subassign_10_template.c new file mode 100644 index 0000000000..90080e68e3 --- /dev/null +++ b/Source/assign/template/GB_subassign_10_template.c @@ -0,0 +1,497 @@ +//------------------------------------------------------------------------------ +// GB_subassign_10_template: C(I,J) = A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 10: C(I,J) = A ; using S +// Method 18: C(I,J) = A ; using S + +// M: present +// Mask_comp: true or false +// Mask_struct: true or false +// C_replace: true +// accum: NULL +// A: matrix +// S: constructed + +// C: not bitmap: use GB_bitmap_assign instead +// M, A: any sparsity structure. + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + GB_GET_MASK ; + GB_GET_MASK_HYPER_HASH ; + GB_GET_A ; + GB_GET_S ; + + //-------------------------------------------------------------------------- + // Method 10: C(I,J) = A ; using S + // Method 18: C(I,J) = A ; using S + //-------------------------------------------------------------------------- + + // Time: Optimal. Omega (nnz(A)+nnz(S)), since all entries in S+A must be + // traversed, and the corresponding entry in M (even if not present) + // determines the action to take. M can add a log(m) factor if sparse. + + //-------------------------------------------------------------------------- + // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + // all of IxJ must be examined + GB_SUBASSIGN_IXJ_SLICE ; + } + else + { + // traverse all A+S + GB_SUBASSIGN_TWO_SLICE (A, S) ; + } + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase1: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + + if (Sfound && !Afound) + { + // S (i,j) is present but A (i,j) is not + // ----[C . 1] or [X . 1]------------------------------- + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still zombie + // ----[C . 0] or [X . 0]------------------------------- + // [X . 0]: action: ( X ): still a zombie + // [C . 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + else if (!Sfound && Afound) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + else if (Sfound && Afound) + { + // both S (i,j) and A (i,j) present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + GB_C_S_LOOKUP ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): A to C no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_matrix ; + } + else + { + // ----[C A 0] or [X A 0]--------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): now zombie + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE1_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase1: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // S (i,j) is present but A (i,j) is not + // ----[C . 1] or [X . 1]------------------------------- + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still zombie + // ----[C . 0] or [X . 0]------------------------------- + // [X . 0]: action: ( X ): still a zombie + // [C . 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pA++ ; // go to the next entry in A(:,j) + } + else + { + // both S (i,j) and A (i,j) present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + GB_C_S_LOOKUP ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): A to C no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_matrix ; + } + else + { + // ----[C A 0] or [X A 0]--------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): now zombie + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // while list S (:,j) has entries. List A (:,j) exhausted. + while (pS < pS_end) + { + // ----[C . 1] or [X . 1]----------------------------------- + // S (i,j) is present but A (i,j) is not + // [C . 1]: action: ( delete ): becomes zombie + // [X . 1]: action: ( X ): still a zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // S (i,j) is not present, A (i,j) is present + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pA++ ; // go to the next entry in A(:,j) + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase2: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + if (!Sfound && Afound) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + } + else if (Sfound) + { + // S (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE2_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase2: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // S (i,j) is present but A (i,j) is not + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + pA++ ; // go to the next entry in A(:,j) + } + else + { + // both S (i,j) and A (i,j) present + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // S (i,j) is not present, A (i,j) is present + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + pA++ ; // go to the next entry in A(:,j) + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_11_template.c b/Source/assign/template/GB_subassign_11_template.c new file mode 100644 index 0000000000..5fff189e63 --- /dev/null +++ b/Source/assign/template/GB_subassign_11_template.c @@ -0,0 +1,431 @@ +//------------------------------------------------------------------------------ +// GB_subassign_11_template: C(I,J) += scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 11: C(I,J) += scalar ; using S + +// M: present +// Mask_comp: false +// Mask_struct: true or false +// C_replace: true +// accum: present +// A: scalar +// S: constructed + +// C, M: not bitmap + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + GB_GET_MASK ; + GB_GET_ACCUM_SCALAR ; + GB_GET_S ; + + //-------------------------------------------------------------------------- + // Method 11: C(I,J) += scalar ; using S + //-------------------------------------------------------------------------- + + // Time: Optimal. All entries in M+S must be examined. All entries in S + // are modified: if M(i,j)=1 then S(i,j) is used to write to the + // corresponding entry in C. If M(i,j) is not present, or zero, then the + // entry in C is cleared (because of C_replace). If S(i,j) is not present, + // and M(i,j)=1, then the scalar is inserted into C. The only case that + // can be skipped is if neither S nor M is present. As a result, this + // method need not traverse all of IxJ. It can limit its traversal to the + // pattern of M+S. + + // Method 09 and Method 11 are very similar. + + //-------------------------------------------------------------------------- + // Parallel: M+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + //-------------------------------------------------------------------------- + + if (GB_M_IS_BITMAP) + { + // all of IxJ must be examined + GB_SUBASSIGN_IXJ_SLICE ; + } + else + { + // traverse all M+S + GB_SUBASSIGN_TWO_SLICE (M, S) ; + } + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + if (GB_M_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase1: M is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iM_start, iM_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iM_start:iM_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iM_start) ; + int64_t pM_start = j * Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iM_start:iM_end,j) and M(ditto,j) + //-------------------------------------------------------------- + + for (int64_t iM = iM_start ; iM < iM_end ; iM++) + { + + int64_t pM = pM_start + iM ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iM) ; + bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; + + if (Sfound && !mij) + { + // S (i,j) is present but M (i,j) is false + // ----[C A 0] or [X A 0]------------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + else if (!Sfound && mij) + { + // S (i,j) is not present, M (i,j) is true + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + task_pending++ ; + } + else if (Sfound && mij) + { + // S (i,j) present and M (i,j) is true + GB_C_S_LOOKUP ; + // ----[C A 1] or [X A 1]------------------------------- + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_withaccum_C_A_1_scalar ; + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE1_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase1: M is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get S(:,j) and M(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and M(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and M (:,j) have entries + while (pS < pS_end && pM < pM_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iM = GBI_M (Mi, pM, Mvlen) ; + + if (iS < iM) + { + // S (i,j) is present but M (i,j) is not + // ----[C A 0] or [X A 0]------------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + else if (iM < iS) + { + // S (i,j) is not present, M (i,j) is present + if (GB_MCAST (Mx, pM, msize)) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pM++ ; // go to the next entry in M(:,j) + } + else + { + // both S (i,j) and M (i,j) present + GB_C_S_LOOKUP ; + if (GB_MCAST (Mx, pM, msize)) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_withaccum_C_A_1_scalar ; + } + else + { + // ----[C A 0] or [X A 0]--------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): now zombie + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + pM++ ; // go to the next entry in M(:,j) + } + } + + // while list S (:,j) has entries. List M (:,j) exhausted. + while (pS < pS_end) + { + // S (i,j) is present but M (i,j) is not + // ----[C A 0] or [X A 0]----------------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + pS++ ; // go to the next entry in S(:,j) + } + + // while list M (:,j) has entries. List S (:,j) exhausted. + while (pM < pM_end) + { + // S (i,j) is not present, M (i,j) is present + if (GB_MCAST (Mx, pM, msize)) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pM++ ; // go to the next entry in M(:,j) + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + if (GB_M_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase2: M is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iM_start, iM_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iM_start:iM_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iM_start) ; + int64_t pM_start = j * Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iM_start:iM_end,j) and M(ditto,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + for (int64_t iM = iM_start ; iM < iM_end ; iM++) + { + int64_t pM = pM_start + iM ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iM) ; + bool mij = Mb [pM] && GB_MCAST (Mx, pM, msize) ; + + if (!Sfound && mij) + { + // S (i,j) is not present, M (i,j) is true + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + else if (Sfound) + { + // S (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE2_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase2: M is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get S(:,j) and M(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pM, pM_end, pA, pA_end, Mp, j, k, Z_to_X, Mvlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and M(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and M (:,j) have entries + while (pS < pS_end && pM < pM_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iM = GBI_M (Mi, pM, Mvlen) ; + + if (iS < iM) + { + // S (i,j) is present but M (i,j) is not + pS++ ; // go to the next entry in S(:,j) + } + else if (iM < iS) + { + // S (i,j) is not present, M (i,j) is present + if (GB_MCAST (Mx, pM, msize)) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + pM++ ; // go to the next entry in M(:,j) + } + else + { + // both S (i,j) and M (i,j) present + pS++ ; // go to the next entry in S(:,j) + pM++ ; // go to the next entry in M(:,j) + } + } + + // while list M (:,j) has entries. List S (:,j) exhausted. + while (pM < pM_end) + { + // S (i,j) is not present, M (i,j) is present + if (GB_MCAST (Mx, pM, msize)) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + int64_t iM = GBI_M (Mi, pM, Mvlen) ; + int64_t iC = GB_ijlist (I, iM, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + pM++ ; // go to the next entry in M(:,j) + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_12_template.c b/Source/assign/template/GB_subassign_12_template.c new file mode 100644 index 0000000000..0d1d1f29da --- /dev/null +++ b/Source/assign/template/GB_subassign_12_template.c @@ -0,0 +1,508 @@ +//------------------------------------------------------------------------------ +// GB_subassign_12_template: C(I,J) += A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 12: C(I,J) += A ; using S +// Method 20: C(I,J) += A ; using S + +// M: present +// Mask_comp: true or false +// Mask_stuct: true or false +// C_replace: true +// accum: present +// A: matrix +// S: constructed + +// C: not bitmap: use GB_bitmap_assign instead +// M, A: any sparsity structure. + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + GB_GET_MASK ; + GB_GET_MASK_HYPER_HASH ; + GB_GET_S ; + GB_GET_ACCUM_MATRIX ; + + //-------------------------------------------------------------------------- + // Method 12: C(I,J) += A ; using S + // Method 20: C(I,J) += A ; using S + //-------------------------------------------------------------------------- + + // Time: all entries in S+A must be traversed, so Omega(nnz(S)+nnz(A)) is + // required. All cases of the mask (0, 1, or not present) must be + // considered, because of the C_replace descriptor being true. + + //-------------------------------------------------------------------------- + // Parallel: A+S (Methods 02, 04, 09, 10, 11, 12, 14, 16, 18, 20) + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + // all of IxJ must be examined + GB_SUBASSIGN_IXJ_SLICE ; + } + else + { + // traverse all A+S + GB_SUBASSIGN_TWO_SLICE (A, S) ; + } + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase1: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + + if (Sfound && !Afound) + { + // S (i,j) is present but A (i,j) is not + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (!mij) + { + // ----[C . 0] or [X . 0]--------------------------- + // [X . 0]: action: ( X ): still a zombie + // [C . 0]: C_repl: action: ( delete ): now zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + else if (!Sfound && Afound) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + else if (Sfound && Afound) + { + // both S (i,j) and A (i,j) present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + GB_C_S_LOOKUP ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): A to C no accum + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_withaccum_C_A_1_matrix ; + } + else + { + // ----[C A 0] or [X A 0]--------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): now zombie + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE1_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase1: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE1 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + // int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // S (i,j) is present but A (i,j) is not + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; + if (GB_MASK_COMP) mij = !mij ; + if (!mij) + { + // ----[C . 0] or [X . 0]--------------------------- + // [X . 0]: action: ( X ): still a zombie + // [C . 0]: C_repl: action: ( delete ): now zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pA++ ; // go to the next entry in A(:,j) + } + else + { + // both S (i,j) and A (i,j) present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + GB_C_S_LOOKUP ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): A to C no accum + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_withaccum_C_A_1_matrix ; + } + else + { + // ----[C A 0] or [X A 0]--------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): now zombie + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // while list S (:,j) has entries. List A (:,j) exhausted. + while (pS < pS_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iS) ; + if (GB_MASK_COMP) mij = !mij ; + if (!mij) + { + // ----[C . 0] or [X . 0]------------------------------- + // [X . 0]: action: ( X ): still a zombie + // [C . 0]: C_repl: action: ( delete ): becomes zombie + GB_C_S_LOOKUP ; + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // S (i,j) is not present, A (i,j) is present + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + task_pending++ ; + } + pA++ ; // go to the next entry in A(:,j) + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + if (GB_A_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // phase2: A is bitmap + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //-------------------------------------------------------------- + // get S(iA_start:iA_end,j) + //-------------------------------------------------------------- + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + int64_t pA_start = j * Avlen ; + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(iA_start:iA_end,j) and A(ditto,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + int64_t pA = pA_start + iA ; + bool Sfound = (pS < pS_end) && (GBI_S (Si,pS,Svlen) == iA) ; + bool Afound = Ab [pA] ; + if (!Sfound && Afound) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + } + else if (Sfound) + { + // S (i,j) present + pS++ ; // go to the next entry in S(:,j) + } + } + } + GB_PHASE2_TASK_WRAPUP ; + } + + } + else + { + + //---------------------------------------------------------------------- + // phase2: A is hypersparse, sparse, or full + //---------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //------------------------------------------------------------------ + // get the task descriptor + //------------------------------------------------------------------ + + GB_GET_TASK_DESCRIPTOR_PHASE2 ; + + //------------------------------------------------------------------ + // compute all vectors in this task + //------------------------------------------------------------------ + + for (int64_t k = kfirst ; k <= klast ; k++) + { + + //-------------------------------------------------------------- + // get A(:,j) and S(:,j) + //-------------------------------------------------------------- + + int64_t j = GBH (Zh, k) ; + GB_GET_MAPPED (pA, pA_end, pA, pA_end, Ap, j, k, Z_to_X, Avlen); + GB_GET_MAPPED (pS, pS_end, pB, pB_end, Sp, j, k, Z_to_S, Svlen); + + //-------------------------------------------------------------- + // get M(:,j) + //-------------------------------------------------------------- + + int64_t pM_start, pM_end ; + GB_LOOKUP_VECTOR_M (j, pM_start, pM_end) ; + bool mjdense = (pM_end - pM_start) == Mvlen ; + + //-------------------------------------------------------------- + // do a 2-way merge of S(:,j) and A(:,j) + //-------------------------------------------------------------- + + // jC = J [j] ; or J is a colon expression + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + // while both list S (:,j) and A (:,j) have entries + while (pS < pS_end && pA < pA_end) + { + int64_t iS = GBI_S (Si, pS, Svlen) ; + int64_t iA = GBI_A (Ai, pA, Avlen) ; + + if (iS < iA) + { + // S (i,j) is present but A (i,j) is not + pS++ ; // go to the next entry in S(:,j) + } + else if (iA < iS) + { + // S (i,j) is not present, A (i,j) is present + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + pA++ ; // go to the next entry in A(:,j) + } + else + { + // both S (i,j) and A (i,j) present + pS++ ; // go to the next entry in S(:,j) + pA++ ; // go to the next entry in A(:,j) + } + } + + // while list A (:,j) has entries. List S (:,j) exhausted. + while (pA < pA_end) + { + // S (i,j) is not present, A (i,j) is present + int64_t iA = GBI_A (Ai, pA, Avlen) ; + GB_MIJ_BINARY_SEARCH_OR_DENSE_LOOKUP (iA) ; + if (GB_MASK_COMP) mij = !mij ; + if (mij) + { + // ----[. A 1]------------------------------------------ + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_aij ; + } + pA++ ; // go to the next entry in A(:,j) + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_13_template.c b/Source/assign/template/GB_subassign_13_template.c new file mode 100644 index 0000000000..e4350dcbc6 --- /dev/null +++ b/Source/assign/template/GB_subassign_13_template.c @@ -0,0 +1,285 @@ +//------------------------------------------------------------------------------ +// GB_subassign_13_template: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 13: C(I,J) = scalar ; using S + +// M: present +// Mask_comp: true +// Mask_struct: true or false +// C_replace: false +// accum: NULL +// A: scalar +// S: constructed + +// C: not bitmap, but can be full since no zombies are inserted in that case +// M: not bitmap + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + const int64_t Cnvec = C->nvec ; + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + GB_GET_MASK ; + GB_GET_MASK_HYPER_HASH ; + GB_GET_SCALAR ; + GB_GET_S ; + + //-------------------------------------------------------------------------- + // Method 13: C(I,J) = scalar ; using S + //-------------------------------------------------------------------------- + + // Time: Close to optimal; must visit all IxJ, so Omega(|I|*|J|) is + // required. The sparsity of !M cannot be exploited. + + // Methods 13, 15, 17, and 19 are very similar. + + //-------------------------------------------------------------------------- + // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_IXJ_SLICE ; + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) and M(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + GB_LOOKUP_VECTOR_M_FOR_IXJ (j, pM, pM_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) = scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + + //-------------------------------------------------------------- + // Get the indices at the top of each list. + //-------------------------------------------------------------- + + int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + + //-------------------------------------------------------------- + // find the smallest index of [iS iA iM] (always iA) + //-------------------------------------------------------------- + + int64_t i = iA ; + + //-------------------------------------------------------------- + // get M(i,j) + //-------------------------------------------------------------- + + bool mij ; + if (i == iM) + { + // mij = (bool) M [pM] + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + pM++ ; // go to the next entry in M(:,j) + } + else + { + // mij not present, implicitly false + ASSERT (i < iM) ; + mij = false ; + } + + // complement the mask entry mij since Mask_comp is true + mij = !mij ; + + //-------------------------------------------------------------- + // assign the entry + //-------------------------------------------------------------- + + if (i == iS) + { + ASSERT (i == iA) ; + { + // both S (i,j) and A (i,j) present + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): copy A, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_noaccum_C_A_1_scalar ; + } + pS++ ; // go to the next entry in S(:,j) + } + } + else + { + ASSERT (i == iA) ; + { + // S (i,j) is not present, A (i,j) is present + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) and M(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + GB_LOOKUP_VECTOR_M_FOR_IXJ (j, pM, pM_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) = scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + + //-------------------------------------------------------------- + // Get the indices at the top of each list. + //-------------------------------------------------------------- + + int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + + //-------------------------------------------------------------- + // find the smallest index of [iS iA iM] (always iA) + //-------------------------------------------------------------- + + int64_t i = iA ; + + //-------------------------------------------------------------- + // get M(i,j) + //-------------------------------------------------------------- + + bool mij ; + if (i == iM) + { + // mij = (bool) M [pM] + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + pM++ ; // go to the next entry in M(:,j) + } + else + { + // mij not present, implicitly false + ASSERT (i < iM) ; + mij = false ; + } + + // complement the mask entry mij since Mask_comp is true + mij = !mij ; + + //-------------------------------------------------------------- + // assign the entry + //-------------------------------------------------------------- + + if (i == iS) + { + ASSERT (i == iA) ; + { + pS++ ; // go to the next entry in S(:,j) + } + } + else + { + ASSERT (i == iA) ; + { + // S (i,j) is not present, A (i,j) is present + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + } + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_15_template.c b/Source/assign/template/GB_subassign_15_template.c new file mode 100644 index 0000000000..748c9dc5b3 --- /dev/null +++ b/Source/assign/template/GB_subassign_15_template.c @@ -0,0 +1,285 @@ +//------------------------------------------------------------------------------ +// GB_subassign_15_template: C(I,J) += scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 15: C(I,J) += scalar ; using S + +// M: present +// Mask_comp: true +// Mask_struct: true or false +// C_replace: false +// accum: present +// A: scalar +// S: constructed + +// C: not bitmap, but can be full since no zombies are inserted in that case +// M: not bitmap + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + const int64_t Cnvec = C->nvec ; + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + GB_GET_MASK ; + GB_GET_MASK_HYPER_HASH ; + GB_GET_S ; + GB_GET_ACCUM_SCALAR ; + + //-------------------------------------------------------------------------- + // Method 15: C(I,J) += scalar ; using S + //-------------------------------------------------------------------------- + + // Time: Close to optimal; must visit all IxJ, so Omega(|I|*|J|) is + // required. The sparsity of !M cannot be exploited. + + // Methods 13, 15, 17, and 19 are very similar. + + //-------------------------------------------------------------------------- + // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_IXJ_SLICE ; + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) and M(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + GB_LOOKUP_VECTOR_M_FOR_IXJ (j, pM, pM_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) += scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + + //-------------------------------------------------------------- + // Get the indices at the top of each list. + //-------------------------------------------------------------- + + int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + + //-------------------------------------------------------------- + // find the smallest index of [iS iA iM] (always iA) + //-------------------------------------------------------------- + + int64_t i = iA ; + + //-------------------------------------------------------------- + // get M(i,j) + //-------------------------------------------------------------- + + bool mij ; + if (i == iM) + { + // mij = (bool) M [pM] + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + pM++ ; // go to the next entry in M(:,j) + } + else + { + // mij not present, implicitly false + ASSERT (i < iM) ; + mij = false ; + } + + // complement the mask entry mij since Mask_comp is true + mij = !mij ; + + //-------------------------------------------------------------- + // accumulate the entry + //-------------------------------------------------------------- + + if (i == iS) + { + ASSERT (i == iA) ; + { + // both S (i,j) and A (i,j) present + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_C_S_LOOKUP ; + GB_withaccum_C_A_1_scalar ; + } + pS++ ; // go to the next entry in S(:,j) + } + } + else + { + ASSERT (i == iA) ; + { + // S (i,j) is not present, A (i,j) is present + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) and M(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + GB_LOOKUP_VECTOR_M_FOR_IXJ (j, pM, pM_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) += scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + + //-------------------------------------------------------------- + // Get the indices at the top of each list. + //-------------------------------------------------------------- + + int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + + //-------------------------------------------------------------- + // find the smallest index of [iS iA iM] (always iA) + //-------------------------------------------------------------- + + int64_t i = iA ; + + //-------------------------------------------------------------- + // get M(i,j) + //-------------------------------------------------------------- + + bool mij ; + if (i == iM) + { + // mij = (bool) M [pM] + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + pM++ ; // go to the next entry in M(:,j) + } + else + { + // mij not present, implicitly false + ASSERT (i < iM) ; + mij = false ; + } + + // complement the mask entry mij since Mask_comp is true + mij = !mij ; + + //-------------------------------------------------------------- + // accumulate the entry + //-------------------------------------------------------------- + + if (i == iS) + { + ASSERT (i == iA) ; + { + pS++ ; // go to the next entry in S(:,j) + } + } + else + { + ASSERT (i == iA) ; + { + // S (i,j) is not present, A (i,j) is present + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + } + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_17_template.c b/Source/assign/template/GB_subassign_17_template.c new file mode 100644 index 0000000000..8a6547b74a --- /dev/null +++ b/Source/assign/template/GB_subassign_17_template.c @@ -0,0 +1,292 @@ +//------------------------------------------------------------------------------ +// GB_subassign_17_template: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 17: C(I,J) = scalar ; using S + +// M: present +// Mask_struct: true or false +// Mask_comp: true +// C_replace: true +// accum: NULL +// A: scalar +// S: constructed + +// C: not bitmap +// M: not bitmap + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + const int64_t Cnvec = C->nvec ; + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + GB_GET_MASK ; + GB_GET_MASK_HYPER_HASH ; + GB_GET_SCALAR ; + GB_GET_S ; + + //-------------------------------------------------------------------------- + // Method 17: C(I,J) = scalar ; using S + //-------------------------------------------------------------------------- + + // Time: Close to optimal; must visit all IxJ, so Omega(|I|*|J|) is + // required. The sparsity of !M cannot be exploited. + + // Methods 13, 15, 17, and 19 are very similar. + + //-------------------------------------------------------------------------- + // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_IXJ_SLICE ; + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) and M(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + GB_LOOKUP_VECTOR_M_FOR_IXJ (j, pM, pM_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) = scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + + //-------------------------------------------------------------- + // Get the indices at the top of each list. + //-------------------------------------------------------------- + + int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + + //-------------------------------------------------------------- + // find the smallest index of [iS iA iM] (always iA) + //-------------------------------------------------------------- + + int64_t i = iA ; + + //-------------------------------------------------------------- + // get M(i,j) + //-------------------------------------------------------------- + + bool mij ; + if (i == iM) + { + // mij = (bool) M [pM] + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + pM++ ; // go to the next entry in M(:,j) + } + else + { + // mij not present, implicitly false + ASSERT (i < iM) ; + mij = false ; + } + + // complement the mask entry mij since Mask_comp is true + mij = !mij ; + + //-------------------------------------------------------------- + // assign the entry + //-------------------------------------------------------------- + + if (i == iS) + { + ASSERT (i == iA) ; + { + // both S (i,j) and A (i,j) present + GB_C_S_LOOKUP ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =A ): copy A, no accum + // [X A 1]: action: ( undelete ): zombie lives + GB_noaccum_C_A_1_scalar ; + } + else + { + // ----[C A 0] or [X A 0]--------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): zombie + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + } + else + { + ASSERT (i == iA) ; + { + // S (i,j) is not present, A (i,j) is present + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) and M(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + GB_LOOKUP_VECTOR_M_FOR_IXJ (j, pM, pM_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) = scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + + //-------------------------------------------------------------- + // Get the indices at the top of each list. + //-------------------------------------------------------------- + + int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + + //-------------------------------------------------------------- + // find the smallest index of [iS iA iM] (always iA) + //-------------------------------------------------------------- + + int64_t i = iA ; + + //-------------------------------------------------------------- + // get M(i,j) + //-------------------------------------------------------------- + + bool mij ; + if (i == iM) + { + // mij = (bool) M [pM] + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + pM++ ; // go to the next entry in M(:,j) + } + else + { + // mij not present, implicitly false + ASSERT (i < iM) ; + mij = false ; + } + + // complement the mask entry mij since Mask_comp is true + mij = !mij ; + + //-------------------------------------------------------------- + // assign the entry + //-------------------------------------------------------------- + + if (i == iS) + { + ASSERT (i == iA) ; + { + pS++ ; // go to the next entry in S(:,j) + } + } + else + { + ASSERT (i == iA) ; + { + // S (i,j) is not present, A (i,j) is present + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + } + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_19_template.c b/Source/assign/template/GB_subassign_19_template.c new file mode 100644 index 0000000000..0b692b7abe --- /dev/null +++ b/Source/assign/template/GB_subassign_19_template.c @@ -0,0 +1,292 @@ +//------------------------------------------------------------------------------ +// GB_subassign_19: C(I,J) += scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Method 19: C(I,J) += scalar ; using S + +// M: present +// Mask_comp: true +// Mask_struct: true or false +// C_replace: true +// accum: present +// A: scalar +// S: constructed + +// C: not bitmap +// M: not bitmap + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + GB_EMPTY_TASKLIST ; + GB_GET_C ; // C must not be bitmap + const int64_t *restrict Ch = C->h ; + const int64_t *restrict Cp = C->p ; + const bool C_is_hyper = (Ch != NULL) ; + const int64_t Cnvec = C->nvec ; + GB_GET_MASK ; + GB_GET_MASK_HYPER_HASH ; + GB_GET_S ; + GB_GET_ACCUM_SCALAR ; + + //-------------------------------------------------------------------------- + // Method 19: C(I,J) += scalar ; using S + //-------------------------------------------------------------------------- + + // Time: Close to optimal; must visit all IxJ, so Omega(|I|*|J|) is + // required. The sparsity of !M cannot be exploited. + + // Methods 13, 15, 17, and 19 are very similar. + + //-------------------------------------------------------------------------- + // Parallel: all IxJ (Methods 01, 03, 13, 15, 17, 19) + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_IXJ_SLICE ; + + //-------------------------------------------------------------------------- + // phase 1: create zombies, update entries, and count pending tuples + //-------------------------------------------------------------------------- + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(+:nzombies) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE1 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) and M(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + GB_LOOKUP_VECTOR_M_FOR_IXJ (j, pM, pM_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) += scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + + //-------------------------------------------------------------- + // Get the indices at the top of each list. + //-------------------------------------------------------------- + + int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + + //-------------------------------------------------------------- + // find the smallest index of [iS iA iM] (always iA) + //-------------------------------------------------------------- + + int64_t i = iA ; + + //-------------------------------------------------------------- + // get M(i,j) + //-------------------------------------------------------------- + + bool mij ; + if (i == iM) + { + // mij = (bool) M [pM] + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + pM++ ; // go to the next entry in M(:,j) + } + else + { + // mij not present, implicitly false + ASSERT (i < iM) ; + mij = false ; + } + + // complement the mask entry mij since Mask_comp is true + mij = !mij ; + + //-------------------------------------------------------------- + // accumulate the entry + //-------------------------------------------------------------- + + if (i == iS) + { + ASSERT (i == iA) ; + { + // both S (i,j) and A (i,j) present + GB_C_S_LOOKUP ; + if (mij) + { + // ----[C A 1] or [X A 1]--------------------------- + // [C A 1]: action: ( =C+A ): apply accum + // [X A 1]: action: ( undelete ): zombie lives + GB_withaccum_C_A_1_scalar ; + } + else + { + // ----[C A 0] or [X A 0]--------------------------- + // [X A 0]: action: ( X ): still a zombie + // [C A 0]: C_repl: action: ( delete ): zombie + GB_DELETE_ENTRY ; + } + pS++ ; // go to the next entry in S(:,j) + } + } + else + { + ASSERT (i == iA) ; + { + // S (i,j) is not present, A (i,j) is present + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + task_pending++ ; + } + } + } + } + } + + GB_PHASE1_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // phase 2: insert pending tuples + //-------------------------------------------------------------------------- + + GB_PENDING_CUMSUM ; + + #pragma omp parallel for num_threads(nthreads) schedule(dynamic,1) \ + reduction(&&:pending_sorted) + for (taskid = 0 ; taskid < ntasks ; taskid++) + { + + //---------------------------------------------------------------------- + // get the task descriptor + //---------------------------------------------------------------------- + + GB_GET_IXJ_TASK_DESCRIPTOR_PHASE2 (iA_start, iA_end) ; + + //---------------------------------------------------------------------- + // compute all vectors in this task + //---------------------------------------------------------------------- + + for (int64_t j = kfirst ; j <= klast ; j++) + { + + //------------------------------------------------------------------ + // get jC, the corresponding vector of C + //------------------------------------------------------------------ + + int64_t jC = GB_ijlist (J, j, GB_J_KIND, Jcolon) ; + + //------------------------------------------------------------------ + // get S(iA_start:end,j) and M(iA_start:end,j) + //------------------------------------------------------------------ + + GB_LOOKUP_VECTOR_S_FOR_IXJ (j, pS, pS_end, iA_start) ; + GB_LOOKUP_VECTOR_M_FOR_IXJ (j, pM, pM_end, iA_start) ; + + //------------------------------------------------------------------ + // C(I(iA_start,iA_end-1),jC) += scalar + //------------------------------------------------------------------ + + for (int64_t iA = iA_start ; iA < iA_end ; iA++) + { + + //-------------------------------------------------------------- + // Get the indices at the top of each list. + //-------------------------------------------------------------- + + int64_t iS = (pS < pS_end) ? GBI_S (Si, pS, Svlen) : INT64_MAX ; + int64_t iM = (pM < pM_end) ? GBI_M (Mi, pM, Mvlen) : INT64_MAX ; + + //-------------------------------------------------------------- + // find the smallest index of [iS iA iM] (always iA) + //-------------------------------------------------------------- + + int64_t i = iA ; + + //-------------------------------------------------------------- + // get M(i,j) + //-------------------------------------------------------------- + + bool mij ; + if (i == iM) + { + // mij = (bool) M [pM] + mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; + pM++ ; // go to the next entry in M(:,j) + } + else + { + // mij not present, implicitly false + ASSERT (i < iM) ; + mij = false ; + } + + // complement the mask entry mij since Mask_comp is true + mij = !mij ; + + //-------------------------------------------------------------- + // accumulate the entry + //-------------------------------------------------------------- + + if (i == iS) + { + ASSERT (i == iA) ; + { + pS++ ; // go to the next entry in S(:,j) + } + } + else + { + ASSERT (i == iA) ; + { + // S (i,j) is not present, A (i,j) is present + if (mij) + { + // ----[. A 1]-------------------------------------- + // [. A 1]: action: ( insert ) + int64_t iC = GB_ijlist (I, iA, GB_I_KIND, Icolon) ; + GB_PENDING_INSERT_scalar ; + } + } + } + } + } + + GB_PHASE2_TASK_WRAPUP ; + } + + //-------------------------------------------------------------------------- + // finalize the matrix and return result + //-------------------------------------------------------------------------- + + GB_SUBASSIGN_WRAPUP ; +} + diff --git a/Source/assign/template/GB_subassign_22_template.c b/Source/assign/template/GB_subassign_22_template.c index 07ba7835f8..d5c5b1ebb0 100644 --- a/Source/assign/template/GB_subassign_22_template.c +++ b/Source/assign/template/GB_subassign_22_template.c @@ -2,7 +2,7 @@ // GB_subassign_22_template: C += y where C is full and y is a scalar //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -44,7 +44,7 @@ for (pC = 0 ; pC < cnz ; pC++) { // Cx [pC] += ywork - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; + GB_ACCUMULATE_scalar (Cx, pC, ywork, false) ; } } diff --git a/Source/assign/template/GB_subassign_23_template.c b/Source/assign/template/GB_subassign_23_template.c index 6c1eabbc92..5cac9bebdc 100644 --- a/Source/assign/template/GB_subassign_23_template.c +++ b/Source/assign/template/GB_subassign_23_template.c @@ -2,11 +2,28 @@ // GB_subassign_23_template: C += A where C is full //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ +// Method 23: C += A, where C is full + +// M: NULL +// Mask_comp: false +// Mask_struct: ignored +// C_replace: false +// accum: present +// A: matrix +// S: none + +// The type of C must match the type of x and z for the accum function, since +// C(i,j) = accum (C(i,j), A(i,j)) is handled. The generic case here can +// typecast A(i,j) but not C(i,j). The case for typecasting of C is handled by +// Method 04. + +// C and A can have any sparsity structure, but C must be as-if-full. + #include "include/GB_unused.h" #undef GB_FREE_ALL @@ -21,15 +38,9 @@ // get inputs //-------------------------------------------------------------------------- - #ifdef GB_JIT_KERNEL - #define A_is_bitmap GB_A_IS_BITMAP - #define A_is_full GB_A_IS_FULL - #define A_iso GB_A_ISO - #else - bool A_is_bitmap = GB_IS_BITMAP (A) ; - bool A_is_full = GB_IS_FULL (A) ; + const bool A_is_bitmap = GB_IS_BITMAP (A) ; + const bool A_is_full = GB_IS_FULL (A) ; const bool A_iso = A->iso ; - #endif //-------------------------------------------------------------------------- // slice the A matrix @@ -39,9 +50,9 @@ int A_ntasks, A_nthreads ; GB_A_NHELD (anz) ; // int64_t anz = GB_nnz_held (A) ; double work = anz + A->nvec ; - if (A_is_bitmap || A_is_full) + if (GB_A_IS_BITMAP || GB_A_IS_FULL) { - // C is full and A is bitmap or full + // C is full and A is bitmap or full: A_ek_slicing is not created. A_nthreads = GB_nthreads (work, chunk, nthreads_max) ; A_ntasks = 0 ; // unused ASSERT (A_ek_slicing == NULL) ; @@ -63,14 +74,14 @@ ASSERT (GB_IS_FULL (C)) ; GB_C_NHELD (cnz) ; // const int64_t cnz = GB_nnz_held (C) ; GB_DECLAREY (ywork) ; - if (A_iso) + if (GB_A_ISO) { // get the iso value of A and typecast it to Y // ywork = (ytype) Ax [0] GB_COPY_aij_to_ywork (ywork, Ax, 0, true) ; } - if (A_is_bitmap) + if (GB_A_IS_BITMAP) { //---------------------------------------------------------------------- @@ -84,11 +95,11 @@ { if (!Ab [p]) continue ; // Cx [p] += (ytype) Ax [p], with typecasting - GB_ACCUMULATE_aij (Cx, p, Ax, p, A_iso, ywork) ; + GB_ACCUMULATE_aij (Cx, p, Ax, p, GB_A_ISO, ywork, false) ; } } - else if (A_is_full) + else if (GB_A_IS_FULL) { //---------------------------------------------------------------------- @@ -100,7 +111,7 @@ for (p = 0 ; p < cnz ; p++) { // Cx [p] += (ytype) Ax [p], with typecasting - GB_ACCUMULATE_aij (Cx, p, Ax, p, A_iso, ywork) ; + GB_ACCUMULATE_aij (Cx, p, Ax, p, GB_A_ISO, ywork, false) ; } } @@ -117,7 +128,7 @@ const int64_t *restrict Ah = A->h ; const int64_t *restrict Ai = A->i ; const int64_t avlen = A->vlen ; - const int64_t cvlen = C->vlen ; + const int64_t Cvlen = C->vlen ; bool A_jumbled = A->jumbled ; const int64_t *restrict kfirst_Aslice = A_ek_slicing ; @@ -149,10 +160,10 @@ int64_t pA_end = GBP_A (Ap, k+1, avlen) ; GB_GET_PA (my_pA_start, my_pA_end, taskid, k, kfirst, klast, pstart_Aslice, pA_start, pA_end) ; - bool ajdense = ((pA_end - pA_start) == cvlen) ; + bool ajdense = ((pA_end - pA_start) == Cvlen) ; // pC points to the start of C(:,j) - int64_t pC = j * cvlen ; + int64_t pC = j * Cvlen ; //-------------------------------------------------------------- // C(:,j) += A(:,j) @@ -171,7 +182,8 @@ int64_t i = pA - pA_start ; int64_t p = pC + i ; // Cx [p] += (ytype) Ax [pA], with typecasting - GB_ACCUMULATE_aij (Cx, p, Ax, pA, A_iso, ywork) ; + GB_ACCUMULATE_aij (Cx, p, Ax, pA, GB_A_ISO, ywork, + false) ; } } @@ -179,7 +191,7 @@ { //---------------------------------------------------------- - // A(:,j) is sparse + // A(:,j) is sparse //---------------------------------------------------------- GB_PRAGMA_SIMD_VECTORIZE @@ -188,7 +200,8 @@ int64_t i = Ai [pA] ; int64_t p = pC + i ; // Cx [p] += (ytype) Ax [pA], with typecasting - GB_ACCUMULATE_aij (Cx, p, Ax, pA, A_iso, ywork) ; + GB_ACCUMULATE_aij (Cx, p, Ax, pA, GB_A_ISO, ywork, + false) ; } } } diff --git a/Source/assign/template/GB_subassign_25_template.c b/Source/assign/template/GB_subassign_25_template.c index 64a3f34b19..5e7f8cd37c 100644 --- a/Source/assign/template/GB_subassign_25_template.c +++ b/Source/assign/template/GB_subassign_25_template.c @@ -2,11 +2,29 @@ // GB_subassign_25_template: C = A where C is empty and A is dense //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ +// Method 25: C(:,:) = A ; C is empty, M structural, A bitmap/as-if-full + +// M: present +// Mask_comp: false +// Mask_struct: true +// C_replace: effectively false (not relevant since C is empty) +// accum: NULL +// A: matrix +// S: none + +// C and M are sparse or hypersparse. A can have any sparsity structure, even +// bitmap, but it must either be bitmap, or as-if-full. M may be jumbled. If +// so, C is constructed as jumbled. C is reconstructed with the same structure +// as M and can have any sparsity structure on input. The only constraint on C +// is nnz(C) is zero on input. + +// C is iso if A is iso + // C = A where C starts as empty, M is structural, and A is dense. The // pattern of C is an exact copy of M. A is full, dense, or bitmap. // M is sparse or hypersparse, and C is constructed with the same pattern as M. @@ -23,14 +41,9 @@ // get inputs //-------------------------------------------------------------------------- - #ifdef GB_JIT_KERNEL - #define A_is_bitmap GB_A_IS_BITMAP - #define A_iso GB_A_ISO - #else const bool A_is_bitmap = GB_IS_BITMAP (A) ; const bool A_iso = A->iso ; - #endif - ASSERT (GB_IS_FULL (A) || A_is_bitmap) ; + ASSERT (GB_IS_FULL (A) || GB_A_IS_BITMAP) ; //-------------------------------------------------------------------------- // Parallel: slice M into equal-sized chunks @@ -57,6 +70,7 @@ const int8_t *restrict Ab = A->b ; const int64_t avlen = A->vlen ; + bool C_iso = C->iso ; ASSERT (C->iso == A->iso) ; #ifdef GB_ISO_ASSIGN @@ -66,7 +80,7 @@ const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; GB_DECLAREC (cwork) ; - if (A_iso) + if (GB_A_ISO) { // get the iso value of A and typecast to C->type // cwork = (ctype) Ax [0] @@ -81,7 +95,7 @@ // C = A //-------------------------------------------------------------------------- - if (A_is_bitmap) + if (GB_A_IS_BITMAP) { //---------------------------------------------------------------------- @@ -113,9 +127,8 @@ //-------------------------------------------------------------- int64_t j = GBH_M (Mh, k) ; - GB_GET_PA (pM_start, pM_end, tid, k, - kfirst, klast, pstart_Mslice, - GBP_M (Mp, k, Mvlen), GBP_M (Mp, k+1, Mvlen)) ; + GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, + pstart_Mslice, Mp [k], Mp [k+1]) ; //-------------------------------------------------------------- // C = A(:,j) @@ -132,14 +145,15 @@ { // C(i,j) = A(i,j) #ifndef GB_ISO_ASSIGN - GB_COPY_aij_to_C (Cx, pM, Ax, p, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, pM, Ax, p, GB_A_ISO, cwork, + GB_C_ISO) ; #endif } else { // C(i,j) becomes a zombie task_nzombies++ ; - Ci [pM] = GB_FLIP (i) ; + Ci [pM] = GB_ZOMBIE (i) ; } } } @@ -179,9 +193,8 @@ //---------------------------------------------------------- int64_t j = GBH_M (Mh, k) ; - GB_GET_PA (pM_start, pM_end, tid, k, - kfirst, klast, pstart_Mslice, - GBP_M (Mp, k, Mvlen), GBP_M (Mp, k+1, Mvlen)) ; + GB_GET_PA (pM_start, pM_end, tid, k, kfirst, klast, + pstart_Mslice, Mp [k], Mp [k+1]) ; //---------------------------------------------------------- // C = A(:,j) @@ -195,7 +208,8 @@ { // C(i,j) = A(i,j) int64_t p = pA + GBI_M (Mi, pM, Mvlen) ; - GB_COPY_aij_to_C (Cx, pM, Ax, p, A_iso, cwork) ; + GB_COPY_aij_to_C (Cx, pM, Ax, p, + GB_A_ISO, cwork, GB_C_ISO) ; } } } diff --git a/Source/binaryop/GB_binop_builtin.c b/Source/binaryop/GB_binop_builtin.c index 07526d604e..cce03bbb6d 100644 --- a/Source/binaryop/GB_binop_builtin.c +++ b/Source/binaryop/GB_binop_builtin.c @@ -57,16 +57,17 @@ bool GB_binop_builtin // true if binary operator is builtin } ASSERT (GB_IS_BINARYOP_CODE (*opcode)) ; - if (*opcode == GB_USER_binop_code) + if (*opcode == GB_USER_binop_code || *opcode == GB_USER_idxbinop_code) { // the binary operator is user-defined return (false) ; } - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (*opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (*opcode) ; // check if A matches the input to the operator - if (!A_is_pattern && !op_is_positional) + if (!A_is_pattern && !op_is_builtin_positional) { if ((A_type != op->xtype) || (A_type->code >= GB_UDT_code)) { @@ -77,7 +78,7 @@ bool GB_binop_builtin // true if binary operator is builtin } // check if B matches the input to the operator - if (!B_is_pattern && !op_is_positional) + if (!B_is_pattern && !op_is_builtin_positional) { if ((B_type != op->ytype) || (B_type->code >= GB_UDT_code)) { diff --git a/Source/binaryop/GB_binop_pattern.c b/Source/binaryop/GB_binop_pattern.c index 459750fd0b..948ec18524 100644 --- a/Source/binaryop/GB_binop_pattern.c +++ b/Source/binaryop/GB_binop_pattern.c @@ -30,12 +30,13 @@ void GB_binop_pattern // determine A_is_pattern and B_is_pattern //-------------------------------------------------------------------------- - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; 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) ; - if (op_is_positional || op_is_pair) + if (op_is_builtin_positional || op_is_pair) { // mult (x,y) does not depend on the values of x or y (*A_is_pattern) = true ; diff --git a/Source/binaryop/GxB_BinaryOp_new.c b/Source/binaryop/GxB_BinaryOp_new.c index f66b7d9724..8e71f0dda3 100644 --- a/Source/binaryop/GxB_BinaryOp_new.c +++ b/Source/binaryop/GxB_BinaryOp_new.c @@ -46,7 +46,7 @@ GrB_Info GxB_BinaryOp_new //-------------------------------------------------------------------------- size_t header_size ; - GrB_BinaryOp op = GB_MALLOC (1, struct GB_BinaryOp_opaque, &header_size) ; + GrB_BinaryOp op = GB_CALLOC (1, struct GB_BinaryOp_opaque, &header_size) ; if (op == NULL) { // out of memory @@ -80,7 +80,10 @@ GrB_Info GxB_BinaryOp_new { // unable to construct the function pointer GB_Op_free ((GB_Operator *) &op) ; - return (GrB_NULL_POINTER) ; + // If the JIT fails, it returns GrB_NO_VALUE or GxB_JIT_ERROR. + // Convert GrB_NO_VALUE to GrB_NULL_POINTER (the function is NULL + // and cannot be compiled by the JIT). + return (info == GrB_NO_VALUE ? GrB_NULL_POINTER : info) ; } op->binop_function = (GxB_binary_function) user_function ; GB_BURBLE_END ; diff --git a/Source/binaryop/factory/GB_binop_factory.c b/Source/binaryop/factory/GB_binop_factory.c index 1ec015e91b..d0d861a000 100644 --- a/Source/binaryop/factory/GB_binop_factory.c +++ b/Source/binaryop/factory/GB_binop_factory.c @@ -14,10 +14,88 @@ // name. Except for the GxB_BSHIFT_[XTYPE] operators (where y always has type // int8), the types of x and y are the same. +#if defined (GxB_NO_BOOL) +#define GB_CASE_BOOL(op) +#else +#define GB_CASE_BOOL(op) case GB_BOOL_code: GB_BINOP_WORKER (op, _bool ) +#endif + +#if defined (GxB_NO_INT8) +#define GB_CASE_INT8(op) +#else +#define GB_CASE_INT8(op) case GB_INT8_code: GB_BINOP_WORKER (op, _int8 ) +#endif + +#if defined (GxB_NO_INT16) +#define GB_CASE_INT16(op) +#else +#define GB_CASE_INT16(op) case GB_INT16_code: GB_BINOP_WORKER (op, _int16 ) +#endif + +#if defined (GxB_NO_INT32) +#define GB_CASE_INT32(op) +#else +#define GB_CASE_INT32(op) case GB_INT32_code: GB_BINOP_WORKER (op, _int32 ) +#endif + +#if defined (GxB_NO_INT64) +#define GB_CASE_INT64(op) +#else +#define GB_CASE_INT64(op) case GB_INT64_code: GB_BINOP_WORKER (op, _int64 ) +#endif + +#if defined (GxB_NO_UINT8) +#define GB_CASE_UINT8(op) +#else +#define GB_CASE_UINT8(op) case GB_UINT8_code: GB_BINOP_WORKER (op, _uint8 ) +#endif + +#if defined (GxB_NO_UINT16) +#define GB_CASE_UINT16(op) +#else +#define GB_CASE_UINT16(op) case GB_UINT16_code: GB_BINOP_WORKER (op, _uint16) +#endif + +#if defined (GxB_NO_UINT32) +#define GB_CASE_UINT32(op) +#else +#define GB_CASE_UINT32(op) case GB_UINT32_code: GB_BINOP_WORKER (op, _uint32) +#endif + +#if defined (GxB_NO_UINT64) +#define GB_CASE_UINT64(op) +#else +#define GB_CASE_UINT64(op) case GB_UINT64_code: GB_BINOP_WORKER (op, _uint64) +#endif + +#if defined (GxB_NO_FP32) +#define GB_CASE_FP32(op) +#else +#define GB_CASE_FP32(op) case GB_FP32_code: GB_BINOP_WORKER (op, _fp32 ) +#endif + +#if defined (GxB_NO_FP64) +#define GB_CASE_FP64(op) +#else +#define GB_CASE_FP64(op) case GB_FP64_code: GB_BINOP_WORKER (op, _fp64 ) +#endif + +#if defined (GxB_NO_FC32) +#define GB_CASE_FC32(op) +#else +#define GB_CASE_FC32(op) case GB_FC32_code: GB_BINOP_WORKER (op, _fc32 ) +#endif + +#if defined (GxB_NO_FC64) +#define GB_CASE_FC64(op) +#else +#define GB_CASE_FC64(op) case GB_FC64_code: GB_BINOP_WORKER (op, _fc64 ) +#endif + { // this switch factory does not handle positional operators - ASSERT (!GB_OPCODE_IS_POSITIONAL (opcode)) ; + ASSERT (!GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode)) ; switch (opcode) { @@ -31,16 +109,16 @@ // MIN == TIMES == AND for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_min, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_min, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_min, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_min, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_min, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_min, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_min, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_min, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_min, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_min, _fp64 ) + GB_CASE_INT8 (_min) + GB_CASE_INT16 (_min) + GB_CASE_INT32 (_min) + GB_CASE_INT64 (_min) + GB_CASE_UINT8 (_min) + GB_CASE_UINT16 (_min) + GB_CASE_UINT32 (_min) + GB_CASE_UINT64 (_min) + GB_CASE_FP32 (_min) + GB_CASE_FP64 (_min) default: ; } break ; @@ -52,16 +130,16 @@ // MAX == PLUS == OR for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_max, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_max, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_max, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_max, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_max, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_max, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_max, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_max, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_max, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_max, _fp64 ) + GB_CASE_INT8 (_max) + GB_CASE_INT16 (_max) + GB_CASE_INT32 (_max) + GB_CASE_INT64 (_max) + GB_CASE_UINT8 (_max) + GB_CASE_UINT16 (_max) + GB_CASE_UINT32 (_max) + GB_CASE_UINT64 (_max) + GB_CASE_FP32 (_max) + GB_CASE_FP64 (_max) default: ; } break ; @@ -73,18 +151,18 @@ // MAX == PLUS == OR for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_plus, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_plus, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_plus, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_plus, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_plus, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_plus, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_plus, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_plus, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_plus, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_plus, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_plus, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_plus, _fc64 ) + GB_CASE_INT8 (_plus) + GB_CASE_INT16 (_plus) + GB_CASE_INT32 (_plus) + GB_CASE_INT64 (_plus) + GB_CASE_UINT8 (_plus) + GB_CASE_UINT16 (_plus) + GB_CASE_UINT32 (_plus) + GB_CASE_UINT64 (_plus) + GB_CASE_FP32 (_plus) + GB_CASE_FP64 (_plus) + GB_CASE_FC32 (_plus) + GB_CASE_FC64 (_plus) default: ; } break ; @@ -96,18 +174,18 @@ // MIN == TIMES == AND for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_times, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_times, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_times, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_times, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_times, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_times, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_times, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_times, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_times, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_times, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_times, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_times, _fc64 ) + GB_CASE_INT8 (_times) + GB_CASE_INT16 (_times) + GB_CASE_INT32 (_times) + GB_CASE_INT64 (_times) + GB_CASE_UINT8 (_times) + GB_CASE_UINT16 (_times) + GB_CASE_UINT32 (_times) + GB_CASE_UINT64 (_times) + GB_CASE_FP32 (_times) + GB_CASE_FP64 (_times) + GB_CASE_FC32 (_times) + GB_CASE_FC64 (_times) default: ; } break ; @@ -120,18 +198,18 @@ // MINUS == RMINUS == NE == ISNE == XOR for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_minus, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_minus, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_minus, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_minus, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_minus, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_minus, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_minus, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_minus, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_minus, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_minus, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_minus, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_minus, _fc64 ) + GB_CASE_INT8 (_minus) + GB_CASE_INT16 (_minus) + GB_CASE_INT32 (_minus) + GB_CASE_INT64 (_minus) + GB_CASE_UINT8 (_minus) + GB_CASE_UINT16 (_minus) + GB_CASE_UINT32 (_minus) + GB_CASE_UINT64 (_minus) + GB_CASE_FP32 (_minus) + GB_CASE_FP64 (_minus) + GB_CASE_FC32 (_minus) + GB_CASE_FC64 (_minus) default: ; } break ; @@ -143,18 +221,18 @@ // MINUS == RMINUS == NE == ISNE == XOR for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_rminus, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_rminus, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_rminus, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_rminus, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_rminus, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_rminus, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_rminus, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_rminus, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_rminus, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_rminus, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_rminus, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_rminus, _fc64 ) + GB_CASE_INT8 (_rminus) + GB_CASE_INT16 (_rminus) + GB_CASE_INT32 (_rminus) + GB_CASE_INT64 (_rminus) + GB_CASE_UINT8 (_rminus) + GB_CASE_UINT16 (_rminus) + GB_CASE_UINT32 (_rminus) + GB_CASE_UINT64 (_rminus) + GB_CASE_FP32 (_rminus) + GB_CASE_FP64 (_rminus) + GB_CASE_FC32 (_rminus) + GB_CASE_FC64 (_rminus) default: ; } break ; @@ -166,18 +244,18 @@ // FIRST == DIV for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_div, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_div, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_div, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_div, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_div, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_div, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_div, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_div, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_div, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_div, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_div, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_div, _fc64 ) + GB_CASE_INT8 (_div) + GB_CASE_INT16 (_div) + GB_CASE_INT32 (_div) + GB_CASE_INT64 (_div) + GB_CASE_UINT8 (_div) + GB_CASE_UINT16 (_div) + GB_CASE_UINT32 (_div) + GB_CASE_UINT64 (_div) + GB_CASE_FP32 (_div) + GB_CASE_FP64 (_div) + GB_CASE_FC32 (_div) + GB_CASE_FC64 (_div) default: ; } break ; @@ -189,18 +267,18 @@ // SECOND == RDIV for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_rdiv, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_rdiv, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_rdiv, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_rdiv, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_rdiv, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_rdiv, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_rdiv, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_rdiv, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_rdiv, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_rdiv, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_rdiv, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_rdiv, _fc64 ) + GB_CASE_INT8 (_rdiv) + GB_CASE_INT16 (_rdiv) + GB_CASE_INT32 (_rdiv) + GB_CASE_INT64 (_rdiv) + GB_CASE_UINT8 (_rdiv) + GB_CASE_UINT16 (_rdiv) + GB_CASE_UINT32 (_rdiv) + GB_CASE_UINT64 (_rdiv) + GB_CASE_FP32 (_rdiv) + GB_CASE_FP64 (_rdiv) + GB_CASE_FC32 (_rdiv) + GB_CASE_FC64 (_rdiv) default: ; } break ; @@ -218,19 +296,19 @@ switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_first, _bool ) - case GB_INT8_code : GB_BINOP_WORKER (_first, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_first, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_first, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_first, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_first, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_first, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_first, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_first, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_first, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_first, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_first, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_first, _fc64 ) + GB_CASE_BOOL (_first) + GB_CASE_INT8 (_first) + GB_CASE_INT16 (_first) + GB_CASE_INT32 (_first) + GB_CASE_INT64 (_first) + GB_CASE_UINT8 (_first) + GB_CASE_UINT16 (_first) + GB_CASE_UINT32 (_first) + GB_CASE_UINT64 (_first) + GB_CASE_FP32 (_first) + GB_CASE_FP64 (_first) + GB_CASE_FC32 (_first) + GB_CASE_FC64 (_first) default: ; } break ; @@ -245,19 +323,19 @@ switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_second, _bool ) - case GB_INT8_code : GB_BINOP_WORKER (_second, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_second, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_second, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_second, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_second, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_second, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_second, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_second, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_second, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_second, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_second, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_second, _fc64 ) + GB_CASE_BOOL (_second) + GB_CASE_INT8 (_second) + GB_CASE_INT16 (_second) + GB_CASE_INT32 (_second) + GB_CASE_INT64 (_second) + GB_CASE_UINT8 (_second) + GB_CASE_UINT16 (_second) + GB_CASE_UINT32 (_second) + GB_CASE_UINT64 (_second) + GB_CASE_FP32 (_second) + GB_CASE_FP64 (_second) + GB_CASE_FC32 (_second) + GB_CASE_FC64 (_second) default: ; } break ; @@ -273,75 +351,82 @@ switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_pair, _bool ) - case GB_INT8_code : GB_BINOP_WORKER (_pair, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_pair, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_pair, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_pair, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_pair, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_pair, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_pair, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_pair, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_pair, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_pair, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_pair, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_pair, _fc64 ) + GB_CASE_BOOL (_pair) + GB_CASE_INT8 (_pair) + GB_CASE_INT16 (_pair) + GB_CASE_INT32 (_pair) + GB_CASE_INT64 (_pair) + GB_CASE_UINT8 (_pair) + GB_CASE_UINT16 (_pair) + GB_CASE_UINT32 (_pair) + GB_CASE_UINT64 (_pair) + GB_CASE_FP32 (_pair) + GB_CASE_FP64 (_pair) + GB_CASE_FC32 (_pair) + GB_CASE_FC64 (_pair) default: ; } break ; #endif +#if 0 + //---------------------------------------------------------------------- - case GB_ISEQ_binop_code : // z = (x == y) + // IS* operators fully disabled + //---------------------------------------------------------------------- + + //---------------------------------------------------------------------- + case GB_ISEQ_binop_code: // z = (x == y) //---------------------------------------------------------------------- // ISEQ == EQ for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_iseq, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_iseq, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_iseq, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_iseq, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_iseq, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_iseq, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_iseq, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_iseq, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_iseq, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_iseq, _fp64 ) + GB_CASE_INT8 (_iseq) + GB_CASE_INT16 (_iseq) + GB_CASE_INT32 (_iseq) + GB_CASE_INT64 (_iseq) + GB_CASE_UINT8 (_iseq) + GB_CASE_UINT16 (_iseq) + GB_CASE_UINT32 (_iseq) + GB_CASE_UINT64 (_iseq) + GB_CASE_FP32 (_iseq) + GB_CASE_FP64 (_iseq) #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER // ISEQ does not appear in a builtin complex semiring - case GB_FC32_code : GB_BINOP_WORKER (_iseq, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_iseq, _fc64 ) + GB_CASE_FC32 (_iseq) + GB_CASE_FC64 (_iseq) #endif default: ; } break ; //---------------------------------------------------------------------- - case GB_ISNE_binop_code : // z = (x != y) + case GB_ISNE_binop_code: // z = (x != y) //---------------------------------------------------------------------- // MINUS == RMINUS == NE == ISNE == XOR for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_isne, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_isne, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_isne, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_isne, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_isne, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_isne, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_isne, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_isne, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_isne, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_isne, _fp64 ) + GB_CASE_INT8 (_isne) + GB_CASE_INT16 (_isne) + GB_CASE_INT32 (_isne) + GB_CASE_INT64 (_isne) + GB_CASE_UINT8 (_isne) + GB_CASE_UINT16 (_isne) + GB_CASE_UINT32 (_isne) + GB_CASE_UINT64 (_isne) + GB_CASE_FP32 (_isne) + GB_CASE_FP64 (_isne) #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER // ISNE does not appear in a builtin complex semiring - case GB_FC32_code : GB_BINOP_WORKER (_isne, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_isne, _fc64 ) + GB_CASE_FC32 (_isne) + GB_CASE_FC64 (_isne) #endif default: ; } break ; +#endif //---------------------------------------------------------------------- case GB_EQ_binop_code : // z = (x == y) @@ -353,22 +438,22 @@ switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_eq, _bool ) + GB_CASE_BOOL (_eq) #ifndef GB_XTYPE_AND_ZTYPE_MUST_MATCH - case GB_INT8_code : GB_BINOP_WORKER (_eq, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_eq, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_eq, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_eq, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_eq, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_eq, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_eq, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_eq, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_eq, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_eq, _fp64 ) + GB_CASE_INT8 (_eq) + GB_CASE_INT16 (_eq) + GB_CASE_INT32 (_eq) + GB_CASE_INT64 (_eq) + GB_CASE_UINT8 (_eq) + GB_CASE_UINT16 (_eq) + GB_CASE_UINT32 (_eq) + GB_CASE_UINT64 (_eq) + GB_CASE_FP32 (_eq) + GB_CASE_FP64 (_eq) #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER // EQ does not appear in a builtin complex semiring - case GB_FC32_code : GB_BINOP_WORKER (_eq, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_eq, _fc64 ) + GB_CASE_FC32 (_eq) + GB_CASE_FC64 (_eq) #endif #endif default: ; @@ -384,20 +469,20 @@ // MINUS == RMINUS == NE == ISNE == XOR for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_ne, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_ne, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_ne, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_ne, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_ne, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_ne, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_ne, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_ne, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_ne, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_ne, _fp64 ) + GB_CASE_INT8 (_ne) + GB_CASE_INT16 (_ne) + GB_CASE_INT32 (_ne) + GB_CASE_INT64 (_ne) + GB_CASE_UINT8 (_ne) + GB_CASE_UINT16 (_ne) + GB_CASE_UINT32 (_ne) + GB_CASE_UINT64 (_ne) + GB_CASE_FP32 (_ne) + GB_CASE_FP64 (_ne) #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER // NE does not appear in a builtin complex semiring - case GB_FC32_code : GB_BINOP_WORKER (_ne, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_ne, _fc64 ) + GB_CASE_FC32 (_ne) + GB_CASE_FC64 (_ne) #endif default: ; } @@ -412,17 +497,17 @@ // no complex case switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_lor, _bool ) - case GB_INT8_code : GB_BINOP_WORKER (_lor, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_lor, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_lor, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_lor, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_lor, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_lor, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_lor, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_lor, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_lor, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_lor, _fp64 ) + GB_CASE_BOOL (_lor) + GB_CASE_INT8 (_lor) + GB_CASE_INT16 (_lor) + GB_CASE_INT32 (_lor) + GB_CASE_INT64 (_lor) + GB_CASE_UINT8 (_lor) + GB_CASE_UINT16 (_lor) + GB_CASE_UINT32 (_lor) + GB_CASE_UINT64 (_lor) + GB_CASE_FP32 (_lor) + GB_CASE_FP64 (_lor) default: ; } break ; @@ -434,17 +519,17 @@ // no complex case switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_land, _bool ) - case GB_INT8_code : GB_BINOP_WORKER (_land, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_land, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_land, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_land, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_land, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_land, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_land, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_land, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_land, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_land, _fp64 ) + GB_CASE_BOOL (_land) + GB_CASE_INT8 (_land) + GB_CASE_INT16 (_land) + GB_CASE_INT32 (_land) + GB_CASE_INT64 (_land) + GB_CASE_UINT8 (_land) + GB_CASE_UINT16 (_land) + GB_CASE_UINT32 (_land) + GB_CASE_UINT64 (_land) + GB_CASE_FP32 (_land) + GB_CASE_FP64 (_land) default: ; } break ; @@ -456,107 +541,114 @@ // no complex case switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_lxor, _bool ) - case GB_INT8_code : GB_BINOP_WORKER (_lxor, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_lxor, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_lxor, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_lxor, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_lxor, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_lxor, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_lxor, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_lxor, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_lxor, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_lxor, _fp64 ) + GB_CASE_BOOL (_lxor) + GB_CASE_INT8 (_lxor) + GB_CASE_INT16 (_lxor) + GB_CASE_INT32 (_lxor) + GB_CASE_INT64 (_lxor) + GB_CASE_UINT8 (_lxor) + GB_CASE_UINT16 (_lxor) + GB_CASE_UINT32 (_lxor) + GB_CASE_UINT64 (_lxor) + GB_CASE_FP32 (_lxor) + GB_CASE_FP64 (_lxor) default: ; } break ; #endif +#if 0 + //---------------------------------------------------------------------- + // IS* operators fully disabled + //---------------------------------------------------------------------- + //---------------------------------------------------------------------- - case GB_ISGT_binop_code : // z = (x > y) + case GB_ISGT_binop_code: // z = (x > y) //---------------------------------------------------------------------- // ISGT == GT for boolean. no complex case switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_isgt, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_isgt, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_isgt, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_isgt, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_isgt, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_isgt, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_isgt, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_isgt, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_isgt, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_isgt, _fp64 ) + GB_CASE_INT8 (_isgt) + GB_CASE_INT16 (_isgt) + GB_CASE_INT32 (_isgt) + GB_CASE_INT64 (_isgt) + GB_CASE_UINT8 (_isgt) + GB_CASE_UINT16 (_isgt) + GB_CASE_UINT32 (_isgt) + GB_CASE_UINT64 (_isgt) + GB_CASE_FP32 (_isgt) + GB_CASE_FP64 (_isgt) default: ; } break ; //---------------------------------------------------------------------- - case GB_ISLT_binop_code : // z = (x < y) + case GB_ISLT_binop_code: // z = (x < y) //---------------------------------------------------------------------- // ISLT == LT for boolean. no complex case switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_islt, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_islt, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_islt, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_islt, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_islt, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_islt, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_islt, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_islt, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_islt, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_islt, _fp64 ) + GB_CASE_INT8 (_islt) + GB_CASE_INT16 (_islt) + GB_CASE_INT32 (_islt) + GB_CASE_INT64 (_islt) + GB_CASE_UINT8 (_islt) + GB_CASE_UINT16 (_islt) + GB_CASE_UINT32 (_islt) + GB_CASE_UINT64 (_islt) + GB_CASE_FP32 (_islt) + GB_CASE_FP64 (_islt) default: ; } break ; //---------------------------------------------------------------------- - case GB_ISGE_binop_code : // z = (x >= y) + case GB_ISGE_binop_code: // z = (x >= y) //---------------------------------------------------------------------- // POW == ISGE == GE for boolean. no complex case. switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_isge, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_isge, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_isge, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_isge, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_isge, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_isge, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_isge, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_isge, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_isge, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_isge, _fp64 ) + GB_CASE_INT8 (_isge) + GB_CASE_INT16 (_isge) + GB_CASE_INT32 (_isge) + GB_CASE_INT64 (_isge) + GB_CASE_UINT8 (_isge) + GB_CASE_UINT16 (_isge) + GB_CASE_UINT32 (_isge) + GB_CASE_UINT64 (_isge) + GB_CASE_FP32 (_isge) + GB_CASE_FP64 (_isge) default: ; } break ; //---------------------------------------------------------------------- - case GB_ISLE_binop_code : // z = (x <= y) + case GB_ISLE_binop_code: // z = (x <= y) //---------------------------------------------------------------------- // ISLE == LE for boolean. no complex case switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_isle, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_isle, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_isle, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_isle, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_isle, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_isle, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_isle, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_isle, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_isle, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_isle, _fp64 ) + GB_CASE_INT8 (_isle) + GB_CASE_INT16 (_isle) + GB_CASE_INT32 (_isle) + GB_CASE_INT64 (_isle) + GB_CASE_UINT8 (_isle) + GB_CASE_UINT16 (_isle) + GB_CASE_UINT32 (_isle) + GB_CASE_UINT64 (_isle) + GB_CASE_FP32 (_isle) + GB_CASE_FP64 (_isle) default: ; } break ; +#endif + //---------------------------------------------------------------------- case GB_GT_binop_code : // z = (x > y) //---------------------------------------------------------------------- @@ -564,18 +656,18 @@ // no complex case switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_gt, _bool ) + GB_CASE_BOOL (_gt) #ifndef GB_XTYPE_AND_ZTYPE_MUST_MATCH - case GB_INT8_code : GB_BINOP_WORKER (_gt, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_gt, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_gt, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_gt, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_gt, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_gt, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_gt, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_gt, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_gt, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_gt, _fp64 ) + GB_CASE_INT8 (_gt) + GB_CASE_INT16 (_gt) + GB_CASE_INT32 (_gt) + GB_CASE_INT64 (_gt) + GB_CASE_UINT8 (_gt) + GB_CASE_UINT16 (_gt) + GB_CASE_UINT32 (_gt) + GB_CASE_UINT64 (_gt) + GB_CASE_FP32 (_gt) + GB_CASE_FP64 (_gt) #endif default: ; } @@ -588,18 +680,18 @@ // no complex case switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_lt, _bool ) + GB_CASE_BOOL (_lt) #ifndef GB_XTYPE_AND_ZTYPE_MUST_MATCH - case GB_INT8_code : GB_BINOP_WORKER (_lt, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_lt, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_lt, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_lt, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_lt, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_lt, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_lt, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_lt, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_lt, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_lt, _fp64 ) + GB_CASE_INT8 (_lt) + GB_CASE_INT16 (_lt) + GB_CASE_INT32 (_lt) + GB_CASE_INT64 (_lt) + GB_CASE_UINT8 (_lt) + GB_CASE_UINT16 (_lt) + GB_CASE_UINT32 (_lt) + GB_CASE_UINT64 (_lt) + GB_CASE_FP32 (_lt) + GB_CASE_FP64 (_lt) #endif default: ; } @@ -612,18 +704,18 @@ // no complex case switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_ge, _bool ) + GB_CASE_BOOL (_ge) #ifndef GB_XTYPE_AND_ZTYPE_MUST_MATCH - case GB_INT8_code : GB_BINOP_WORKER (_ge, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_ge, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_ge, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_ge, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_ge, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_ge, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_ge, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_ge, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_ge, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_ge, _fp64 ) + GB_CASE_INT8 (_ge) + GB_CASE_INT16 (_ge) + GB_CASE_INT32 (_ge) + GB_CASE_INT64 (_ge) + GB_CASE_UINT8 (_ge) + GB_CASE_UINT16 (_ge) + GB_CASE_UINT32 (_ge) + GB_CASE_UINT64 (_ge) + GB_CASE_FP32 (_ge) + GB_CASE_FP64 (_ge) #endif default: ; } @@ -636,18 +728,18 @@ // no complex case switch (xcode) { - case GB_BOOL_code : GB_BINOP_WORKER (_le, _bool ) + GB_CASE_BOOL (_le) #ifndef GB_XTYPE_AND_ZTYPE_MUST_MATCH - case GB_INT8_code : GB_BINOP_WORKER (_le, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_le, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_le, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_le, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_le, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_le, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_le, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_le, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_le, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_le, _fp64 ) + GB_CASE_INT8 (_le) + GB_CASE_INT16 (_le) + GB_CASE_INT32 (_le) + GB_CASE_INT64 (_le) + GB_CASE_UINT8 (_le) + GB_CASE_UINT16 (_le) + GB_CASE_UINT32 (_le) + GB_CASE_UINT64 (_le) + GB_CASE_FP32 (_le) + GB_CASE_FP64 (_le) #endif default: ; } @@ -665,18 +757,18 @@ // POW == ISGE == GE for boolean switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_pow, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_pow, _int16 ) - case GB_INT32_code : GB_BINOP_WORKER (_pow, _int32 ) - case GB_INT64_code : GB_BINOP_WORKER (_pow, _int64 ) - case GB_UINT8_code : GB_BINOP_WORKER (_pow, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_pow, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_pow, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_pow, _uint64) - case GB_FP32_code : GB_BINOP_WORKER (_pow, _fp32 ) - case GB_FP64_code : GB_BINOP_WORKER (_pow, _fp64 ) - case GB_FC32_code : GB_BINOP_WORKER (_pow, _fc32 ) - case GB_FC64_code : GB_BINOP_WORKER (_pow, _fc64 ) + GB_CASE_INT8 (_pow) + GB_CASE_INT16 (_pow) + GB_CASE_INT32 (_pow) + GB_CASE_INT64 (_pow) + GB_CASE_UINT8 (_pow) + GB_CASE_UINT16 (_pow) + GB_CASE_UINT32 (_pow) + GB_CASE_UINT64 (_pow) + GB_CASE_FP32 (_pow) + GB_CASE_FP64 (_pow) + GB_CASE_FC32 (_pow) + GB_CASE_FC64 (_pow) default: ; } break ; @@ -687,8 +779,8 @@ switch (xcode) { - case GB_FP32_code : GB_BINOP_WORKER (_atan2, _fp32) - case GB_FP64_code : GB_BINOP_WORKER (_atan2, _fp64) + GB_CASE_FP32 (_atan2) + GB_CASE_FP64 (_atan2) default: ; } break ; @@ -701,8 +793,8 @@ switch (xcode) { - case GB_FP32_code : GB_BINOP_WORKER (_hypot, _fp32) - case GB_FP64_code : GB_BINOP_WORKER (_hypot, _fp64) + GB_CASE_FP32 (_hypot) + GB_CASE_FP64 (_hypot) default: ; } break ; @@ -715,8 +807,8 @@ switch (xcode) { - case GB_FP32_code : GB_BINOP_WORKER (_fmod, _fp32) - case GB_FP64_code : GB_BINOP_WORKER (_fmod, _fp64) + GB_CASE_FP32 (_fmod) + GB_CASE_FP64 (_fmod) default: ; } break ; @@ -727,8 +819,8 @@ switch (xcode) { - case GB_FP32_code : GB_BINOP_WORKER (_remainder, _fp32) - case GB_FP64_code : GB_BINOP_WORKER (_remainder, _fp64) + GB_CASE_FP32 (_remainder) + GB_CASE_FP64 (_remainder) default: ; } break ; @@ -739,8 +831,8 @@ switch (xcode) { - case GB_FP32_code : GB_BINOP_WORKER (_ldexp, _fp32) - case GB_FP64_code : GB_BINOP_WORKER (_ldexp, _fp64) + GB_CASE_FP32 (_ldexp) + GB_CASE_FP64 (_ldexp) default: ; } break ; @@ -751,8 +843,8 @@ switch (xcode) { - case GB_FP32_code : GB_BINOP_WORKER (_copysign, _fp32) - case GB_FP64_code : GB_BINOP_WORKER (_copysign, _fp64) + GB_CASE_FP32 (_copysign) + GB_CASE_FP64 (_copysign) default: ; } break ; @@ -765,8 +857,8 @@ switch (xcode) { - case GB_FP32_code : GB_BINOP_WORKER (_cmplx, _fp32) - case GB_FP64_code : GB_BINOP_WORKER (_cmplx, _fp64) + GB_CASE_FP32 (_cmplx) + GB_CASE_FP64 (_cmplx) default: ; } break ; @@ -779,14 +871,14 @@ switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_bget, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_bget, _int16) - case GB_INT32_code : GB_BINOP_WORKER (_bget, _int32) - case GB_INT64_code : GB_BINOP_WORKER (_bget, _int64) - case GB_UINT8_code : GB_BINOP_WORKER (_bget, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_bget, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_bget, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_bget, _uint64) + GB_CASE_INT8 (_bget) + GB_CASE_INT16 (_bget) + GB_CASE_INT32 (_bget) + GB_CASE_INT64 (_bget) + GB_CASE_UINT8 (_bget) + GB_CASE_UINT16 (_bget) + GB_CASE_UINT32 (_bget) + GB_CASE_UINT64 (_bget) default: ; } break ; @@ -797,14 +889,14 @@ switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_bset, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_bset, _int16) - case GB_INT32_code : GB_BINOP_WORKER (_bset, _int32) - case GB_INT64_code : GB_BINOP_WORKER (_bset, _int64) - case GB_UINT8_code : GB_BINOP_WORKER (_bset, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_bset, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_bset, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_bset, _uint64) + GB_CASE_INT8 (_bset) + GB_CASE_INT16 (_bset) + GB_CASE_INT32 (_bset) + GB_CASE_INT64 (_bset) + GB_CASE_UINT8 (_bset) + GB_CASE_UINT16 (_bset) + GB_CASE_UINT32 (_bset) + GB_CASE_UINT64 (_bset) default: ; } break ; @@ -815,14 +907,14 @@ switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_bclr, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_bclr, _int16) - case GB_INT32_code : GB_BINOP_WORKER (_bclr, _int32) - case GB_INT64_code : GB_BINOP_WORKER (_bclr, _int64) - case GB_UINT8_code : GB_BINOP_WORKER (_bclr, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_bclr, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_bclr, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_bclr, _uint64) + GB_CASE_INT8 (_bclr) + GB_CASE_INT16 (_bclr) + GB_CASE_INT32 (_bclr) + GB_CASE_INT64 (_bclr) + GB_CASE_UINT8 (_bclr) + GB_CASE_UINT16 (_bclr) + GB_CASE_UINT32 (_bclr) + GB_CASE_UINT64 (_bclr) default: ; } break ; @@ -834,14 +926,14 @@ // y is always int8; z and x have int* or uint* type switch (xcode) { - case GB_INT8_code : GB_BINOP_WORKER (_bshift, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_bshift, _int16) - case GB_INT32_code : GB_BINOP_WORKER (_bshift, _int32) - case GB_INT64_code : GB_BINOP_WORKER (_bshift, _int64) - case GB_UINT8_code : GB_BINOP_WORKER (_bshift, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_bshift, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_bshift, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_bshift, _uint64) + GB_CASE_INT8 (_bshift) + GB_CASE_INT16 (_bshift) + GB_CASE_INT32 (_bshift) + GB_CASE_INT64 (_bshift) + GB_CASE_UINT8 (_bshift) + GB_CASE_UINT16 (_bshift) + GB_CASE_UINT32 (_bshift) + GB_CASE_UINT64 (_bshift) default: ; } break ; @@ -856,17 +948,18 @@ switch (xcode) { + #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER // BOR for signed integers is not in any builtin semiring - case GB_INT8_code : GB_BINOP_WORKER (_bor, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_bor, _int16) - case GB_INT32_code : GB_BINOP_WORKER (_bor, _int32) - case GB_INT64_code : GB_BINOP_WORKER (_bor, _int64) + GB_CASE_INT8 (_bor) + GB_CASE_INT16 (_bor) + GB_CASE_INT32 (_bor) + GB_CASE_INT64 (_bor) #endif - case GB_UINT8_code : GB_BINOP_WORKER (_bor, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_bor, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_bor, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_bor, _uint64) + GB_CASE_UINT8 (_bor) + GB_CASE_UINT16 (_bor) + GB_CASE_UINT32 (_bor) + GB_CASE_UINT64 (_bor) default: ; } break ; @@ -879,15 +972,15 @@ { #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER // BAND for signed integers is not in any builtin semiring - case GB_INT8_code : GB_BINOP_WORKER (_band, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_band, _int16) - case GB_INT32_code : GB_BINOP_WORKER (_band, _int32) - case GB_INT64_code : GB_BINOP_WORKER (_band, _int64) + GB_CASE_INT8 (_band) + GB_CASE_INT16 (_band) + GB_CASE_INT32 (_band) + GB_CASE_INT64 (_band) #endif - case GB_UINT8_code : GB_BINOP_WORKER (_band, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_band, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_band, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_band, _uint64) + GB_CASE_UINT8 (_band) + GB_CASE_UINT16 (_band) + GB_CASE_UINT32 (_band) + GB_CASE_UINT64 (_band) default: ; } break ; @@ -900,15 +993,15 @@ { #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER // BXOR for signed integers is not in any builtin semiring - case GB_INT8_code : GB_BINOP_WORKER (_bxor, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_bxor, _int16) - case GB_INT32_code : GB_BINOP_WORKER (_bxor, _int32) - case GB_INT64_code : GB_BINOP_WORKER (_bxor, _int64) + GB_CASE_INT8 (_bxor) + GB_CASE_INT16 (_bxor) + GB_CASE_INT32 (_bxor) + GB_CASE_INT64 (_bxor) #endif - case GB_UINT8_code : GB_BINOP_WORKER (_bxor, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_bxor, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_bxor, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_bxor, _uint64) + GB_CASE_UINT8 (_bxor) + GB_CASE_UINT16 (_bxor) + GB_CASE_UINT32 (_bxor) + GB_CASE_UINT64 (_bxor) default: ; } break ; @@ -921,15 +1014,15 @@ { #ifndef GB_BINOP_IS_SEMIRING_MULTIPLIER // BXNOR for signed integers is not in any builtin semiring - case GB_INT8_code : GB_BINOP_WORKER (_bxnor, _int8 ) - case GB_INT16_code : GB_BINOP_WORKER (_bxnor, _int16) - case GB_INT32_code : GB_BINOP_WORKER (_bxnor, _int32) - case GB_INT64_code : GB_BINOP_WORKER (_bxnor, _int64) + GB_CASE_INT8 (_bxnor) + GB_CASE_INT16 (_bxnor) + GB_CASE_INT32 (_bxnor) + GB_CASE_INT64 (_bxnor) #endif - case GB_UINT8_code : GB_BINOP_WORKER (_bxnor, _uint8 ) - case GB_UINT16_code : GB_BINOP_WORKER (_bxnor, _uint16) - case GB_UINT32_code : GB_BINOP_WORKER (_bxnor, _uint32) - case GB_UINT64_code : GB_BINOP_WORKER (_bxnor, _uint64) + GB_CASE_UINT8 (_bxnor) + GB_CASE_UINT16 (_bxnor) + GB_CASE_UINT32 (_bxnor) + GB_CASE_UINT64 (_bxnor) default: ; } break ; @@ -946,3 +1039,17 @@ #undef GB_NO_PAIR #undef GB_XTYPE_AND_ZTYPE_MUST_MATCH +#undef GB_CASE_BOOL +#undef GB_CASE_INT8 +#undef GB_CASE_INT16 +#undef GB_CASE_INT32 +#undef GB_CASE_INT64 +#undef GB_CASE_UINT8 +#undef GB_CASE_UINT16 +#undef GB_CASE_UINT32 +#undef GB_CASE_UINT64 +#undef GB_CASE_FP32 +#undef GB_CASE_FP64 +#undef GB_CASE_FC32 +#undef GB_CASE_FC64 + diff --git a/Source/builder/GB_build.c b/Source/builder/GB_build.c index 37a3f6e9da..02301e4d0e 100644 --- a/Source/builder/GB_build.c +++ b/Source/builder/GB_build.c @@ -44,6 +44,8 @@ // not done here. If dup is not associative, the GraphBLAS spec states that // the results are not defined. +// The dup operator cannot be based on a GxB_IndexBinaryOp. + // SuiteSparse:GraphBLAS provides a well-defined order of assembly, however. // For a CSC format, entries in [I,J,X] are first sorted in increasing order of // row and column index via a stable sort, with ties broken by the position of @@ -305,7 +307,7 @@ GrB_Info GB_build // build matrix // match nvals, then duplicates have been detected. In the v2.0 C API, // this is an error condition. If the user application wants the C // matrix returned with duplicates discarded, use dup = GxB_IGNORE_DUP - // instead. + // instead. GB_FREE_ALL ; GB_ERROR (GrB_INVALID_VALUE, "Duplicates appear (" GBd ") but dup " "is NULL", ((int64_t) nvals) - tnvals) ; @@ -321,8 +323,8 @@ GrB_Info GB_build // build matrix // created an iso-valued matrix T, but this is not yet known. X_iso is // false for these methods. Since it has not yet been conformed to its // final sparsity structure, the matrix T is hypersparse, not bitmap. It - // has no zombies or pending tuples, so GB_all_entries_are_iso does need to handle - // those cases. T->x [0] is the new iso value of T. + // has no zombies or pending tuples, so GB_all_entries_are_iso does need to + // handle those cases. T->x [0] is the new iso value of T. if (!X_iso && GB_all_entries_are_iso (T)) { diff --git a/Source/builder/GB_builder.c b/Source/builder/GB_builder.c index 65d989be26..50c1d0b67a 100644 --- a/Source/builder/GB_builder.c +++ b/Source/builder/GB_builder.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // CALLED BY: GB_build, GB_wait, GB_transpose, GB_concat_hyper // This function is called by GB_build to build a matrix T for GrB_Matrix_build @@ -110,6 +108,7 @@ #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_bld__include.h" #endif @@ -789,11 +788,11 @@ GrB_Info GB_builder // build a matrix from tuples // Replace tnvec_slice with its cumulative sum, after which each slice tid // will be responsible for the # vectors in T that range from tnvec_slice // [tid] to tnvec_slice [tid+1]-1. - GB_cumsum (tnvec_slice, nthreads, NULL, 1, NULL) ; + GB_cumsum1 (tnvec_slice, nthreads) ; int64_t tnvec = tnvec_slice [nthreads] ; // Replace tnz_slice with its cumulative sum - GB_cumsum (tnz_slice, nthreads, NULL, 1, NULL) ; + GB_cumsum1 (tnz_slice, nthreads) ; // find the total # of final entries, after assembling duplicates int64_t tnz = tnz_slice [nthreads] ; @@ -1354,15 +1353,15 @@ GrB_Info GB_builder // build a matrix from tuples // types are the same, but all of them are built-in since // user-defined types cannot be typecasted. - const GB_Type_code scode = stype->code ; + const GB_Type_code Scode = stype->code ; const size_t ssize = stype->size ; - GB_cast_function cast_S_to_T = GB_cast_factory (tcode, scode) ; - GB_cast_function cast_S_to_Y = GB_cast_factory (ycode, scode) ; + GB_cast_function cast_S_to_T = GB_cast_factory (tcode, Scode) ; + GB_cast_function cast_S_to_Y = GB_cast_factory (ycode, Scode) ; GB_cast_function cast_T_to_X = GB_cast_factory (xcode, tcode) ; GB_cast_function cast_Z_to_T = GB_cast_factory (tcode, zcode) ; // all types must be built-in - ASSERT (scode <= GB_FC64_code) ; + ASSERT (Scode <= GB_FC64_code) ; ASSERT (tcode <= GB_FC64_code) ; ASSERT (xcode <= GB_FC64_code) ; ASSERT (ycode <= GB_FC64_code) ; diff --git a/Source/builder/factory/GB_bld_factory.c b/Source/builder/factory/GB_bld_factory.c index 8d9c223997..66ceca544d 100644 --- a/Source/builder/factory/GB_bld_factory.c +++ b/Source/builder/factory/GB_bld_factory.c @@ -16,8 +16,89 @@ // 13: any: for all 13 types // 26: first, second: for all 13 types -// FUTUTE: add band, bor, bxor, bxnor for uint [8,16,32,64]. -// Or, just use the JIT. +#if defined (GxB_NO_INT8) +#define GB_CASE_INT8(op) +#else +#define GB_CASE_INT8(op) \ + case GB_INT8_code: GB_BLD_WORKER (op, _int8 , int8_t ) +#endif + +#if defined (GxB_NO_INT16) +#define GB_CASE_INT16(op) +#else +#define GB_CASE_INT16(op) \ + case GB_INT16_code: GB_BLD_WORKER (op, _int16 , int16_t ) +#endif + +#if defined (GxB_NO_INT32) +#define GB_CASE_INT32(op) +#else +#define GB_CASE_INT32(op) \ + case GB_INT32_code: GB_BLD_WORKER (op, _int32 , int32_t ) +#endif + +#if defined (GxB_NO_INT64) +#define GB_CASE_INT64(op) +#else +#define GB_CASE_INT64(op) \ + case GB_INT64_code: GB_BLD_WORKER (op, _int64 , int64_t ) +#endif + +#if defined (GxB_NO_UINT8) +#define GB_CASE_UINT8(op) +#else +#define GB_CASE_UINT8(op) \ + case GB_UINT8_code: GB_BLD_WORKER (op, _uint8 , uint8_t ) +#endif + +#if defined (GxB_NO_UINT16) +#define GB_CASE_UINT16(op) +#else +#define GB_CASE_UINT16(op) \ + case GB_UINT16_code: GB_BLD_WORKER (op, _uint16, uint16_t) +#endif + +#if defined (GxB_NO_UINT32) +#define GB_CASE_UINT32(op) +#else +#define GB_CASE_UINT32(op) \ + case GB_UINT32_code: GB_BLD_WORKER (op, _uint32, uint32_t) +#endif + +#if defined (GxB_NO_UINT64) +#define GB_CASE_UINT64(op) +#else +#define GB_CASE_UINT64(op) \ + case GB_UINT64_code: GB_BLD_WORKER (op, _uint64, uint64_t) +#endif + +#if defined (GxB_NO_FP32) +#define GB_CASE_FP32(op) +#else +#define GB_CASE_FP32(op) \ + case GB_FP32_code: GB_BLD_WORKER (op, _fp32 , float ) +#endif + +#if defined (GxB_NO_FP64) +#define GB_CASE_FP64(op) +#else +#define GB_CASE_FP64(op) \ + case GB_FP64_code: GB_BLD_WORKER (op, _fp64 , double ) +#endif + +#if defined (GxB_NO_FC32) +#define GB_CASE_FC32(op) +#else +#define GB_CASE_FC32(op) \ + case GB_FC32_code: GB_BLD_WORKER (op, _fc32 , GxB_FC32_t) +#endif + +#if defined (GxB_NO_FC64) +#define GB_CASE_FC64(op) +#else +#define GB_CASE_FC64(op) \ + case GB_FC64_code: GB_BLD_WORKER (op, _fc64 , GxB_FC64_t) +#endif if (tcode != GB_BOOL_code) { @@ -29,98 +110,98 @@ if (tcode != GB_BOOL_code) // non-boolean, associative operators //---------------------------------------------------------------------- - case GB_MIN_binop_code : + case GB_MIN_binop_code : switch (tcode) { - case GB_INT8_code : GB_BLD_WORKER (_min, _int8, int8_t ) - case GB_INT16_code : GB_BLD_WORKER (_min, _int16, int16_t ) - case GB_INT32_code : GB_BLD_WORKER (_min, _int32, int32_t ) - case GB_INT64_code : GB_BLD_WORKER (_min, _int64, int64_t ) - case GB_UINT8_code : GB_BLD_WORKER (_min, _uint8, uint8_t ) - case GB_UINT16_code : GB_BLD_WORKER (_min, _uint16, uint16_t) - case GB_UINT32_code : GB_BLD_WORKER (_min, _uint32, uint32_t) - case GB_UINT64_code : GB_BLD_WORKER (_min, _uint64, uint64_t) - case GB_FP32_code : GB_BLD_WORKER (_min, _fp32, float ) - case GB_FP64_code : GB_BLD_WORKER (_min, _fp64, double ) + GB_CASE_INT8 (_min) + GB_CASE_INT16 (_min) + GB_CASE_INT32 (_min) + GB_CASE_INT64 (_min) + GB_CASE_UINT8 (_min) + GB_CASE_UINT16 (_min) + GB_CASE_UINT32 (_min) + GB_CASE_UINT64 (_min) + GB_CASE_FP32 (_min) + GB_CASE_FP64 (_min) default: ; } break ; - case GB_MAX_binop_code : + case GB_MAX_binop_code : switch (tcode) { - case GB_INT8_code : GB_BLD_WORKER (_max, _int8, int8_t ) - case GB_INT16_code : GB_BLD_WORKER (_max, _int16, int16_t ) - case GB_INT32_code : GB_BLD_WORKER (_max, _int32, int32_t ) - case GB_INT64_code : GB_BLD_WORKER (_max, _int64, int64_t ) - case GB_UINT8_code : GB_BLD_WORKER (_max, _uint8, uint8_t ) - case GB_UINT16_code : GB_BLD_WORKER (_max, _uint16, uint16_t) - case GB_UINT32_code : GB_BLD_WORKER (_max, _uint32, uint32_t) - case GB_UINT64_code : GB_BLD_WORKER (_max, _uint64, uint64_t) - case GB_FP32_code : GB_BLD_WORKER (_max, _fp32, float ) - case GB_FP64_code : GB_BLD_WORKER (_max, _fp64, double ) + GB_CASE_INT8 (_max) + GB_CASE_INT16 (_max) + GB_CASE_INT32 (_max) + GB_CASE_INT64 (_max) + GB_CASE_UINT8 (_max) + GB_CASE_UINT16 (_max) + GB_CASE_UINT32 (_max) + GB_CASE_UINT64 (_max) + GB_CASE_FP32 (_max) + GB_CASE_FP64 (_max) default: ; } break ; - case GB_PLUS_binop_code : + case GB_PLUS_binop_code : switch (tcode) { - case GB_INT8_code : GB_BLD_WORKER (_plus, _int8, int8_t ) - case GB_INT16_code : GB_BLD_WORKER (_plus, _int16, int16_t ) - case GB_INT32_code : GB_BLD_WORKER (_plus, _int32, int32_t ) - case GB_INT64_code : GB_BLD_WORKER (_plus, _int64, int64_t ) - case GB_UINT8_code : GB_BLD_WORKER (_plus, _uint8, uint8_t ) - case GB_UINT16_code : GB_BLD_WORKER (_plus, _uint16, uint16_t) - case GB_UINT32_code : GB_BLD_WORKER (_plus, _uint32, uint32_t) - case GB_UINT64_code : GB_BLD_WORKER (_plus, _uint64, uint64_t) - case GB_FP32_code : GB_BLD_WORKER (_plus, _fp32, float ) - case GB_FP64_code : GB_BLD_WORKER (_plus, _fp64, double ) - case GB_FC32_code : GB_BLD_WORKER (_plus, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_BLD_WORKER (_plus, _fc64, GxB_FC64_t) + GB_CASE_INT8 (_plus) + GB_CASE_INT16 (_plus) + GB_CASE_INT32 (_plus) + GB_CASE_INT64 (_plus) + GB_CASE_UINT8 (_plus) + GB_CASE_UINT16 (_plus) + GB_CASE_UINT32 (_plus) + GB_CASE_UINT64 (_plus) + GB_CASE_FP32 (_plus) + GB_CASE_FP64 (_plus) + GB_CASE_FC32 (_plus) + GB_CASE_FC64 (_plus) default: ; } break ; - case GB_TIMES_binop_code : + case GB_TIMES_binop_code : switch (tcode) { - case GB_INT8_code : GB_BLD_WORKER (_times, _int8, int8_t ) - case GB_INT16_code : GB_BLD_WORKER (_times, _int16, int16_t ) - case GB_INT32_code : GB_BLD_WORKER (_times, _int32, int32_t ) - case GB_INT64_code : GB_BLD_WORKER (_times, _int64, int64_t ) - case GB_UINT8_code : GB_BLD_WORKER (_times, _uint8, uint8_t ) - case GB_UINT16_code : GB_BLD_WORKER (_times, _uint16, uint16_t) - case GB_UINT32_code : GB_BLD_WORKER (_times, _uint32, uint32_t) - case GB_UINT64_code : GB_BLD_WORKER (_times, _uint64, uint64_t) - case GB_FP32_code : GB_BLD_WORKER (_times, _fp32, float ) - case GB_FP64_code : GB_BLD_WORKER (_times, _fp64, double ) - case GB_FC32_code : GB_BLD_WORKER (_times, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_BLD_WORKER (_times, _fc64, GxB_FC64_t) + GB_CASE_INT8 (_times) + GB_CASE_INT16 (_times) + GB_CASE_INT32 (_times) + GB_CASE_INT64 (_times) + GB_CASE_UINT8 (_times) + GB_CASE_UINT16 (_times) + GB_CASE_UINT32 (_times) + GB_CASE_UINT64 (_times) + GB_CASE_FP32 (_times) + GB_CASE_FP64 (_times) + GB_CASE_FC32 (_times) + GB_CASE_FC64 (_times) default: ; } break ; - case GB_ANY_binop_code : + case GB_ANY_binop_code : switch (tcode) { - case GB_INT8_code : GB_BLD_WORKER (_any, _int8, int8_t ) - case GB_INT16_code : GB_BLD_WORKER (_any, _int16, int16_t ) - case GB_INT32_code : GB_BLD_WORKER (_any, _int32, int32_t ) - case GB_INT64_code : GB_BLD_WORKER (_any, _int64, int64_t ) - case GB_UINT8_code : GB_BLD_WORKER (_any, _uint8, uint8_t ) - case GB_UINT16_code : GB_BLD_WORKER (_any, _uint16, uint16_t) - case GB_UINT32_code : GB_BLD_WORKER (_any, _uint32, uint32_t) - case GB_UINT64_code : GB_BLD_WORKER (_any, _uint64, uint64_t) - case GB_FP32_code : GB_BLD_WORKER (_any, _fp32, float ) - case GB_FP64_code : GB_BLD_WORKER (_any, _fp64, double ) - case GB_FC32_code : GB_BLD_WORKER (_any, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_BLD_WORKER (_any, _fc64, GxB_FC64_t) + GB_CASE_INT8 (_any) + GB_CASE_INT16 (_any) + GB_CASE_INT32 (_any) + GB_CASE_INT64 (_any) + GB_CASE_UINT8 (_any) + GB_CASE_UINT16 (_any) + GB_CASE_UINT32 (_any) + GB_CASE_UINT64 (_any) + GB_CASE_FP32 (_any) + GB_CASE_FP64 (_any) + GB_CASE_FC32 (_any) + GB_CASE_FC64 (_any) default: ; } break ; @@ -129,42 +210,42 @@ if (tcode != GB_BOOL_code) // FIRST and SECOND //---------------------------------------------------------------------- - case GB_FIRST_binop_code : + case GB_FIRST_binop_code : switch (tcode) { - case GB_INT8_code : GB_BLD_WORKER (_first, _int8, int8_t ) - case GB_INT16_code : GB_BLD_WORKER (_first, _int16, int16_t ) - case GB_INT32_code : GB_BLD_WORKER (_first, _int32, int32_t ) - case GB_INT64_code : GB_BLD_WORKER (_first, _int64, int64_t ) - case GB_UINT8_code : GB_BLD_WORKER (_first, _uint8, uint8_t ) - case GB_UINT16_code : GB_BLD_WORKER (_first, _uint16, uint16_t) - case GB_UINT32_code : GB_BLD_WORKER (_first, _uint32, uint32_t) - case GB_UINT64_code : GB_BLD_WORKER (_first, _uint64, uint64_t) - case GB_FP32_code : GB_BLD_WORKER (_first, _fp32, float ) - case GB_FP64_code : GB_BLD_WORKER (_first, _fp64, double ) - case GB_FC32_code : GB_BLD_WORKER (_first, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_BLD_WORKER (_first, _fc64, GxB_FC64_t) + GB_CASE_INT8 (_first) + GB_CASE_INT16 (_first) + GB_CASE_INT32 (_first) + GB_CASE_INT64 (_first) + GB_CASE_UINT8 (_first) + GB_CASE_UINT16 (_first) + GB_CASE_UINT32 (_first) + GB_CASE_UINT64 (_first) + GB_CASE_FP32 (_first) + GB_CASE_FP64 (_first) + GB_CASE_FC32 (_first) + GB_CASE_FC64 (_first) default: ; } break ; - case GB_SECOND_binop_code : + case GB_SECOND_binop_code : switch (tcode) { - case GB_INT8_code : GB_BLD_WORKER (_second, _int8, int8_t ) - case GB_INT16_code : GB_BLD_WORKER (_second, _int16, int16_t ) - case GB_INT32_code : GB_BLD_WORKER (_second, _int32, int32_t ) - case GB_INT64_code : GB_BLD_WORKER (_second, _int64, int64_t ) - case GB_UINT8_code : GB_BLD_WORKER (_second, _uint8, uint8_t ) - case GB_UINT16_code : GB_BLD_WORKER (_second, _uint16, uint16_t) - case GB_UINT32_code : GB_BLD_WORKER (_second, _uint32, uint32_t) - case GB_UINT64_code : GB_BLD_WORKER (_second, _uint64, uint64_t) - case GB_FP32_code : GB_BLD_WORKER (_second, _fp32, float ) - case GB_FP64_code : GB_BLD_WORKER (_second, _fp64, double ) - case GB_FC32_code : GB_BLD_WORKER (_second, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_BLD_WORKER (_second, _fc64, GxB_FC64_t) + GB_CASE_INT8 (_second) + GB_CASE_INT16 (_second) + GB_CASE_INT32 (_second) + GB_CASE_INT64 (_second) + GB_CASE_UINT8 (_second) + GB_CASE_UINT16 (_second) + GB_CASE_UINT32 (_second) + GB_CASE_UINT64 (_second) + GB_CASE_FP32 (_second) + GB_CASE_FP64 (_second) + GB_CASE_FC32 (_second) + GB_CASE_FC64 (_second) default: ; } break ; @@ -179,6 +260,7 @@ else // boolean operators //-------------------------------------------------------------------------- + #ifndef GxB_NO_BOOL switch (opcode) { case GB_LOR_binop_code : GB_BLD_WORKER (_lor, _bool, bool) @@ -190,5 +272,19 @@ else case GB_SECOND_binop_code : GB_BLD_WORKER (_second, _bool, bool) default: ; } + #endif } +#undef GB_CASE_INT8 +#undef GB_CASE_INT16 +#undef GB_CASE_INT32 +#undef GB_CASE_INT64 +#undef GB_CASE_UINT8 +#undef GB_CASE_UINT16 +#undef GB_CASE_UINT32 +#undef GB_CASE_UINT64 +#undef GB_CASE_FP32 +#undef GB_CASE_FP64 +#undef GB_CASE_FC32 +#undef GB_CASE_FC64 + diff --git a/Source/builtin/GB_builtin.c b/Source/builtin/GB_builtin.c index b120666af0..5776e3c965 100644 --- a/Source/builtin/GB_builtin.c +++ b/Source/builtin/GB_builtin.c @@ -2,7 +2,7 @@ // GB_builtin.c: built-in types, functions, operators, and other externs //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -128,10 +128,10 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) #undef o //------------------------------------------------------------------------------ -// GB_OP: construct the name of an operator +// GB_OP_NAME: construct the name of an operator //------------------------------------------------------------------------------ -#define GB_OP(op) GB_EVAL3 (op, _, GB_XTYPE) +#define GB_OP_NAME(op) GB_EVAL3 (op, _, GB_XTYPE) //------------------------------------------------------------------------------ // helper macros to define unary operators @@ -139,7 +139,7 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) #define GB_OP1zx(op,name,z_t,ztype,x_t,xtype) \ extern void GB_FUNC_T (op, xtype) (z_t *z, const x_t *x) ; \ - struct GB_UnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ + struct GB_UnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ NULL, 0, /* no user_name for GrB_get/GrB_set */ \ @@ -149,23 +149,24 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) (GxB_unary_function) (& GB_FUNC_T (op, xtype)), NULL, NULL, \ name, 0, /* name and name_len */ \ GB_ ## op ## _unop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } #define GRB_OP1z(op,name,z_t,ztype) \ GB_OP1zx (op, name, z_t, ztype, GB_TYPE, GB_XTYPE) ; \ - GrB_UnaryOp GRB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_UnaryOp GRB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) #define GRB_OP1(op,name) GRB_OP1z (op, name, GB_TYPE, GB_XTYPE) #define GXB_OP1z(op,name,z_t,ztype) \ GB_OP1zx (op, name, z_t, ztype, GB_TYPE, GB_XTYPE) ; \ - GrB_UnaryOp GXB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_UnaryOp GXB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) #define GXB_OP1(op,name) GXB_OP1z (op, name, GB_TYPE, GB_XTYPE) #define GXB_OP1_RENAME(op) \ - GrB_UnaryOp GXB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_UnaryOp GXB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) //------------------------------------------------------------------------------ // helper macros to define binary operators @@ -173,7 +174,7 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) #define GB_OP2zxy(op,name,z_t,ztype,x_t,xtype,y_t,ytype) \ extern void GB_FUNC_T(op,xtype) (z_t *z, const x_t *x, const y_t *y) ; \ - struct GB_BinaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ + struct GB_BinaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ NULL, 0, /* no user_name for GrB_get/GrB_set */ \ @@ -183,32 +184,33 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) NULL, NULL, (GxB_binary_function) (& GB_FUNC_T (op, xtype)), \ name, 0, /* name and name_len */ \ GB_ ## op ## _binop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } #define GRB_OP2z(op,name,z_t,ztype) \ GB_OP2zxy (op, name, z_t, ztype, GB_TYPE, GB_XTYPE, GB_TYPE, GB_XTYPE) ; \ - GrB_BinaryOp GRB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_BinaryOp GRB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) #define GRB_OP2(op,name) GRB_OP2z (op, name, GB_TYPE, GB_XTYPE) #define GXB_OP2z(op,name,z_t,ztype) \ GB_OP2zxy (op, name, z_t, ztype, GB_TYPE, GB_XTYPE, GB_TYPE, GB_XTYPE) ; \ - GrB_BinaryOp GXB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_BinaryOp GXB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) #define GXB_OP2(op,name) GXB_OP2z (op, name, GB_TYPE, GB_XTYPE) #define GXB_OP2shift(op,name) \ GB_OP2zxy (op, name, GB_TYPE, GB_XTYPE, GB_TYPE, GB_XTYPE, int8_t, INT8) ; \ - GrB_BinaryOp GXB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_BinaryOp GXB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) //------------------------------------------------------------------------------ -// positional unary and binary operators +// positional unary operators //------------------------------------------------------------------------------ -// The function pointer inside a positional operator cannot be called directly, -// since it does not depend on the values of its two arguments. The operator -// can only be implemented via its opcode. +// The function pointer inside a positional unary operator cannot be called +// directly, since it does not depend on the values of its two arguments. The +// operator can only be implemented via its opcode. // helper macros to define positional unary operators #define GXB_OP1_POS(op,name,type) \ @@ -222,26 +224,11 @@ GB_DESC (RSCT0T1, GrB_REPLACE, GrB_STRUCTURE + GrB_COMP, GrB_TRAN, GrB_TRAN ) NULL, NULL, NULL, /* no function pointer */ \ name, 0, /* name and name_len */ \ GB_ ## op ## _unop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } ; \ GrB_UnaryOp GXB (op ## _ ## type) = & GB_OPAQUE (op ## _ ## type) -// helper macros to define positional binary operators -#define GXB_OP2_POS(op,name,type) \ - 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 */ \ - NULL, NULL, NULL, /* no function pointer */ \ - name, 0, /* name and name_len */ \ - GB_ ## op ## _binop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ - } ; \ - GrB_BinaryOp GXB (op ## _ ## type) = & GB_OPAQUE (op ## _ ## type) - GXB_OP1_POS (POSITIONI , "positioni" , INT32) ; GXB_OP1_POS (POSITIONI , "positioni" , INT64) ; GXB_OP1_POS (POSITIONI1, "positioni1", INT32) ; @@ -251,23 +238,41 @@ GXB_OP1_POS (POSITIONJ , "positionj" , INT64) ; GXB_OP1_POS (POSITIONJ1, "positionj1", INT32) ; GXB_OP1_POS (POSITIONJ1, "positionj1", INT64) ; -GXB_OP2_POS (FIRSTI , "firsti" , INT32) ; -GXB_OP2_POS (FIRSTI , "firsti" , INT64) ; -GXB_OP2_POS (FIRSTI1 , "firsti1" , INT32) ; -GXB_OP2_POS (FIRSTI1 , "firsti1" , INT64) ; -GXB_OP2_POS (FIRSTJ , "firstj" , INT32) ; -GXB_OP2_POS (FIRSTJ , "firstj" , INT64) ; -GXB_OP2_POS (FIRSTJ1 , "firstj1" , INT32) ; -GXB_OP2_POS (FIRSTJ1 , "firstj1" , INT64) ; - -GXB_OP2_POS (SECONDI , "secondi" , INT32) ; -GXB_OP2_POS (SECONDI , "secondi" , INT64) ; -GXB_OP2_POS (SECONDI1 , "secondi1" , INT32) ; -GXB_OP2_POS (SECONDI1 , "secondi1" , INT64) ; -GXB_OP2_POS (SECONDJ , "secondj" , INT32) ; -GXB_OP2_POS (SECONDJ , "secondj" , INT64) ; -GXB_OP2_POS (SECONDJ1 , "secondj1" , INT32) ; -GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; +//------------------------------------------------------------------------------ +// built-in binary operators based on an internal index-binary op +//------------------------------------------------------------------------------ + +// This macro creates the FIRSTI, SECONDI, and related GrB_BinaryOps. They +// are built as if they came from a built-in index binary op, but the +// corresponding GxB_IndexBinaryOp is not actually defined. Instead, it is +// entirely encapsulated inside these GrB_BinaryOps. None of these ops use +// their theta value; the offset of +1 for FIRSTI1 is built into the operator +// itself as z=ix+1; it is not computed as z = (ix)+theta with theta = 1. + +// helper macros to define binary operators based on an index-binary op +#define GXB_OP2_POS(op,name) \ + extern void GB_FUNC_T(op,GB_XTYPE) (GB_TYPE *z, \ + const void *x, GrB_Index ix, GrB_Index jx, \ + const void *y, GrB_Index iy, GrB_Index jy, \ + const void *theta_parameter) ; \ + GB_TYPE GB_OPAQUE (GB_EVAL3 (op, GB_XTYPE, _theta)) = 0 ; \ + struct GB_BinaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ + { \ + GB_MAGIC, 0, /* magic and header_size */ \ + NULL, 0, /* no user_name for GrB_get/GrB_set */ \ + & GB_OPAQUE (GB_XTYPE), /* ztype */ \ + & GB_OPAQUE (GB_XTYPE), /* xtype */ \ + & GB_OPAQUE (GB_XTYPE), /* ytype */ \ + NULL, NULL, NULL, /* no function pointer */ \ + name, 0, /* name and name_len */ \ + GB_ ## op ## _binop_code, /* opcode */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + & GB_OPAQUE (GB_XTYPE), /* theta_type */ \ + (GxB_index_binary_function) (& GB_FUNC_T (op, GB_XTYPE)), /* func */\ + & GB_OPAQUE (GB_EVAL3 (op, GB_XTYPE, _theta)), /* theta = 0 */ \ + 0 /* theta_size */ \ + } ; \ + GrB_BinaryOp GXB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) //------------------------------------------------------------------------------ // built-in index_unary operators @@ -278,7 +283,7 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; #define GRB_IDXOP_POSITIONAL(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (GB_TYPE *z, const void *unused, \ GrB_Index i, GrB_Index j, const GB_TYPE *y) ; \ - struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ + struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ NULL, 0, /* no user_name for GrB_get/GrB_set */ \ @@ -288,16 +293,17 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; NULL, (GxB_index_unary_function) (& GB_FUNC_T (op, GB_XTYPE)), NULL,\ name, 0, /* name and name_len */ \ GB_ ## op ## _idxunop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } ; \ - GrB_IndexUnaryOp GRB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_IndexUnaryOp GRB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) // GxB_IndexUnaryOps that depend on i,j,y but not A(i,j), and result has // the same type as the scalar y: FLIPDIAGINDEX #define GXB_IDXOP_POSITIONAL(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (GB_TYPE *z, const void *unused, \ GrB_Index i, GrB_Index j, const GB_TYPE *y) ; \ - struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ + struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ NULL, 0, /* no user_name for GrB_get/GrB_set */ \ @@ -307,9 +313,10 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; NULL, (GxB_index_unary_function) (& GB_FUNC_T (op, GB_XTYPE)), NULL,\ name, 0, /* name and name_len */ \ GB_ ## op ## _idxunop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } ; \ - GrB_IndexUnaryOp GXB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_IndexUnaryOp GXB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) // IndexUnaryOps that depend on i,j, and y but not A(i,j), and result is // bool: TRIL, TRIU, DIAG, OFFDIAG, COLLE, COLGT, ROWLE, ROWGT. @@ -317,7 +324,7 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; #define GRB_IDXOP_POSITIONAL_BOOL(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (bool *z, const void *unused, \ GrB_Index i, GrB_Index j, const GB_TYPE *y) ; \ - struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ + struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ NULL, 0, /* no user_name for GrB_get/GrB_set */ \ @@ -327,15 +334,16 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; NULL, (GxB_index_unary_function) (& GB_FUNC_T (op, GB_XTYPE)), NULL,\ name, 0, /* name and name_len */ \ GB_ ## op ## _idxunop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } ; \ - GrB_IndexUnaryOp GRB (op) = & GB_OPAQUE (GB_OP (op)) + GrB_IndexUnaryOp GRB (op) = & GB_OPAQUE (GB_OP_NAME (op)) // GrB_IndexUnaryOps that depend on A(i,j), and result is bool: VALUE* ops #define GRB_IDXOP_VALUE(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (bool *z, const GB_TYPE *x, \ GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) ; \ - struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ + struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ NULL, 0, /* no user_name for GrB_get/GrB_set */ \ @@ -345,15 +353,16 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; NULL, (GxB_index_unary_function) (& GB_FUNC_T (op, GB_XTYPE)), NULL,\ name, 0, /* name and name_len */ \ GB_ ## op ## _idxunop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } ; \ - GrB_IndexUnaryOp GRB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_IndexUnaryOp GRB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) // GxB* IndexUnaryOps that depend on A(i,j), result is bool: VALUE* complex ops #define GXB_IDXOP_VALUE(op,name) \ extern void GB_FUNC_T(op,GB_XTYPE) (bool *z, const GB_TYPE *x, \ GrB_Index i_unused, GrB_Index j_unused, const GB_TYPE *y) ; \ - struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP (op)) = \ + struct GB_IndexUnaryOp_opaque GB_OPAQUE (GB_OP_NAME (op)) = \ { \ GB_MAGIC, 0, /* magic and header_size */ \ NULL, 0, /* no user_name for GrB_get/GrB_set */ \ @@ -363,9 +372,10 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; NULL, (GxB_index_unary_function) (& GB_FUNC_T (op, GB_XTYPE)), NULL,\ name, 0, /* name and name_len */ \ GB_ ## op ## _idxunop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } ; \ - GrB_IndexUnaryOp GXB (GB_OP (op)) = & GB_OPAQUE (GB_OP (op)) + GrB_IndexUnaryOp GXB (GB_OP_NAME (op)) = & GB_OPAQUE (GB_OP_NAME (op)) //------------------------------------------------------------------------------ // built-in select operators (DEPRECATED: do not use in any code) @@ -382,7 +392,8 @@ GXB_OP2_POS (SECONDJ1 , "secondj1" , INT64) ; NULL, NULL, NULL, /* no function pointer */ \ name, 0, /* name and name_len */ \ GB_ ## op ## _selop_code, /* opcode */ \ - NULL, 0, 0 /* defn, alloc, hash */ \ + NULL, 0, 0, /* defn, alloc, hash */ \ + NULL, NULL, NULL, 0 /* theta_type, etc */ \ } ; \ GxB_SelectOp GXB (op) = & GB_OPAQUE (op) @@ -507,7 +518,8 @@ struct GB_BinaryOp_opaque GB_OPAQUE (IGNORE_DUP) = NULL, NULL, NULL, // no function pointer "ignore_dup", 0, // name and name_len GB_NOP_code, // opcode - NULL, 0, 0 // defn, alloc, and hash + NULL, 0, 0, // defn, alloc, and hash + NULL, NULL, NULL, 0 // theta_type, etc } ; GrB_BinaryOp GxB_IGNORE_DUP = & GB_OPAQUE (IGNORE_DUP) ; @@ -541,7 +553,8 @@ struct GB_IndexUnaryOp_opaque GB_OPAQUE (NONZOMBIE) = NULL, (GxB_index_unary_function) &GB_nonzombie_func, NULL, "nonzombie", 0, // name and name_len GB_NONZOMBIE_idxunop_code, // opcode - NULL, 0, 0 // defn, alloc, hash + NULL, 0, 0, // defn, alloc, hash + NULL, NULL, NULL, 0 // theta_type, etc } ; GrB_IndexUnaryOp GxB_NONZOMBIE = & GB_OPAQUE (NONZOMBIE) ; diff --git a/Source/builtin/GB_builtin.h b/Source/builtin/GB_builtin.h index aa0d64991a..2e0b3d9046 100644 --- a/Source/builtin/GB_builtin.h +++ b/Source/builtin/GB_builtin.h @@ -30,28 +30,28 @@ inline void GB_nonzombie_func (bool *z, const void *x, #define GB_TYPE bool #define GB_XTYPE BOOL -#define GB_BITS 1 +#define GB_X_NBITS 1 #define GB_REAL #define GB_BOOLEAN #include "builtin/factory/GB_builtin_template.h" #define GB_TYPE int8_t #define GB_XTYPE INT8 -#define GB_BITS 8 +#define GB_X_NBITS 8 #define GB_REAL #define GB_SIGNED_INT #include "builtin/factory/GB_builtin_template.h" #define GB_TYPE int16_t #define GB_XTYPE INT16 -#define GB_BITS 16 +#define GB_X_NBITS 16 #define GB_REAL #define GB_SIGNED_INT #include "builtin/factory/GB_builtin_template.h" #define GB_TYPE int32_t #define GB_XTYPE INT32 -#define GB_BITS 32 +#define GB_X_NBITS 32 #define GB_REAL #define GB_SIGNED_INT #define GB_SIGNED_INDEX @@ -59,7 +59,7 @@ inline void GB_nonzombie_func (bool *z, const void *x, #define GB_TYPE int64_t #define GB_XTYPE INT64 -#define GB_BITS 64 +#define GB_X_NBITS 64 #define GB_REAL #define GB_SIGNED_INT #define GB_SIGNED_INDEX @@ -68,35 +68,35 @@ inline void GB_nonzombie_func (bool *z, const void *x, #define GB_TYPE uint8_t #define GB_XTYPE UINT8 -#define GB_BITS 8 +#define GB_X_NBITS 8 #define GB_REAL #define GB_UNSIGNED_INT #include "builtin/factory/GB_builtin_template.h" #define GB_TYPE uint16_t #define GB_XTYPE UINT16 -#define GB_BITS 16 +#define GB_X_NBITS 16 #define GB_REAL #define GB_UNSIGNED_INT #include "builtin/factory/GB_builtin_template.h" #define GB_TYPE uint32_t #define GB_XTYPE UINT32 -#define GB_BITS 32 +#define GB_X_NBITS 32 #define GB_REAL #define GB_UNSIGNED_INT #include "builtin/factory/GB_builtin_template.h" #define GB_TYPE uint64_t #define GB_XTYPE UINT64 -#define GB_BITS 64 +#define GB_X_NBITS 64 #define GB_REAL #define GB_UNSIGNED_INT #include "builtin/factory/GB_builtin_template.h" #define GB_TYPE float #define GB_XTYPE FP32 -#define GB_BITS 32 +#define GB_X_NBITS 32 #define GB_REAL #define GB_FLOATING_POINT #define GB_FLOAT @@ -104,7 +104,7 @@ inline void GB_nonzombie_func (bool *z, const void *x, #define GB_TYPE double #define GB_XTYPE FP64 -#define GB_BITS 64 +#define GB_X_NBITS 64 #define GB_REAL #define GB_FLOATING_POINT #define GB_DOUBLE @@ -112,7 +112,7 @@ inline void GB_nonzombie_func (bool *z, const void *x, #define GB_TYPE GxB_FC32_t #define GB_XTYPE FC32 -#define GB_BITS 64 +#define GB_X_NBITS 64 #define GB_COMPLEX #define GB_FLOATING_POINT #define GB_FLOAT_COMPLEX @@ -120,7 +120,7 @@ inline void GB_nonzombie_func (bool *z, const void *x, #define GB_TYPE GxB_FC64_t #define GB_XTYPE FC64 -#define GB_BITS 128 +#define GB_X_NBITS 128 #define GB_COMPLEX #define GB_FLOATING_POINT #define GB_DOUBLE_COMPLEX diff --git a/Source/builtin/factory/GB_builtin_template.c b/Source/builtin/factory/GB_builtin_template.c index 30273c7e1a..7bed927bd1 100644 --- a/Source/builtin/factory/GB_builtin_template.c +++ b/Source/builtin/factory/GB_builtin_template.c @@ -302,6 +302,24 @@ GXB_OP2 (POW , "pow" ) ; #endif +//------------------------------------------------------------------------------ +// binary functions constructed from index_binary functions +//------------------------------------------------------------------------------ + +#if defined ( GB_SIGNED_INDEX ) + + // z = f (x,ix,jx, y,iy,jy, theta) + GXB_OP2_POS (FIRSTI , "firsti" ) ; + GXB_OP2_POS (FIRSTI1 , "firsti1" ) ; + GXB_OP2_POS (FIRSTJ , "firstj" ) ; + GXB_OP2_POS (FIRSTJ1 , "firstj1" ) ; + GXB_OP2_POS (SECONDI , "secondi" ) ; + GXB_OP2_POS (SECONDI1 , "secondi1") ; + GXB_OP2_POS (SECONDJ , "secondj" ) ; + GXB_OP2_POS (SECONDJ1 , "secondj1") ; + +#endif + //------------------------------------------------------------------------------ // clear macros for next use of this file //------------------------------------------------------------------------------ diff --git a/Source/builtin/factory/GB_builtin_template.h b/Source/builtin/factory/GB_builtin_template.h index 281463a074..4f3b9fd79c 100644 --- a/Source/builtin/factory/GB_builtin_template.h +++ b/Source/builtin/factory/GB_builtin_template.h @@ -75,23 +75,23 @@ inline void GB_FUNC (MINV) (GB_TYPE *z, const GB_TYPE *x) #if defined ( GB_BOOLEAN ) (*z) = true ; #elif defined ( GB_SIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_idiv_int8 (1, (*x)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_idiv_int16 (1, (*x)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_idiv_int32 (1, (*x)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_idiv_int64 (1, (*x)) ; #endif #elif defined ( GB_UNSIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_idiv_uint8 (1, (*x)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_idiv_uint16 (1, (*x)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_idiv_uint32 (1, (*x)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_idiv_uint64 (1, (*x)) ; #endif #elif defined ( GB_FLOAT ) @@ -218,8 +218,8 @@ GB_UNOP_STRUCT (ABS, GB_XTYPE) ; // For these operators, the input and output types are the same. -#undef GB_OP -#define GB_OP(op,func) \ +#undef GB_UNOP_DEFINE +#define GB_UNOP_DEFINE(op,func) \ GB_UNOP_STRUCT (op, GB_XTYPE) ; \ inline void GB_FUNC (op) (GB_TYPE *z, const GB_TYPE *x) \ { \ @@ -232,44 +232,44 @@ GB_UNOP_STRUCT (ABS, GB_XTYPE) ; // float //-------------------------------------------------------------------------- - GB_OP (SQRT , sqrtf ) - GB_OP (LOG , logf ) - GB_OP (EXP , expf ) + GB_UNOP_DEFINE (SQRT , sqrtf ) + GB_UNOP_DEFINE (LOG , logf ) + GB_UNOP_DEFINE (EXP , expf ) - GB_OP (SIN , sinf ) - GB_OP (COS , cosf ) - GB_OP (TAN , tanf ) + GB_UNOP_DEFINE (SIN , sinf ) + GB_UNOP_DEFINE (COS , cosf ) + GB_UNOP_DEFINE (TAN , tanf ) - GB_OP (ASIN , asinf ) - GB_OP (ACOS , acosf ) - GB_OP (ATAN , atanf ) + GB_UNOP_DEFINE (ASIN , asinf ) + GB_UNOP_DEFINE (ACOS , acosf ) + GB_UNOP_DEFINE (ATAN , atanf ) - GB_OP (SINH , sinhf ) - GB_OP (COSH , coshf ) - GB_OP (TANH , tanhf ) + GB_UNOP_DEFINE (SINH , sinhf ) + GB_UNOP_DEFINE (COSH , coshf ) + GB_UNOP_DEFINE (TANH , tanhf ) - GB_OP (ASINH , asinhf ) - GB_OP (ACOSH , acoshf ) - GB_OP (ATANH , atanhf ) + GB_UNOP_DEFINE (ASINH , asinhf ) + GB_UNOP_DEFINE (ACOSH , acoshf ) + GB_UNOP_DEFINE (ATANH , atanhf ) - GB_OP (SIGNUM, GB_signumf ) - GB_OP (CEIL , ceilf ) - GB_OP (FLOOR , floorf ) - GB_OP (ROUND , roundf ) - GB_OP (TRUNC , truncf ) + GB_UNOP_DEFINE (SIGNUM, GB_signumf ) + GB_UNOP_DEFINE (CEIL , ceilf ) + GB_UNOP_DEFINE (FLOOR , floorf ) + GB_UNOP_DEFINE (ROUND , roundf ) + GB_UNOP_DEFINE (TRUNC , truncf ) - GB_OP (EXP2 , exp2f ) - GB_OP (EXPM1 , expm1f ) - GB_OP (LOG10 , log10f ) - GB_OP (LOG1P , log1pf ) - GB_OP (LOG2 , log2f ) + GB_UNOP_DEFINE (EXP2 , exp2f ) + GB_UNOP_DEFINE (EXPM1 , expm1f ) + GB_UNOP_DEFINE (LOG10 , log10f ) + GB_UNOP_DEFINE (LOG1P , log1pf ) + GB_UNOP_DEFINE (LOG2 , log2f ) // real only - GB_OP (LGAMMA, lgammaf ) - GB_OP (TGAMMA, tgammaf ) - GB_OP (ERF , erff ) - GB_OP (ERFC , erfcf ) - GB_OP (CBRT , cbrtf ) + GB_UNOP_DEFINE (LGAMMA, lgammaf ) + GB_UNOP_DEFINE (TGAMMA, tgammaf ) + GB_UNOP_DEFINE (ERF , erff ) + GB_UNOP_DEFINE (ERFC , erfcf ) + GB_UNOP_DEFINE (CBRT , cbrtf ) #elif defined ( GB_DOUBLE ) @@ -277,44 +277,44 @@ GB_UNOP_STRUCT (ABS, GB_XTYPE) ; // double //-------------------------------------------------------------------------- - GB_OP (SQRT , sqrt ) - GB_OP (LOG , log ) - GB_OP (EXP , exp ) + GB_UNOP_DEFINE (SQRT , sqrt ) + GB_UNOP_DEFINE (LOG , log ) + GB_UNOP_DEFINE (EXP , exp ) - GB_OP (SIN , sin ) - GB_OP (COS , cos ) - GB_OP (TAN , tan ) + GB_UNOP_DEFINE (SIN , sin ) + GB_UNOP_DEFINE (COS , cos ) + GB_UNOP_DEFINE (TAN , tan ) - GB_OP (ASIN , asin ) - GB_OP (ACOS , acos ) - GB_OP (ATAN , atan ) + GB_UNOP_DEFINE (ASIN , asin ) + GB_UNOP_DEFINE (ACOS , acos ) + GB_UNOP_DEFINE (ATAN , atan ) - GB_OP (SINH , sinh ) - GB_OP (COSH , cosh ) - GB_OP (TANH , tanh ) + GB_UNOP_DEFINE (SINH , sinh ) + GB_UNOP_DEFINE (COSH , cosh ) + GB_UNOP_DEFINE (TANH , tanh ) - GB_OP (ASINH , asinh ) - GB_OP (ACOSH , acosh ) - GB_OP (ATANH , atanh ) + GB_UNOP_DEFINE (ASINH , asinh ) + GB_UNOP_DEFINE (ACOSH , acosh ) + GB_UNOP_DEFINE (ATANH , atanh ) - GB_OP (SIGNUM, GB_signum ) - GB_OP (CEIL , ceil ) - GB_OP (FLOOR , floor ) - GB_OP (ROUND , round ) - GB_OP (TRUNC , trunc ) + GB_UNOP_DEFINE (SIGNUM, GB_signum ) + GB_UNOP_DEFINE (CEIL , ceil ) + GB_UNOP_DEFINE (FLOOR , floor ) + GB_UNOP_DEFINE (ROUND , round ) + GB_UNOP_DEFINE (TRUNC , trunc ) - GB_OP (EXP2 , exp2 ) - GB_OP (EXPM1 , expm1 ) - GB_OP (LOG10 , log10 ) - GB_OP (LOG1P , log1p ) - GB_OP (LOG2 , log2 ) + GB_UNOP_DEFINE (EXP2 , exp2 ) + GB_UNOP_DEFINE (EXPM1 , expm1 ) + GB_UNOP_DEFINE (LOG10 , log10 ) + GB_UNOP_DEFINE (LOG1P , log1p ) + GB_UNOP_DEFINE (LOG2 , log2 ) // real only - GB_OP (LGAMMA, lgamma ) - GB_OP (TGAMMA, tgamma ) - GB_OP (ERF , erf ) - GB_OP (ERFC , erfc ) - GB_OP (CBRT , cbrt ) + GB_UNOP_DEFINE (LGAMMA, lgamma ) + GB_UNOP_DEFINE (TGAMMA, tgamma ) + GB_UNOP_DEFINE (ERF , erf ) + GB_UNOP_DEFINE (ERFC , erfc ) + GB_UNOP_DEFINE (CBRT , cbrt ) #elif defined ( GB_FLOAT_COMPLEX ) @@ -322,39 +322,39 @@ GB_UNOP_STRUCT (ABS, GB_XTYPE) ; // float complex //-------------------------------------------------------------------------- - GB_OP (SQRT , GB_csqrtf ) - GB_OP (LOG , GB_clogf ) - GB_OP (EXP , GB_cexpf ) + GB_UNOP_DEFINE (SQRT , GB_csqrtf ) + GB_UNOP_DEFINE (LOG , GB_clogf ) + GB_UNOP_DEFINE (EXP , GB_cexpf ) - GB_OP (SIN , GB_csinf ) - GB_OP (COS , GB_ccosf ) - GB_OP (TAN , GB_ctanf ) + GB_UNOP_DEFINE (SIN , GB_csinf ) + GB_UNOP_DEFINE (COS , GB_ccosf ) + GB_UNOP_DEFINE (TAN , GB_ctanf ) - GB_OP (ASIN , GB_casinf ) - GB_OP (ACOS , GB_cacosf ) - GB_OP (ATAN , GB_catanf ) + GB_UNOP_DEFINE (ASIN , GB_casinf ) + GB_UNOP_DEFINE (ACOS , GB_cacosf ) + GB_UNOP_DEFINE (ATAN , GB_catanf ) - GB_OP (SINH , GB_csinhf ) - GB_OP (COSH , GB_ccoshf ) - GB_OP (TANH , GB_ctanhf ) + GB_UNOP_DEFINE (SINH , GB_csinhf ) + GB_UNOP_DEFINE (COSH , GB_ccoshf ) + GB_UNOP_DEFINE (TANH , GB_ctanhf ) - GB_OP (ASINH , GB_casinhf ) - GB_OP (ACOSH , GB_cacoshf ) - GB_OP (ATANH , GB_catanhf ) + GB_UNOP_DEFINE (ASINH , GB_casinhf ) + GB_UNOP_DEFINE (ACOSH , GB_cacoshf ) + GB_UNOP_DEFINE (ATANH , GB_catanhf ) - GB_OP (SIGNUM, GB_csignumf ) - GB_OP (CEIL , GB_cceilf ) - GB_OP (FLOOR , GB_cfloorf ) - GB_OP (ROUND , GB_croundf ) - GB_OP (TRUNC , GB_ctruncf ) + GB_UNOP_DEFINE (SIGNUM, GB_csignumf ) + GB_UNOP_DEFINE (CEIL , GB_cceilf ) + GB_UNOP_DEFINE (FLOOR , GB_cfloorf ) + GB_UNOP_DEFINE (ROUND , GB_croundf ) + GB_UNOP_DEFINE (TRUNC , GB_ctruncf ) - GB_OP (EXP2 , GB_cexp2f ) - GB_OP (EXPM1 , GB_cexpm1f ) - GB_OP (LOG10 , GB_clog10f ) - GB_OP (LOG1P , GB_clog1pf ) - GB_OP (LOG2 , GB_clog2f ) + GB_UNOP_DEFINE (EXP2 , GB_cexp2f ) + GB_UNOP_DEFINE (EXPM1 , GB_cexpm1f ) + GB_UNOP_DEFINE (LOG10 , GB_clog10f ) + GB_UNOP_DEFINE (LOG1P , GB_clog1pf ) + GB_UNOP_DEFINE (LOG2 , GB_clog2f ) - GB_OP (CONJ , GB_conjf ) + GB_UNOP_DEFINE (CONJ , GB_conjf ) #elif defined ( GB_DOUBLE_COMPLEX ) @@ -362,39 +362,39 @@ GB_UNOP_STRUCT (ABS, GB_XTYPE) ; // double complex //-------------------------------------------------------------------------- - GB_OP (SQRT , GB_csqrt ) - GB_OP (LOG , GB_clog ) - GB_OP (EXP , GB_cexp ) + GB_UNOP_DEFINE (SQRT , GB_csqrt ) + GB_UNOP_DEFINE (LOG , GB_clog ) + GB_UNOP_DEFINE (EXP , GB_cexp ) - GB_OP (SIN , GB_csin ) - GB_OP (COS , GB_ccos ) - GB_OP (TAN , GB_ctan ) + GB_UNOP_DEFINE (SIN , GB_csin ) + GB_UNOP_DEFINE (COS , GB_ccos ) + GB_UNOP_DEFINE (TAN , GB_ctan ) - GB_OP (ASIN , GB_casin ) - GB_OP (ACOS , GB_cacos ) - GB_OP (ATAN , GB_catan ) + GB_UNOP_DEFINE (ASIN , GB_casin ) + GB_UNOP_DEFINE (ACOS , GB_cacos ) + GB_UNOP_DEFINE (ATAN , GB_catan ) - GB_OP (SINH , GB_csinh ) - GB_OP (COSH , GB_ccosh ) - GB_OP (TANH , GB_ctanh ) + GB_UNOP_DEFINE (SINH , GB_csinh ) + GB_UNOP_DEFINE (COSH , GB_ccosh ) + GB_UNOP_DEFINE (TANH , GB_ctanh ) - GB_OP (ASINH , GB_casinh ) - GB_OP (ACOSH , GB_cacosh ) - GB_OP (ATANH , GB_catanh ) + GB_UNOP_DEFINE (ASINH , GB_casinh ) + GB_UNOP_DEFINE (ACOSH , GB_cacosh ) + GB_UNOP_DEFINE (ATANH , GB_catanh ) - GB_OP (SIGNUM, GB_csignum ) - GB_OP (CEIL , GB_cceil ) - GB_OP (FLOOR , GB_cfloor ) - GB_OP (ROUND , GB_cround ) - GB_OP (TRUNC , GB_ctrunc ) + GB_UNOP_DEFINE (SIGNUM, GB_csignum ) + GB_UNOP_DEFINE (CEIL , GB_cceil ) + GB_UNOP_DEFINE (FLOOR , GB_cfloor ) + GB_UNOP_DEFINE (ROUND , GB_cround ) + GB_UNOP_DEFINE (TRUNC , GB_ctrunc ) - GB_OP (EXP2 , GB_cexp2 ) - GB_OP (EXPM1 , GB_cexpm1 ) - GB_OP (LOG10 , GB_clog10 ) - GB_OP (LOG1P , GB_clog1p ) - GB_OP (LOG2 , GB_clog2 ) + GB_UNOP_DEFINE (EXP2 , GB_cexp2 ) + GB_UNOP_DEFINE (EXPM1 , GB_cexpm1 ) + GB_UNOP_DEFINE (LOG10 , GB_clog10 ) + GB_UNOP_DEFINE (LOG1P , GB_clog1p ) + GB_UNOP_DEFINE (LOG2 , GB_clog2 ) - GB_OP (CONJ , GB_conj ) + GB_UNOP_DEFINE (CONJ , GB_conj ) #endif @@ -404,8 +404,8 @@ GB_UNOP_STRUCT (ABS, GB_XTYPE) ; // x is float, double, float complex, or double complex -#undef GB_OP -#define GB_OP(op,expression,z_t,x_t) \ +#undef GB_UNOP_DEFINE +#define GB_UNOP_DEFINE(op,expression,z_t,x_t) \ GB_UNOP_STRUCT(op, GB_XTYPE) ; \ inline void GB_FUNC (op) (z_t *z, const x_t *x) \ { \ @@ -414,37 +414,37 @@ GB_UNOP_STRUCT (ABS, GB_XTYPE) ; #if defined ( GB_FLOAT ) - GB_OP (ISINF , (isinf (*x)) , bool, float) - GB_OP (ISNAN , (isnan (*x)) , bool, float) - GB_OP (ISFINITE , (isfinite (*x)) , bool, float) + GB_UNOP_DEFINE (ISINF , (isinf (*x)) , bool, float) + GB_UNOP_DEFINE (ISNAN , (isnan (*x)) , bool, float) + GB_UNOP_DEFINE (ISFINITE , (isfinite (*x)) , bool, float) #elif defined ( GB_DOUBLE ) - GB_OP (ISINF , (isinf (*x)) , bool, double) - GB_OP (ISNAN , (isnan (*x)) , bool, double) - GB_OP (ISFINITE , (isfinite (*x)) , bool, double) + GB_UNOP_DEFINE (ISINF , (isinf (*x)) , bool, double) + GB_UNOP_DEFINE (ISNAN , (isnan (*x)) , bool, double) + GB_UNOP_DEFINE (ISFINITE , (isfinite (*x)) , bool, double) #elif defined ( GB_FLOAT_COMPLEX ) - GB_OP (ISINF , GB_cisinff (*x) , bool, GxB_FC32_t) - GB_OP (ISNAN , GB_cisnanf (*x) , bool, GxB_FC32_t) - GB_OP (ISFINITE , GB_cisfinitef (*x), bool, GxB_FC32_t) + GB_UNOP_DEFINE (ISINF , GB_cisinff (*x) , bool, GxB_FC32_t) + GB_UNOP_DEFINE (ISNAN , GB_cisnanf (*x) , bool, GxB_FC32_t) + GB_UNOP_DEFINE (ISFINITE , GB_cisfinitef (*x), bool, GxB_FC32_t) // complex only - GB_OP (CREAL , GB_crealf (*x), float, GxB_FC32_t) - GB_OP (CIMAG , GB_cimagf (*x), float, GxB_FC32_t) - GB_OP (CARG , GB_cargf (*x), float, GxB_FC32_t) + GB_UNOP_DEFINE (CREAL , GB_crealf (*x), float, GxB_FC32_t) + GB_UNOP_DEFINE (CIMAG , GB_cimagf (*x), float, GxB_FC32_t) + GB_UNOP_DEFINE (CARG , GB_cargf (*x), float, GxB_FC32_t) #elif defined ( GB_DOUBLE_COMPLEX ) - GB_OP (ISINF , GB_cisinf (*x) , bool, GxB_FC64_t) - GB_OP (ISNAN , GB_cisnan (*x) , bool, GxB_FC64_t) - GB_OP (ISFINITE , GB_cisfinite (*x) , bool, GxB_FC64_t) + GB_UNOP_DEFINE (ISINF , GB_cisinf (*x) , bool, GxB_FC64_t) + GB_UNOP_DEFINE (ISNAN , GB_cisnan (*x) , bool, GxB_FC64_t) + GB_UNOP_DEFINE (ISFINITE , GB_cisfinite (*x) , bool, GxB_FC64_t) // complex only - GB_OP (CREAL , GB_creal (*x), double, GxB_FC64_t) - GB_OP (CIMAG , GB_cimag (*x), double, GxB_FC64_t) - GB_OP (CARG , GB_carg (*x), double, GxB_FC64_t) + GB_UNOP_DEFINE (CREAL , GB_creal (*x), double, GxB_FC64_t) + GB_UNOP_DEFINE (CIMAG , GB_cimag (*x), double, GxB_FC64_t) + GB_UNOP_DEFINE (CARG , GB_carg (*x), double, GxB_FC64_t) #endif @@ -541,23 +541,23 @@ inline void GB_FUNC (DIV) (GB_Z_X_Y_ARGS) // boolean div (== first) (*z) = (*x) ; #elif defined ( GB_SIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_idiv_int8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_idiv_int16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_idiv_int32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_idiv_int64 ((*x), (*y)) ; #endif #elif defined ( GB_UNSIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_idiv_uint8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_idiv_uint16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_idiv_uint32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_idiv_uint64 ((*x), (*y)) ; #endif #elif defined ( GB_FLOAT ) || defined ( GB_DOUBLE ) @@ -576,23 +576,23 @@ inline void GB_FUNC (RDIV) (GB_Z_X_Y_ARGS) // boolean rdiv (== second) (*z) = (*y) ; #elif defined ( GB_SIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_idiv_int8 ((*y), (*x)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_idiv_int16 ((*y), (*x)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_idiv_int32 ((*y), (*x)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_idiv_int64 ((*y), (*x)) ; #endif #elif defined ( GB_UNSIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_idiv_uint8 ((*y), (*x)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_idiv_uint16 ((*y), (*x)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_idiv_uint32 ((*y), (*x)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_idiv_uint64 ((*y), (*x)) ; #endif #elif defined ( GB_FLOAT ) || defined ( GB_DOUBLE ) @@ -611,23 +611,23 @@ inline void GB_FUNC (POW) (GB_Z_X_Y_ARGS) #if defined ( GB_BOOLEAN ) (*z) = (*x) || (!(*y)) ; #elif defined ( GB_SIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_pow_int8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_pow_int16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_pow_int32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_pow_int64 ((*x), (*y)) ; #endif #elif defined ( GB_UNSIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_pow_uint8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_pow_uint16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_pow_uint32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_pow_uint64 ((*x), (*y)) ; #endif #elif defined ( GB_FLOAT ) @@ -696,31 +696,31 @@ inline void GB_FUNC (POW) (GB_Z_X_Y_ARGS) inline void GB_FUNC (BGET) (GB_Z_X_Y_ARGS) { // bitget (x,y) returns a single bit from x, as 0 or 1, whose position - // is given by y. y = 1 is the least significant bit, and y = GB_BITS - // (64 for uint64) is the most significant bit. If y is outside this - // range, the result is zero. + // is given by y. y = 1 is the least significant bit, and y = + // GB_X_NBITS (64 for uint64, for example) is the most significant bit. + // If y is outside this range, the result is zero. #if defined ( GB_SIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_bitget_int8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_bitget_int16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_bitget_int32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_bitget_int64 ((*x), (*y)) ; #endif #elif defined ( GB_UNSIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_bitget_uint8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_bitget_uint16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_bitget_uint32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_bitget_uint64 ((*x), (*y)) ; #endif @@ -731,31 +731,31 @@ inline void GB_FUNC (POW) (GB_Z_X_Y_ARGS) inline void GB_FUNC (BSET) (GB_Z_X_Y_ARGS) { // bitset (x,y) returns x modified by setting a bit from x to 1, whose - // position is given by y. If y is in the range 1 to GB_BITS, then y - // gives the position of the bit to set. If y is outside the range 1 - // to GB_BITS, then z = x is returned, unmodified. + // position is given by y. If y is in the range 1 to GB_X_NBITS, then + // y gives the position of the bit to set. If y is outside the range 1 + // to GB_X_NBITS, then z = x is returned, unmodified. #if defined ( GB_SIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_bitset_int8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_bitset_int16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_bitset_int32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_bitset_int64 ((*x), (*y)) ; #endif #elif defined ( GB_UNSIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_bitset_uint8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_bitset_uint16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_bitset_uint32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_bitset_uint64 ((*x), (*y)) ; #endif @@ -766,31 +766,31 @@ inline void GB_FUNC (POW) (GB_Z_X_Y_ARGS) inline void GB_FUNC (BCLR) (GB_Z_X_Y_ARGS) { // bitclr (x,y) returns x modified by setting a bit from x to 0, whose - // position is given by y. If y is in the range 1 to GB_BITS, then y - // gives the position of the bit to clear. If y is outside the range 1 - // to GB_BITS, then z = x is returned, unmodified. + // position is given by y. If y is in the range 1 to GB_X_NBITS, then + // y gives the position of the bit to clear. If y is outside the range + // 1 to GB_X_NBITS, then z = x is returned, unmodified. #if defined ( GB_SIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_bitclr_int8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_bitclr_int16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_bitclr_int32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_bitclr_int64 ((*x), (*y)) ; #endif #elif defined ( GB_UNSIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_bitclr_uint8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_bitclr_uint16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_bitclr_uint32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_bitclr_uint64 ((*x), (*y)) ; #endif @@ -807,25 +807,25 @@ inline void GB_FUNC (POW) (GB_Z_X_Y_ARGS) #if defined ( GB_SIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_bitshift_int8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_bitshift_int16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_bitshift_int32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_bitshift_int64 ((*x), (*y)) ; #endif #elif defined ( GB_UNSIGNED_INT ) - #if ( GB_BITS == 8) + #if ( GB_X_NBITS == 8) (*z) = GB_bitshift_uint8 ((*x), (*y)) ; - #elif ( GB_BITS == 16) + #elif ( GB_X_NBITS == 16) (*z) = GB_bitshift_uint16 ((*x), (*y)) ; - #elif ( GB_BITS == 32) + #elif ( GB_X_NBITS == 32) (*z) = GB_bitshift_uint32 ((*x), (*y)) ; - #elif ( GB_BITS == 64) + #elif ( GB_X_NBITS == 64) (*z) = GB_bitshift_uint64 ((*x), (*y)) ; #endif @@ -1227,20 +1227,100 @@ inline void GB_FUNC (NE) (GB_Zbool_X_Y_ARGS) #endif +//------------------------------------------------------------------------------ +// builtin index binary operators +//------------------------------------------------------------------------------ + +#if defined ( GB_SIGNED_INDEX ) + + GB_BINOP_STRUCT (FIRSTI, GB_XTYPE) ; + inline void GB_FUNC (FIRSTI) (GB_TYPE *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + (*z) = (GB_TYPE) ix ; + } + + GB_BINOP_STRUCT (FIRSTI1, GB_XTYPE) ; + inline void GB_FUNC (FIRSTI1) (GB_TYPE *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + (*z) = ((GB_TYPE) ix) + 1 ; + } + + GB_BINOP_STRUCT (FIRSTJ, GB_XTYPE) ; + inline void GB_FUNC (FIRSTJ) (GB_TYPE *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + (*z) = (GB_TYPE) jx ; + } + + GB_BINOP_STRUCT (FIRSTJ1, GB_XTYPE) ; + inline void GB_FUNC (FIRSTJ1) (GB_TYPE *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + (*z) = ((GB_TYPE) jx) + 1 ; + } + + GB_BINOP_STRUCT (SECONDI, GB_XTYPE) ; + inline void GB_FUNC (SECONDI) (GB_TYPE *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + (*z) = (GB_TYPE) iy ; + } + + GB_BINOP_STRUCT (SECONDI1, GB_XTYPE) ; + inline void GB_FUNC (SECONDI1) (GB_TYPE *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + (*z) = ((GB_TYPE) iy) + 1 ; + } + + GB_BINOP_STRUCT (SECONDJ, GB_XTYPE) ; + inline void GB_FUNC (SECONDJ) (GB_TYPE *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + (*z) = (GB_TYPE) jy ; + } + + GB_BINOP_STRUCT (SECONDJ1, GB_XTYPE) ; + inline void GB_FUNC (SECONDJ1) (GB_TYPE *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) + { + (*z) = ((GB_TYPE) jy) + 1 ; + } + +#endif + //------------------------------------------------------------------------------ // clear macros for next use of this file //------------------------------------------------------------------------------ #undef GB_TYPE #undef GB_XTYPE -#undef GB_OP +#undef GB_UNOP_DEFINE #undef GB_BOOLEAN #undef GB_FLOATING_POINT #undef GB_UNSIGNED_INT #undef GB_SIGNED_INT #undef GB_SIGNED_INDEX #undef GB_SIGNED_INDEX64 -#undef GB_BITS +#undef GB_X_NBITS #undef GB_REAL #undef GB_DOUBLE #undef GB_FLOAT diff --git a/Source/builtin/include/GB_Operator.h b/Source/builtin/include/GB_Operator.h index ea197fd881..7436310b2b 100644 --- a/Source/builtin/include/GB_Operator.h +++ b/Source/builtin/include/GB_Operator.h @@ -2,13 +2,13 @@ // GB_Operator.h: definitions of all operator objects //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// GrB_UnaryOp, GrB_IndexUnaryOp, GrB_BinaryOp, and GxB_SelectOp all use the -// same internal structure. +// GrB_UnaryOp, GrB_IndexUnaryOp, GrB_BinaryOp, GxB_IndexBinaryOp, and +// GxB_SelectOp all use the same internal structure. int64_t magic ; // for detecting uninitialized objects size_t header_size ; // size of the malloc'd block for this struct, or 0 @@ -35,3 +35,17 @@ uint64_t hash ; // if 0, operator uses only builtin ops and types + //-------------------------------------------------------------------------- + // new for the index binary op: + //-------------------------------------------------------------------------- + + GrB_Type theta_type ; // type of theta for IndexBinaryOp, and for a + // binary op created from an IndexBinaryOp; + // NULL otherwise + + GxB_index_binary_function idxbinop_function ; // function pointer + + void *theta ; // theta for binary op created from an index binary + // op, NULL otherwise (even for an index binary op) + size_t theta_size ; // allocated size of theta, or 0 + diff --git a/Source/builtin/include/GB_matrix.h b/Source/builtin/include/GB_matrix.h index 8c4961edb0..5dbf66fcbd 100644 --- a/Source/builtin/include/GB_matrix.h +++ b/Source/builtin/include/GB_matrix.h @@ -364,18 +364,18 @@ GB_Pending Pending ; // list of pending tuples //----------------------------------------------------------------------------- // A "zombie" is the opposite of a pending tuple. It is an entry A(i,j) that -// has been marked for deletion, but has not been deleted yet because it is more -// efficient to delete all zombies all at once, rather than one (or a few) at a -// time. An entry A(i,j) is marked as a zombie by 'flipping' its index via -// GB_FLIP(i). A flipped index is negative, and the actual index can be -// obtained by GB_UNFLIP(i). GB_FLIP(i) is a function that is its own inverse: -// GB_FLIP(GB_FLIP(x))=x for all x. +// has been marked for deletion, but has not been deleted yet because it is +// more efficient to delete all zombies all at once, rather than one (or a few) +// at a time. An entry A(i,j) is marked as a zombie by 'zombifying' its index +// via GB_ZOMBIE(i). A zombie index is negative, and the actual index can be +// obtained by GB_UNZOMBIE(i). GB_ZOMBIE(i) is a function that is its own +// inverse: GB_ZOMBIE(GB_ZOMBIE(x))=x for all x. // Using zombies allows entries to be marked for deletion. Their index is // still important, for two reasons: (1) the indices in each vector of the // matrix are kept sorted to enable the use of binary search, (2) a zombie may // be restored as a regular entry by a subsequent update, via setElement, -// subassign, or assign. In this case its index is unflipped and its value +// subassign, or assign. In this case its index is dezombied and its value // modified. Had the zombie not been there, the update would have to be placed // in the pending tuple list. It is more efficient to keep the pending tuple // lists as short as possible, so zombies are kept as long as possible to @@ -389,6 +389,32 @@ GB_Pending Pending ; // list of pending tuples uint64_t nzombies ; // number of zombies marked for deletion +//------------------------------------------------------------------------------ +// CUDA memory distribution +//------------------------------------------------------------------------------ + +#if 0 +// IN PROGRESS ... + +int64_t cuda_memory_hints [4] ; // handle up to 255 GPUs, one bit per GPU, + // and one bit for the CPU memory. If a bit is one, the matrix can reside + // on that particular memory space. Default: all ones (the matrix can + // be anywhere). The A->cuda_memory_hints [...] field would only change + // via GrB_set, and not changed as the matrix moves from memory space to + // memory space. A call to GrB_set would trigger a cudaMemAdvise. + +// *_memory_location: GraphBLAS' current notion of where the memory space +// is currently. If GPU 4 touches p, h, and i, for example, but not b or x, +// then [phi]_memory_location would all be set to 4. It the CPU touches the +// space then it gets set to -1. + +int32_t p_memory_location ; // -1: on CPU, k if on GPU k +int32_t h_memory_location ; +int32_t b_memory_location ; +int32_t i_memory_location ; +int32_t x_memory_location ; +#endif + //------------------------------------------------------------------------------ // sparsity control //------------------------------------------------------------------------------ diff --git a/Source/builtin/include/GB_opaque.h b/Source/builtin/include/GB_opaque.h index 4b2299be32..d7968894d0 100644 --- a/Source/builtin/include/GB_opaque.h +++ b/Source/builtin/include/GB_opaque.h @@ -2,7 +2,7 @@ // GB_opaque.h: definitions of opaque objects //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -149,7 +149,7 @@ typedef enum (opcode) <= GB_USER_unop_code) // true if opcode is for a GrB_UnaryOp positional operator - #define GB_IS_UNARYOP_CODE_POSITIONAL(opcode) \ + #define GB_IS_BUILTIN_UNOP_CODE_POSITIONAL(opcode) \ ((opcode) >= GB_POSITIONI_unop_code && \ (opcode) <= GB_POSITIONJ1_unop_code) @@ -203,120 +203,116 @@ typedef enum //========================================================================== //-------------------------------------------------------------------------- - // binary operators z=f(x,y) that return the same type as their inputs + // binary ops for 14 valid monoids, including user-defined (72 to 85): //-------------------------------------------------------------------------- - GB_FIRST_binop_code = 72, // z = x - GB_SECOND_binop_code = 73, // z = y - GB_ANY_binop_code = 74, // z = x or y, selected arbitrarily - GB_PAIR_binop_code = 75, // z = 1 - GB_MIN_binop_code = 76, // z = min(x,y) - GB_MAX_binop_code = 77, // z = max(x,y) - GB_PLUS_binop_code = 78, // z = x + y - GB_MINUS_binop_code = 79, // z = x - y - GB_RMINUS_binop_code = 80, // z = y - x - GB_TIMES_binop_code = 81, // z = x * y - GB_DIV_binop_code = 82, // z = x / y - GB_RDIV_binop_code = 83, // z = y / x - GB_POW_binop_code = 84, // z = pow (x,y) - - GB_ISEQ_binop_code = 85, // z = (x == y) - GB_ISNE_binop_code = 86, // z = (x != y) - GB_ISGT_binop_code = 87, // z = (x > y) - GB_ISLT_binop_code = 88, // z = (x < y) - GB_ISGE_binop_code = 89, // z = (x >= y) - GB_ISLE_binop_code = 90, // z = (x <= y) - - GB_LOR_binop_code = 91, // z = (x != 0) || (y != 0) - GB_LAND_binop_code = 92, // z = (x != 0) && (y != 0) - GB_LXOR_binop_code = 93, // z = (x != 0) != (y != 0) - - GB_BOR_binop_code = 94, // z = (x | y), bitwise or - GB_BAND_binop_code = 95, // z = (x & y), bitwise and - GB_BXOR_binop_code = 96, // z = (x ^ y), bitwise xor - GB_BXNOR_binop_code = 97, // z = ~(x ^ y), bitwise xnor - GB_BGET_binop_code = 98, // z = bitget (x,y) - GB_BSET_binop_code = 99, // z = bitset (x,y) - GB_BCLR_binop_code =100, // z = bitclr (x,y) - GB_BSHIFT_binop_code =101, // z = bitshift (x,y) + GB_USER_binop_code = 72, // user defined binary op + GB_ANY_binop_code = 73, // z = x or y, selected arbitrarily + GB_MIN_binop_code = 74, // z = min(x,y) + GB_MAX_binop_code = 75, // z = max(x,y) + GB_PLUS_binop_code = 76, // z = x + y + GB_TIMES_binop_code = 77, // z = x * y + GB_LOR_binop_code = 78, // z = (x != 0) || (y != 0) + GB_LAND_binop_code = 79, // z = (x != 0) && (y != 0) + GB_LXOR_binop_code = 80, // z = (x != 0) != (y != 0) + GB_EQ_binop_code = 81, // z = (x == y), is LXNOR for bool + GB_BOR_binop_code = 82, // z = (x | y), bitwise or + GB_BAND_binop_code = 83, // z = (x & y), bitwise and + GB_BXOR_binop_code = 84, // z = (x ^ y), bitwise xor + GB_BXNOR_binop_code = 85, // z = ~(x ^ y), bitwise xnor //-------------------------------------------------------------------------- - // binary operators z=f(x,y) that return bool (TxT -> bool) + // other binary operators //-------------------------------------------------------------------------- - GB_EQ_binop_code = 102, // z = (x == y), is LXNOR for bool - GB_NE_binop_code = 103, // z = (x != y) - GB_GT_binop_code = 104, // z = (x > y) - GB_LT_binop_code = 105, // z = (x < y) - GB_GE_binop_code = 106, // z = (x >= y) - GB_LE_binop_code = 107, // z = (x <= y) + GB_NE_binop_code = 86, // z = (x != y) + GB_FIRST_binop_code = 87, // z = x + GB_SECOND_binop_code = 88, // z = y + GB_PAIR_binop_code = 89, // z = 1 + GB_MINUS_binop_code = 90, // z = x - y + GB_RMINUS_binop_code = 91, // z = y - x + GB_DIV_binop_code = 92, // z = x / y + GB_RDIV_binop_code = 93, // z = y / x + GB_POW_binop_code = 94, // z = pow (x,y) + GB_ISEQ_binop_code = 95, // z = (x == y) + GB_ISNE_binop_code = 96, // z = (x != y) + GB_ISGT_binop_code = 97, // z = (x > y) + GB_ISLT_binop_code = 98, // z = (x < y) + GB_ISGE_binop_code = 99, // z = (x >= y) + GB_ISLE_binop_code = 100, // z = (x <= y) + GB_BGET_binop_code = 101, // z = bitget (x,y) + GB_BSET_binop_code = 102, // z = bitset (x,y) + GB_BCLR_binop_code = 103, // z = bitclr (x,y) + GB_BSHIFT_binop_code = 104, // z = bitshift (x,y) + GB_GT_binop_code = 105, // z = (x > y) + GB_LT_binop_code = 106, // z = (x < y) + GB_GE_binop_code = 107, // z = (x >= y) + GB_LE_binop_code = 108, // z = (x <= y) + GB_ATAN2_binop_code = 109, // z = atan2 (x,y) + GB_HYPOT_binop_code = 110, // z = hypot (x,y) + GB_FMOD_binop_code = 111, // z = fmod (x,y) + GB_REMAINDER_binop_code = 112, // z = remainder (x,y) + GB_COPYSIGN_binop_code = 113, // z = copysign (x,y) + GB_LDEXP_binop_code = 114, // z = ldexp (x,y) + GB_CMPLX_binop_code = 115, // z = cmplx (x,y) //-------------------------------------------------------------------------- - // binary operators for real floating-point types (TxT -> T) + // built-in positional binary operators: z is int64, x and y are ignored //-------------------------------------------------------------------------- - GB_ATAN2_binop_code = 108, // z = atan2 (x,y) - GB_HYPOT_binop_code = 109, // z = hypot (x,y) - GB_FMOD_binop_code = 110, // z = fmod (x,y) - GB_REMAINDER_binop_code = 111, // z = remainder (x,y) - GB_COPYSIGN_binop_code = 112, // z = copysign (x,y) - GB_LDEXP_binop_code = 113, // z = ldexp (x,y) - - //-------------------------------------------------------------------------- - // binary operator z=f(x,y) where z is complex, x,y real: - //-------------------------------------------------------------------------- - - GB_CMPLX_binop_code = 114, // z = cmplx (x,y) - - //-------------------------------------------------------------------------- - // positional binary operators: z is int64, x and y are ignored - //-------------------------------------------------------------------------- - - GB_FIRSTI_binop_code = 115, // z = first_i(A(i,j),y) == i - GB_FIRSTI1_binop_code = 116, // z = first_i1(A(i,j),y) == i+1 - GB_FIRSTJ_binop_code = 117, // z = first_j(A(i,j),y) == j - GB_FIRSTJ1_binop_code = 118, // z = first_j1(A(i,j),y) == j+1 - GB_SECONDI_binop_code = 119, // z = second_i(x,B(i,j)) == i - GB_SECONDI1_binop_code = 120, // z = second_i1(x,B(i,j)) == i+1 - GB_SECONDJ_binop_code = 121, // z = second_j(x,B(i,j)) == j - GB_SECONDJ1_binop_code = 122, // z = second_j1(x,B(i,j)) == j+1 - - GB_USER_binop_code = 123, + GB_FIRSTI_binop_code = 116, // z = first_i(A(i,j),y) == i + GB_FIRSTI1_binop_code = 117, // z = first_i1(A(i,j),y) == i+1 + GB_FIRSTJ_binop_code = 118, // z = first_j(A(i,j),y) == j + GB_FIRSTJ1_binop_code = 119, // z = first_j1(A(i,j),y) == j+1 + GB_SECONDI_binop_code = 120, // z = second_i(x,B(i,j)) == i + GB_SECONDI1_binop_code = 121, // z = second_i1(x,B(i,j)) == i+1 + GB_SECONDJ_binop_code = 122, // z = second_j(x,B(i,j)) == j + GB_SECONDJ1_binop_code = 123, // z = second_j1(x,B(i,j)) == j+1 // true if opcode is for a GrB_BinaryOp #define GB_IS_BINARYOP_CODE(opcode) \ - ((opcode) >= GB_FIRST_binop_code && (opcode) <= GB_USER_binop_code) + ((opcode) >= GB_USER_binop_code && \ + (opcode) <= GB_SECONDJ1_binop_code) // true if opcode is for a GrB_BinaryOp positional operator - #define GB_IS_BINARYOP_CODE_POSITIONAL(opcode) \ + #define GB_IS_BUILTIN_BINOP_CODE_POSITIONAL(opcode) \ ((opcode) >= GB_FIRSTI_binop_code && \ (opcode) <= GB_SECONDJ1_binop_code) + //-------------------------------------------------------------------------- + // index binary operators: + //-------------------------------------------------------------------------- + + GB_USER_idxbinop_code = 124, + + // true if opcode is for a GxB_IndexBinaryOp + #define GB_IS_INDEXBINARYOP_CODE(opcode) ((opcode) == GB_USER_idxbinop_code) + //========================================================================== // built-in GxB_SelectOp operators (DEPRECATED: do not use) //========================================================================== // built-in positional select operators: thunk optional; defaults to zero - GB_TRIL_selop_code = 124, - GB_TRIU_selop_code = 125, - GB_DIAG_selop_code = 126, - GB_OFFDIAG_selop_code = 127, + GB_TRIL_selop_code = 125, + GB_TRIU_selop_code = 126, + GB_DIAG_selop_code = 127, + GB_OFFDIAG_selop_code = 128, // built-in select operators, no thunk used - GB_NONZERO_selop_code = 128, - GB_EQ_ZERO_selop_code = 129, - GB_GT_ZERO_selop_code = 130, - GB_GE_ZERO_selop_code = 131, - GB_LT_ZERO_selop_code = 132, - GB_LE_ZERO_selop_code = 133, + GB_NONZERO_selop_code = 129, + GB_EQ_ZERO_selop_code = 130, + GB_GT_ZERO_selop_code = 131, + GB_GE_ZERO_selop_code = 132, + GB_LT_ZERO_selop_code = 133, + GB_LE_ZERO_selop_code = 134, // built-in select operators, thunk optional; defaults to zero - GB_NE_THUNK_selop_code = 134, - GB_EQ_THUNK_selop_code = 135, - GB_GT_THUNK_selop_code = 136, - GB_GE_THUNK_selop_code = 137, - GB_LT_THUNK_selop_code = 138, - GB_LE_THUNK_selop_code = 139 + GB_NE_THUNK_selop_code = 135, + GB_EQ_THUNK_selop_code = 136, + GB_GT_THUNK_selop_code = 137, + GB_GE_THUNK_selop_code = 138, + GB_LT_THUNK_selop_code = 139, + GB_LE_THUNK_selop_code = 140 // true if opcode is for a GxB_SelectOp #define GB_IS_SELECTOP_CODE(opcode) \ @@ -331,10 +327,11 @@ typedef enum GB_Opcode ; // true if the opcode is a positional operator of any kind -#define GB_OPCODE_IS_POSITIONAL(opcode) \ - (GB_IS_UNARYOP_CODE_POSITIONAL (opcode) || \ - GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode) || \ - GB_IS_BINARYOP_CODE_POSITIONAL (opcode) || \ +#define GB_OPCODE_IS_POSITIONAL(opcode) \ + (GB_IS_BUILTIN_UNOP_CODE_POSITIONAL (opcode) || \ + GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode) || \ + GB_IS_INDEXBINARYOP_CODE (opcode) || \ + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) || \ GB_IS_SELECTOP_CODE_POSITIONAL (opcode)) // true if the op is a unary or binary positional operator @@ -394,6 +391,11 @@ struct GB_BinaryOp_opaque // content of GrB_BinaryOp #include "include/GB_Operator.h" } ; +struct GB_IndexBinaryOp_opaque // content of GxB_IndexBinaryOp +{ + #include "include/GB_Operator.h" +} ; + struct GB_SelectOp_opaque // content of GxB_SelectOp { #include "include/GB_Operator.h" @@ -499,7 +501,7 @@ struct GB_Pending_struct // list of pending tuples for a matrix size_t j_size ; GB_void *x ; // values of pending tuples size_t x_size ; - GrB_Type type ; // the type of s + GrB_Type type ; // the type of x size_t size ; // type->size GrB_BinaryOp op ; // operator to assemble pending tuples } ; @@ -583,5 +585,29 @@ struct GB_Matrix_opaque // content of GrB_Matrix #define GB_B_NVALS(e) int64_t e = GB_nnz (B) #define GB_B_NHELD(e) int64_t e = GB_nnz_held (B) +// accessing the S matrix +#define GBP_S(Sp,k,vlen) GBP (Sp,k,vlen) +#define GBH_S(Sh,k) GBH (Sh,k) +#define GBI_S(Si,p,vlen) GBI (Si,p,vlen) +#define GBB_S(Sb,p) GBB (Sb,p) +#define GB_S_NVALS(e) int64_t e = GB_nnz (S) +#define GB_S_NHELD(e) int64_t e = GB_nnz_held (S) + +// accessing the R matrix +#define GBP_R(Rp,k,vlen) GBP (Rp,k,vlen) +#define GBH_R(Rh,k) GBH (Rh,k) +#define GBI_R(Ri,p,vlen) GBI (Ri,p,vlen) +#define GBB_R(Rb,p) GBB (Rb,p) +#define GB_R_NVALS(e) int64_t e = GB_nnz (R) +#define GB_R_NHELD(e) int64_t e = GB_nnz_held (R) + +// accessing the Z matrix +#define GBP_Z(Zp,k,vlen) GBP (Zp,k,vlen) +#define GBH_Z(Zh,k) GBH (Zh,k) +#define GBI_Z(Zi,p,vlen) GBI (Zi,p,vlen) +#define GBB_Z(Zb,p) GBB (Zb,p) +#define GB_Z_NVALS(e) int64_t e = GB_nnz (Z) +#define GB_Z_NHELD(e) int64_t e = GB_nnz_held (Z) + #endif diff --git a/Source/callback/GB_callback.c b/Source/callback/GB_callback.c index 4b86692e19..42c228533f 100644 --- a/Source/callback/GB_callback.c +++ b/Source/callback/GB_callback.c @@ -2,22 +2,17 @@ // GB_callback.c: global callback struct for 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 //------------------------------------------------------------------------------ #include "GB.h" #include "callback/include/GB_callback.h" -#include "mxm/GB_AxB_saxpy3.h" -#include "assign/GB_bitmap_assign_methods.h" -#include "slice/GB_ek_slice.h" -#include "sort/GB_sort.h" GB_callback_struct GB_callback = { .GB_AxB_saxpy3_cumsum_func = GB_AxB_saxpy3_cumsum, - .GB_bitmap_M_scatter_func = GB_bitmap_M_scatter, .GB_bitmap_M_scatter_whole_func = GB_bitmap_M_scatter_whole, .GB_bix_alloc_func = GB_bix_alloc, .GB_ek_slice_func = GB_ek_slice, @@ -27,6 +22,20 @@ GB_callback_struct GB_callback = .GB_memset_func = GB_memset, .GB_qsort_1_func = GB_qsort_1, .GB_werk_pop_func = GB_werk_pop, - .GB_werk_push_func = GB_werk_push + .GB_werk_push_func = GB_werk_push, + + // added for assign: + .GB_hyper_hash_build_func = GB_hyper_hash_build, + .GB_subassign_one_slice_func = GB_subassign_one_slice, + .GB_add_phase0_func = GB_add_phase0, + .GB_ewise_slice_func = GB_ewise_slice, + .GB_subassign_IxJ_slice_func = GB_subassign_IxJ_slice, + .GB_Pending_ensure_func = GB_Pending_ensure, + .GB_subassign_08n_slice_func = GB_subassign_08n_slice, + .GB_bitmap_assign_to_full_func = GB_bitmap_assign_to_full, + + // added for sort: + .GB_p_slice_func = GB_p_slice, + } ; diff --git a/Source/callback/GB_callbacks.h b/Source/callback/GB_callbacks.h index 2c2d6954ee..bc35bc83c5 100644 --- a/Source/callback/GB_callbacks.h +++ b/Source/callback/GB_callbacks.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_callbacks.h: prototypes for kernel callbacks for PreJIT +// GB_callbacks.h: prototypes for kernel callbacks //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -20,8 +20,20 @@ GB_CALLBACK_BIX_ALLOC_PROTO (GB_bix_alloc) ; GB_CALLBACK_QSORT_1_PROTO (GB_qsort_1) ; GB_CALLBACK_WERK_PUSH_PROTO (GB_werk_push) ; GB_CALLBACK_WERK_POP_PROTO (GB_werk_pop) ; -GB_CALLBACK_BITMAP_M_SCATTER_PROTO (GB_bitmap_M_scatter) ; GB_CALLBACK_BITMAP_M_SCATTER_WHOLE_PROTO (GB_bitmap_M_scatter_whole) ; +// added for assign: +GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) ; +GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO (GB_subassign_one_slice) ; +GB_CALLBACK_ADD_PHASE0_PROTO (GB_add_phase0) ; +GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) ; +GB_CALLBACK_SUBASSIGN_IXJ_SLICE_PROTO (GB_subassign_IxJ_slice) ; +GB_CALLBACK_PENDING_ENSURE_PROTO (GB_Pending_ensure) ; +GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO (GB_subassign_08n_slice) ; +GB_CALLBACK_BITMAP_ASSIGN_TO_FULL_PROTO (GB_bitmap_assign_to_full) ; + +// added for sort: +GB_CALLBACK_P_SLICE_PROTO (GB_p_slice) ; + #endif diff --git a/Source/callback/include/GB_callback.h b/Source/callback/include/GB_callback.h index 3cfec10491..e974fdb8da 100644 --- a/Source/callback/include/GB_callback.h +++ b/Source/callback/include/GB_callback.h @@ -2,7 +2,7 @@ // GB_callback.h: typedefs for kernel callbacks //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -15,7 +15,6 @@ //------------------------------------------------------------------------------ typedef GB_CALLBACK_SAXPY3_CUMSUM_PROTO ((*GB_AxB_saxpy3_cumsum_f)) ; -typedef GB_CALLBACK_BITMAP_M_SCATTER_PROTO ((*GB_bitmap_M_scatter_f)) ; typedef GB_CALLBACK_BITMAP_M_SCATTER_WHOLE_PROTO ((*GB_bitmap_M_scatter_whole_f)) ; typedef GB_CALLBACK_BIX_ALLOC_PROTO ((*GB_bix_alloc_f)) ; typedef GB_CALLBACK_EK_SLICE_PROTO ((*GB_ek_slice_f)) ; @@ -27,6 +26,19 @@ typedef GB_CALLBACK_QSORT_1_PROTO ((*GB_qsort_1_f)) ; typedef GB_CALLBACK_WERK_POP_PROTO ((*GB_werk_pop_f)) ; typedef GB_CALLBACK_WERK_PUSH_PROTO ((*GB_werk_push_f)) ; +// added for assign: +typedef GB_CALLBACK_HYPER_HASH_BUILD_PROTO ((*GB_hyper_hash_build_f)) ; +typedef GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO ((*GB_subassign_one_slice_f)) ; +typedef GB_CALLBACK_ADD_PHASE0_PROTO ((*GB_add_phase0_f)) ; +typedef GB_CALLBACK_EWISE_SLICE_PROTO ((*GB_ewise_slice_f)) ; +typedef GB_CALLBACK_SUBASSIGN_IXJ_SLICE_PROTO ((*GB_subassign_IxJ_slice_f)) ; +typedef GB_CALLBACK_PENDING_ENSURE_PROTO ((*GB_Pending_ensure_f)) ; +typedef GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO ((*GB_subassign_08n_slice_f)) ; +typedef GB_CALLBACK_BITMAP_ASSIGN_TO_FULL_PROTO ((*GB_bitmap_assign_to_full_f)) ; + +// added for sort: +typedef GB_CALLBACK_P_SLICE_PROTO ((*GB_p_slice_f)) ; + //------------------------------------------------------------------------------ // GB_callback: a struct to pass to kernels to give them their callback methods //------------------------------------------------------------------------------ @@ -34,7 +46,6 @@ typedef GB_CALLBACK_WERK_PUSH_PROTO ((*GB_werk_push_f)) ; typedef struct { GB_AxB_saxpy3_cumsum_f GB_AxB_saxpy3_cumsum_func ; - GB_bitmap_M_scatter_f GB_bitmap_M_scatter_func ; GB_bitmap_M_scatter_whole_f GB_bitmap_M_scatter_whole_func ; GB_bix_alloc_f GB_bix_alloc_func ; GB_ek_slice_f GB_ek_slice_func ; @@ -45,6 +56,19 @@ typedef struct GB_qsort_1_f GB_qsort_1_func ; GB_werk_pop_f GB_werk_pop_func ; GB_werk_push_f GB_werk_push_func ; + + // added for assign: + GB_hyper_hash_build_f GB_hyper_hash_build_func ; + GB_subassign_one_slice_f GB_subassign_one_slice_func ; + GB_add_phase0_f GB_add_phase0_func ; + GB_ewise_slice_f GB_ewise_slice_func ; + GB_subassign_IxJ_slice_f GB_subassign_IxJ_slice_func ; + GB_Pending_ensure_f GB_Pending_ensure_func ; + GB_subassign_08n_slice_f GB_subassign_08n_slice_func ; + GB_bitmap_assign_to_full_f GB_bitmap_assign_to_full_func ; + + // added for sort: + GB_p_slice_f GB_p_slice_func ; } GB_callback_struct ; diff --git a/Source/callback/include/GB_callback_proto.h b/Source/callback/include/GB_callback_proto.h index affb2bb9a2..ed1aa1ddcb 100644 --- a/Source/callback/include/GB_callback_proto.h +++ b/Source/callback/include/GB_callback_proto.h @@ -2,7 +2,7 @@ // GB_callback_proto.h: prototypes for functions for kernel callbacks //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -27,29 +27,6 @@ void GX_AxB_saxpy3_cumsum \ GB_Werk Werk \ ) -#define GB_CALLBACK_BITMAP_M_SCATTER_PROTO(GX_bitmap_M_scatter) \ -void GX_bitmap_M_scatter /* scatter M into the C bitmap */ \ -( \ - /* input/output: */ \ - GrB_Matrix C, \ - /* inputs: */ \ - const GrB_Index *I, /* I index list */ \ - const int64_t nI, \ - const int Ikind, \ - const int64_t Icolon [3], \ - const GrB_Index *J, /* J index list */ \ - const int64_t nJ, \ - const int Jkind, \ - const int64_t Jcolon [3], \ - const GrB_Matrix M, /* mask to scatter into the C bitmap */ \ - const bool Mask_struct, /* true: M structural, false: M valued */ \ - const int assign_kind, /* row assign, col assign, assign, sub. */ \ - const int operation, /* +=2, -=2, or %=2 */ \ - const int64_t *M_ek_slicing, /* size 3*M_ntasks+1 */ \ - const int M_ntasks, \ - const int M_nthreads \ -) - #define GB_CALLBACK_BITMAP_M_SCATTER_WHOLE_PROTO(GX_bitmap_M_scatter_whole) \ void GX_bitmap_M_scatter_whole /* scatter M into the C bitmap */ \ ( \ @@ -58,7 +35,7 @@ void GX_bitmap_M_scatter_whole /* scatter M into the C bitmap */ \ /* inputs: */ \ const GrB_Matrix M, /* mask to scatter into the C bitmap */ \ const bool Mask_struct, /* true: M structural, false: M valued */ \ - const int operation, /* +=2, -=2, or %=2 */ \ + const int operation, /* +=2, -=2, or =2 */ \ const int64_t *M_ek_slicing, /* size 3*M_ntasks+1 */ \ const int M_ntasks, \ const int M_nthreads \ @@ -125,13 +102,6 @@ void GX_memset /* parallel memset */ \ int nthreads /* max # of threads to use */ \ ) -#define GB_CALLBACK_QSORT_1_PROTO(GX_qsort_1) \ -void GX_qsort_1 /* sort array A of size 1-by-n */ \ -( \ - int64_t *restrict A_0, /* size n array */ \ - const int64_t n \ -) - #define GB_CALLBACK_WERK_POP_PROTO(GX_werk_pop) \ void *GX_werk_pop /* free the top block of werkspace memory */ \ ( \ @@ -157,5 +127,156 @@ void *GX_werk_push /* return pointer to newly allocated space */ \ GB_Werk Werk \ ) +#define GB_CALLBACK_HYPER_HASH_BUILD_PROTO(GX_hyper_hash_build) \ +GrB_Info GX_hyper_hash_build /* construct the A->Y hyper_hash for A */ \ +( \ + GrB_Matrix A, \ + GB_Werk Werk \ +) + +#define GB_CALLBACK_SUBASSIGN_ONE_SLICE_PROTO(GX_subassign_one_slice) \ +GrB_Info GX_subassign_one_slice /* slice M for subassign_05, 06n, 07 */ \ +( \ + /* output: */ \ + GB_task_struct **p_TaskList, /* array of structs */ \ + size_t *p_TaskList_size, /* size of TaskList */ \ + int *p_ntasks, /* # of tasks constructed */ \ + int *p_nthreads, /* # of threads to use */ \ + /* input: */ \ + const GrB_Matrix C, /* output matrix C */ \ + const GrB_Index *I, \ + const int64_t nI, \ + const int Ikind, \ + const int64_t Icolon [3], \ + const GrB_Index *J, \ + const int64_t nJ, \ + const int Jkind, \ + const int64_t Jcolon [3], \ + const GrB_Matrix M, /* matrix to slice */ \ + GB_Werk Werk \ +) + +#define GB_CALLBACK_ADD_PHASE0_PROTO(GX_add_phase0) \ +GrB_Info GX_add_phase0 /* find vectors in C for C=A+B or C=A+B*/\ +( \ + int64_t *p_Cnvec, /* # of vectors to compute in C */ \ + int64_t *restrict *Ch_handle, /* Ch: size Cnvec, or NULL */ \ + size_t *Ch_size_handle, /* size of Ch in bytes */ \ + int64_t *restrict *C_to_M_handle, /* C_to_M: size Cnvec, or NULL */ \ + size_t *C_to_M_size_handle, /* size of C_to_M in bytes */ \ + int64_t *restrict *C_to_A_handle, /* C_to_A: size Cnvec, or NULL */ \ + size_t *C_to_A_size_handle, /* size of C_to_A in bytes */ \ + int64_t *restrict *C_to_B_handle, /* C_to_B: size Cnvec, or NULL */ \ + size_t *C_to_B_size_handle, /* size of C_to_A in bytes */ \ + bool *p_Ch_is_Mh, /* if true, then Ch == Mh */ \ + int *C_sparsity, /* sparsity structure of C */ \ + const GrB_Matrix M, /* optional mask, may be NULL; not compl */ \ + const GrB_Matrix A, /* first input matrix */ \ + const GrB_Matrix B, /* second input matrix */ \ + GB_Werk Werk \ +) + +#define GB_CALLBACK_EWISE_SLICE_PROTO(GX_ewise_slice) \ +GrB_Info GX_ewise_slice \ +( \ + /* output: */ \ + GB_task_struct **p_TaskList, /* array of structs */ \ + size_t *p_TaskList_size, /* size of TaskList */ \ + int *p_ntasks, /* # of tasks constructed */ \ + int *p_nthreads, /* # of threads for eWise operation */ \ + /* input: */ \ + const int64_t Cnvec, /* # of vectors of C */ \ + const int64_t *restrict Ch, /* vectors of C, if hypersparse */ \ + const int64_t *restrict C_to_M, /* mapping of C to M */ \ + const int64_t *restrict C_to_A, /* mapping of C to A */ \ + const int64_t *restrict C_to_B, /* mapping of C to B */ \ + bool Ch_is_Mh, /* if true, then Ch == Mh; GB_add only*/\ + const GrB_Matrix M, /* mask matrix to slice (optional) */ \ + const GrB_Matrix A, /* matrix to slice */ \ + const GrB_Matrix B, /* matrix to slice */ \ + GB_Werk Werk \ +) + +#define GB_CALLBACK_SUBASSIGN_IXJ_SLICE_PROTO(GX_subassign_IxJ_slice) \ +GrB_Info GX_subassign_IxJ_slice \ +( \ + /* output: */ \ + GB_task_struct **p_TaskList, /* array of structs */ \ + size_t *p_TaskList_size, /* size of TaskList */ \ + int *p_ntasks, /* # of tasks constructed */ \ + int *p_nthreads, /* # of threads to use */ \ + /* input: */ \ + const int64_t nI, \ + const int64_t nJ, \ + GB_Werk Werk \ +) + +#define GB_CALLBACK_PENDING_ENSURE_PROTO(GX_Pending_ensure) \ +bool GX_Pending_ensure \ +( \ + GB_Pending *PHandle, /* input/output */ \ + bool iso, /* if true, do not allocate Pending->x */ \ + GrB_Type type, /* type of pending tuples */ \ + GrB_BinaryOp op, /* operator for assembling pending tuples */ \ + bool is_matrix, /* true if Pending->j must be allocated */ \ + int64_t nnew, /* # of pending tuples to add */ \ + GB_Werk Werk \ +) + +#define GB_CALLBACK_SUBASSIGN_08N_SLICE_PROTO(GX_subassign_08n_slice) \ +GrB_Info GX_subassign_08n_slice \ +( \ + /* output: */ \ + GB_task_struct **p_TaskList, /* size max_ntasks */ \ + size_t *p_TaskList_size, /* size of TaskList */ \ + int *p_ntasks, /* # of tasks constructed */ \ + int *p_nthreads, /* # of threads to use */ \ + int64_t *p_Znvec, /* # of vectors to compute in Z */ \ + const int64_t *restrict *Zh_handle, /* Zh is A->h, M->h, or NULL */ \ + int64_t *restrict *Z_to_A_handle, /* Z_to_A: size Znvec, or NULL */ \ + size_t *Z_to_A_size_handle, \ + int64_t *restrict *Z_to_M_handle, /* Z_to_M: size Znvec, or NULL */ \ + size_t *Z_to_M_size_handle, \ + /* input: */ \ + const GrB_Matrix C, /* output matrix C */ \ + const GrB_Index *I, \ + const int64_t nI, \ + const int Ikind, \ + const int64_t Icolon [3], \ + const GrB_Index *J, \ + const int64_t nJ, \ + const int Jkind, \ + const int64_t Jcolon [3], \ + const GrB_Matrix A, /* matrix to slice */ \ + const GrB_Matrix M, /* matrix to slice */ \ + GB_Werk Werk \ +) + +#define GB_CALLBACK_BITMAP_ASSIGN_TO_FULL_PROTO(GX_bitmap_assign_to_full) \ +void GX_bitmap_assign_to_full /* set all C->b to 1, or make C full */ \ +( \ + GrB_Matrix C, \ + int nthreads_max \ +) + +#define GB_CALLBACK_QSORT_1_PROTO(GX_qsort_1) \ +void GX_qsort_1 /* sort array A of size 1-by-n */ \ +( \ + int64_t *restrict A_0, /* size n array */ \ + const int64_t n \ +) + +#define GB_CALLBACK_P_SLICE_PROTO(GX_p_slice) \ +void GX_p_slice /* slice Ap */ \ +( \ + /* output: */ \ + int64_t *restrict Slice, /* size ntasks+1 */ \ + /* input: */ \ + const int64_t *restrict Ap, /* array size n+1 (full/bitmap: NULL)*/ \ + const int64_t n, \ + const int ntasks, /* # of tasks */ \ + const bool perfectly_balanced \ +) + #endif diff --git a/Source/cast/GB_cast.h b/Source/cast/GB_cast.h index 5312d08c58..d0aa1e772a 100644 --- a/Source/cast/GB_cast.h +++ b/Source/cast/GB_cast.h @@ -80,9 +80,9 @@ static inline void GB_cast_one // z = 1 with typecasting zcode GrB_Info GB_cast_array // typecast an array ( GB_void *Cx, // output array - const GB_Type_code code1, // type code for Cx + const GB_Type_code ccode, // type code for Cx GrB_Matrix A, - const int nthreads // number of threads to use + const int A_nthreads // number of threads to use ) ; GrB_Info GB_cast_matrix // copy or typecast the values from A into C diff --git a/Source/cast/GB_cast_array.c b/Source/cast/GB_cast_array.c index 1bd695e5cf..062164744c 100644 --- a/Source/cast/GB_cast_array.c +++ b/Source/cast/GB_cast_array.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // Casts an input array A->x to an output array Cx with a different type. The // two types are always different, so this does not need to handle user-defined // types. The iso case is not handled; A->x and Cx must be the same size and no @@ -24,7 +22,7 @@ GrB_Info GB_cast_array // typecast an array ( GB_void *Cx, // output array - const GB_Type_code code1, // type code for Cx + const GB_Type_code ccode, // type code for Cx GrB_Matrix A, const int A_nthreads // number of threads to use ) @@ -38,7 +36,7 @@ GrB_Info GB_cast_array // typecast an array const GB_void *restrict Ax = A->x ; const int8_t *restrict Ab = A->b ; const int64_t anz = GB_nnz_held (A) ; - const GB_Type_code code2 = A->type->code ; + const GB_Type_code acode = A->type->code ; if (anz == 0 || Cx == Ax) { @@ -49,9 +47,9 @@ GrB_Info GB_cast_array // typecast an array ASSERT (Cx != NULL) ; ASSERT (Ax != NULL) ; ASSERT (anz > 0) ; - ASSERT (GB_code_compatible (code1, code2)) ; - ASSERT (code1 != code2) ; - ASSERT (code1 != GB_UDT_code) ; + ASSERT (GB_code_compatible (ccode, acode)) ; + ASSERT (ccode != acode) ; + ASSERT (ccode != GB_UDT_code) ; ASSERT (!A->iso) ; //-------------------------------------------------------------------------- @@ -68,6 +66,8 @@ GrB_Info GB_cast_array // typecast an array // define the worker for the switch factory //---------------------------------------------------------------------- + const GB_Type_code code1 = ccode, code2 = acode ; + #define GB_uop_apply(zname,xname) \ GB (_uop_apply__identity ## zname ## xname) @@ -93,7 +93,7 @@ GrB_Info GB_cast_array // typecast an array if (info == GrB_NO_VALUE) { - GrB_Type ctype = GB_code_type (code1, NULL) ; + GrB_Type ctype = GB_code_type (ccode, NULL) ; GB_Operator op = GB_unop_identity (ctype, NULL) ; ASSERT_OP_OK (op, "id op for cast_array", GB0) ; info = GB_apply_unop_jit (Cx, ctype, op, false, A, NULL, NULL, 0, @@ -107,9 +107,9 @@ GrB_Info GB_cast_array // typecast an array if (info == GrB_NO_VALUE) { GB_BURBLE_N (anz, "(generic cast array) ") ; - int64_t csize = GB_code_size (code1, 0) ; - int64_t asize = GB_code_size (code2, 0) ; - GB_cast_function cast_A_to_C = GB_cast_factory (code1, code2) ; + int64_t csize = GB_code_size (ccode, 0) ; + int64_t asize = GB_code_size (acode, 0) ; + GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; #define GB_APPLY_OP(pC,pA) \ cast_A_to_C (Cx +((pC)*csize), Ax +((pA)*asize), asize) #include "apply/template/GB_apply_unop_ip.c" diff --git a/Source/codegen/Contents.m b/Source/codegen/Contents.m index 62855d0ed3..481d28bfaa 100644 --- a/Source/codegen/Contents.m +++ b/Source/codegen/Contents.m @@ -4,30 +4,30 @@ % GraphBLAS/FactoryKernels, from the input files in Source/codegen/Generator. % These functions do not need to be used by the end user. % -% codegen -% codegen_aop -% codegen_aop_method -% codegen_aop_template -% codegen_as -% codegen_as_template -% codegen_axb -% codegen_axb_method -% codegen_axb_compare_template -% codegen_axb_template -% codegen_ew -% codegen_ew_method -% codegen_ew_template -% codegen_red -% codegen_red_method -% codegen_sel -% codegen_sel_method -% codegen_uop -% codegen_uop_identity -% codegen_uop_method -% codegen_uop_template -% -% codegen_type -% codegen_contains +% codegen - generate all code for ../../FactoryKernels/*.c +% codegen_aop - create functions for all binary operators for assign/subassign +% codegen_aop_method - create a function to compute C(:,:)+=A +% codegen_aop_template - create aop functions +% codegen_as - create functions for assign/subassign methods with no accum +% codegen_as_template - create a function for subassign/assign with no accum +% codegen_axb - create all C=A*B functions for all semirings +% codegen_axb_compare_template - create a function for a semiring with a TxT -> bool multiplier +% codegen_axb_method - create a function to compute C=A*B over a semiring +% codegen_axb_template - create a function for a semiring with a TxT->T multiplier +% codegen_contains - same as contains (text, pattern) +% codegen_ew - create ewise kernels +% codegen_ew_method - create an ewise kernel +% codegen_ew_template - create ewise kernels +% codegen_red - create functions for all reduction operators +% codegen_red_method - create a reduction function, C = reduce (A) +% codegen_sel - create functions for all selection operators +% codegen_sel_method - create a selection function, C = select (A,thunk) +% codegen_type - determine function fname, signed or not +% codegen_uop - create functions for all unary operators +% codegen_uop_identity - create identity functions +% codegen_uop_method - create a function to compute C=uop(A) +% codegen_uop_template - CODEGEN_UNOP_TEMPLATE create uop functions % SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 + diff --git a/Source/codegen/Generator/GB_AxB.c b/Source/codegen/Generator/GB_AxB.c index c3d8f1b0af..ad8475ec12 100644 --- a/Source/codegen/Generator/GB_AxB.c +++ b/Source/codegen/Generator/GB_AxB.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +GB_type_enabled +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -555,3 +557,5 @@ GrB_Info GB (_Asaxpy3B) #endif +#endif + diff --git a/Source/codegen/Generator/GB_aop.c b/Source/codegen/Generator/GB_aop.c index 4522ad33ca..892fbebda4 100644 --- a/Source/codegen/Generator/GB_aop.c +++ b/Source/codegen/Generator/GB_aop.c @@ -9,8 +9,10 @@ // C(I,J) += A -#include "GB.h" #include "GB_control.h" +GB_type_enabled +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_aop__include.h" @@ -28,25 +30,25 @@ GB_ctype GB_declarec GB_copy_aij_to_cwork GB_copy_aij_to_c -GB_copy_scalar_to_c +GB_copy_cwork_to_c GB_ax_mask // C(i,j) += ywork -#define GB_ACCUMULATE_scalar(Cx,pC,ywork) \ +#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso) \ GB_ACCUM_OP (Cx [pC], Cx [pC], ywork) // C(i,j) += (ytype) A(i,j) -#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork) \ -{ \ - if (A_iso) \ - { \ - GB_ACCUMULATE_scalar (Cx, pC, ywork) ; \ - } \ - else \ - { \ - /* A and Y have the same type here */ \ - GB_ACCUMULATE_scalar (Cx, pC, Ax [pA]) ; \ - } \ +#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso) \ +{ \ + if (A_iso) \ + { \ + GB_ACCUMULATE_scalar (Cx, pC, ywork, C_iso) ; \ + } \ + else \ + { \ + /* A and Y have the same type here */ \ + GB_ACCUMULATE_scalar (Cx, pC, Ax [pA], C_iso) ; \ + } \ } // disable this operator and use the generic case if these conditions hold @@ -58,6 +60,9 @@ GB_disable // C += A, accumulate a sparse matrix into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_23) ( GrB_Matrix C, @@ -79,6 +84,9 @@ GrB_Info GB (_subassign_23) // C += y, accumulate a scalar into a dense matrix //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_22) ( GrB_Matrix C, @@ -97,3 +105,5 @@ GrB_Info GB (_subassign_22) #endif } +#endif + diff --git a/Source/codegen/Generator/GB_as.c b/Source/codegen/Generator/GB_as.c index cc98bb4eaa..358ffddef1 100644 --- a/Source/codegen/Generator/GB_as.c +++ b/Source/codegen/Generator/GB_as.c @@ -9,8 +9,10 @@ // C(I,J) = A -#include "GB.h" #include "GB_control.h" +GB_type_enabled +#if GB_TYPE_ENABLED +#include "GB.h" #include "slice/GB_ek_slice.h" #include "FactoryKernels/GB_as__include.h" @@ -20,7 +22,7 @@ GB_ctype GB_declarec GB_copy_aij_to_cwork GB_copy_aij_to_c -GB_copy_scalar_to_c +GB_copy_cwork_to_c GB_ax_mask // disable this operator and use the generic case if these conditions hold @@ -32,12 +34,15 @@ GB_disable // C = scalar, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 1 + GrB_Info GB (_subassign_05d) ( GrB_Matrix C, const GrB_Matrix M, const bool Mask_struct, - const GB_void *scalar, // of type C->type + const GB_void *scalar, // of type C->type, already typecasted GB_Werk Werk ) { @@ -56,6 +61,9 @@ GrB_Info GB (_subassign_05d) // C = A, when C is dense //------------------------------------------------------------------------------ +#undef GB_SCALAR_ASSIGN +#define GB_SCALAR_ASSIGN 0 + GrB_Info GB (_subassign_06d) ( GrB_Matrix C, @@ -98,3 +106,5 @@ GrB_Info GB (_subassign_25) #endif } +#endif + diff --git a/Source/codegen/Generator/GB_bld.c b/Source/codegen/Generator/GB_bld.c index 38eb3b02de..c7250e8478 100644 --- a/Source/codegen/Generator/GB_bld.c +++ b/Source/codegen/Generator/GB_bld.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +GB_type_enabled +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_bld__include.h" // dup operator: Tx [k] += Sx [i], no typecast here @@ -35,9 +37,9 @@ GB_disable GrB_Info GB (_bld) ( - GB_T_TYPE *restrict Tx, + GB_Tx_TYPE *restrict Tx, int64_t *restrict Ti, - const GB_S_TYPE *restrict Sx, + const GB_Sx_TYPE *restrict Sx, int64_t nvals, int64_t ndupl, const int64_t *restrict I_work, @@ -55,3 +57,5 @@ GrB_Info GB (_bld) #endif } +#endif + diff --git a/Source/codegen/Generator/GB_ew.c b/Source/codegen/Generator/GB_ew.c index dfab3a7c4a..1ec31f59e6 100644 --- a/Source/codegen/Generator/GB_ew.c +++ b/Source/codegen/Generator/GB_ew.c @@ -7,9 +7,11 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" -#include "ewise/GB_emult.h" +GB_type_enabled +#if GB_TYPE_ENABLED +#include "GB.h" +#include "emult/GB_emult.h" #include "slice/GB_ek_slice.h" #include "assign/GB_bitmap_assign_methods.h" #include "FactoryKernels/GB_ew__include.h" @@ -164,7 +166,7 @@ GrB_Info GB (_AaddB) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -212,7 +214,7 @@ GrB_Info GB (_AunionB) // for the "easy mask" condition: bool M_is_A = GB_all_aliased (M, A) ; bool M_is_B = GB_all_aliased (M, B) ; - #include "ewise/template/GB_add_template.c" + #include "add/template/GB_add_template.c" return (GrB_SUCCESS) ; #endif } @@ -240,7 +242,7 @@ GrB_Info GB (_AemultB_08) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" return (GrB_SUCCESS) ; #endif } @@ -266,7 +268,7 @@ GrB_Info GB (_AemultB_02) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" return (GrB_SUCCESS) ; #endif } @@ -293,7 +295,7 @@ GrB_Info GB (_AemultB_03) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" return (GrB_SUCCESS) ; #endif } @@ -319,7 +321,7 @@ GrB_Info GB (_AemultB_04) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" return (GrB_SUCCESS) ; #endif } @@ -345,7 +347,7 @@ GrB_Info GB (_AemultB_bitmap) #if GB_DISABLE return (GrB_NO_VALUE) ; #else - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; #endif } @@ -401,11 +403,11 @@ GrB_Info GB (_bind2nd) // cij = op (x, aij) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREB (aij) ; \ - GB_GETB (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREB (aij) ; \ + GB_GETB (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, x, aij, 0, 0) ; \ } GrB_Info GB (_bind1st_tran) @@ -436,11 +438,11 @@ GrB_Info GB (_bind1st_tran) // cij = op (aij, y) #undef GB_APPLY_OP -#define GB_APPLY_OP(pC,pA) \ -{ \ - GB_DECLAREA (aij) ; \ - GB_GETA (aij, Ax, pA, false) ; \ - GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ +#define GB_APPLY_OP(pC,pA) \ +{ \ + GB_DECLAREA (aij) ; \ + GB_GETA (aij, Ax, pA, false) ; \ + GB_EWISEOP (Cx, pC, aij, y, 0, 0) ; \ } GrB_Info GB (_bind2nd_tran) @@ -462,4 +464,7 @@ GrB_Info GB (_bind2nd_tran) return (GrB_SUCCESS) ; #endif } +m4_divert(0) + +#endif diff --git a/Source/codegen/Generator/GB_red.c b/Source/codegen/Generator/GB_red.c index c28bda2f2e..a7b165be92 100644 --- a/Source/codegen/Generator/GB_red.c +++ b/Source/codegen/Generator/GB_red.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +GB_type_enabled +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_red__include.h" // reduction operator and type: @@ -71,3 +73,5 @@ GrB_Info GB (_red) #endif } +#endif + diff --git a/Source/codegen/Generator/GB_sel.c b/Source/codegen/Generator/GB_sel.c index 1aadfca51d..fd8b9b50fc 100644 --- a/Source/codegen/Generator/GB_sel.c +++ b/Source/codegen/Generator/GB_sel.c @@ -62,7 +62,7 @@ GrB_Info GB (_sel_phase2) { GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_out ; GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/Source/codegen/Generator/GB_uop.c b/Source/codegen/Generator/GB_uop.c index b4f562b036..09658e7afd 100644 --- a/Source/codegen/Generator/GB_uop.c +++ b/Source/codegen/Generator/GB_uop.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +GB_type_enabled +#if GB_TYPE_ENABLED +#include "GB.h" #include "FactoryKernels/GB_uop__include.h" // unary operator: z = f(x) @@ -30,14 +32,14 @@ GB_ctype /* aij = Ax [pA] */ \ GB_DECLAREA (aij) ; \ GB_GETA (aij, Ax, pA, false) ; \ - /* Cx [pC] = unaryop (aij) */ \ + /* Cx [pC] = unaryop (aij) */ \ GB_UNARYOP (Cx [pC], aij) ; \ } // disable this operator and use the generic case if these conditions hold GB_disable -#include "apply/include/GB_apply_shared_definitions.h" +#include "omp/include/GB_kernel_shared_definitions.h" m4_divert(if_uop_apply_enabled) //------------------------------------------------------------------------------ @@ -84,3 +86,5 @@ GrB_Info GB (_uop_tran) #endif } +#endif + diff --git a/Source/codegen/codegen_aop.m b/Source/codegen/codegen_aop.m index e52f44ea29..2fd6d4bc2b 100644 --- a/Source/codegen/codegen_aop.m +++ b/Source/codegen/codegen_aop.m @@ -1,5 +1,5 @@ function codegen_aop -%CODEGEN_ASSIGN create functions for all binary operators for assign/subassign +%CODEGEN_AOP create functions for all binary operators for assign/subassign % % This function creates all files of the form GB_aop__*.[ch], including 260 % functions (GB_aop__*.c) and one include file, GB_aop__include.h. @@ -112,6 +112,7 @@ 'GB_FC32_div (yarg, xarg)', ... % GxB_FC32_t 'GB_FC64_div (yarg, xarg)') ; ... % GxB_FC64_t +%{ codegen_aop_template ('iseq', ... [ ], ... % bool '((xarg) == (yarg))', ... % int, uint @@ -159,6 +160,7 @@ '((xarg) <= (yarg))', ... % double [ ], ... % GxB_FC32_t [ ]) ; ... % GxB_FC64_t +%} codegen_aop_template ('eq', ... '((xarg) == (yarg))', ... % bool @@ -381,3 +383,4 @@ fprintf ('\n') ; + diff --git a/Source/codegen/codegen_aop_method.m b/Source/codegen/codegen_aop_method.m index 25c512b811..9c813f6341 100644 --- a/Source/codegen/codegen_aop_method.m +++ b/Source/codegen/codegen_aop_method.m @@ -42,6 +42,7 @@ function codegen_aop_method (binop, op, xtype) assert (~isequal (binop, 'any')) ; [fname, unsigned, bits] = codegen_type (xtype) ; +codegen_type_enabled (f, fname) ; name = sprintf ('%s_%s', binop, fname) ; @@ -79,9 +80,9 @@ function codegen_aop_method (binop, op, xtype) fprintf (f, 'm4_define(`GB_copy_aij_to_ywork'', `#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso)%s'')\n', gb_copy_aij_to_ywork) ; % to copy a scalar into C (no typecasting) -fprintf (f, 'm4_define(`GB_copy_scalar_to_c'', `#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork'')\n') ; +fprintf (f, 'm4_define(`GB_copy_cwork_to_c'', `#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork'')\n') ; -% to copy an entry from A to C +% to copy an entry from A to C (with typecasting) if (isequal (ytype, 'GxB_FC32_t') && isequal (ztype, 'bool')) a2c = '((GB_crealf (Ax [pA]) != 0) || (GB_cimagf (Ax [pA]) != 0))' ; elseif (isequal (ytype, 'GxB_FC64_t') && isequal (ztype, 'bool')) @@ -96,7 +97,7 @@ function codegen_aop_method (binop, op, xtype) % use ANSI C typecasting a2c = sprintf ('((%s) Ax [pA])', ytype) ; end -fprintf (f, 'm4_define(`GB_copy_aij_to_c'', `#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : %s'')\n', a2c) ; +fprintf (f, 'm4_define(`GB_copy_aij_to_c'', `#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : %s'')\n', a2c) ; a2c = strrep (a2c, 'pA', 'A_iso ? 0 : (pA)') ; fprintf (f, 'm4_define(`GB_copy_aij_to_cwork'', `#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = %s'')\n', a2c) ; diff --git a/Source/codegen/codegen_aop_template.m b/Source/codegen/codegen_aop_template.m index 89ed5cc46b..50faaf0405 100644 --- a/Source/codegen/codegen_aop_template.m +++ b/Source/codegen/codegen_aop_template.m @@ -1,5 +1,5 @@ function codegen_aop_template (binop, bfunc, ifunc, ffunc, dfunc, fcfunc, dcfunc) -%CODEGEN_ASSIGNOP_TEMPLATE create aop functions +%CODEGEN_AOP_TEMPLATE create aop functions % % Generate functions for a binary operator, for all types, for assign/subassign @@ -39,3 +39,4 @@ function codegen_aop_template (binop, bfunc, ifunc, ffunc, dfunc, fcfunc, dcfunc codegen_aop_method (binop, dcfunc, 'GxB_FC64_t') ; end + diff --git a/Source/codegen/codegen_as_template.m b/Source/codegen/codegen_as_template.m index 6d6ef86717..a228eccc2f 100644 --- a/Source/codegen/codegen_as_template.m +++ b/Source/codegen/codegen_as_template.m @@ -10,6 +10,7 @@ function codegen_as_template (xtype) fprintf (f, 'm4_divert(-1)\n') ; [fname, unsigned, bits] = codegen_type (xtype) ; +codegen_type_enabled (f, fname) ; fprintf ('%-11s: fname: %-7s unsigned: %d bits: %d\n', xtype, fname, unsigned, bits) ; % function names @@ -22,10 +23,10 @@ function codegen_as_template (xtype) fprintf (f, 'm4_define(`GB_declarec'', `#define GB_DECLAREC(cwork) %s cwork'')\n', xtype) ; % to copy a scalar into C (no typecasting) -fprintf (f, 'm4_define(`GB_copy_scalar_to_c'', `#define GB_COPY_scalar_to_C(Cx,pC,cwork) Cx [pC] = cwork'')\n') ; +fprintf (f, 'm4_define(`GB_copy_cwork_to_c'', `#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso) Cx [pC] = cwork'')\n') ; % to copy an entry from A to C (no typecasting) -fprintf (f, 'm4_define(`GB_copy_aij_to_c'', `#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork) Cx [pC] = (A_iso) ? cwork : Ax [pA]'')\n') ; +fprintf (f, 'm4_define(`GB_copy_aij_to_c'', `#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso) Cx [pC] = (A_iso) ? cwork : Ax [pA]'')\n') ; % to copy an entry from A into a cwork scalar fprintf (f, 'm4_define(`GB_copy_aij_to_cwork'', `#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso) cwork = Ax [A_iso ? 0 : (pA)]'')\n') ; diff --git a/Source/codegen/codegen_axb_method.m b/Source/codegen/codegen_axb_method.m index 1d18ab5f3e..41b47c62a5 100644 --- a/Source/codegen/codegen_axb_method.m +++ b/Source/codegen/codegen_axb_method.m @@ -825,7 +825,9 @@ function codegen_axb_method (addop, multop, update, addfunc, mult, ztype, xytype if (is_any_pair) % never disable the any_pair_iso semiring fprintf (f, 'm4_define(`GB_disable'', `#define GB_DISABLE 0'')\n') ; + fprintf (f, 'm4_define(`GB_type_enabled'', `#define GB_TYPE_ENABLED 1'')\n'); else + codegen_type_enabled (f, fname) ; disable = sprintf ('defined(GxB_NO_%s)', upper (addop)) ; if (~isequal (addop, multop)) disable = [disable (sprintf (' || defined(GxB_NO_%s)', upper (multop)))] ; diff --git a/Source/codegen/codegen_ew.m b/Source/codegen/codegen_ew.m index 1c12605f77..72f4247e3d 100644 --- a/Source/codegen/codegen_ew.m +++ b/Source/codegen/codegen_ew.m @@ -112,6 +112,7 @@ 'GB_FC32_div (yarg, xarg)', ... % GxB_FC32_t 'GB_FC64_div (yarg, xarg)') ; ... % GxB_FC64_t +%{ codegen_ew_template ('iseq', ... [ ], ... % bool '((xarg) == (yarg))', ... % int, uint @@ -159,6 +160,7 @@ '((xarg) <= (yarg))', ... % double [ ], ... % GxB_FC32_t [ ]) ; ... % GxB_FC64_t +%} codegen_ew_template ('eq', ... '((xarg) == (yarg))', ... % bool diff --git a/Source/codegen/codegen_ew_method.m b/Source/codegen/codegen_ew_method.m index 5b36790cae..15bbc68f36 100644 --- a/Source/codegen/codegen_ew_method.m +++ b/Source/codegen/codegen_ew_method.m @@ -11,6 +11,7 @@ function codegen_ew_method (binop, op, xtype) assert (~isequal (binop, 'any')) ; [fname, unsigned, bits] = codegen_type (xtype) ; +codegen_type_enabled (f, fname) ; name = sprintf ('%s_%s', binop, fname) ; diff --git a/Source/codegen/codegen_red_method.m b/Source/codegen/codegen_red_method.m index 8d04a34196..cc3c79ff72 100644 --- a/Source/codegen/codegen_red_method.m +++ b/Source/codegen/codegen_red_method.m @@ -10,6 +10,7 @@ function codegen_red_method (opname, op, atype, identity, terminal, panel) fprintf (f, 'm4_divert(-1)\n') ; [aname, unsigned, bits] = codegen_type (atype) ; +codegen_type_enabled (f, aname) ; name = sprintf ('%s_%s', opname, aname) ; is_any = isequal (opname, 'any') ; @@ -19,12 +20,12 @@ function codegen_red_method (opname, op, atype, identity, terminal, panel) % the type of A, S, T, X, Y, and Z (no typecasting) ztype = atype ; -fprintf (f, 'm4_define(`GB_atype'', `#define GB_A_TYPE %s'')\n', atype) ; -fprintf (f, 'm4_define(`GB_stype'', `#define GB_S_TYPE %s'')\n', atype) ; -fprintf (f, 'm4_define(`GB_ttype'', `#define GB_T_TYPE %s'')\n', atype) ; -fprintf (f, 'm4_define(`GB_xtype'', `#define GB_X_TYPE %s'')\n', atype) ; -fprintf (f, 'm4_define(`GB_ytype'', `#define GB_Y_TYPE %s'')\n', atype) ; -fprintf (f, 'm4_define(`GB_ztype'', `#define GB_Z_TYPE %s'')\n', atype) ; +fprintf (f, 'm4_define(`GB_atype'', `#define GB_A_TYPE %s'')\n', atype) ; +fprintf (f, 'm4_define(`GB_stype'', `#define GB_Sx_TYPE %s'')\n', atype) ; +fprintf (f, 'm4_define(`GB_ttype'', `#define GB_Tx_TYPE %s'')\n', atype) ; +fprintf (f, 'm4_define(`GB_xtype'', `#define GB_X_TYPE %s'')\n', atype) ; +fprintf (f, 'm4_define(`GB_ytype'', `#define GB_Y_TYPE %s'')\n', atype) ; +fprintf (f, 'm4_define(`GB_ztype'', `#define GB_Z_TYPE %s'')\n', atype) ; fprintf (f, 'm4_define(`GB_atype_parameter'', `%s'')\n', atype) ; fprintf (f, 'm4_define(`GB_stype_parameter'', `%s'')\n', atype) ; diff --git a/Source/codegen/codegen_type_enabled.m b/Source/codegen/codegen_type_enabled.m new file mode 100644 index 0000000000..7a52c521ef --- /dev/null +++ b/Source/codegen/codegen_type_enabled.m @@ -0,0 +1,4 @@ +function codegen_type_enabled (f, fname) +% CODEGEN_TYPE_ENABLED create the GB_TYPE_ENABLED macro + +fprintf (f, 'm4_define(`GB_type_enabled'', `#if defined (GxB_NO_%s)\n#define GB_TYPE_ENABLED 0\n#else\n#define GB_TYPE_ENABLED 1\n#endif\n'')\n', upper (fname)) ; diff --git a/Source/codegen/codegen_uop.m b/Source/codegen/codegen_uop.m index 7e3a21aae2..52ddfdfd0d 100644 --- a/Source/codegen/codegen_uop.m +++ b/Source/codegen/codegen_uop.m @@ -1,5 +1,5 @@ function codegen_uop -%CODEGEN_UNOP create functions for all unary operators +%CODEGEN_UOP create functions for all unary operators % % This function creates all files of the form GB_uop__*.[ch], % and the include file GB_uop__include.h. @@ -411,3 +411,4 @@ codegen_uop_method ('isfinite', 'GB_cisfinite (xarg)' , 'bool', 'GxB_FC64_t') ; fprintf ('\n') ; + diff --git a/Source/codegen/codegen_uop_identity.m b/Source/codegen/codegen_uop_identity.m index 903bc427fb..d0de1fde6f 100644 --- a/Source/codegen/codegen_uop_identity.m +++ b/Source/codegen/codegen_uop_identity.m @@ -1,5 +1,5 @@ function codegen_uop_identity -%CODEGEN_UNOP_IDENTITY create identity functions +%CODEGEN_UOP_IDENTITY create identity functions % % The 'identity' operator is unique: it is used for typecasting, and all 13*13 % pairs of functions are generated. @@ -109,3 +109,4 @@ end end + diff --git a/Source/codegen/codegen_uop_method.m b/Source/codegen/codegen_uop_method.m index defb330f7a..7642d0ffdf 100644 --- a/Source/codegen/codegen_uop_method.m +++ b/Source/codegen/codegen_uop_method.m @@ -1,5 +1,5 @@ function codegen_uop_method (uop, op, ztype, xtype) -%CODEGEN_UNOP_METHOD create a function to compute C=uop(A) +%CODEGEN_UOP_METHOD create a function to compute C=uop(A) % % codegen_uop_method (uop, op, ztype, xtype) % @@ -31,6 +31,13 @@ function codegen_uop_method (uop, op, ztype, xtype) fprintf (f, 'm4_define(`if_uop_apply_enabled'', `0'')\n') ; end +if (is_identity) + % identity ops are never disabled + fprintf (f, 'm4_define(`GB_type_enabled'', `#define GB_TYPE_ENABLED 1'')\n'); +else + codegen_type_enabled (f, xname) ; +end + % function names fprintf (f, 'm4_define(`_uop_tran'', `_uop_tran__%s'')\n', name) ; @@ -86,3 +93,4 @@ function codegen_uop_method (uop, op, ztype, xtype) delete ('control.m4') ; + diff --git a/Source/compatible/GB_BinaryOp_compatible.c b/Source/compatible/GB_BinaryOp_compatible.c index 1b73a584f4..27c036ee49 100644 --- a/Source/compatible/GB_BinaryOp_compatible.c +++ b/Source/compatible/GB_BinaryOp_compatible.c @@ -34,7 +34,7 @@ GrB_Info GB_BinaryOp_compatible // check for domain mismatch ASSERT (bcode <= GB_UDT_code) ; GB_Opcode opcode = op->opcode ; bool op_is_pair_or_positional = (opcode == GB_PAIR_binop_code) - || GB_OPCODE_IS_POSITIONAL (opcode) ; + || GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; //-------------------------------------------------------------------------- // first input A is cast into the type of op->xtype diff --git a/Source/concat/GB_concat.c b/Source/concat/GB_concat.c index 1dc7999910..935e5e877b 100644 --- a/Source/concat/GB_concat.c +++ b/Source/concat/GB_concat.c @@ -197,8 +197,8 @@ GrB_Info GB_concat // concatenate a 2D array of matrices // replace Tile_rows and Tile_cols with their cumulative sum //-------------------------------------------------------------------------- - GB_cumsum (Tile_rows, m, NULL, 1, Werk) ; - GB_cumsum (Tile_cols, n, NULL, 1, Werk) ; + GB_cumsum1 (Tile_rows, m) ; + GB_cumsum1 (Tile_cols, n) ; int64_t cnrows = Tile_rows [m] ; int64_t cncols = Tile_cols [n] ; if (cnrows != GB_NROWS (C) || cncols != GB_NCOLS (C)) @@ -226,7 +226,8 @@ GrB_Info GB_concat // concatenate a 2D array of matrices GB_OK (GB_concat_full (C, C_iso, cscalar, Tiles, m, n, Tile_rows, Tile_cols, Werk)) ; } - else if (GB_convert_s2b_test (C->bitmap_switch, cnz, cnrows, cncols)) + else if (GB_convert_sparse_to_bitmap_test (C->bitmap_switch, + cnz, cnrows, cncols)) { // construct C as bitmap GBURBLE ("(%sbitmap concat) ", C_iso ? "iso " : "") ; diff --git a/Source/concat/GB_concat_bitmap.c b/Source/concat/GB_concat_bitmap.c index b0777ae2d5..d090689d67 100644 --- a/Source/concat/GB_concat_bitmap.c +++ b/Source/concat/GB_concat_bitmap.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #define GB_FREE_WORKSPACE \ GB_WERK_POP (A_ek_slicing, int64_t) ; \ GB_Matrix_free (&T) ; @@ -236,6 +234,7 @@ GrB_Info GB_concat_bitmap // concatenate into a bitmap matrix if (info == GrB_NO_VALUE) { // with typecasting or user-defined types + GBURBLE ("(generic concat) ") ; GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; size_t asize = A->type->size ; #define GB_C_TYPE GB_void diff --git a/Source/concat/GB_concat_full.c b/Source/concat/GB_concat_full.c index 52621b1664..f00835a510 100644 --- a/Source/concat/GB_concat_full.c +++ b/Source/concat/GB_concat_full.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #define GB_FREE_WORKSPACE \ GB_Matrix_free (&T) ; @@ -220,6 +218,7 @@ GrB_Info GB_concat_full // concatenate into a full matrix if (info == GrB_NO_VALUE) { // with typecasting or user-defined types + GBURBLE ("(generic concat) ") ; GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; size_t asize = A->type->size ; #define GB_C_TYPE GB_void diff --git a/Source/concat/GB_concat_hyper.c b/Source/concat/GB_concat_hyper.c index fb59770f09..ca3e4e8de9 100644 --- a/Source/concat/GB_concat_hyper.c +++ b/Source/concat/GB_concat_hyper.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - #define GB_FREE_ALL \ { \ GB_FREE (&Wi, Wi_size) ; \ @@ -52,7 +50,6 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix int64_t cvdim = C->vdim ; bool csc = C->is_csc ; size_t csize = ctype->size ; - GB_Type_code ccode = ctype->code ; float hyper_switch = C->hyper_switch ; float bitmap_switch = C->bitmap_switch ; @@ -133,7 +130,7 @@ GrB_Info GB_concat_hyper // concatenate into a hypersparse matrix (GrB_Index *) ((csc ? Wi : Wj) + pC), (GrB_Index *) ((csc ? Wj : Wi) + pC), (C_iso) ? NULL : (Wx + pC * csize), - (GrB_Index *) (&anz), ccode, A, Werk)) ; + (GrB_Index *) (&anz), ctype, A, Werk)) ; //------------------------------------------------------------------ // adjust the indices to reflect their new place in C diff --git a/Source/concat/GB_concat_sparse.c b/Source/concat/GB_concat_sparse.c index ee9d37015e..ad890f860e 100644 --- a/Source/concat/GB_concat_sparse.c +++ b/Source/concat/GB_concat_sparse.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #define GB_FREE_WORKSPACE \ if (S != NULL) \ { \ @@ -419,6 +417,7 @@ GrB_Info GB_concat_sparse // concatenate into a sparse matrix if (info == GrB_NO_VALUE) { // with typecasting or user-defined types + GBURBLE ("(generic concat) ") ; GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; size_t asize = A->type->size ; #define GB_C_TYPE GB_void diff --git a/Source/concat/template/GB_concat_sparse_template.c b/Source/concat/template/GB_concat_sparse_template.c index 806875be63..4aac44f082 100644 --- a/Source/concat/template/GB_concat_sparse_template.c +++ b/Source/concat/template/GB_concat_sparse_template.c @@ -51,8 +51,9 @@ // find the part of the kth vector A(:,j) for this task //------------------------------------------------------------------ +#if 0 int64_t pA_start, pA_end ; - // as done by GB_get_pA, but also get p0 = Ap [k] + // as done by GB_GET_PA, but also get p0 = Ap [k] const int64_t p0 = GBP_A (Ap, k, avlen) ; const int64_t p1 = GBP_A (Ap, k+1, avlen) ; if (k == kfirst) @@ -73,6 +74,11 @@ pA_start = p0 ; pA_end = p1 ; } +#endif + + const int64_t p0 = GBP_A (Ap, k, avlen) ; + GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, + p0, GBP_A (Ap, k+1, avlen)) ; //------------------------------------------------------------------ // append A(:,j) onto C(:,j) diff --git a/Source/convert/GB_conform.c b/Source/convert/GB_conform.c index 7e4a0072e8..bfb0d707ab 100644 --- a/Source/convert/GB_conform.c +++ b/Source/convert/GB_conform.c @@ -2,7 +2,7 @@ // GB_conform: conform any matrix to its desired sparsity structure //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -30,7 +30,7 @@ static inline GrB_Info GB_conform_hyper_or_bitmap { GrB_Info info ; if (is_full || ((is_hyper || is_sparse) && - GB_convert_s2b_test (A->bitmap_switch, + GB_convert_sparse_to_bitmap_test (A->bitmap_switch, GB_nnz (A), A->vlen, A->vdim))) { // if full or sparse/hypersparse with many entries: to bitmap @@ -58,7 +58,7 @@ static inline GrB_Info GB_conform_sparse_or_bitmap { GrB_Info info ; if (is_full || ((is_hyper || is_sparse) && - GB_convert_s2b_test (A->bitmap_switch, + GB_convert_sparse_to_bitmap_test (A->bitmap_switch, GB_nnz (A), A->vlen, A->vdim))) { // if full or sparse/hypersparse with many entries: to bitmap @@ -86,7 +86,7 @@ static inline GrB_Info GB_conform_hyper_sparse_or_bitmap { GrB_Info info ; if (is_full || ((is_hyper || is_sparse) && - GB_convert_s2b_test (A->bitmap_switch, + GB_convert_sparse_to_bitmap_test (A->bitmap_switch, GB_nnz (A), A->vlen, A->vdim))) { // if full or sparse/hypersparse with many entries: to bitmap diff --git a/Source/convert/GB_convert.h b/Source/convert/GB_convert.h index 19fd07a5ec..3fe6273e1d 100644 --- a/Source/convert/GB_convert.h +++ b/Source/convert/GB_convert.h @@ -82,7 +82,7 @@ bool GB_convert_bitmap_to_sparse_test // test for hyper/sparse to bitmap int64_t vdim // A->vdim ) ; -bool GB_convert_s2b_test // test for hyper/sparse to bitmap +bool GB_convert_sparse_to_bitmap_test // test for hyper/sparse to bitmap ( float bitmap_switch, // A->bitmap_switch int64_t anz, // # of entries in A = GB_nnz (A) @@ -112,15 +112,16 @@ GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse GB_Werk Werk ) ; -GrB_Info GB_convert_bitmap_worker // extract CSC/CSR or triplets from bitmap +GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap ( // outputs: - int64_t *restrict Ap, // vector pointers for CSC/CSR form - int64_t *restrict Ai, // indices for CSC/CSR or triplet form - int64_t *restrict Aj, // vector indices for triplet form - GB_void *restrict Ax_new, // values for CSC/CSR or triplet form - int64_t *anvec_nonempty, // # of non-empty vectors + int64_t *restrict Cp, // vector pointers for CSC/CSR form + int64_t *restrict Ci, // indices for CSC/CSR or triplet form + int64_t *restrict Cj, // vector indices for triplet form + GB_void *restrict Cx, // values for CSC/CSR or triplet form + int64_t *cnvec_nonempty, // # of non-empty vectors // inputs: not modified + const GrB_Type ctype, // type of Cx const GrB_Matrix A, // matrix to extract; not modified GB_Werk Werk ) ; diff --git a/Source/convert/GB_convert_any_to_non_iso.c b/Source/convert/GB_convert_any_to_non_iso.c index 6ae3479335..f39e4b7bf3 100644 --- a/Source/convert/GB_convert_any_to_non_iso.c +++ b/Source/convert/GB_convert_any_to_non_iso.c @@ -8,6 +8,7 @@ //------------------------------------------------------------------------------ #include "GB.h" +#define GB_FREE_ALL ; GrB_Info GB_convert_any_to_non_iso // convert iso matrix to non-iso ( @@ -21,6 +22,7 @@ GrB_Info GB_convert_any_to_non_iso // convert iso matrix to non-iso // check inputs //-------------------------------------------------------------------------- + GrB_Info info ; ASSERT_MATRIX_OK (A, "A to convert to non-iso", GB0) ; if (!A->iso) { @@ -69,7 +71,7 @@ GrB_Info GB_convert_any_to_non_iso // convert iso matrix to non-iso if (initialize) { // Ax [0:anz-1] = scalar - GB_expand_iso (A->x, anz, scalar, asize) ; + GB_OK (GB_iso_expand (A->x, anz, scalar, A->type)) ; } else { diff --git a/Source/convert/GB_convert_bitmap_worker.c b/Source/convert/GB_convert_b2s.c similarity index 50% rename from Source/convert/GB_convert_bitmap_worker.c rename to Source/convert/GB_convert_b2s.c index c1955af296..651bc4ba88 100644 --- a/Source/convert/GB_convert_bitmap_worker.c +++ b/Source/convert/GB_convert_b2s.c @@ -1,33 +1,32 @@ //------------------------------------------------------------------------------ -// GB_convert_bitmap_worker: construct triplets or CSC/CSR from bitmap +// GB_convert_b2s: construct triplets or CSC/CSR from bitmap //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - -// If A is iso and Ax_new is not NULL, the iso scalar is expanded into the -// non-iso array Ax_new. Otherwise, if Ax_new and Ax are NULL then no values -// are extracted. - -// TODO allow this function to do typecasting. +// Constructs a triplet or CSC/CSR form (in Cp, Ci, Cj, and Cx_new) from the +// bitmap input matrix A. If A is iso or Cx_new is NULL then no values are +// extracted. The iso case is handled by the caller. #include "GB.h" -#include "slice/include/GB_partition.h" #include "include/GB_unused.h" +#include "jitifyer/GB_stringify.h" +#include "unaryop/GB_unop.h" +#define GB_FREE_ALL GB_FREE_WORK (&W, W_size) ; -GrB_Info GB_convert_bitmap_worker // extract CSC/CSR or triplets from bitmap +GrB_Info GB_convert_b2s // extract CSC/CSR or triplets from bitmap ( // outputs: - int64_t *restrict Ap, // vector pointers for CSC/CSR form - int64_t *restrict Ai, // indices for CSC/CSR or triplet form - int64_t *restrict Aj, // vector indices for triplet form - GB_void *restrict Ax_new, // values for CSC/CSR or triplet form - int64_t *anvec_nonempty, // # of non-empty vectors + int64_t *restrict Cp, // vector pointers for CSC/CSR form + int64_t *restrict Ci, // indices for CSC/CSR or triplet form + int64_t *restrict Cj, // vector indices for triplet form + GB_void *restrict Cx_new, // values for CSC/CSR or triplet form + int64_t *cnvec_nonempty, // # of non-empty vectors // inputs: not modified + const GrB_Type ctype, // type of Cx const GrB_Matrix A, // matrix to extract; not modified GB_Werk Werk ) @@ -38,17 +37,18 @@ GrB_Info GB_convert_bitmap_worker // extract CSC/CSR or triplets from bitmap //-------------------------------------------------------------------------- ASSERT (GB_IS_BITMAP (A)) ; - ASSERT (Ap != NULL) ; // must be provided on input, size avdim+1 + ASSERT (Cp != NULL) ; // must be provided on input, size avdim+1 + ASSERT_MATRIX_OK (A, "A for b2s", GB0) ; + ASSERT_TYPE_OK (ctype, "ctype for b2s", GB0) ; + + //-------------------------------------------------------------------------- + // get inputs and determine tasks + //-------------------------------------------------------------------------- int64_t *restrict W = NULL ; size_t W_size = 0 ; const int64_t avdim = A->vdim ; const int64_t avlen = A->vlen ; const size_t asize = A->type->size ; - - //-------------------------------------------------------------------------- - // count the entries in each vector - //-------------------------------------------------------------------------- - const int8_t *restrict Ab = A->b ; int nthreads_max = GB_Context_nthreads_max ( ) ; @@ -56,6 +56,10 @@ GrB_Info GB_convert_bitmap_worker // extract CSC/CSR or triplets from bitmap int nthreads = GB_nthreads (avlen*avdim, chunk, nthreads_max) ; bool by_vector = (nthreads <= avdim) ; + //-------------------------------------------------------------------------- + // count the entries in each vector + //-------------------------------------------------------------------------- + if (by_vector) { @@ -77,7 +81,7 @@ GrB_Info GB_convert_bitmap_worker // extract CSC/CSR or triplets from bitmap ajnz += Ab [p] ; ASSERT (Ab [p] == 0 || Ab [p] == 1) ; } - Ap [j] = ajnz ; + Cp [j] = ajnz ; } } @@ -132,101 +136,127 @@ GrB_Info GB_convert_bitmap_worker // extract CSC/CSR or triplets from bitmap Wtask [j] = ajnz ; ajnz += c ; } - Ap [j] = ajnz ; + Cp [j] = ajnz ; } } //-------------------------------------------------------------------------- - // cumulative sum of Ap + // cumulative sum of Cp //-------------------------------------------------------------------------- int nth = GB_nthreads (avdim, chunk, nthreads_max) ; - GB_cumsum (Ap, avdim, anvec_nonempty, nth, Werk) ; - ASSERT (Ap [avdim] == A->nvals) ; + GB_cumsum (Cp, avdim, cnvec_nonempty, nth, Werk) ; + ASSERT (Cp [avdim] == A->nvals) ; //-------------------------------------------------------------------------- // gather the pattern and values from the bitmap //-------------------------------------------------------------------------- - // TODO: add type-specific versions for built-in types - + GrB_Info info = GrB_NO_VALUE ; const GB_void *restrict Ax = (GB_void *) (A->x) ; - const bool A_iso = A->iso ; - const bool numeric = (Ax_new != NULL && Ax != NULL) ; - if (by_vector) - { + if (Cx_new == NULL || Ax == NULL || A->iso) + { //---------------------------------------------------------------------- - // construct all vectors in parallel (no workspace) + // via the symbolic kernel //---------------------------------------------------------------------- - int64_t j ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (j = 0 ; j < avdim ; j++) - { - // gather from the bitmap into the new A (:,j) - int64_t pnew = Ap [j] ; - int64_t pA_start = j * avlen ; - for (int64_t i = 0 ; i < avlen ; i++) - { - int64_t p = i + pA_start ; - if (Ab [p]) - { - // A(i,j) is in the bitmap - if (Ai != NULL) Ai [pnew] = i ; - if (Aj != NULL) Aj [pnew] = j ; - if (numeric) - { - // Ax_new [pnew] = Ax [p]) - memcpy (Ax_new +(pnew)*asize, - Ax +(A_iso ? 0:(p)*asize), asize) ; - } - pnew++ ; - } - } - ASSERT (pnew == Ap [j+1]) ; - } + #undef GB_COPY + #define GB_COPY(Cx,pC,Ax,pA) + #include "convert/template/GB_convert_b2s_template.c" + info = GrB_SUCCESS ; } else { //---------------------------------------------------------------------- - // compute blocks of rows in parallel + // via the factory kernel //---------------------------------------------------------------------- - int taskid ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (taskid = 0 ; taskid < nthreads ; taskid++) + if (ctype == A->type) { - int64_t *restrict Wtask = W + taskid * avdim ; - int64_t istart, iend ; - GB_PARTITION (istart, iend, avlen, taskid, nthreads) ; - for (int64_t j = 0 ; j < avdim ; j++) - { - // gather from the bitmap into the new A (:,j) - int64_t pnew = Ap [j] + Wtask [j] ; - int64_t pA_start = j * avlen ; - for (int64_t i = istart ; i < iend ; i++) + + #undef GB_COPY + #define GB_COPY(Cx,pC,Ax,pA) Cx [pC] = Ax [pA] ; + + #ifndef GBCOMPACT + GB_IF_FACTORY_KERNELS_ENABLED + { + switch (asize) { - // see if A(i,j) is present in the bitmap - int64_t p = i + pA_start ; - if (Ab [p]) - { - // A(i,j) is in the bitmap - if (Ai != NULL) Ai [pnew] = i ; - if (Aj != NULL) Aj [pnew] = j ; - if (numeric) - { - // Ax_new [pnew] = Ax [p] ; - memcpy (Ax_new +(pnew)*asize, - Ax +(A_iso ? 0:(p)*asize), asize) ; - } - pnew++ ; - } + + case GB_1BYTE : // uint8, int8, bool, or 1-byte user + #define GB_C_TYPE uint8_t + #define GB_A_TYPE uint8_t + #include "convert/template/GB_convert_b2s_template.c" + info = GrB_SUCCESS ; + break ; + + case GB_2BYTE : // uint16, int16, or 2-byte user-defined + #define GB_C_TYPE uint16_t + #define GB_A_TYPE uint16_t + #include "convert/template/GB_convert_b2s_template.c" + info = GrB_SUCCESS ; + break ; + + case GB_4BYTE : // uint32, int32, float, or 4-byte user + #define GB_C_TYPE uint32_t + #define GB_A_TYPE uint32_t + #include "convert/template/GB_convert_b2s_template.c" + info = GrB_SUCCESS ; + break ; + + case GB_8BYTE : // uint64, int64, double, float complex, + // or 8-byte user defined + #define GB_C_TYPE uint64_t + #define GB_A_TYPE uint64_t + #include "convert/template/GB_convert_b2s_template.c" + info = GrB_SUCCESS ; + break ; + + case GB_16BYTE : // double complex or 16-byte user-defined + #define GB_C_TYPE GB_blob16 + #define GB_A_TYPE GB_blob16 + #include "convert/template/GB_convert_b2s_template.c" + info = GrB_SUCCESS ; + break ; + + default:; } } + #endif + } + + //---------------------------------------------------------------------- + // via the JIT kernel + //---------------------------------------------------------------------- + + if (info == GrB_NO_VALUE) + { + struct GB_UnaryOp_opaque op_header ; + GB_Operator op = GB_unop_identity (ctype, &op_header) ; + info = GB_convert_b2s_jit (Cp, Ci, Cj, Cx_new, ctype, op, A, + W, nthreads) ; + } + + //---------------------------------------------------------------------- + // via the generic kernel + //---------------------------------------------------------------------- + + if (info == GrB_NO_VALUE) + { + GB_Type_code ccode = ctype->code ; + GB_Type_code acode = A->type->code ; + const size_t csize = ctype->size ; + GB_cast_function cast_A_to_C = GB_cast_factory (ccode, acode) ; + GB_void *restrict Cx = (GB_void *) Cx_new ; + #undef GB_COPY + #define GB_COPY(Cx,pC,Ax,pA) \ + cast_A_to_C (Cx +(pC)*csize, Ax +(pA)*asize, asize) + #include "convert/template/GB_convert_b2s_template.c" + info = GrB_SUCCESS ; } } @@ -234,7 +264,7 @@ GrB_Info GB_convert_bitmap_worker // extract CSC/CSR or triplets from bitmap // free workspace return result //-------------------------------------------------------------------------- - GB_FREE_WORK (&W, W_size) ; - return (GrB_SUCCESS) ; + GB_FREE_ALL ; + return (info) ; } diff --git a/Source/convert/GB_convert_bitmap_to_sparse.c b/Source/convert/GB_convert_bitmap_to_sparse.c index a91a1d9215..75f3062933 100644 --- a/Source/convert/GB_convert_bitmap_to_sparse.c +++ b/Source/convert/GB_convert_bitmap_to_sparse.c @@ -11,9 +11,9 @@ #define GB_FREE_ALL \ { \ - GB_FREE (&Ap, Ap_size) ; \ - GB_FREE (&Ai, Ai_size) ; \ - GB_FREE (&Ax, Ax_size) ; \ + GB_FREE (&Cp, Cp_size) ; \ + GB_FREE (&Ci, Ci_size) ; \ + GB_FREE (&Cx, Cx_size) ; \ } GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse @@ -38,46 +38,46 @@ GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse ASSERT (!GB_ZOMBIES (A)) ; // bitmap never has zomies //-------------------------------------------------------------------------- - // allocate Ap, Ai, and Ax + // allocate Cp, Ci, and Cx //-------------------------------------------------------------------------- const int64_t anvals = A->nvals ; GB_BURBLE_N (anvals, "(bitmap to sparse) ") ; const int64_t anzmax = GB_IMAX (anvals, 1) ; - int64_t anvec_nonempty ; + int64_t cnvec_nonempty ; const int64_t avdim = A->vdim ; const size_t asize = A->type->size ; - int64_t *restrict Ap = NULL ; size_t Ap_size = 0 ; - int64_t *restrict Ai = NULL ; size_t Ai_size = 0 ; - GB_void *restrict Ax = NULL ; size_t Ax_size = 0 ; - Ap = GB_MALLOC (avdim+1, int64_t, &Ap_size) ; - Ai = GB_MALLOC (anzmax, int64_t, &Ai_size) ; - if (Ap == NULL || Ai == NULL) + int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; + int64_t *restrict Ci = NULL ; size_t Ci_size = 0 ; + GB_void *restrict Cx = NULL ; size_t Cx_size = 0 ; + Cp = GB_MALLOC (avdim+1, int64_t, &Cp_size) ; + Ci = GB_MALLOC (anzmax, int64_t, &Ci_size) ; + if (Cp == NULL || Ci == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - bool Ax_shallow ; + bool Cx_shallow ; const bool A_iso = A->iso ; if (A_iso) { // A is iso. Remove A->x from the matrix so it is not freed by - // GB_phybix_free. It is not modified by GB_convert_bitmap_worker, and - // is transplanted back into A, below. - Ax = (GB_void *) A->x ; - Ax_shallow = A->x_shallow ; - Ax_size = A->x_size ; + // GB_phybix_free. It is not modified by GB_convert_b2s, and is + // transplanted back into A, below. + Cx = (GB_void *) A->x ; + Cx_shallow = A->x_shallow ; + Cx_size = A->x_size ; A->x = NULL ; } else { - // A is not iso. Allocate new space for Ax, which is filled by - // GB_convert_bitmap_worker. - Ax = GB_MALLOC (anzmax * asize, GB_void, &Ax_size) ; // x:OK - Ax_shallow = false ; - if (Ax == NULL) + // A is not iso. Allocate new space for Cx, which is filled by + // GB_convert_b2s. + Cx = GB_MALLOC (anzmax * asize, GB_void, &Cx_size) ; + Cx_shallow = false ; + if (Cx == NULL) { // out of memory GB_FREE_ALL ; @@ -86,27 +86,29 @@ GrB_Info GB_convert_bitmap_to_sparse // convert matrix from bitmap to sparse } //-------------------------------------------------------------------------- - // convert to sparse format (Ap, Ai, and Ax) + // convert to sparse format (Cp, Ci, and Cx) //-------------------------------------------------------------------------- + // Cx and A->x always have the same type + // the values are not converted if A is iso - GB_OK (GB_convert_bitmap_worker (Ap, Ai, NULL, (A_iso) ? NULL : Ax, - &anvec_nonempty, A, Werk)) ; + GB_OK (GB_convert_b2s (Cp, Ci, NULL, (A_iso) ? NULL : Cx, + &cnvec_nonempty, A->type, A, Werk)) ; //-------------------------------------------------------------------------- // free prior content of A and transplant the new content //-------------------------------------------------------------------------- GB_phybix_free (A) ; // clears A->nvals - A->p = Ap ; A->p_size = Ap_size ; A->p_shallow = false ; - A->i = Ai ; A->i_size = Ai_size ; A->i_shallow = false ; - A->x = Ax ; A->x_size = Ax_size ; A->x_shallow = Ax_shallow ; - A->iso = A_iso ; // OK: convert_bitmap_to_sparse, keep iso + A->p = Cp ; A->p_size = Cp_size ; A->p_shallow = false ; + A->i = Ci ; A->i_size = Ci_size ; A->i_shallow = false ; + A->x = Cx ; A->x_size = Cx_size ; A->x_shallow = Cx_shallow ; + A->iso = A_iso ; A->nvals = anvals ; - ASSERT (A->nvals == Ap [avdim]) ; + ASSERT (A->nvals == Cp [avdim]) ; A->plen = avdim ; A->nvec = avdim ; - A->nvec_nonempty = anvec_nonempty ; + A->nvec_nonempty = cnvec_nonempty ; A->magic = GB_MAGIC ; //-------------------------------------------------------------------------- diff --git a/Source/convert/GB_convert_full_to_sparse.c b/Source/convert/GB_convert_full_to_sparse.c index 3b118f7c2c..074a4b34d8 100644 --- a/Source/convert/GB_convert_full_to_sparse.c +++ b/Source/convert/GB_convert_full_to_sparse.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - #include "GB.h" GrB_Info GB_convert_full_to_sparse // convert matrix from full to sparse diff --git a/Source/convert/GB_convert_hyper_to_sparse.c b/Source/convert/GB_convert_hyper_to_sparse.c index 5982ac92fe..cb4f758d46 100644 --- a/Source/convert/GB_convert_hyper_to_sparse.c +++ b/Source/convert/GB_convert_hyper_to_sparse.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // On input, the matrix may have shallow A->p and A->h content; it is safely // removed. On output, the matrix is always non-hypersparse (even if out of // memory). If the input matrix is hypersparse, it is given a new A->p that is @@ -238,7 +236,7 @@ GrB_Info GB_convert_hyper_to_sparse // convert hypersparse to sparse } } - // free the old A->p, A->h, and A->H hyperlist content. + // free the old A->p, A->h, and A->Y hyperlist content. // this clears A->nvec_nonempty so it must be restored below. GB_phy_free (A) ; diff --git a/Source/convert/GB_convert_s2b.c b/Source/convert/GB_convert_s2b.c index 9f92724189..a65cf1b52a 100644 --- a/Source/convert/GB_convert_s2b.c +++ b/Source/convert/GB_convert_s2b.c @@ -7,9 +7,8 @@ //------------------------------------------------------------------------------ -// JIT: done. - // The matrix A is converted from sparse/hypersparse to bitmap. + // FUTURE: A could also be typecasted and/or a unary operator applied, // via the JIT kernel. @@ -25,8 +24,8 @@ #define GB_FREE_ALL \ { \ GB_FREE_WORKSPACE ; \ - GB_FREE (&Ax_new, Ax_size) ; \ - GB_FREE (&Ab, Ab_size) ; \ + GB_FREE (&Cx_new, Cx_size) ; \ + GB_FREE (&Cb, Cb_size) ; \ } GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap @@ -42,8 +41,8 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap GrB_Info info ; GB_WERK_DECLARE (A_ek_slicing, int64_t) ; - int8_t *restrict Ab = NULL ; size_t Ab_size = 0 ; - GB_void *restrict Ax_new = NULL ; size_t Ax_size = 0 ; + int8_t *restrict Cb = NULL ; size_t Cb_size = 0 ; + GB_void *restrict Cx_new = NULL ; size_t Cx_size = 0 ; GB_void *restrict Ax_keep = NULL ; ASSERT_MATRIX_OK (A, "A converting sparse/hypersparse to bitmap", GB0) ; @@ -71,7 +70,7 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap bool in_place = A_as_if_full || A_iso ; //-------------------------------------------------------------------------- - // allocate A->b + // allocate Cb //-------------------------------------------------------------------------- const int64_t anz = GB_nnz (A) ; @@ -85,8 +84,8 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap return (GrB_OUT_OF_MEMORY) ; } anzmax = GB_IMAX (anzmax, 1) ; - Ab = GB_MALLOC (anzmax, int8_t, &Ab_size) ; - if (Ab == NULL) + Cb = GB_MALLOC (anzmax, int8_t, &Cb_size) ; + if (Cb == NULL) { // out of memory return (GrB_OUT_OF_MEMORY) ; @@ -103,22 +102,22 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap { // keep the existing A->x Ax_keep = (GB_void *) A->x ; - Ax_shallow = A->x_shallow ; Ax_size = A->x_size ; + Ax_shallow = A->x_shallow ; Cx_size = A->x_size ; } else { // A->x must be modified to fit the bitmap structure. A->x is calloc'd // since otherwise it would contain uninitialized values where A->b is // false and entries are not present. - Ax_new = GB_CALLOC (anzmax * asize, GB_void, &Ax_size) ; // x:OK:calloc + Cx_new = GB_CALLOC (anzmax * asize, GB_void, &Cx_size) ; Ax_shallow = false ; - if (Ax_new == NULL) + if (Cx_new == NULL) { // out of memory GB_FREE_ALL ; return (GrB_OUT_OF_MEMORY) ; } - Ax_keep = Ax_new ; + Ax_keep = Cx_new ; } //-------------------------------------------------------------------------- @@ -134,8 +133,8 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap //---------------------------------------------------------------------- ASSERT (nzombies == 0) ; - // set all of Ab [0..anz-1] to 1, in parallel - GB_memset (Ab, 1, anz, nthreads_max) ; + // set all of Cb [0..anz-1] to 1, in parallel + GB_memset (Cb, 1, anz, nthreads_max) ; info = GrB_SUCCESS ; } @@ -143,10 +142,10 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap { //---------------------------------------------------------------------- - // set all of Ab to zero + // set all of Cb to zero //---------------------------------------------------------------------- - GB_memset (Ab, 0, anzmax, nthreads_max) ; + GB_memset (Cb, 0, anzmax, nthreads_max) ; //---------------------------------------------------------------------- // scatter the values and pattern of A into the bitmap @@ -159,23 +158,31 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap if (A_iso) { + + //------------------------------------------------------------------ + // via the iso kernel + //------------------------------------------------------------------ + // A is iso; numerical entries are not modified #undef GB_COPY - #define GB_COPY(Axnew,pnew,Ax,p) ; + #define GB_COPY(Cx,pC,Ax,pA) ; #include "convert/template/GB_convert_s2b_template.c" info = GrB_SUCCESS ; } else { + //------------------------------------------------------------------ + // via the built-in kernel + //------------------------------------------------------------------ + #ifndef GBCOMPACT GB_IF_FACTORY_KERNELS_ENABLED { switch (asize) { #undef GB_COPY - #define GB_COPY(Axnew,pnew,Ax,p) \ - Axnew [pnew] = Ax [p] ; + #define GB_COPY(Cx,pC,Ax,pA) Cx [pC] = Ax [pA] ; case GB_1BYTE : // uint8, int8, bool, or 1-byte user #define GB_A_TYPE uint8_t @@ -222,7 +229,7 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap struct GB_UnaryOp_opaque op_header ; GB_Operator op = GB_unop_identity (A->type, &op_header) ; ASSERT_OP_OK (op, "identity op for convert s2b", GB0) ; - info = GB_convert_s2b_jit (Ax_new, Ab, op, + info = GB_convert_s2b_jit (Cx_new, Cb, op, A, A_ek_slicing, A_ntasks, A_nthreads) ; } @@ -233,10 +240,11 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap if (info == GrB_NO_VALUE) { // with user-defined types of other sizes + GBURBLE ("(generic convert) ") ; #define GB_A_TYPE GB_void #undef GB_COPY - #define GB_COPY(Axnew,pnew,Ax,p) \ - memcpy (Axnew +(pnew)*asize, Ax +(p)*asize, asize) + #define GB_COPY(Cx,pC,Ax,pA) \ + memcpy (Cx +(pC)*asize, Ax +(pA)*asize, asize) #include "convert/template/GB_convert_s2b_template.c" info = GrB_SUCCESS ; } @@ -264,10 +272,10 @@ GrB_Info GB_convert_s2b // convert sparse/hypersparse to bitmap GB_phybix_free (A) ; A->iso = A_iso ; // OK: convert_s2b, keep iso - A->b = Ab ; A->b_size = Ab_size ; A->b_shallow = false ; - Ab = NULL ; + A->b = Cb ; A->b_size = Cb_size ; A->b_shallow = false ; + Cb = NULL ; - A->x = Ax_keep ; A->x_size = Ax_size ; A->x_shallow = Ax_shallow ; + A->x = Ax_keep ; A->x_size = Cx_size ; A->x_shallow = Ax_shallow ; A->nvals = anz - nzombies ; ASSERT (A->nzombies == 0) ; diff --git a/Source/convert/GB_convert_s2b_test.c b/Source/convert/GB_convert_sparse_to_bitmap_test.c similarity index 86% rename from Source/convert/GB_convert_s2b_test.c rename to Source/convert/GB_convert_sparse_to_bitmap_test.c index 8506b5e443..0694c045b5 100644 --- a/Source/convert/GB_convert_s2b_test.c +++ b/Source/convert/GB_convert_sparse_to_bitmap_test.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_convert_s2b_test: test conversion of hyper/sparse to bitmap +// GB_convert_sparse_to_bitmap_test: test conversion of hyper/sparse to bitmap //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ #include "GB.h" -bool GB_convert_s2b_test // test for hyper/sparse to bitmap +bool GB_convert_sparse_to_bitmap_test // test for hyper/sparse to bitmap ( float bitmap_switch, // A->bitmap_switch int64_t anz, // # of entries in A = GB_nnz (A) diff --git a/Source/convert/GB_convert_sparse_to_hyper.c b/Source/convert/GB_convert_sparse_to_hyper.c index 81feb3b69e..9aa61133e1 100644 --- a/Source/convert/GB_convert_sparse_to_hyper.c +++ b/Source/convert/GB_convert_sparse_to_hyper.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // On input, the matrix may have shallow A->p content; it is safely removed. // On output, the matrix is always hypersparse (even if out of memory). If the // input matrix is non-hypersparse, it is given new A->p and A->h that are not @@ -95,7 +93,7 @@ GrB_Info GB_convert_sparse_to_hyper // convert from sparse to hypersparse // compute cumulative sum of Counts and nvec_nonempty //---------------------------------------------------------------------- - GB_cumsum (Count, ntasks, NULL, 1, NULL) ; + GB_cumsum1 (Count, ntasks) ; int64_t nvec_nonempty = Count [ntasks] ; A->nvec_nonempty = nvec_nonempty ; diff --git a/Source/convert/template/GB_convert_b2s_template.c b/Source/convert/template/GB_convert_b2s_template.c new file mode 100644 index 0000000000..c3654b9bf4 --- /dev/null +++ b/Source/convert/template/GB_convert_b2s_template.c @@ -0,0 +1,101 @@ +//------------------------------------------------------------------------------ +// GB_convert_b2s_template: construct triplets or CSC/CSR from bitmap +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + #ifdef GB_JIT_KERNEL + const int64_t avdim = A->vdim ; + const int64_t avlen = A->vlen ; + const int8_t *restrict Ab = A->b ; + #endif + + #ifdef GB_A_TYPE + const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) Cx_new ; + #endif + + //-------------------------------------------------------------------------- + // convert A from bitmap to C sparse (Cp, Ci, Cj, and Cx) + //-------------------------------------------------------------------------- + + if (W == NULL) + { + + //---------------------------------------------------------------------- + // construct all vectors in parallel (no workspace) + //---------------------------------------------------------------------- + + int64_t j ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (j = 0 ; j < avdim ; j++) + { + // gather from the bitmap into the new A (:,j) + int64_t pC = Cp [j] ; + int64_t pA_start = j * avlen ; + for (int64_t i = 0 ; i < avlen ; i++) + { + int64_t pA = i + pA_start ; + if (Ab [pA]) + { + // A(i,j) is in the bitmap + if (Ci != NULL) Ci [pC] = i ; + if (Cj != NULL) Cj [pC] = j ; + // Cx [pC] = Ax [pA]) + GB_COPY (Cx, pC, Ax, pA) ; + pC++ ; + } + } + ASSERT (pC == Cp [j+1]) ; + } + + } + else + { + + //---------------------------------------------------------------------- + // compute blocks of rows in parallel + //---------------------------------------------------------------------- + + int taskid ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (taskid = 0 ; taskid < nthreads ; taskid++) + { + const int64_t *restrict Wtask = W + taskid * avdim ; + int64_t istart, iend ; + GB_PARTITION (istart, iend, avlen, taskid, nthreads) ; + for (int64_t j = 0 ; j < avdim ; j++) + { + // gather from the bitmap into the new A (:,j) + int64_t pC = Cp [j] + Wtask [j] ; + int64_t pA_start = j * avlen ; + for (int64_t i = istart ; i < iend ; i++) + { + // see if A(i,j) is present in the bitmap + int64_t pA = i + pA_start ; + if (Ab [pA]) + { + // A(i,j) is in the bitmap + if (Ci != NULL) Ci [pC] = i ; + if (Cj != NULL) Cj [pC] = j ; + GB_COPY (Cx, pC, Ax, pA) ; + pC++ ; + } + } + } + } + } +} + +#undef GB_A_TYPE +#undef GB_C_TYPE + diff --git a/Source/convert/template/GB_convert_s2b_nozombies.c b/Source/convert/template/GB_convert_s2b_nozombies.c index 79089cbb2c..acb7e85cf8 100644 --- a/Source/convert/template/GB_convert_s2b_nozombies.c +++ b/Source/convert/template/GB_convert_s2b_nozombies.c @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------ -// A is sparse or hypersparse. Axnew and Ab have the same type as A, +// A is sparse or hypersparse. Cx and Cb have the same type as A, // and represent a bitmap format. { @@ -33,21 +33,21 @@ kfirst, klast, pstart_Aslice, Ap [k], Ap [k+1]) ; // the start of A(:,j) in the new bitmap - int64_t pA_new = j * avlen ; + int64_t pC_start = j * avlen ; //------------------------------------------------------------------ // convert A(:,j) from sparse to bitmap //------------------------------------------------------------------ - for (int64_t p = pA_start ; p < pA_end ; p++) + for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - // A(i,j) has index i, value Ax [p] - int64_t i = Ai [p] ; - int64_t pnew = i + pA_new ; + // A(i,j) has index i, value Ax [pA] + int64_t i = Ai [pA] ; + int64_t pC = i + pC_start ; // move A(i,j) to its new place in the bitmap - // Axnew [pnew] = Ax [p] - GB_COPY (Axnew, pnew, Ax, p) ; - Ab [pnew] = 1 ; + // Cx [pC] = Ax [pA] + GB_COPY (Cx, pC, Ax, pA) ; + Cb [pC] = 1 ; } } } diff --git a/Source/convert/template/GB_convert_s2b_template.c b/Source/convert/template/GB_convert_s2b_template.c index 5ff7c9d4b1..62aa626bcc 100644 --- a/Source/convert/template/GB_convert_s2b_template.c +++ b/Source/convert/template/GB_convert_s2b_template.c @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------ -// A is sparse or hypersparse. Axnew and Ab have the same type as A, +// A is sparse or hypersparse. Cx and Cb have the same type as A, // and represent a bitmap format. { @@ -21,9 +21,9 @@ const int64_t *restrict Ai = A->i ; const int64_t avlen = A->vlen ; - #if defined ( GB_A_TYPE ) + #ifdef GB_A_TYPE const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; - GB_A_TYPE *restrict Axnew = (GB_A_TYPE *) Ax_new ; + GB_A_TYPE *restrict Cx = (GB_A_TYPE *) Cx_new ; #endif //-------------------------------------------------------------------------- diff --git a/Source/convert/template/GB_convert_s2b_zombies.c b/Source/convert/template/GB_convert_s2b_zombies.c index 3b44487a25..9039b88a86 100644 --- a/Source/convert/template/GB_convert_s2b_zombies.c +++ b/Source/convert/template/GB_convert_s2b_zombies.c @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------ -// A is sparse or hypersparse. Axnew and Ab have the same type as A, +// A is sparse or hypersparse. Cx and Cb have the same type as A, // and represent a bitmap format. { @@ -40,17 +40,17 @@ // convert A(:,j) from sparse to bitmap //------------------------------------------------------------------ - for (int64_t p = pA_start ; p < pA_end ; p++) + for (int64_t pA = pA_start ; pA < pA_end ; pA++) { - // A(i,j) has index i, value Ax [p] - int64_t i = Ai [p] ; + // A(i,j) has index i, value Ax [pA] + int64_t i = Ai [pA] ; if (!GB_IS_ZOMBIE (i)) { - int64_t pnew = i + pA_new ; + int64_t pC = i + pA_new ; // move A(i,j) to its new place in the bitmap - // Axnew [pnew] = Ax [p] - GB_COPY (Axnew, pnew, Ax, p) ; - Ab [pnew] = 1 ; + // Cx [pC] = Ax [pA] + GB_COPY (Cx, pC, Ax, pA) ; + Cb [pC] = 1 ; } } } diff --git a/Source/cumsum/GB_cumsum.c b/Source/cumsum/GB_cumsum.c index 82b3db9108..5c3efb3da5 100644 --- a/Source/cumsum/GB_cumsum.c +++ b/Source/cumsum/GB_cumsum.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Compute the cumulative sum of an array count[0:n], of size n+1: // k = sum (count [0:n-1] != 0) ; @@ -65,14 +63,7 @@ void GB_cumsum // cumulative sum of an array // cumsum with one thread //------------------------------------------------------------------ - int64_t s = 0 ; - for (int64_t i = 0 ; i < n ; i++) - { - int64_t c = count [i] ; - count [i] = s ; - s += c ; - } - count [n] = s ; + GB_cumsum1 (count, n) ; } else @@ -88,7 +79,7 @@ void GB_cumsum // cumulative sum of an array if (ws == NULL) { // out of memory; use a single thread instead - GB_cumsum (count, n, NULL, 1, NULL) ; + GB_cumsum1 (count, n) ; return ; } diff --git a/Source/cumsum/GB_cumsum.h b/Source/cumsum/GB_cumsum.h index a06f3016aa..21d1687c60 100644 --- a/Source/cumsum/GB_cumsum.h +++ b/Source/cumsum/GB_cumsum.h @@ -10,6 +10,8 @@ #ifndef GB_CUMSUM_H #define GB_CUMSUM_H +#include "include/GB_cumsum1.h" + void GB_cumsum // cumulative sum of an array ( int64_t *restrict count, // size n+1, input/output diff --git a/Source/cumsum/include/GB_cumsum1.h b/Source/cumsum/include/GB_cumsum1.h new file mode 100644 index 0000000000..d261d5cef1 --- /dev/null +++ b/Source/cumsum/include/GB_cumsum1.h @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// GB_cumsum1: cumlative sum of an array (single threaded) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Compute the cumulative sum of an array count[0:n], of size n+1: + +// count = cumsum ([0 count[0:n-1]]) ; + +// That is, count [j] on input is overwritten with sum (count [0..j-1]). +// On input, count [n] is not accessed and is implicitly zero on input. +// On output, count [n] is the total sum. + +#ifndef GB_CUMSUM1_H +#define GB_CUMSUM1_H + +static inline void GB_cumsum1 // cumulative sum of an array +( + int64_t *restrict count, // size n+1, input/output + const int64_t n +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + ASSERT (count != NULL) ; + ASSERT (n >= 0) ; + + //-------------------------------------------------------------------------- + // count = cumsum ([0 count[0:n-1]]) ; + //-------------------------------------------------------------------------- + + int64_t s = 0 ; + for (int64_t i = 0 ; i < n ; i++) + { + int64_t c = count [i] ; + count [i] = s ; + s += c ; + } + count [n] = s ; +} + +#endif + diff --git a/Source/diag/GB_Matrix_diag.c b/Source/diag/GB_Matrix_diag.c index ce4a1769da..9c5c5505e0 100644 --- a/Source/diag/GB_Matrix_diag.c +++ b/Source/diag/GB_Matrix_diag.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - #define GB_FREE_WORKSPACE \ { \ GB_Matrix_free (&T) ; \ diff --git a/Source/element/GB_setElement.c b/Source/element/GB_setElement.c index 7f189bd83b..2c6c88eee6 100644 --- a/Source/element/GB_setElement.c +++ b/Source/element/GB_setElement.c @@ -297,6 +297,7 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar { // C(i,j) += scalar GxB_binary_function faccum = accum->binop_function ; + ASSERT (faccum != NULL) ; GB_cast_function cast_C_to_X, cast_Z_to_Y, cast_Z_to_C ; cast_C_to_X = GB_cast_factory (accum->xtype->code, ctype->code); @@ -349,8 +350,7 @@ GrB_Info GB_setElement // set a single entry, C(row,col) = scalar // No typecasting can be done. The new pending tuple must either be // the first pending tuple, or its type must match the prior pending - // tuples. See assign/include/GB_assign_shared_definitions.h for a - // complete description. + // tuples. //---------------------------------------------------------------------- // check for wait diff --git a/Source/element/GrB_Matrix_removeElement.c b/Source/element/GrB_Matrix_removeElement.c index 722f6bd790..bed63ddb23 100644 --- a/Source/element/GrB_Matrix_removeElement.c +++ b/Source/element/GrB_Matrix_removeElement.c @@ -113,7 +113,7 @@ static inline bool GB_removeElement // return true if found { // C(:,k) is as-if-full so no binary search needed to find C(i,k) pleft = pleft + i ; - ASSERT (GB_UNFLIP (Ci [pleft]) == i) ; + ASSERT (GB_UNZOMBIE (Ci [pleft]) == i) ; found = true ; is_zombie = GB_IS_ZOMBIE (Ci [pleft]) ; } @@ -129,7 +129,7 @@ static inline bool GB_removeElement // return true if found if (found && !is_zombie) { // C(i,j) becomes a zombie - C->i [pleft] = GB_FLIP (i) ; + C->i [pleft] = GB_ZOMBIE (i) ; C->nzombies++ ; } return (found) ; diff --git a/Source/element/GrB_Vector_removeElement.c b/Source/element/GrB_Vector_removeElement.c index 556ec346dd..d7f17419bf 100644 --- a/Source/element/GrB_Vector_removeElement.c +++ b/Source/element/GrB_Vector_removeElement.c @@ -74,7 +74,7 @@ static inline bool GB_removeElement // returns true if found { // V(:) is as-if-full so no binary search is needed to find V(i) pleft = i ; - ASSERT (GB_UNFLIP (Vi [pleft]) == i) ; + ASSERT (GB_UNZOMBIE (Vi [pleft]) == i) ; found = true ; is_zombie = GB_IS_ZOMBIE (Vi [pleft]) ; } @@ -91,7 +91,7 @@ static inline bool GB_removeElement // returns true if found if (found && !is_zombie) { // V(i) becomes a zombie - V->i [pleft] = GB_FLIP (i) ; + V->i [pleft] = GB_ZOMBIE (i) ; V->nzombies++ ; } return (found) ; diff --git a/Source/element/factory/GB_Matrix_extractElement.c b/Source/element/factory/GB_Matrix_extractElement.c index ec6f71f1e7..edac45e920 100644 --- a/Source/element/factory/GB_Matrix_extractElement.c +++ b/Source/element/factory/GB_Matrix_extractElement.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. - // Extract the value of single scalar, x = A(row,col), typecasting from the // type of A to the type of x, as needed. diff --git a/Source/element/factory/GB_Scalar_extractElement.c b/Source/element/factory/GB_Scalar_extractElement.c index 3585f4d4ad..636a3e52d3 100644 --- a/Source/element/factory/GB_Scalar_extractElement.c +++ b/Source/element/factory/GB_Scalar_extractElement.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. - // Extract the value of single scalar, x = S, typecasting from the // type of S to the type of x, as needed. @@ -48,8 +46,8 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry from S ASSERT (!GB_ANY_PENDING_WORK (S)) ; // GB_XCODE and S must be compatible - GB_Type_code scode = S->type->code ; - if (!GB_code_compatible (GB_XCODE, scode)) + GB_Type_code scalar_code = S->type->code ; + if (!GB_code_compatible (GB_XCODE, scalar_code)) { return (GrB_DOMAIN_MISMATCH) ; } @@ -67,7 +65,7 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry from S //-------------------------------------------------------------------------- #if !defined ( GB_UDT_EXTRACT ) - if (GB_XCODE == scode) + if (GB_XCODE == scalar_code) { // copy S into x, no typecasting, for built-in types only. GB_XTYPE *restrict Sx = ((GB_XTYPE *) (S->x)) ; @@ -77,7 +75,7 @@ GrB_Info GB_EXTRACT_ELEMENT // extract a single entry from S #endif { // typecast S into x - GB_cast_scalar (x, GB_XCODE, S->x, scode, S->type->size) ; + GB_cast_scalar (x, GB_XCODE, S->x, scalar_code, S->type->size) ; } #pragma omp flush return (GrB_SUCCESS) ; diff --git a/Source/element/factory/GB_Vector_extractElement.c b/Source/element/factory/GB_Vector_extractElement.c index 9b7b9d5f4e..c6e2e85af8 100644 --- a/Source/element/factory/GB_Vector_extractElement.c +++ b/Source/element/factory/GB_Vector_extractElement.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. - // Extract the value of single scalar, x = V(i), typecasting from the // type of V to the type of x, as needed. diff --git a/Source/ewise/GB_emult.c b/Source/emult/GB_emult.c similarity index 98% rename from Source/ewise/GB_emult.c rename to Source/emult/GB_emult.c index 73f67f5891..bd4c825b61 100644 --- a/Source/ewise/GB_emult.c +++ b/Source/emult/GB_emult.c @@ -31,8 +31,8 @@ // but T=A.*B is sparse (M sparse, with A and B bitmap), then it too can // be done in place. -#include "ewise/GB_emult.h" -#include "ewise/GB_add.h" +#include "emult/GB_emult.h" +#include "add/GB_add.h" #include "binaryop/GB_binop.h" #define GB_FREE_WORKSPACE \ @@ -61,6 +61,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B const GrB_Matrix A, // input A matrix const GrB_Matrix B, // input B matrix const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) { @@ -174,7 +175,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B return (GB_add (C, ctype, C_is_csc, M, Mask_struct, Mask_comp, mask_applied, A, B, false, NULL, NULL, - op, false, Werk)) ; + op, flipij, false, Werk)) ; case GB_EMULT_METHOD2 : // A sparse/hyper, B bitmap/full @@ -210,7 +211,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B return (GB_emult_02 (C, ctype, C_is_csc, (apply_mask) ? M : NULL, Mask_struct, Mask_comp, - A, B, op, Werk)) ; + A, B, op, flipij, Werk)) ; case GB_EMULT_METHOD3 : // A bitmap/full, B sparse/hyper @@ -252,14 +253,14 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B // GB_binop_factory. return (GB_emult_02 (C, ctype, C_is_csc, (apply_mask) ? M : NULL, Mask_struct, Mask_comp, - B, A, op, Werk)) ; + B, A, op, flipij, Werk)) ; } else { // the op is not commutative: use GB_emult_03 return (GB_emult_03 (C, ctype, C_is_csc, (apply_mask) ? M : NULL, Mask_struct, Mask_comp, - A, B, op, Werk)) ; + A, B, op, flipij, Werk)) ; } case GB_EMULT_METHOD8 : @@ -337,7 +338,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B return (GB_emult_bitmap (C, ewise_method, ctype, C_is_csc, M, Mask_struct, Mask_comp, mask_applied, A, B, - op, Werk)) ; + op, flipij, Werk)) ; case GB_EMULT_METHOD4 : @@ -350,7 +351,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B // sparse sparse full full (GB_add or 4) return (GB_emult_04 (C, ctype, C_is_csc, M, Mask_struct, - mask_applied, A, B, op, Werk)) ; + mask_applied, A, B, op, flipij, Werk)) ; case GB_EMULT_METHOD9 : break ; // punt @@ -455,7 +456,7 @@ GrB_Info GB_emult // C=A.*B, C=A.*B, or C=A.*B GB_OK (GB_emult_08_phase2 ( // computed or used by phase2: - C, ctype, C_is_csc, op, + C, ctype, C_is_csc, op, flipij, // from phase1: &Cp, Cp_size, Cnvec_nonempty, // from phase1a: diff --git a/Source/ewise/GB_emult.h b/Source/emult/GB_emult.h similarity index 95% rename from Source/ewise/GB_emult.h rename to Source/emult/GB_emult.h index 510f280438..d8c9d0ccae 100644 --- a/Source/ewise/GB_emult.h +++ b/Source/emult/GB_emult.h @@ -36,6 +36,7 @@ GrB_Info GB_emult // C=A.*B or C=A.*B const GrB_Matrix A, // input A matrix const GrB_Matrix B, // input B matrix const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) ; @@ -101,6 +102,7 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B const GrB_Type ctype, // type of output matrix C const bool C_is_csc, // format of output matrix C const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped // from phase1: int64_t **Cp_handle, // vector pointers for C size_t Cp_size, @@ -139,6 +141,7 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full const GrB_Matrix A, // input A matrix (sparse/hyper) const GrB_Matrix B, // input B matrix (bitmap/full) GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) ; @@ -175,6 +178,7 @@ GrB_Info GB_emult_03 // C=A.*B when A is bitmap/full, B sparse/hyper const GrB_Matrix A, // input A matrix (sparse/hyper) const GrB_Matrix B, // input B matrix (bitmap/full) GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) ; @@ -189,6 +193,7 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full const GrB_Matrix A, // input A matrix (bitmap/full) const GrB_Matrix B, // input B matrix (bitmap/full) const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) ; @@ -205,6 +210,7 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B const GrB_Matrix A, // input A matrix (bitmap/full) const GrB_Matrix B, // input B matrix (bitmap/full) const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) ; @@ -225,6 +231,7 @@ GrB_Info GB_emult_generic // generic emult GrB_Matrix C, // output matrix, static header // input: const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped // tasks from phase1a: const GB_task_struct *restrict TaskList, // array of structs const int C_ntasks, // # of tasks diff --git a/Source/ewise/GB_emult_02.c b/Source/emult/GB_emult_02.c similarity index 94% rename from Source/ewise/GB_emult_02.c rename to Source/emult/GB_emult_02.c index 0cae107881..7879358b4d 100644 --- a/Source/ewise/GB_emult_02.c +++ b/Source/emult/GB_emult_02.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // C = A.*B where A is sparse/hyper and B is bitmap/full constructs C with // the same sparsity structure as A. @@ -56,11 +54,12 @@ // sparse full sparse full #include "ewise/GB_ewise.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" #include "binaryop/GB_binop.h" #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -87,6 +86,7 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full const GrB_Matrix A, // input A matrix (sparse/hyper) const GrB_Matrix B, // input B matrix (bitmap/full) GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) { @@ -211,7 +211,10 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full //-------------------------------------------------------------------------- GB_Opcode opcode = op->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + bool op_is_index_binop = GB_IS_INDEXBINARYOP_CODE (opcode) ; + bool op_is_positional = op_is_builtin_positional || op_is_index_binop ; 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) ; @@ -228,8 +231,8 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full // Contrast with ewiseadd. // A is passed as x, and B as y, in z = op(x,y) - bool A_is_pattern = op_is_second || op_is_pair || op_is_positional ; - bool B_is_pattern = op_is_first || op_is_pair || op_is_positional ; + bool A_is_pattern = op_is_second || op_is_pair || op_is_builtin_positional ; + bool B_is_pattern = op_is_first || op_is_pair || op_is_builtin_positional ; //-------------------------------------------------------------------------- // using a built-in binary operator (except for positional operators) @@ -250,7 +253,7 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full // pattern of C = set intersection of pattern of A and B #define GB_ISO_EMULT - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" info = GrB_SUCCESS ; } @@ -302,7 +305,7 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full if (info == GrB_NO_VALUE) { info = GB_emult_02_jit (C, C_sparsity, M, Mask_struct, - Mask_comp, op, A, B, Cp_kfirst, A_ek_slicing, A_ntasks, + Mask_comp, op, flipij, A, B, Cp_kfirst, A_ek_slicing, A_ntasks, A_nthreads) ; } @@ -313,7 +316,7 @@ GrB_Info GB_emult_02 // C=A.*B when A is sparse/hyper, B bitmap/full if (info == GrB_NO_VALUE) { GB_BURBLE_MATRIX (C, "(generic emult_02: %s) ", op->name) ; - info = GB_emult_generic (C, op, NULL, 0, 0, + info = GB_emult_generic (C, op, flipij, NULL, 0, 0, NULL, NULL, NULL, C_sparsity, GB_EMULT_METHOD2, Cp_kfirst, NULL, 0, 0, A_ek_slicing, A_ntasks, A_nthreads, NULL, 0, 0, M, Mask_struct, Mask_comp, A, B) ; diff --git a/Source/ewise/GB_emult_02_phase1.c b/Source/emult/GB_emult_02_phase1.c similarity index 91% rename from Source/ewise/GB_emult_02_phase1.c rename to Source/emult/GB_emult_02_phase1.c index 6289bd6c6f..61bd226a0d 100644 --- a/Source/ewise/GB_emult_02_phase1.c +++ b/Source/emult/GB_emult_02_phase1.c @@ -7,14 +7,15 @@ //------------------------------------------------------------------------------ -// JIT: not needed, but could use one for each mask type. +// JIT: not needed: factory cases: mask types, M bitmap/full, B bitmap/full, +// A sparse/hyper // Symbolic analysis phase for GB_emult_02 and GB_emult_03. #define GB_FREE_ALL ; #include "ewise/GB_ewise.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" @@ -45,6 +46,10 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 // get C, M, A, and B //-------------------------------------------------------------------------- + ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; + ASSERT (GB_IS_BITMAP (B) || GB_IS_FULL (B)) ; + ASSERT ((M == NULL) || GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; + GrB_Info info ; const int8_t *restrict Mb = (M == NULL) ? NULL : M->b ; const GB_M_TYPE *restrict Mx = (M == NULL || Mask_struct) ? NULL : @@ -102,9 +107,8 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 // count the entries in C(:,j) int64_t j = GBH (Ah, k) ; int64_t pB_start = j * vlen ; - int64_t pA, pA_end ; - GB_get_pA (&pA, &pA_end, tid, k, - kfirst, klast, pstart_Aslice, Ap, vlen) ; + GB_GET_PA (pA, pA_end, tid, k, kfirst, klast, pstart_Aslice, + Ap [k], Ap [k+1]) ; int64_t cjnz = 0 ; for ( ; pA < pA_end ; pA++) { @@ -134,6 +138,8 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 //------------------------------------------------------------------ ASSERT (M != NULL) ; + ASSERT (GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; + ASSERT (GB_IS_BITMAP (B) || GB_IS_FULL (B)) ; int tid ; #pragma omp parallel for num_threads(A_nthreads) schedule(dynamic,1) @@ -148,9 +154,8 @@ GrB_Info GB_emult_02_phase1 // symbolic analysis for GB_emult_02 and GB_emult_03 // count the entries in C(:,j) int64_t j = GBH (Ah, k) ; int64_t pB_start = j * vlen ; - int64_t pA, pA_end ; - GB_get_pA (&pA, &pA_end, tid, k, - kfirst, klast, pstart_Aslice, Ap, vlen) ; + GB_GET_PA (pA, pA_end, tid, k, kfirst, klast, pstart_Aslice, + Ap [k], Ap [k+1]) ; int64_t cjnz = 0 ; for ( ; pA < pA_end ; pA++) { diff --git a/Source/ewise/GB_emult_03.c b/Source/emult/GB_emult_03.c similarity index 94% rename from Source/ewise/GB_emult_03.c rename to Source/emult/GB_emult_03.c index 539c39007c..8a9f18c85a 100644 --- a/Source/ewise/GB_emult_03.c +++ b/Source/emult/GB_emult_03.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // C = A.*B where B is sparse/hyper and A is bitmap/full constructs C with // the same sparsity structure as B. @@ -56,11 +54,12 @@ // sparse full full sparse #include "ewise/GB_ewise.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" #include "binaryop/GB_binop.h" #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -87,6 +86,7 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper const GrB_Matrix A, // input A matrix (bitmap/full) const GrB_Matrix B, // input B matrix (sparse/hyper) GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) { @@ -109,7 +109,7 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper ASSERT (GB_JUMBLED_OK (B)) ; ASSERT (!GB_ZOMBIES (B)) ; ASSERT (GB_IS_BITMAP (A) || GB_IS_FULL (A)) ; - ASSERT (M == NULL || GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; + ASSERT ((M == NULL) || GB_IS_BITMAP (M) || GB_IS_FULL (M)) ; int C_sparsity = GB_sparsity (B) ; @@ -211,7 +211,10 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper //-------------------------------------------------------------------------- GB_Opcode opcode = op->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + bool op_is_index_binop = GB_IS_INDEXBINARYOP_CODE (opcode) ; + bool op_is_positional = op_is_builtin_positional || op_is_index_binop ; 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) ; @@ -228,8 +231,8 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper // Contrast with ewiseadd. // A is passed as x, and B as y, in z = op(x,y) - bool A_is_pattern = op_is_second || op_is_pair || op_is_positional ; - bool B_is_pattern = op_is_first || op_is_pair || op_is_positional ; + bool A_is_pattern = op_is_second || op_is_pair || op_is_builtin_positional ; + bool B_is_pattern = op_is_first || op_is_pair || op_is_builtin_positional ; //-------------------------------------------------------------------------- // using a built-in binary operator (except for positional operators) @@ -250,7 +253,7 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper // pattern of C = set intersection of pattern of A and B #define GB_ISO_EMULT - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" info = GrB_SUCCESS ; } @@ -303,7 +306,7 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper if (info == GrB_NO_VALUE) { info = GB_emult_03_jit (C, C_sparsity, M, Mask_struct, - Mask_comp, op, A, B, Cp_kfirst, B_ek_slicing, B_ntasks, + Mask_comp, op, flipij, A, B, Cp_kfirst, B_ek_slicing, B_ntasks, B_nthreads) ; } @@ -314,7 +317,7 @@ GrB_Info GB_emult_03 // C=A.*B when A bitmap/full, B is sparse/hyper if (info == GrB_NO_VALUE) { GB_BURBLE_MATRIX (C, "(generic emult_03: %s) ", op->name) ; - info = GB_emult_generic (C, op, NULL, 0, 0, + info = GB_emult_generic (C, op, flipij, NULL, 0, 0, NULL, NULL, NULL, C_sparsity, GB_EMULT_METHOD3, Cp_kfirst, NULL, 0, 0, NULL, 0, 0, B_ek_slicing, B_ntasks, B_nthreads, M, Mask_struct, Mask_comp, A, B) ; diff --git a/Source/ewise/GB_emult_04.c b/Source/emult/GB_emult_04.c similarity index 94% rename from Source/ewise/GB_emult_04.c rename to Source/emult/GB_emult_04.c index ce8fa8fb69..e64c65f62b 100644 --- a/Source/ewise/GB_emult_04.c +++ b/Source/emult/GB_emult_04.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done, but could be extended. symbolic phase 1 has 48 variants of mask -// M, matrices A, B. 6 mask types x (M sparse or hyper) x A and B (bitmap or // full) = 48. Use the JIT for select phase1 instead? // C= A.*B, M sparse/hyper, A and B bitmap/full. C has the same sparsity @@ -27,11 +25,12 @@ // If A and B are both full, eadd and emult are identical. #include "ewise/GB_ewise.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" #include "binaryop/GB_binop.h" #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -58,6 +57,7 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full const GrB_Matrix A, // input A matrix (bitmap/full) const GrB_Matrix B, // input B matrix (bitmap/full) const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) { @@ -179,9 +179,8 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full // count the entries in C(:,j) int64_t j = GBH (Mh, k) ; int64_t pstart = j * vlen ; // start of A(:,j) and B(:,j) - int64_t pM, pM_end ; - GB_get_pA (&pM, &pM_end, tid, k, - kfirst, klast, pstart_Mslice, Mp, vlen) ; + GB_GET_PA (pM, pM_end, tid, k, kfirst, klast, pstart_Mslice, + Mp [k], Mp [k+1]) ; int64_t cjnz = 0 ; for ( ; pM < pM_end ; pM++) { @@ -248,7 +247,10 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full //-------------------------------------------------------------------------- GB_Opcode opcode = op->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + bool op_is_index_binop = GB_IS_INDEXBINARYOP_CODE (opcode) ; + bool op_is_positional = op_is_builtin_positional || op_is_index_binop ; 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) ; @@ -265,8 +267,8 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full // Contrast with ewiseadd. // A is passed as x, and B as y, in z = op(x,y) - bool A_is_pattern = op_is_second || op_is_pair || op_is_positional ; - bool B_is_pattern = op_is_first || op_is_pair || op_is_positional ; + bool A_is_pattern = op_is_second || op_is_pair || op_is_builtin_positional ; + bool B_is_pattern = op_is_first || op_is_pair || op_is_builtin_positional ; //-------------------------------------------------------------------------- // using a built-in binary operator (except for positional operators) @@ -287,7 +289,7 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full // pattern of C = set intersection of pattern of A and B #define GB_ISO_EMULT - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" info = GrB_SUCCESS ; } @@ -337,7 +339,7 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full if (info == GrB_NO_VALUE) { - info = GB_emult_04_jit (C, C_sparsity, M, Mask_struct, op, + info = GB_emult_04_jit (C, C_sparsity, M, Mask_struct, op, flipij, A, B, Cp_kfirst, M_ek_slicing, M_ntasks, M_nthreads) ; } @@ -348,7 +350,7 @@ GrB_Info GB_emult_04 // C=A.*B, M sparse/hyper, A and B bitmap/full if (info == GrB_NO_VALUE) { GB_BURBLE_MATRIX (C, "(generic emult_04: %s) ", op->name) ; - info = GB_emult_generic (C, op, NULL, 0, 0, + info = GB_emult_generic (C, op, flipij, NULL, 0, 0, NULL, NULL, NULL, C_sparsity, GB_EMULT_METHOD4, Cp_kfirst, M_ek_slicing, M_ntasks, M_nthreads, NULL, 0, 0, NULL, 0, 0, M, Mask_struct, false, A, B) ; diff --git a/Source/ewise/GB_emult_08_phase0.c b/Source/emult/GB_emult_08_phase0.c similarity index 99% rename from Source/ewise/GB_emult_08_phase0.c rename to Source/emult/GB_emult_08_phase0.c index b0306fdeb1..f2abf1920d 100644 --- a/Source/ewise/GB_emult_08_phase0.c +++ b/Source/emult/GB_emult_08_phase0.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // The eWise multiply of two matrices, C=A.*B, C=A.*B, or C=A.*B starts // with this phase, which determines which vectors of C need to be computed. @@ -45,7 +43,7 @@ GB_FREE_WORK (&C_to_B, C_to_B_size) ; \ } -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" GrB_Info GB_emult_08_phase0 // find vectors in C for C=A.*B or C=A.*B ( diff --git a/Source/ewise/GB_emult_08_phase1.c b/Source/emult/GB_emult_08_phase1.c similarity index 98% rename from Source/ewise/GB_emult_08_phase1.c rename to Source/emult/GB_emult_08_phase1.c index 3c94f39502..d5f4069e56 100644 --- a/Source/ewise/GB_emult_08_phase1.c +++ b/Source/emult/GB_emult_08_phase1.c @@ -19,7 +19,7 @@ // Cp is either freed by GB_emult_08_phase2, or transplanted into C. -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" GrB_Info GB_emult_08_phase1 // count nnz in each C(:,j) ( @@ -96,7 +96,7 @@ GrB_Info GB_emult_08_phase1 // count nnz in each C(:,j) //-------------------------------------------------------------------------- #define GB_EMULT_08_PHASE 1 - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" //-------------------------------------------------------------------------- // cumulative sum of Cp and fine tasks in TaskList diff --git a/Source/ewise/GB_emult_08_phase2.c b/Source/emult/GB_emult_08_phase2.c similarity index 92% rename from Source/ewise/GB_emult_08_phase2.c rename to Source/emult/GB_emult_08_phase2.c index 06b29a9f6e..bd1c6726c4 100644 --- a/Source/ewise/GB_emult_08_phase2.c +++ b/Source/emult/GB_emult_08_phase2.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // GB_emult_08_phase2 computes C=A.*B, C=A.*B, or C=A.*B. It is // preceded first by GB_emult_08_phase0, which computes the list of vectors of // C to compute (Ch) and their location in M, A, and B (C_to_[MAB]). Next, @@ -26,11 +24,12 @@ // way, the caller must not free it. #include "ewise/GB_ewise.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" #include "binaryop/GB_binop.h" #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -45,6 +44,7 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B const GrB_Type ctype, // type of output matrix C const bool C_is_csc, // format of output matrix C const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped // from phase1: int64_t **Cp_handle, // vector pointers for C size_t Cp_size, @@ -110,16 +110,21 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B ASSERT (C_is_hyper == (Ch != NULL)) ; GB_Opcode opcode = op->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + bool op_is_index_binop = GB_IS_INDEXBINARYOP_CODE (opcode) ; + bool op_is_positional = op_is_builtin_positional || op_is_index_binop ; 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) ; ASSERT (GB_Type_compatible (ctype, op->ztype)) ; - ASSERT (GB_IMPLIES (!(op_is_second || op_is_pair || op_is_positional), - GB_Type_compatible (A->type, op->xtype))) ; - ASSERT (GB_IMPLIES (!(op_is_first || op_is_pair || op_is_positional), - GB_Type_compatible (B->type, op->ytype))) ; + ASSERT (GB_IMPLIES (!(op_is_second || op_is_pair + || op_is_builtin_positional), + GB_Type_compatible (A->type, op->xtype))) ; + ASSERT (GB_IMPLIES (!(op_is_first || op_is_pair + || op_is_builtin_positional), + GB_Type_compatible (B->type, op->ytype))) ; //-------------------------------------------------------------------------- // check if C is iso and compute its iso value if it is @@ -201,7 +206,7 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B // pattern of C = set intersection of pattern of A and B #define GB_ISO_EMULT - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" info = GrB_SUCCESS ; } @@ -252,8 +257,8 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B if (info == GrB_NO_VALUE) { - info = GB_emult_08_jit (C, C_sparsity, M, Mask_struct, - Mask_comp, op, A, B, C_to_M, C_to_A, C_to_B, TaskList, C_ntasks, + info = GB_emult_08_jit (C, C_sparsity, M, Mask_struct, Mask_comp, + op, flipij, A, B, C_to_M, C_to_A, C_to_B, TaskList, C_ntasks, C_nthreads) ; } @@ -264,7 +269,7 @@ GrB_Info GB_emult_08_phase2 // C=A.*B or C=A.*B if (info == GrB_NO_VALUE) { GB_BURBLE_MATRIX (C, "(generic emult: %s) ", op->name) ; - info = GB_emult_generic (C, op, TaskList, C_ntasks, C_nthreads, + info = GB_emult_generic (C, op, flipij, TaskList, C_ntasks, C_nthreads, C_to_M, C_to_A, C_to_B, C_sparsity, ewise_method, NULL, NULL, 0, 0, NULL, 0, 0, NULL, 0, 0, M, Mask_struct, Mask_comp, A, B) ; diff --git a/Source/ewise/GB_emult_bitmap.c b/Source/emult/GB_emult_bitmap.c similarity index 94% rename from Source/ewise/GB_emult_bitmap.c rename to Source/emult/GB_emult_bitmap.c index 42ce935089..bca1196a42 100644 --- a/Source/ewise/GB_emult_bitmap.c +++ b/Source/emult/GB_emult_bitmap.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // GB_EMULT_METHOD5 : // ------------------------------------------ @@ -59,12 +57,13 @@ // C=A.*B and C+=A.*B can all be done in-place. #include "ewise/GB_ewise.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" #include "binaryop/GB_binop.h" #include "include/GB_unused.h" #include "slice/GB_ek_slice.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -92,6 +91,7 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B const GrB_Matrix A, // input A matrix (bitmap/full) const GrB_Matrix B, // input B matrix (bitmap/full) const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped GB_Werk Werk ) { @@ -152,7 +152,10 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B //-------------------------------------------------------------------------- GB_Opcode opcode = op->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + bool op_is_index_binop = GB_IS_INDEXBINARYOP_CODE (opcode) ; + bool op_is_positional = op_is_builtin_positional || op_is_index_binop ; 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) ; @@ -189,8 +192,8 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B // Contrast with ewiseadd. // A is passed as x, and B as y, in z = op(x,y) - bool A_is_pattern = op_is_second || op_is_pair || op_is_positional ; - bool B_is_pattern = op_is_first || op_is_pair || op_is_positional ; + bool A_is_pattern = op_is_second || op_is_pair || op_is_builtin_positional ; + bool B_is_pattern = op_is_first || op_is_pair || op_is_builtin_positional ; //-------------------------------------------------------------------------- // using a built-in binary operator (except for positional operators) @@ -211,7 +214,7 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B // pattern of C = set intersection of pattern of A and B #define GB_ISO_EMULT - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" info = GrB_SUCCESS ; } @@ -264,7 +267,7 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B if (info == GrB_NO_VALUE) { info = GB_emult_bitmap_jit (C, M, Mask_struct, - Mask_comp, op, A, B, M_ek_slicing, M_ntasks, M_nthreads, + Mask_comp, op, flipij, A, B, M_ek_slicing, M_ntasks, M_nthreads, C_nthreads) ; } @@ -275,7 +278,7 @@ GrB_Info GB_emult_bitmap // C=A.*B, C=A.*B, or C=A.*B if (info == GrB_NO_VALUE) { GB_BURBLE_MATRIX (C, "(generic bitmap emult: %s) ", op->name) ; - info = GB_emult_generic (C, op, NULL, 0, C_nthreads, + info = GB_emult_generic (C, op, flipij, NULL, 0, C_nthreads, NULL, NULL, NULL, GxB_BITMAP, ewise_method, NULL, M_ek_slicing, M_ntasks, M_nthreads, NULL, 0, 0, NULL, 0, 0, M, Mask_struct, Mask_comp, A, B) ; diff --git a/Source/ewise/GB_emult_generic.c b/Source/emult/GB_emult_generic.c similarity index 73% rename from Source/ewise/GB_emult_generic.c rename to Source/emult/GB_emult_generic.c index e8b22c74e3..0b252711fc 100644 --- a/Source/ewise/GB_emult_generic.c +++ b/Source/emult/GB_emult_generic.c @@ -15,7 +15,7 @@ // C is not iso, but A and/or B might be. #include "ewise/GB_ewise.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" #include "binaryop/GB_binop.h" #include "include/GB_unused.h" #include "slice/GB_ek_slice.h" @@ -27,6 +27,7 @@ GrB_Info GB_emult_generic // generic emult GrB_Matrix C, // output matrix, static header // input: const GrB_BinaryOp op, // op to perform C = op (A,B) + const bool flipij, // if true, i,j must be flipped // tasks from phase1a: const GB_task_struct *restrict TaskList, // array of structs const int C_ntasks, // # of tasks @@ -77,14 +78,19 @@ GrB_Info GB_emult_generic // generic emult GB_Opcode opcode = op->opcode ; - const bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + const bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + const bool op_is_index_binop = GB_IS_INDEXBINARYOP_CODE (opcode) ; const bool op_is_first = (opcode == GB_FIRST_binop_code) ; const bool op_is_second = (opcode == GB_SECOND_binop_code) ; const bool op_is_pair = (opcode == GB_PAIR_binop_code) ; - const bool A_is_pattern = (op_is_second || op_is_pair || op_is_positional) ; - const bool B_is_pattern = (op_is_first || op_is_pair || op_is_positional) ; + const bool A_is_pattern = (op_is_second || op_is_pair + || op_is_builtin_positional) ; + const bool B_is_pattern = (op_is_first || op_is_pair + || op_is_builtin_positional) ; const GxB_binary_function fop = op->binop_function ; // NULL if positional + const GxB_index_binary_function fop_idx = op->idxbinop_function ; const size_t csize = ctype->size ; const size_t asize = A->type->size ; const size_t bsize = B->type->size ; @@ -136,108 +142,97 @@ GrB_Info GB_emult_generic // generic emult #undef GB_PUTC #define GB_PUTC(z, Cx, p) cast_Z_to_C (Cx +((p)*csize), &z, csize) - if (op_is_positional) + // C(i,j) = (ctype) (A(i,j) + B(i,j)) + #undef GB_EWISEOP + #define GB_EWISEOP(Cx, p, aij, bij, i, j) \ + { \ + GB_void z [GB_VLA(zsize)] ; \ + GB_BINOP (z, aij, bij, i, j) ; \ + GB_PUTC (z, Cx, p) ; \ + } + + if (fop_idx != NULL) { //---------------------------------------------------------------------- - // C(i,j) = positional_op (aij, bij) + // index binary operator //---------------------------------------------------------------------- - bool depends_on_j ; - const int64_t offset = GB_positional_offset (opcode, NULL, - &depends_on_j) ; - const bool index_is_i = - (opcode == GB_FIRSTI_binop_code ) || - (opcode == GB_FIRSTI1_binop_code ) || - (opcode == GB_SECONDI_binop_code ) || - (opcode == GB_SECONDI1_binop_code) ; + const void *theta = op->theta ; - if (op->ztype == GrB_INT64) + if (flipij) { - - // z = op (aij, bij) + // z = op (aij, bij, j, i) #undef GB_BINOP - #define GB_BINOP(z,x,y,i,j) \ - z = ((index_is_i)? (i):(j)) + offset - - // C(i,j) = positional_op (aij, bij) - #undef GB_EWISEOP - #define GB_EWISEOP(Cx, p, aij, bij, i, j) \ - { \ - int64_t z ; \ - GB_BINOP (z, , , i, j) ; \ - GB_PUTC (z, Cx, p) ; \ - } - + #define GB_BINOP(z, aij, bij, j, i) \ + fop_idx (z, aij, i, j, bij, i, j, theta) ; + // C(i,j) = (ctype) (A(i,j) + B(i,j)) if (ewise_method == GB_EMULT_METHOD2) { + // emult method 2 (abc) // C=A.*B or C<#M>=A.*B; A sparse/hyper; M and B bitmap/full // C is sparse - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" } else if (ewise_method == GB_EMULT_METHOD3) { + // emult method 3 (abc) // C=A.*B or C<#M>=A.*B; B sparse/hyper; M and A bitmap/full // C is sparse - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" } else if (ewise_method == GB_EMULT_METHOD4) { // C=A.*B; M sparse/hyper, A and B bitmap/full // C is sparse - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" } else if (C_sparsity == GxB_BITMAP) { // C is bitmap: emult methods 5, 6, or 7 - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" } else { // C is sparse: emult method 8 (abcdefgh) - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" } } else { - - // C(i,j) = positional_op (aij, bij) - #undef GB_EWISEOP - #define GB_EWISEOP(Cx, p, aij, bij, i, j) \ - { \ - int64_t z ; \ - GB_BINOP (z, , , i, j) ; \ - int32_t z32 = (int32_t) z ; \ - GB_PUTC (z32, Cx, p) ; \ - } - + // z = op (aij, bij, i, j) + #undef GB_BINOP + #define GB_BINOP(z, aij, bij, i, j) \ + fop_idx (z, aij, i, j, bij, i, j, theta) ; if (ewise_method == GB_EMULT_METHOD2) { + // emult method 2 (abc) // C=A.*B or C<#M>=A.*B; A sparse/hyper; M and B bitmap/full // C is sparse - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" } else if (ewise_method == GB_EMULT_METHOD3) { + // emult method 3 (abc) // C=A.*B or C<#M>=A.*B; B sparse/hyper; M and A bitmap/full // C is sparse - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" } else if (ewise_method == GB_EMULT_METHOD4) { // C=A.*B; M sparse/hyper, A and B bitmap/full // C is sparse - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" } else if (C_sparsity == GxB_BITMAP) { // C is bitmap: emult methods 5, 6, or 7 - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" } else { // C is sparse: emult method 8 (abcdefgh) - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" } } @@ -255,45 +250,36 @@ GrB_Info GB_emult_generic // generic emult ASSERT (fop != NULL) ; \ fop (z, aij, bij) ; - // C(i,j) = (ctype) (A(i,j) + B(i,j)) - #undef GB_EWISEOP - #define GB_EWISEOP(Cx, p, aij, bij, i, j) \ - { \ - GB_void z [GB_VLA(zsize)] ; \ - GB_BINOP (z, aij, bij, i, j) ; \ - GB_PUTC (z, Cx, p) ; \ - } - // C(i,j) = (ctype) (A(i,j) + B(i,j)) if (ewise_method == GB_EMULT_METHOD2) { // emult method 2 (abc) // C=A.*B or C<#M>=A.*B; A sparse/hyper; M and B bitmap/full // C is sparse - #include "ewise/template/GB_emult_02_template.c" + #include "emult/template/GB_emult_02_template.c" } else if (ewise_method == GB_EMULT_METHOD3) { // emult method 3 (abc) // C=A.*B or C<#M>=A.*B; B sparse/hyper; M and A bitmap/full // C is sparse - #include "ewise/template/GB_emult_03_template.c" + #include "emult/template/GB_emult_03_template.c" } else if (ewise_method == GB_EMULT_METHOD4) { // C=A.*B; M sparse/hyper, A and B bitmap/full // C is sparse - #include "ewise/template/GB_emult_04_template.c" + #include "emult/template/GB_emult_04_template.c" } else if (C_sparsity == GxB_BITMAP) { // C is bitmap: emult methods 5, 6, or 7 - #include "ewise/template/GB_emult_bitmap_template.c" + #include "emult/template/GB_emult_bitmap_template.c" } else { // C is sparse: emult method 8 (abcdefgh) - #include "ewise/template/GB_emult_08_meta.c" + #include "emult/template/GB_emult_08_meta.c" } } diff --git a/Source/ewise/GB_emult_iso.c b/Source/emult/GB_emult_iso.c similarity index 98% rename from Source/ewise/GB_emult_iso.c rename to Source/emult/GB_emult_iso.c index 56e6183aec..40e64ca3c6 100644 --- a/Source/ewise/GB_emult_iso.c +++ b/Source/emult/GB_emult_iso.c @@ -11,7 +11,7 @@ // C=kron(A,B) results in an iso matrix C. If true, the output scalar c is the // iso value for the matrix C. -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" bool GB_emult_iso // c = op(a,b), return true if C is iso ( @@ -50,6 +50,7 @@ bool GB_emult_iso // c = op(a,b), return true if C is iso //-------------------------------------------------------------------------- const GxB_binary_function femult = op->binop_function ; + ASSERT (femult != NULL) ; // the op is not positional (see test above) GB_Opcode opcode = op->opcode ; const GrB_Type xtype = op->xtype ; diff --git a/Source/ewise/GB_emult_sparsity.c b/Source/emult/GB_emult_sparsity.c similarity index 99% rename from Source/ewise/GB_emult_sparsity.c rename to Source/emult/GB_emult_sparsity.c index f36492cb74..8ffebd6969 100644 --- a/Source/ewise/GB_emult_sparsity.c +++ b/Source/emult/GB_emult_sparsity.c @@ -21,7 +21,7 @@ // and as a result, there is no need for a GB_emult to handle the case when // C is full. -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" #include "mask/GB_mask_very_sparse.h" int GB_emult_sparsity // return the sparsity structure for C diff --git a/Source/ewise/GrB_Matrix_eWiseMult.c b/Source/emult/GrB_Matrix_eWiseMult.c similarity index 100% rename from Source/ewise/GrB_Matrix_eWiseMult.c rename to Source/emult/GrB_Matrix_eWiseMult.c diff --git a/Source/ewise/GrB_Vector_eWiseMult.c b/Source/emult/GrB_Vector_eWiseMult.c similarity index 100% rename from Source/ewise/GrB_Vector_eWiseMult.c rename to Source/emult/GrB_Vector_eWiseMult.c diff --git a/Source/ewise/template/GB_emult_02_template.c b/Source/emult/template/GB_emult_02_template.c similarity index 100% rename from Source/ewise/template/GB_emult_02_template.c rename to Source/emult/template/GB_emult_02_template.c diff --git a/Source/ewise/template/GB_emult_02a.c b/Source/emult/template/GB_emult_02a.c similarity index 100% rename from Source/ewise/template/GB_emult_02a.c rename to Source/emult/template/GB_emult_02a.c diff --git a/Source/ewise/template/GB_emult_02b.c b/Source/emult/template/GB_emult_02b.c similarity index 100% rename from Source/ewise/template/GB_emult_02b.c rename to Source/emult/template/GB_emult_02b.c diff --git a/Source/ewise/template/GB_emult_02c.c b/Source/emult/template/GB_emult_02c.c similarity index 100% rename from Source/ewise/template/GB_emult_02c.c rename to Source/emult/template/GB_emult_02c.c diff --git a/Source/ewise/template/GB_emult_03_template.c b/Source/emult/template/GB_emult_03_template.c similarity index 100% rename from Source/ewise/template/GB_emult_03_template.c rename to Source/emult/template/GB_emult_03_template.c diff --git a/Source/ewise/template/GB_emult_03a.c b/Source/emult/template/GB_emult_03a.c similarity index 100% rename from Source/ewise/template/GB_emult_03a.c rename to Source/emult/template/GB_emult_03a.c diff --git a/Source/ewise/template/GB_emult_03b.c b/Source/emult/template/GB_emult_03b.c similarity index 100% rename from Source/ewise/template/GB_emult_03b.c rename to Source/emult/template/GB_emult_03b.c diff --git a/Source/ewise/template/GB_emult_03c.c b/Source/emult/template/GB_emult_03c.c similarity index 100% rename from Source/ewise/template/GB_emult_03c.c rename to Source/emult/template/GB_emult_03c.c diff --git a/Source/ewise/template/GB_emult_04_template.c b/Source/emult/template/GB_emult_04_template.c similarity index 100% rename from Source/ewise/template/GB_emult_04_template.c rename to Source/emult/template/GB_emult_04_template.c diff --git a/Source/ewise/template/GB_emult_08_meta.c b/Source/emult/template/GB_emult_08_meta.c similarity index 100% rename from Source/ewise/template/GB_emult_08_meta.c rename to Source/emult/template/GB_emult_08_meta.c diff --git a/Source/ewise/template/GB_emult_08_template.c b/Source/emult/template/GB_emult_08_template.c similarity index 100% rename from Source/ewise/template/GB_emult_08_template.c rename to Source/emult/template/GB_emult_08_template.c diff --git a/Source/ewise/template/GB_emult_08bcd.c b/Source/emult/template/GB_emult_08bcd.c similarity index 100% rename from Source/ewise/template/GB_emult_08bcd.c rename to Source/emult/template/GB_emult_08bcd.c diff --git a/Source/ewise/template/GB_emult_08e.c b/Source/emult/template/GB_emult_08e.c similarity index 100% rename from Source/ewise/template/GB_emult_08e.c rename to Source/emult/template/GB_emult_08e.c diff --git a/Source/ewise/template/GB_emult_08fgh.c b/Source/emult/template/GB_emult_08fgh.c similarity index 100% rename from Source/ewise/template/GB_emult_08fgh.c rename to Source/emult/template/GB_emult_08fgh.c diff --git a/Source/ewise/template/GB_emult_bitmap_5.c b/Source/emult/template/GB_emult_bitmap_5.c similarity index 100% rename from Source/ewise/template/GB_emult_bitmap_5.c rename to Source/emult/template/GB_emult_bitmap_5.c diff --git a/Source/ewise/template/GB_emult_bitmap_6.c b/Source/emult/template/GB_emult_bitmap_6.c similarity index 92% rename from Source/ewise/template/GB_emult_bitmap_6.c rename to Source/emult/template/GB_emult_bitmap_6.c index d7147b9a12..babfff98ac 100644 --- a/Source/ewise/template/GB_emult_bitmap_6.c +++ b/Source/emult/template/GB_emult_bitmap_6.c @@ -26,7 +26,10 @@ // complemented, then C is constructed as sparse, not bitmap. ASSERT (M != NULL) ; ASSERT (Mask_comp) ; + ASSERT (GB_IS_BITMAP (C)) ; ASSERT (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) ; + ASSERT (GB_IS_BITMAP (A) || GB_IS_FULL (A)) ; + ASSERT (GB_IS_BITMAP (B) || GB_IS_FULL (B)) ; // C(i,j) = A(i,j) .* B(i,j) can only be computed where M(i,j) is // not present in the sparse pattern of M, and where it is present @@ -36,8 +39,8 @@ // scatter M into the C bitmap //-------------------------------------------------------------------------- - GB_bitmap_M_scatter_whole (C, M, Mask_struct, GB_BITMAP_M_SCATTER_SET_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + GB_bitmap_M_scatter_whole (C, M, Mask_struct, + GB_BITMAP_M_SCATTER_SET_2, M_ek_slicing, M_ntasks, M_nthreads) ; // C(i,j) has been marked, in Cb, with the value 2 where M(i,j)=1. // These positions will not be computed in C(i,j). C(i,j) can only diff --git a/Source/ewise/template/GB_emult_bitmap_7.c b/Source/emult/template/GB_emult_bitmap_7.c similarity index 100% rename from Source/ewise/template/GB_emult_bitmap_7.c rename to Source/emult/template/GB_emult_bitmap_7.c diff --git a/Source/ewise/template/GB_emult_bitmap_template.c b/Source/emult/template/GB_emult_bitmap_template.c similarity index 100% rename from Source/ewise/template/GB_emult_bitmap_template.c rename to Source/emult/template/GB_emult_bitmap_template.c diff --git a/Source/ewise/GB_ewise.c b/Source/ewise/GB_ewise.c index c24eefbb7f..2ef856849b 100644 --- a/Source/ewise/GB_ewise.c +++ b/Source/ewise/GB_ewise.c @@ -20,8 +20,8 @@ } #include "ewise/GB_ewise.h" -#include "ewise/GB_add.h" -#include "ewise/GB_emult.h" +#include "add/GB_add.h" +#include "emult/GB_emult.h" #include "transpose/GB_transpose.h" #include "mask/GB_accum_mask.h" #include "binaryop/GB_binop.h" @@ -162,14 +162,19 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B // handle CSR and CSC formats //-------------------------------------------------------------------------- + // The op can be a built-in or user-defined positional operator. + GB_Opcode opcode = op->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; + bool op_is_index_binop = GB_IS_INDEXBINARYOP_CODE (opcode) ; + bool op_is_positional = op_is_builtin_positional || op_is_index_binop ; // CSC/CSR format of T is same as C. Conform A and B to the format of C. bool T_is_csc = C->is_csc ; if (T_is_csc != A->is_csc) { - // Flip the sense of A_transpose. For example, if C is CSC and A is + // Negate A_transpose. For example, if C is CSC and A is // CSR, and A_transpose is true, then C=A'+B is being computed. But // this is the same as C=A+B where A is treated as if it is CSC. A_transpose = !A_transpose ; @@ -177,7 +182,7 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B if (T_is_csc != B->is_csc) { - // Flip the sense of B_transpose. + // Negate B_transpose. B_transpose = !B_transpose ; } @@ -191,14 +196,21 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B T_is_csc = !T_is_csc ; } - if (!T_is_csc) + bool flipij = false ; + if (!T_is_csc && op_is_positional) { - if (op_is_positional) + if (op_is_builtin_positional) { - // positional ops must be flipped, with i and j swapped + // positional ops must be flipped, with i and j swapped. + // This can be done for builtin ops (FIRSTI, SECONDJ, etc). op = GB_positional_binop_ijflip (op) ; opcode = op->opcode ; } + else // if (op_is_index_binop) + { + // user-defined index binary ops must have their i,j flipped + flipij = true ; + } } //-------------------------------------------------------------------------- @@ -375,8 +387,8 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B // could be faster to exploit the mask duing GB_add. GB_OK (GB_add (T, T_type, T_is_csc, M1, Mask_struct, Mask_comp, - &mask_applied, A1, B1, is_eWiseUnion, alpha, beta, op, false, - Werk)) ; + &mask_applied, A1, B1, is_eWiseUnion, alpha, beta, op, flipij, + false, Werk)) ; } else @@ -394,7 +406,7 @@ GrB_Info GB_ewise // C = accum (C, A+B) or A.*B // pruned by GB_hypermatrix_prune, and thus no longer shallow. GB_OK (GB_emult (T, T_type, T_is_csc, M1, Mask_struct, Mask_comp, - &mask_applied, A1, B1, op, Werk)) ; + &mask_applied, A1, B1, op, flipij, Werk)) ; //---------------------------------------------------------------------- // transplant shallow content from AT, BT, or MT diff --git a/Source/ewise/GB_ewise_fulla.c b/Source/ewise/GB_ewise_fulla.c index ec9d5161e2..f6190beebe 100644 --- a/Source/ewise/GB_ewise_fulla.c +++ b/Source/ewise/GB_ewise_fulla.c @@ -9,12 +9,11 @@ // C += A+B where no matrix is iso and all three matrices are as-if-full -// JIT: done. - #include "ewise/GB_ewise.h" #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif diff --git a/Source/ewise/GB_ewise_fulln.c b/Source/ewise/GB_ewise_fulln.c index 99fa7c3f66..7203583f9a 100644 --- a/Source/ewise/GB_ewise_fulln.c +++ b/Source/ewise/GB_ewise_fulln.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // C can have any sparsity on input; it becomes a full non-iso matrix on output. // C can have pending work, which is discarded. @@ -16,6 +14,7 @@ #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif diff --git a/Source/extract/GB_I_inverse.c b/Source/extract/GB_I_inverse.c index 2798e238e4..d761ebecef 100644 --- a/Source/extract/GB_I_inverse.c +++ b/Source/extract/GB_I_inverse.c @@ -2,7 +2,7 @@ // GB_I_inverse: invert an index list //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -29,7 +29,7 @@ GrB_Info GB_I_inverse // invert the I list for C=A(I,:) size_t *p_Mark_size, int64_t *restrict *p_Inext, // next pointers for buckets, size nI size_t *p_Inext_size, - int64_t *p_ndupl, // number of duplicate entries in I + int64_t *p_nduplicates, // number of duplicate entries in I GB_Werk Werk ) { @@ -40,11 +40,11 @@ GrB_Info GB_I_inverse // invert the I list for C=A(I,:) int64_t *Mark = NULL ; size_t Mark_size = 0 ; int64_t *Inext = NULL ; size_t Inext_size = 0 ; - int64_t ndupl = 0 ; + int64_t nduplicates = 0 ; (*p_Mark ) = NULL ; (*p_Mark_size ) = 0 ; (*p_Inext) = NULL ; (*p_Inext_size) = 0 ; - (*p_ndupl) = 0 ; + (*p_nduplicates) = 0 ; //-------------------------------------------------------------------------- // allocate workspace @@ -81,7 +81,7 @@ GrB_Info GB_I_inverse // invert the I list for C=A(I,:) else { // i has already been seen in the list I - ndupl++ ; + nduplicates++ ; } Mark [i] = inew + 1 ; // (Mark [i] - 1) = inew Inext [inew] = ihead ; @@ -119,7 +119,7 @@ GrB_Info GB_I_inverse // invert the I list for C=A(I,:) (*p_Mark ) = Mark ; (*p_Mark_size ) = Mark_size ; (*p_Inext) = Inext ; (*p_Inext_size) = Inext_size ; - (*p_ndupl) = ndupl ; + (*p_nduplicates) = nduplicates ; return (GrB_SUCCESS) ; } diff --git a/Source/extract/GB_bitmap_subref.c b/Source/extract/GB_bitmap_subref.c index e5801b8b8c..b813b49ed2 100644 --- a/Source/extract/GB_bitmap_subref.c +++ b/Source/extract/GB_bitmap_subref.c @@ -2,22 +2,25 @@ // GB_bitmap_subref: C = A(I,J) where A is bitmap or full //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ // C=A(I,J), where A is bitmap or full, symbolic and numeric. -// See GB_subref for details. - -// JIT: needed. #include "extract/GB_subref.h" -#include "assign/GB_subassign_IxJ_slice.h" +#include "jitifyer/GB_stringify.h" + +#define GB_FREE_WORKSPACE \ +{ \ + GB_FREE_WORK (&TaskList_IxJ, TaskList_IxJ_size) ; \ +} -#define GB_FREE_ALL \ -{ \ - GB_phybix_free (C) ; \ +#define GB_FREE_ALL \ +{ \ + GB_FREE_WORKSPACE \ + GB_phybix_free (C) ; \ } GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric @@ -52,6 +55,13 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric ASSERT (!GB_JUMBLED (A)) ; ASSERT (!GB_PENDING (A)) ; + //-------------------------------------------------------------------------- + // workspace for GB_bitmap_assign_IxJ_template.c + //-------------------------------------------------------------------------- + + GB_task_struct *TaskList_IxJ = NULL ; size_t TaskList_IxJ_size = 0 ; + int ntasks_IxJ = 0, nthreads_IxJ = 0 ; + //-------------------------------------------------------------------------- // get A //-------------------------------------------------------------------------- @@ -59,7 +69,6 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric const int8_t *restrict Ab = A->b ; const int64_t avlen = A->vlen ; const int64_t avdim = A->vdim ; - const size_t asize = A->type->size ; //-------------------------------------------------------------------------- // check the properties of I and J @@ -90,6 +99,11 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric return (info) ; } + #define GB_I_KIND Ikind + #define GB_J_KIND Jkind + #define GB_C_IS_BITMAP (sparsity == GxB_BITMAP) + #define GB_C_IS_FULL (sparsity == GxB_FULL) + //-------------------------------------------------------------------------- // allocate C //-------------------------------------------------------------------------- @@ -113,8 +127,8 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric // In GB_bitmap_assign_IxJ_template, vlen is the vector length of the // submatrix C(I,J), but here the template is used to access A(I,J), and so // the vector length is A->vlen, not C->vlen. The pointers pA and pC are - // swapped in the macros below, since C=A(I,J) is being computed, instead - // of C(I,J)=A for the bitmap assignment. + // swapped in GB_IXJ_WORK macro below, since C=A(I,J) is being computed, + // instead of C(I,J)=A for the bitmap assignment. int64_t vlen = avlen ; @@ -122,13 +136,11 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric // C = A(I,J) //-------------------------------------------------------------------------- - int64_t cnvals = 0 ; - - if (sparsity == GxB_BITMAP) + if (symbolic ) { //---------------------------------------------------------------------- - // C = A (I,J) where A and C are both bitmap + // symbolic subref, for GB_subassign_symbolic //---------------------------------------------------------------------- // symbolic subref is only used by GB_subassign_symbolic, which only @@ -137,10 +149,11 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric // C are bitmap is not needed. The code is left here in case it is // needed in the future. - ASSERT (!symbolic) ; + ASSERT (GB_C_IS_FULL) ; + int64_t cnvals = 0 ; #if 0 - if (symbolic) + if (GB_C_IS_BITMAP) { // C=A(I,J) symbolic with A and C bitmap ASSERT (GB_DEAD_CODE) ; @@ -153,115 +166,94 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric Cx [pC] = pA ; \ task_cnvals += ab ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #include "template/GB_bitmap_assign_IxJ_template.c" } else #endif - - if (C_iso) { - - //------------------------------------------------------------------ - // C=A(I,J) iso numeric with A and C bitmap - //------------------------------------------------------------------ - - memcpy (C->x, cscalar, ctype->size) ; + // C=A(I,J) symbolic with A and C full + int64_t *restrict Cx = (int64_t *) C->x ; #undef GB_IXJ_WORK #define GB_IXJ_WORK(pA,pC) \ { \ - int8_t ab = Ab [pA] ; \ - Cb [pC] = ab ; \ - task_cnvals += ab ; \ + Cx [pC] = pA ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" - + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_IxJ_template.c" + #undef GB_NO_CNVALS } - else - { - //------------------------------------------------------------------ - // C=A(I,J) non-iso numeric with A and C bitmap; both non-iso - //------------------------------------------------------------------ + } + else if (C_iso) + { - const GB_void *restrict Ax = (GB_void *) A->x ; - GB_void *restrict Cx = (GB_void *) C->x ; + //---------------------------------------------------------------------- + // C=A(I,J) iso numeric with A and C bitmap/full + //---------------------------------------------------------------------- + + + if (GB_C_IS_BITMAP) + { + // iso case where C and A are bitmap + int64_t cnvals = 0 ; + memcpy (C->x, cscalar, ctype->size) ; #undef GB_IXJ_WORK #define GB_IXJ_WORK(pA,pC) \ { \ int8_t ab = Ab [pA] ; \ Cb [pC] = ab ; \ - if (ab) \ - { \ - /* Cx [pC] = Ax [pA] */ \ - memcpy (Cx +((pC)*asize), Ax +((pA)*asize), asize) ; \ - task_cnvals++ ; \ - } \ + task_cnvals += ab ; \ } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" - + #include "template/GB_bitmap_assign_IxJ_template.c" + C->nvals = cnvals ; + } + else + { + // iso case where C and A are full + memcpy (C->x, cscalar, ctype->size) ; } - - C->nvals = cnvals ; } else { //---------------------------------------------------------------------- - // C = A (I,J) where A and C are both full + // C=A(I,J) non-iso numeric with A and C bitmap/full //---------------------------------------------------------------------- - if (symbolic) - { - - //------------------------------------------------------------------ - // C=A(I,J) symbolic with A and C full (from GB_subassign_symbolic) - //------------------------------------------------------------------ + // via the JIT kernel + info = GB_subref_bitmap_jit (C, A, + I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, Werk) ; - int64_t *restrict Cx = (int64_t *) C->x ; - #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pA,pC) \ - { \ - Cx [pC] = pA ; \ - } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" - - } - else if (C_iso) + // via the generic kernel + if (info == GrB_NO_VALUE) { - - //------------------------------------------------------------------ - // C=A(I,J) iso numeric with A and C full - //------------------------------------------------------------------ - - memcpy (C->x, cscalar, ctype->size) ; - - } - else - { - - //------------------------------------------------------------------ - // C=A(I,J) non-iso numeric with A and C full, both are non-iso - //------------------------------------------------------------------ - + // using the generic kernel + GBURBLE ("(generic subref) ") ; + const size_t csize = C->type->size ; // C and A have the same type const GB_void *restrict Ax = (GB_void *) A->x ; GB_void *restrict Cx = (GB_void *) C->x ; - #undef GB_IXJ_WORK - #define GB_IXJ_WORK(pA,pC) \ - { \ - /* Cx [pC] = Ax [pA] */ \ - memcpy (Cx +((pC)*asize), Ax +((pA)*asize), asize) ; \ - } - #include "assign/factory/GB_bitmap_assign_IxJ_template.c" + #define GB_COPY_ENTRY(pC,pA) \ + memcpy (Cx + (pC)*csize, Ax + (pA)*csize, csize) ; + #include "extract/template/GB_bitmap_subref_template.c" + info = GrB_SUCCESS ; } } + if (info != GrB_SUCCESS) + { + // out of memory or JIT kernel failed + GB_FREE_ALL ; + return (info) ; + } + //-------------------------------------------------------------------------- // return result //-------------------------------------------------------------------------- C->magic = GB_MAGIC ; ASSERT_MATRIX_OK (C, "C output for bitmap subref C=A(I,J)", GB0) ; + GB_FREE_WORKSPACE ; return (GrB_SUCCESS) ; } diff --git a/Source/extract/GB_extract.c b/Source/extract/GB_extract.c index a8b2db12c4..e4ad520295 100644 --- a/Source/extract/GB_extract.c +++ b/Source/extract/GB_extract.c @@ -2,7 +2,7 @@ // GB_extract: C = accum(C,A(I,J)) //------------------------------------------------------------------------------ -// 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/Source/extract/GB_extract.h b/Source/extract/GB_extract.h index 62ea380aef..777a260349 100644 --- a/Source/extract/GB_extract.h +++ b/Source/extract/GB_extract.h @@ -2,7 +2,7 @@ // GB_extract.h: definitions for GB_extract //------------------------------------------------------------------------------ -// 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/Source/extract/GB_subref.c b/Source/extract/GB_subref.c index c96e10bea6..6e6019760f 100644 --- a/Source/extract/GB_subref.c +++ b/Source/extract/GB_subref.c @@ -2,7 +2,7 @@ // GB_subref: C = A(I,J) //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -51,21 +51,21 @@ // modified here. // Reading a zombie entry: A zombie entry A(i,j) has been marked by -// flipping its index. The value of a zombie is not important, just its -// presence in the pattern. All zombies have been flipped (i < 0), and -// all regular entries are not flipped (i >= 0). Zombies are entries that -// have been marked for deletion but have not been removed from the matrix -// yet, since it's more efficient to delete zombies all at once rather -// than one at a time. +// GB_ZOMBIE on its index. The value of a zombie is not important, just +// its presence in the pattern. All zombies have been marked with +// GB_ZOMBIE so that i < 0, and all regular entries are not marked as +// zombies (i >= 0). Zombies are entries that have been marked for +// deletion but have not been removed from the matrix yet, since it's more +// efficient to delete zombies all at once rather than one at a time. // The symbolic case is zombie-agnostic, in the sense that it does not // delete them. It treats them like regular entries. However, their -// normal index must be used, not their flipped indices. The output -// matrix C contains all unflipped indices, and its references to zombies +// normal index must be used, not their GB_ZOMBIE'd indices. The output +// matrix C contains all non-zombie indices, and its references to zombies // and regular entries are identical. Zombies in A are dealt with later. // They cannot be detected in the output C matrix, but they can be // detected in A. Since pa = Cx [pc] holds the position of the entry in -// A, the entry is a zombie if Ai [pa] has been flipped. +// A, the entry is a zombie if Ai [pa] has been marked with GB_ZOMBIE. // For symbolic extractionm, pending tuples can appear in the input matrix // A. These are ignored. @@ -93,7 +93,7 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric // output GrB_Matrix C, // output matrix, static header // input, not modified - bool C_iso, // if true, return C as iso, regardless of A + bool C_iso, // if true, return C as iso, regardless of A const bool C_is_csc, // requested format of C const GrB_Matrix A, const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. @@ -178,7 +178,7 @@ GrB_Info GB_subref // C = A(I,J): either symbolic or numeric // Ensure input matrix is not jumbled. Zombies are OK. // Pending tuples are OK (and ignored) for symbolic extraction. // GB_subref_phase0 may build the hyper_hash. - GB_MATRIX_WAIT_IF_JUMBLED (A) ; + GB_UNJUMBLE (A) ; //-------------------------------------------------------------------------- // phase0: find vectors for C=A(I,J), and I,J properties diff --git a/Source/extract/GB_subref.h b/Source/extract/GB_subref.h index 04304dec69..18487a9aba 100644 --- a/Source/extract/GB_subref.h +++ b/Source/extract/GB_subref.h @@ -2,7 +2,7 @@ // GB_subref.h: definitions for GB_subref_* functions //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -10,13 +10,14 @@ #ifndef GB_SUBREF_H #define GB_SUBREF_H #include "ij/GB_ij.h" +#include "extract/include/GB_subref_method.h" GrB_Info GB_subref // C = A(I,J): either symbolic or numeric ( // output GrB_Matrix C, // output matrix, static header // input, not modified - bool C_iso, // if true, return C as iso, regardless of A + bool C_iso, // if true, return C as iso, regardless of A const bool C_is_csc, // requested format of C const GrB_Matrix A, const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc. @@ -92,7 +93,7 @@ GrB_Info GB_subref_phase2 // count nnz in each C(:,j) const int nthreads, // # of threads to use const int64_t *Mark, // for I inverse buckets, size A->vlen const int64_t *Inext, // for I inverse buckets, size nI - const int64_t nduplicates, // # of duplicates, if I inverted + const bool I_has_duplicates, // true if I has duplicates // analysis from phase0: const int64_t *restrict Ap_start, const int64_t *restrict Ap_end, @@ -122,7 +123,7 @@ GrB_Info GB_subref_phase3 // C=A(I,J) const bool post_sort, // true if post-sort needed const int64_t *Mark, // for I inverse buckets, size A->vlen const int64_t *Inext, // for I inverse buckets, size nI - const int64_t nduplicates, // # of duplicates, if I inverted + const bool I_has_duplicates, // true if I has duplicates // from phase0: int64_t **Ch_handle, size_t Ch_size, @@ -155,7 +156,7 @@ GrB_Info GB_I_inverse // invert the I list for C=A(I,:) size_t *p_Mark_size, int64_t *restrict *p_Inext, // next pointers for buckets, size nI size_t *p_Inext_size, - int64_t *p_ndupl, // number of duplicate entries in I + int64_t *p_nduplicates, // number of duplicate entries in I GB_Werk Werk ) ; @@ -176,150 +177,5 @@ GrB_Info GB_bitmap_subref // C = A(I,J): either symbolic or numeric GB_Werk Werk ) ; -//------------------------------------------------------------------------------ -// GB_subref_method: select a method for C(:,kC) = A(I,kA), for one vector of C -//------------------------------------------------------------------------------ - -// Determines the method used for to construct C(:,kC) = A(I,kA) for a -// single vector of C and A. - -static inline int GB_subref_method // return the method to use (1 to 12) -( - // output - int64_t *p_work, // work required - bool *p_this_needs_I_inverse, // true if I needs to be inverted - // input: - const int64_t ajnz, // nnz (A (:,j)) - const int64_t avlen, // A->vlen - const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE, or GB_LIST - const int64_t nI, // length of I - const bool I_inverse_ok, // true if I is invertable - const bool need_qsort, // true if C(:,k) requires sorting - const int64_t iinc, // increment for GB_STRIDE - const int64_t nduplicates // # of duplicates in I (zero if not known) -) -{ - - //-------------------------------------------------------------------------- - // initialize return values - //-------------------------------------------------------------------------- - - int method ; // determined below - bool this_needs_I_inverse = false ; // most methods do not need I inverse - int64_t work ; // most methods require O(nnz(A(:,j))) work - - //-------------------------------------------------------------------------- - // determine the method to use for C(:,j) = A (I,j) - //-------------------------------------------------------------------------- - - if (ajnz == avlen) - { - // A(:,j) is dense - if (Ikind == GB_ALL) - { - // Case 1: C(:,k) = A(:,j) are both dense - method = 1 ; - work = nI ; // ajnz == avlen == nI - } - else - { - // Case 2: C(:,k) = A(I,j), where A(:,j) is dense, - // for Ikind == GB_RANGE, GB_STRIDE, or GB_LIST - method = 2 ; - work = nI ; - } - } - else if (nI == 1) - { - // Case 3: one index - method = 3 ; - work = 1 ; - } - else if (Ikind == GB_ALL) - { - // Case 4: I is ":" - method = 4 ; - work = ajnz ; - } - else if (Ikind == GB_RANGE) - { - // Case 5: C (:,k) = A (ibegin:iend,j) - method = 5 ; - work = ajnz ; - } - else if ((Ikind == GB_LIST && !I_inverse_ok) || // must do Case 6 - (64 * nI < ajnz)) // Case 6 faster - { - // Case 6: nI not large; binary search of A(:,j) for each i in I - method = 6 ; - work = nI * 64 ; - } - else if (Ikind == GB_STRIDE) - { - if (iinc >= 0) - { - // Case 7: I = ibegin:iinc:iend with iinc >= 0 - method = 7 ; - work = ajnz ; - } - else if (iinc < -1) - { - // Case 8: I = ibegin:iinc:iend with iinc < =1 - method = 8 ; - work = ajnz ; - } - else // iinc == -1 - { - // Case 9: I = ibegin:(-1):iend - method = 9 ; - work = ajnz ; - } - } - else // Ikind == GB_LIST, and I inverse buckets will be used - { - // construct the I inverse buckets - this_needs_I_inverse = true ; - if (need_qsort) - { - // Case 10: nI large, need qsort - // duplicates are possible so cjnz > ajnz can hold. If fine tasks - // use this method, a post sort is needed when all tasks are done. - method = 10 ; - work = ajnz * 32 ; - } - else if (nduplicates > 0) - { - // Case 11: nI large, no qsort, with duplicates - // duplicates are possible so cjnz > ajnz can hold. Note that the - // # of duplicates is only known after I is inverted, which might - // not yet be done. In that case, nuplicates is assumed to be - // zero, and Case 11 is assumed to be used instead. This is - // revised after I is inverted. - method = 11 ; - work = ajnz * 2 ; - } - else - { - // Case 12: nI large, no qsort, no dupl - method = 12 ; - work = ajnz ; - } - } - - //-------------------------------------------------------------------------- - // return result - //-------------------------------------------------------------------------- - - if (p_work != NULL) - { - (*p_work) = work ; - } - if (p_this_needs_I_inverse != NULL) - { - (*p_this_needs_I_inverse) = this_needs_I_inverse ; - } - return (method) ; -} - #endif diff --git a/Source/extract/GB_subref_phase0.c b/Source/extract/GB_subref_phase0.c index 825474fd3a..2fe1342a98 100644 --- a/Source/extract/GB_subref_phase0.c +++ b/Source/extract/GB_subref_phase0.c @@ -2,16 +2,14 @@ // GB_subref_phase0: find vectors of C = A(I,J) and determine I,J properties //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - #include "extract/GB_subref.h" -#define GB_Ai(p) GBI_UNFLIP (Ai, p, avlen) +#define GB_Ai(p) GBI_UNZOMBIE (Ai, p, avlen) //------------------------------------------------------------------------------ // GB_find_Ap_start_end @@ -404,7 +402,7 @@ GrB_Info GB_subref_phase0 //---------------------------------------------------------------------- // For the case where J is jbegin:jend, Ah has been trimmed (see above). - // Ch is a shifted copy of the trimmed Ah, of length Cnvec = anvec. + // Ch is a shifted copy of the trimmed Ah, of length Cnvec = anvec, // so kA = kC, and jC = Ch [kC] = jA - jmin. Ap has also been trimmed. Cnvec = anvec ; @@ -450,7 +448,7 @@ GrB_Info GB_subref_phase0 Count [tid] = my_Cnvec ; } - GB_cumsum (Count, ntasks, NULL, 1, NULL) ; + GB_cumsum1 (Count, ntasks) ; Cnvec = Count [ntasks] ; } @@ -504,7 +502,7 @@ GrB_Info GB_subref_phase0 Count [tid] = my_Cnvec ; } - GB_cumsum (Count, ntasks, NULL, 1, NULL) ; + GB_cumsum1 (Count, ntasks) ; Cnvec = Count [ntasks] ; } diff --git a/Source/extract/GB_subref_phase2.c b/Source/extract/GB_subref_phase2.c index dcc337461a..a9e3f6e09c 100644 --- a/Source/extract/GB_subref_phase2.c +++ b/Source/extract/GB_subref_phase2.c @@ -2,13 +2,11 @@ // GB_subref_phase2: find # of entries in C=A(I,J) //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed, but GB_subref_method has 6 or 7 variants. - // GB_subref_phase2 counts the number of entries in each vector of C, for // C=A(I,J) and then does a cumulative sum to find Cp. @@ -28,7 +26,7 @@ GrB_Info GB_subref_phase2 // count nnz in each C(:,j) const int nthreads, // # of threads to use const int64_t *Mark, // for I inverse buckets, size A->vlen const int64_t *Inext, // for I inverse buckets, size nI - const int64_t nduplicates, // # of duplicates, if I inverted + const bool I_has_duplicates, // true if I has duplicates // analysis from phase0: const int64_t *restrict Ap_start, const int64_t *restrict Ap_end, @@ -72,19 +70,23 @@ GrB_Info GB_subref_phase2 // count nnz in each C(:,j) // count the entries in each vector of C //-------------------------------------------------------------------------- + #define GB_I_KIND Ikind + #define GB_NEED_QSORT need_qsort + #define GB_I_HAS_DUPLICATES I_has_duplicates + #define GB_ANALYSIS_PHASE if (symbolic) { #define GB_SYMBOLIC // symbolic extraction must handle zombies const int64_t nzombies = A->nzombies ; - #include "extract/factory/GB_subref_template.c" + #include "extract/template/GB_subref_template.c" } else { // iso and non-iso numeric extraction do not see zombies ASSERT (!GB_ZOMBIES (A)) ; - #include "extract/factory/GB_subref_template.c" + #include "extract/template/GB_subref_template.c" } //-------------------------------------------------------------------------- diff --git a/Source/extract/GB_subref_phase3.c b/Source/extract/GB_subref_phase3.c index 323f917f63..56503179df 100644 --- a/Source/extract/GB_subref_phase3.c +++ b/Source/extract/GB_subref_phase3.c @@ -1,20 +1,19 @@ //------------------------------------------------------------------------------ -// GB_subref_phase3: C=A(I,J) +// GB_subref_phase3: C=A(I,J) where C and A are sparse/hypersparse //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // This function either frees Cp and Ch, or transplants then into C, as C->p // and C->h. Either way, the caller must not free them. #include "extract/GB_subref.h" #include "sort/GB_sort.h" #include "include/GB_unused.h" +#include "jitifyer/GB_stringify.h" GrB_Info GB_subref_phase3 // C=A(I,J) ( @@ -30,7 +29,7 @@ GrB_Info GB_subref_phase3 // C=A(I,J) const bool post_sort, // true if post-sort needed const int64_t *Mark, // for I inverse buckets, size A->vlen const int64_t *Inext, // for I inverse buckets, size nI - const int64_t nduplicates, // # of duplicates, if I inverted + const bool I_has_duplicates, // true if I has duplicates // from phase0: int64_t **Ch_handle, size_t Ch_size, @@ -65,7 +64,8 @@ GrB_Info GB_subref_phase3 // C=A(I,J) const int64_t *restrict Cp = (*Cp_handle) ; ASSERT (Cp != NULL) ; ASSERT_MATRIX_OK (A, "A for subref phase3", GB0) ; - ASSERT (!GB_IS_BITMAP (A)) ; // GB_bitmap_subref is used instead + ASSERT (!GB_IS_BITMAP (A)) ; + ASSERT (!GB_IS_FULL (A)) ; //-------------------------------------------------------------------------- // allocate the output matrix C @@ -116,6 +116,9 @@ GrB_Info GB_subref_phase3 // C=A(I,J) #define GB_PHASE_2_OF_2 int64_t *restrict Ci = C->i ; int64_t *restrict Cx = (int64_t *) C->x ; + #define GB_I_KIND Ikind + #define GB_NEED_QSORT need_qsort + #define GB_I_HAS_DUPLICATES I_has_duplicates if (symbolic) { @@ -136,10 +139,10 @@ GrB_Info GB_subref_phase3 // C=A(I,J) Cx [(pC) + k] = (pA) + k ; \ } #define GB_COPY_ENTRY(pC,pA) Cx [pC] = (pA) ; - #define GB_CSIZE1 1 - #define GB_CSIZE2 (sizeof (int64_t)) + #define GB_QSORT_1B(Ci,Cx,pC,clen) \ + GB_qsort_1b_size8 (Ci + pC, (uint64_t *) (Cx + pC), clen) ; #define GB_SYMBOLIC - #include "extract/factory/GB_subref_template.c" + #include "extract/template/GB_subref_template.c" } else if (C_iso) @@ -154,7 +157,8 @@ GrB_Info GB_subref_phase3 // C=A(I,J) #define GB_COPY_RANGE(pC,pA,len) ; #define GB_COPY_ENTRY(pC,pA) ; #define GB_ISO_SUBREF - #include "extract/factory/GB_subref_template.c" + #define GB_QSORT_1B(Ci,Cx,pC,clen) ; + #include "extract/template/GB_subref_template.c" } else @@ -164,39 +168,52 @@ GrB_Info GB_subref_phase3 // C=A(I,J) // non-iso numeric subref //---------------------------------------------------------------------- - // TODO: create versions for asize = 1, 2, 4, 8, 16, and other - - ASSERT (C->type = A->type) ; - const int64_t asize = A->type->size ; - const GB_void *restrict Ax = (GB_void *) A->x ; - GB_void *restrict Cx = (GB_void *) C->x ; - - // C and A have the same type - #define GB_COPY_RANGE(pC,pA,len) \ - memcpy (Cx + (pC)*asize, Ax + (pA)*asize, (len) * asize) ; - #define GB_COPY_ENTRY(pC,pA) \ - memcpy (Cx + (pC)*asize, Ax + (pA)*asize, asize) ; - #define GB_CSIZE1 asize - #define GB_CSIZE2 asize - #include "extract/factory/GB_subref_template.c" + // using the JIT kernel + info = GB_subref_sparse_jit (C, TaskList, ntasks, nthreads, post_sort, + Mark, Inext, I_has_duplicates, Ap_start, Ap_end, need_qsort, + Ikind, nI, Icolon, A, I) ; + + if (info == GrB_NO_VALUE) + { + // using the generic kernel + GBURBLE ("(generic subref) ") ; + ASSERT (C->type = A->type) ; + const int64_t csize = C->type->size ; + const GB_void *restrict Ax = (GB_void *) A->x ; + GB_void *restrict Cx = (GB_void *) C->x ; + + // C and A have the same type + #define GB_COPY_RANGE(pC,pA,len) \ + memcpy (Cx + (pC)*csize, Ax + (pA)*csize, (len) * csize) ; + #define GB_COPY_ENTRY(pC,pA) \ + memcpy (Cx + (pC)*csize, Ax + (pA)*csize, csize) ; + #define GB_QSORT_1B(Ci,Cx,pC,clen) \ + GB_qsort_1b (Ci+(pC), (GB_void *) (Cx+(pC)*csize), csize, clen); + #include "extract/template/GB_subref_template.c" + info = GrB_SUCCESS ; + } } //-------------------------------------------------------------------------- // remove empty vectors from C, if hypersparse //-------------------------------------------------------------------------- - info = GB_hypermatrix_prune (C, Werk) ; - if (info != GrB_SUCCESS) + if (info == GrB_SUCCESS) { - // out of memory - GB_phybix_free (C) ; - return (info) ; + info = GB_hypermatrix_prune (C, Werk) ; } //-------------------------------------------------------------------------- // return result //-------------------------------------------------------------------------- + if (info != GrB_SUCCESS) + { + // out of memory or JIT kernel failed + GB_phybix_free (C) ; + return (info) ; + } + // caller must not free Cp or Ch ASSERT_MATRIX_OK (C, "C output for subref phase3", GB0) ; return (GrB_SUCCESS) ; diff --git a/Source/extract/GB_subref_slice.c b/Source/extract/GB_subref_slice.c index add4b745c9..90ba4c7e11 100644 --- a/Source/extract/GB_subref_slice.c +++ b/Source/extract/GB_subref_slice.c @@ -2,13 +2,11 @@ // GB_subref_slice: construct coarse/fine tasks for C = A(I,J) //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed, but GB_subref_method has 6 or 7 variants. - // Determine the tasks for computing C=A(I,J). The matrix C has Cnvec vectors, // and these are divided into coarse and fine tasks. A coarse task will // compute one or more whole vectors of C. A fine task operates on a slice of @@ -181,17 +179,10 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref int64_t pA_end = Ap_end [kC] ; int64_t alen = pA_end - pA ; // nnz (A (imin:imax,j)) - int64_t work ; // amount of work for C(:,kC) = A (I,kA) bool this_needs_I_inverse ; // true if this vector needs I inverse - - // ndupl in I not yet known; it is found when I is inverted. For - // now, assume I has no duplicate entries. All that is needed for now - // is the work required for each C(:,kC), and whether or not I inverse - // must be created. The # of duplicates has no impact on the I inverse - // decision, and a minor effect on the work (which is ignored). - - GB_subref_method (&work, &this_needs_I_inverse, alen, avlen, - Ikind, nI, I_inverse_ok, need_qsort, iinc, 0) ; + // amount of work for C(:,kC) = A (I,kA): + int64_t work = GB_subref_work (&this_needs_I_inverse, alen, avlen, + Ikind, nI, I_inverse_ok, need_qsort, iinc) ; // log the result need_I_inverse = need_I_inverse || this_needs_I_inverse ; @@ -219,11 +210,11 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref // invert I if required //-------------------------------------------------------------------------- - int64_t ndupl = 0 ; + int64_t nduplicates = 0 ; if (need_I_inverse) { GB_OK (GB_I_inverse (I, nI, avlen, &Mark, &Mark_size, - &Inext, &Inext_size, &ndupl, Werk)) ; + &Inext, &Inext_size, &nduplicates, Werk)) ; ASSERT (Mark != NULL) ; ASSERT (Inext != NULL) ; } @@ -249,7 +240,7 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref (*p_Mark_size ) = Mark_size ; (*p_Inext ) = Inext ; (*p_Inext_size ) = Inext_size ; - (*p_nduplicates) = ndupl ; + (*p_nduplicates) = nduplicates ; return (GrB_SUCCESS) ; } @@ -271,6 +262,7 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref //-------------------------------------------------------------------------- int ntasks = 0 ; + bool I_has_duplicates = (nduplicates > 0) ; for (int t = 0 ; t < ntasks1 ; t++) { @@ -378,8 +370,8 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref int64_t pA_end = Ap_end [k] ; int64_t alen = pA_end - pA ; // nnz (A (imin:imax,j)) - int method = GB_subref_method (NULL, NULL, alen, avlen, - Ikind, nI, I_inverse_ok, need_qsort, iinc, ndupl) ; + int method = GB_subref_method (alen, avlen, Ikind, nI, + I_inverse_ok, need_qsort, iinc, I_has_duplicates) ; if (method == 10) { @@ -470,7 +462,7 @@ GrB_Info GB_subref_slice // phase 1 of GB_subref (*p_Mark_size ) = Mark_size ; (*p_Inext ) = Inext ; (*p_Inext_size ) = Inext_size ; - (*p_nduplicates) = ndupl ; + (*p_nduplicates) = nduplicates ; return (GrB_SUCCESS) ; } diff --git a/Source/extract/GrB_Col_extract.c b/Source/extract/GrB_Col_extract.c index f7e4f64c6a..8940a31b27 100644 --- a/Source/extract/GrB_Col_extract.c +++ b/Source/extract/GrB_Col_extract.c @@ -2,7 +2,7 @@ // GrB_Col_extract: w = accum (w, A(I,j)) or A(j,I)' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/extract/GrB_Matrix_extract.c b/Source/extract/GrB_Matrix_extract.c index cd087d7ad6..667d9a084d 100644 --- a/Source/extract/GrB_Matrix_extract.c +++ b/Source/extract/GrB_Matrix_extract.c @@ -2,7 +2,7 @@ // GrB_Matrix_extract: C = accum (C, A(I,J)) or A(J,I)' //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/extract/GrB_Vector_extract.c b/Source/extract/GrB_Vector_extract.c index c13388b019..34c1ffb880 100644 --- a/Source/extract/GrB_Vector_extract.c +++ b/Source/extract/GrB_Vector_extract.c @@ -2,7 +2,7 @@ // GrB_Vector_extract: w = accum (w, u(I)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/extract/include/GB_subref_method.h b/Source/extract/include/GB_subref_method.h new file mode 100644 index 0000000000..c4d639b0ef --- /dev/null +++ b/Source/extract/include/GB_subref_method.h @@ -0,0 +1,196 @@ +//------------------------------------------------------------------------------ +// GB_subref_method.h: definitions of GB_subref_method and GB_subref_work +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_SUBREF_METHOD_H +#define GB_SUBREF_METHOD_H + +//------------------------------------------------------------------------------ +// GB_subref_method: select a method for C(:,k) = A(I,j), for one vector of C +//------------------------------------------------------------------------------ + +// Determines the method used for to construct C(:,k) = A(I,j) for a +// single vector of C and A. + +static inline int GB_subref_method // return the method to use (1 to 12) +( + // input: + const int64_t ajnz, // nnz (A (:,j)) + const int64_t avlen, // A->vlen + const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE, or GB_LIST + const int64_t nI, // length of I + const bool I_inverse_ok, // true if I is invertable + const bool need_qsort, // true if C(:,k) requires sorting + const int64_t iinc, // increment for GB_STRIDE + const bool I_has_duplicates // true if duplicates in I + // (false if not yet known) +) +{ + + //-------------------------------------------------------------------------- + // determine the method to use for C(:,k) = A (I,j) + //-------------------------------------------------------------------------- + + int method ; + + if (ajnz == avlen) + { + // A(:,j) is dense + if (Ikind == GB_ALL) + { + // Case 1: C(:,k) = A(:,j) are both dense + method = 1 ; + } + else + { + // Case 2: C(:,k) = A(I,j), where A(:,j) is dense, + // for Ikind == GB_RANGE, GB_STRIDE, or GB_LIST + method = 2 ; + } + } + else if (nI == 1) + { + // Case 3: one index + method = 3 ; + } + else if (Ikind == GB_ALL) + { + // Case 4: I is ":" + method = 4 ; + } + else if (Ikind == GB_RANGE) + { + // Case 5: C (:,k) = A (ibegin:iend,j) + method = 5 ; + } + else if ((Ikind == GB_LIST && !I_inverse_ok) || // must do Case 6 + (64 * nI < ajnz)) // Case 6 faster + { + // Case 6: nI not large; binary search of A(:,j) for each i in I + method = 6 ; + } + else if (Ikind == GB_STRIDE) + { + if (iinc >= 0) + { + // Case 7: I = ibegin:iinc:iend with iinc >= 0 + method = 7 ; + } + else if (iinc < -1) + { + // Case 8: I = ibegin:iinc:iend with iinc < =1 + method = 8 ; + } + else // iinc == -1 + { + // Case 9: I = ibegin:(-1):iend + method = 9 ; + } + } + else // Ikind == GB_LIST, and I inverse buckets will be used + { + // construct the I inverse buckets + if (need_qsort) + { + // Case 10: nI large, need qsort + // duplicates are possible so cjnz > ajnz can hold. If fine tasks + // use this method, a post sort is needed when all tasks are done. + method = 10 ; + } + else if (I_has_duplicates) + { + // Case 11: nI large, no qsort, with duplicates + // duplicates are possible so cjnz > ajnz can hold. Note that the + // # of duplicates is only known after I is inverted, which might + // not yet be done. In that case, nuplicates is assumed to be + // zero, and Case 12 is assumed to be used instead. This is + // revised after I is inverted. + method = 11 ; + } + else + { + // Case 12: nI large, no qsort, no duplicates + method = 12 ; + } + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + return (method) ; +} + +//------------------------------------------------------------------------------ +// GB_subref_work: return the work for each subref method +//------------------------------------------------------------------------------ + +static inline int64_t GB_subref_work // return the work for a subref method +( + // output + bool *p_this_needs_I_inverse, // true if I needs to be inverted + // input: + const int64_t ajnz, // nnz (A (:,j)) + const int64_t avlen, // A->vlen + const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE, or GB_LIST + const int64_t nI, // length of I + const bool I_inverse_ok, // true if I is invertable + const bool need_qsort, // true if C(:,k) requires sorting + const int64_t iinc // increment for GB_STRIDE +) +{ + + //-------------------------------------------------------------------------- + // get the method + //-------------------------------------------------------------------------- + + // nduplicates in I not yet known; it is found when I is inverted. For + // now, assume I has no duplicate entries. All that is needed for now is + // the work required for each C(:,k), and whether or not I inverse must be + // created. The # of duplicates has no impact on the I inverse decision, + // and a minor effect on the work (which is ignored). Method 11 is only + // used if I_has_duplicates is true. + + const bool I_has_duplicates = false ; // not yet known + + int method = GB_subref_method (ajnz, avlen, Ikind, nI, I_inverse_ok, + need_qsort, iinc, I_has_duplicates) ; + + //-------------------------------------------------------------------------- + // get the work + //-------------------------------------------------------------------------- + + int64_t work = 0 ; + switch (method) + { + case 1 : work = nI ; break ; + case 2 : work = nI ; break ; + case 3 : work = 1 ; break ; + case 4 : work = ajnz ; break ; + case 5 : work = ajnz ; break ; + case 6 : work = nI * 64 ; break ; + case 7 : work = ajnz ; break ; + case 8 : work = ajnz ; break ; + case 9 : work = ajnz ; break ; + case 10 : work = ajnz * 32 ; break ; +// case 11 : +// work = ajnz * 2 ; break ; // case not determined yet + default : + case 12 : work = ajnz ; break ; + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + (*p_this_needs_I_inverse) = (method >= 10) ; + return (work) ; +} + +#endif + diff --git a/Source/extract/template/GB_bitmap_subref_template.c b/Source/extract/template/GB_bitmap_subref_template.c new file mode 100644 index 0000000000..9f90f467c9 --- /dev/null +++ b/Source/extract/template/GB_bitmap_subref_template.c @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// GB_bitmap_subref_template: C = A(I,J) where A is bitmap/full +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// C=A(I,J), where C and A are bitmap/full, numeric and non-iso + +{ + + int64_t cnvals = 0 ; + + //-------------------------------------------------------------------------- + // C = A(I,J) + //-------------------------------------------------------------------------- + + if (GB_C_IS_BITMAP) + { + + //---------------------------------------------------------------------- + // C=A(I,J) non-iso numeric with A and C bitmap; both non-iso + //---------------------------------------------------------------------- + + #undef GB_IXJ_WORK + #define GB_IXJ_WORK(pA,pC) \ + { \ + int8_t ab = Ab [pA] ; \ + Cb [pC] = ab ; \ + if (ab) \ + { \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_ENTRY (pC, pA) \ + task_cnvals++ ; \ + } \ + } + #include "template/GB_bitmap_assign_IxJ_template.c" + C->nvals = cnvals ; + } + else + { + + //---------------------------------------------------------------------- + // C=A(I,J) non-iso numeric with A and C full, both are non-iso + //---------------------------------------------------------------------- + + #undef GB_IXJ_WORK + #define GB_IXJ_WORK(pA,pC) \ + { \ + /* Cx [pC] = Ax [pA] */ \ + GB_COPY_ENTRY (pC, pA) \ + } + #define GB_NO_CNVALS + #include "template/GB_bitmap_assign_IxJ_template.c" + #undef GB_NO_CNVALS + } +} + diff --git a/Source/extract/factory/GB_subref_template.c b/Source/extract/template/GB_subref_template.c similarity index 90% rename from Source/extract/factory/GB_subref_template.c rename to Source/extract/template/GB_subref_template.c index 42fe3809c8..4040981d8d 100644 --- a/Source/extract/factory/GB_subref_template.c +++ b/Source/extract/template/GB_subref_template.c @@ -1,24 +1,25 @@ //------------------------------------------------------------------------------ -// GB_subref_template: C = A(I,J) +// GB_subref_template: C = A(I,J) where C and A are sparse/hypersparse //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// GB_subref_templat extracts a submatrix, C = A(I,J). The method is done in -// two phases. Phase 1 just counts the entries in C, and phase 2 constructs -// the pattern and values of C. There are 3 kinds of subref: +// GB_subref_template extracts a submatrix, C = A(I,J). The method is done in +// three phases. Phase 1 and 2 are symbolic, and phase 3 (this phase) +// constructs the pattern and values of C. There are 3 kinds of subref: // -// symbolic: C(i,j) is the position of A(I(i),J(j)) in the matrix A -// iso: C = A(I,J), extracting the pattern only, not the values -// numeric: C = A(I,J), extracting the pattern and values +// symbolic: C(i,j) is the position of A(I(i),J(j)) in the matrix A, +// in this case, A can have zombies +// iso: C = A(I,J), extracting the pattern only, not the values +// numeric: C = A(I,J), extracting the pattern and values, #if defined ( GB_SYMBOLIC ) // symbolic method must tolerate zombies - #define GB_Ai(p) GBI_UNFLIP (Ai, p, avlen) + #define GB_Ai(p) GBI_UNZOMBIE (Ai, p, avlen) #else @@ -42,7 +43,7 @@ const int64_t *restrict Ai = A->i ; const int64_t avlen = A->vlen ; - // these values are ignored if Ikind == GB_LIST + // these values are ignored if GB_I_KIND == GB_LIST int64_t ibegin = Icolon [GxB_BEGIN] ; int64_t iinc = Icolon [GxB_INC ] ; int64_t inc = (iinc < 0) ? (-iinc) : iinc ; @@ -173,8 +174,8 @@ else { // determine the method based on A(*,kA) and I - method = GB_subref_method (NULL, NULL, alen, avlen, Ikind, nI, - (Mark != NULL), need_qsort, iinc, nduplicates) ; + method = GB_subref_method (alen, avlen, GB_I_KIND, nI, + (Mark != NULL), GB_NEED_QSORT, iinc, GB_I_HAS_DUPLICATES) ; } //------------------------------------------------------------------ @@ -189,7 +190,7 @@ //-------------------------------------------------------------- // A (:,kA) has not been sliced - ASSERT (Ikind == GB_ALL) ; + ASSERT (GB_I_KIND == GB_ALL) ; ASSERT (pA == Ap_start [kC]) ; ASSERT (pA_end == Ap_end [kC]) ; // copy the entire vector and construct indices @@ -199,7 +200,7 @@ for (int64_t k = 0 ; k < ilen ; k++) { int64_t inew = k + pI ; - ASSERT (inew == GB_ijlist (I, inew, Ikind, Icolon)) ; + ASSERT (inew == GB_ijlist (I, inew, GB_I_KIND, Icolon)); ASSERT (inew == GB_Ai (pA + inew)) ; Ci [pC + k] = inew ; } @@ -223,7 +224,7 @@ { // C(inew,kC) = A(i,kA), and it always exists. int64_t inew = k + pI ; - int64_t i = GB_ijlist (I, inew, Ikind, Icolon) ; + int64_t i = GB_ijlist (I, inew, GB_I_KIND, Icolon) ; ASSERT (i == GB_Ai (pA + i)) ; Ci [pC + k] = inew ; GB_COPY_ENTRY (pC + k, pA + i) ; @@ -236,16 +237,16 @@ //-------------------------------------------------------------- // binary search in GB_subref_phase0 has already found it. - // This can be any Ikind with nI=1: GB_ALL with A->vlen=1, - // GB_RANGE with ibegin==iend, GB_STRIDE such as 0:-1:0 - // (with length 1), or a GB_LIST with ni=1. + // This can be any GB_I_KIND with nI=1: GB_ALL with + // A->vlen=1, GB_RANGE with ibegin==iend, GB_STRIDE such as + // 0:-1:0 (with length 1), or a GB_LIST with ni=1. // Time: 50x faster ASSERT (!fine_task) ; ASSERT (alen == 1) ; ASSERT (nI == 1) ; - ASSERT (GB_Ai (pA) == GB_ijlist (I, 0, Ikind, Icolon)) ; + ASSERT (GB_Ai (pA) == GB_ijlist (I, 0, GB_I_KIND, Icolon)) ; #if defined ( GB_ANALYSIS_PHASE ) clen = 1 ; #else @@ -255,13 +256,13 @@ break ; //-------------------------------------------------------------- - case 4 : // Ikind is ":", thus C(:,kC) = A (:,kA) + case 4 : // GB_I_KIND is ":", thus C(:,kC) = A (:,kA) //-------------------------------------------------------------- // Time: 1x faster but low speedup on the Mac. Why? // Probably memory bound since it is just memcpy's. - ASSERT (Ikind == GB_ALL && ibegin == 0) ; + ASSERT (GB_I_KIND == GB_ALL && ibegin == 0) ; #if defined ( GB_ANALYSIS_PHASE ) clen = alen ; #else @@ -277,7 +278,7 @@ { // symbolic C(:,kC) = A(:,kA) where A has zombies int64_t i = GB_Ai (pA + k) ; - ASSERT (i == GB_ijlist (I, i, Ikind, Icolon)) ; + ASSERT (i == GB_ijlist (I, i, GB_I_KIND, Icolon)) ; Ci [pC + k] = i ; } } @@ -289,12 +290,12 @@ break ; //-------------------------------------------------------------- - case 5 : // Ikind is GB_RANGE = ibegin:iend + case 5 : // GB_I_KIND is GB_RANGE = ibegin:iend //-------------------------------------------------------------- // Time: much faster. Good speedup too. - ASSERT (Ikind == GB_RANGE) ; + ASSERT (GB_I_KIND == GB_RANGE) ; #if defined ( GB_ANALYSIS_PHASE ) clen = alen ; #else @@ -302,7 +303,7 @@ { int64_t i = GB_Ai (pA + k) ; int64_t inew = i - ibegin ; - ASSERT (i == GB_ijlist (I, inew, Ikind, Icolon)) ; + ASSERT (i == GB_ijlist (I, inew, GB_I_KIND, Icolon)) ; Ci [pC + k] = inew ; } GB_COPY_RANGE (pC, pA, alen) ; @@ -340,7 +341,7 @@ // C(inew,kC) = A (i,kA), if it exists. // i = I [inew] ; or from a colon expression int64_t inew = k + pI ; - int64_t i = GB_ijlist (I, inew, Ikind, Icolon) ; + int64_t i = GB_ijlist (I, inew, GB_I_KIND, Icolon) ; bool found ; int64_t pleft = pA ; int64_t pright = pA_end - 1 ; @@ -377,7 +378,7 @@ // but has good speedup. About as fast with // enough threads. - ASSERT (Ikind == GB_STRIDE && iinc > 1) ; + ASSERT (GB_I_KIND == GB_STRIDE && iinc > 1) ; for (int64_t k = 0 ; k < alen ; k++) { // A(i,kA) present; see if it is in ibegin:iinc:iend @@ -410,8 +411,8 @@ // Time: 2x slower for iinc = -2 or -8. // Good speedup though. Faster for // large values (iinc = -128). - - ASSERT (Ikind == GB_STRIDE && iinc < -1) ; + + ASSERT (GB_I_KIND == GB_STRIDE && iinc < -1) ; for (int64_t k = alen - 1 ; k >= 0 ; k--) { // A(i,kA) present; see if it is in ibegin:iinc:iend @@ -443,7 +444,7 @@ // Time: much faster. Good speedup. - ASSERT (Ikind == GB_STRIDE && iinc == -1) ; + ASSERT (GB_I_KIND == GB_STRIDE && iinc == -1) ; #if defined ( GB_ANALYSIS_PHASE ) clen = alen ; #else @@ -452,7 +453,7 @@ // A(i,kA) is present int64_t i = GB_Ai (pA + k) ; int64_t inew = (ibegin - i) ; - ASSERT (i == GB_ijlist (I, inew, Ikind, Icolon)) ; + ASSERT (i == GB_ijlist (I, inew, GB_I_KIND, Icolon)) ; Ci [pC] = inew ; GB_COPY_ENTRY (pC, pA + k) ; pC++ ; @@ -472,7 +473,7 @@ // Case 10 works well when I has many entries and A(:,kA) // has few entries. C(:,kC) must be sorted after this pass. - ASSERT (Ikind == GB_LIST) ; + ASSERT (GB_I_KIND == GB_LIST) ; for (int64_t k = 0 ; k < alen ; k++) { // A(i,kA) present, look it up in the I inverse buckets @@ -482,7 +483,7 @@ GB_for_each_index_in_bucket (inew, i) { ASSERT (inew >= 0 && inew < nI) ; - ASSERT (i == GB_ijlist (I, inew, Ikind, Icolon)) ; + ASSERT (i == GB_ijlist (I, inew, GB_I_KIND,Icolon)); #if defined ( GB_ANALYSIS_PHASE ) clen++ ; #else @@ -512,8 +513,7 @@ GB_qsort_1 (Ci + pC, clen) ; #else // sort the pattern of C(:,kC), and the values - GB_qsort_1b (Ci + pC, (GB_void *) (Cx + pC*GB_CSIZE1), - GB_CSIZE2, clen) ; + GB_QSORT_1B (Ci, Cx, pC, clen) ; #endif } #endif @@ -528,7 +528,7 @@ // so that no sort is required for C(:,kC). It is // otherwise identical to Case 10. - ASSERT (Ikind == GB_LIST) ; + ASSERT (GB_I_KIND == GB_LIST) ; for (int64_t k = 0 ; k < alen ; k++) { // A(i,kA) present, look it up in the I inverse buckets @@ -538,7 +538,7 @@ GB_for_each_index_in_bucket (inew, i) { ASSERT (inew >= 0 && inew < nI) ; - ASSERT (i == GB_ijlist (I, inew, Ikind, Icolon)) ; + ASSERT (i == GB_ijlist (I, inew, GB_I_KIND,Icolon)); #if defined ( GB_ANALYSIS_PHASE ) clen++ ; #else @@ -562,7 +562,7 @@ // just needs to iterate 0 or 1 times. Works well when I // has many entries and A(:,kA) has few entries. - ASSERT (Ikind == GB_LIST && nduplicates == 0) ; + ASSERT (GB_I_KIND == GB_LIST && !GB_I_HAS_DUPLICATES) for (int64_t k = 0 ; k < alen ; k++) { // A(i,kA) present, look it up in the I inverse buckets @@ -573,7 +573,7 @@ if (inew >= 0) { ASSERT (inew >= 0 && inew < nI) ; - ASSERT (i == GB_ijlist (I, inew, Ikind, Icolon)) ; + ASSERT (i == GB_ijlist (I, inew, GB_I_KIND,Icolon)); #if defined ( GB_ANALYSIS_PHASE ) clen++ ; #else @@ -641,8 +641,7 @@ #else { // sort the pattern of C(:,kC), and the values - GB_qsort_1b (Ci + pC, (GB_void *) (Cx + pC*GB_CSIZE1), - GB_CSIZE2, clen) ; + GB_QSORT_1B (Ci, Cx, pC, clen) ; } #endif } @@ -657,8 +656,7 @@ #undef GB_for_each_index_in_bucket #undef GB_COPY_RANGE #undef GB_COPY_ENTRY -#undef GB_CSIZE1 -#undef GB_CSIZE2 #undef GB_SYMBOLIC #undef GB_ISO_SUBREF +#undef GB_QSORT_1B diff --git a/Source/extractTuples/GB_extractTuples.c b/Source/extractTuples/GB_extractTuples.c index 78ba80fa65..084f92cf75 100644 --- a/Source/extractTuples/GB_extractTuples.c +++ b/Source/extractTuples/GB_extractTuples.c @@ -2,13 +2,11 @@ // GB_extractTuples: extract all the tuples from a matrix //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Extracts all tuples from a matrix, like [I,J,X] = find (A). If any // parameter I, J and/or X is NULL, then that component is not extracted. The // size of the I, J, and X arrays (those that are not NULL) is given by nvals, @@ -26,8 +24,7 @@ #define GB_FREE_ALL \ { \ GB_Matrix_free (&T) ; \ - GB_FREE_WORK (&Ap, Ap_size) ; \ - GB_FREE_WORK (&X_bitmap, X_bitmap_size) ; \ + GB_FREE_WORK (&Cp, Cp_size) ; \ } GrB_Info GB_extractTuples // extract all tuples from a matrix @@ -36,7 +33,7 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix GrB_Index *J_out, // array for returning col indices of tuples void *X, // array for returning values of tuples GrB_Index *p_nvals, // I,J,X size on input; # tuples on output - const GB_Type_code xcode, // type of array X + const GrB_Type xtype, // type of array X const GrB_Matrix A, // matrix to extract tuples from GB_Werk Werk ) @@ -49,27 +46,22 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix GrB_Info info ; struct GB_Matrix_opaque T_header ; GrB_Matrix T = NULL ; - GB_void *restrict X_bitmap = NULL ; size_t X_bitmap_size = 0 ; - int64_t *restrict Ap = NULL ; size_t Ap_size = 0 ; + int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ; ASSERT_MATRIX_OK (A, "A to extract", GB0) ; + ASSERT_TYPE_OK (xtype, "xtype to extract", GB0) ; ASSERT (p_nvals != NULL) ; // delete any lingering zombies and assemble any pending tuples; // allow A to remain jumbled GB_MATRIX_WAIT_IF_PENDING_OR_ZOMBIES (A) ; + // get the types GB_BURBLE_DENSE (A, "(A %s) ") ; - ASSERT (xcode <= GB_UDT_code) ; + const GB_Type_code xcode = xtype->code ; const GB_Type_code acode = A->type->code ; const size_t asize = A->type->size ; - // xcode and A must be compatible - if (!GB_code_compatible (xcode, acode)) - { - return (GrB_DOMAIN_MISMATCH) ; - } - const int64_t anz = GB_nnz (A) ; if (anz == 0) { @@ -120,15 +112,8 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix // allocate workspace //---------------------------------------------------------------------- - bool need_typecast = (X != NULL) && (xcode != acode) ; - if (need_typecast) - { - // X must be typecasted - int64_t anzmax = GB_IMAX (anz, 1) ; - X_bitmap = GB_MALLOC_WORK (anzmax*asize, GB_void, &X_bitmap_size) ; - } - Ap = GB_MALLOC_WORK (A->vdim+1, int64_t, &Ap_size) ; - if (Ap == NULL || (need_typecast && X_bitmap == NULL)) + Cp = GB_MALLOC_WORK (A->vdim+1, int64_t, &Cp_size) ; + if (Cp == NULL) { // out of memory GB_FREE_ALL ; @@ -139,36 +124,20 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix // extract the tuples //---------------------------------------------------------------------- - // TODO: pass xcode to GB_convert_bitmap_worker and let it do the - // typecasting. This works for now, however. - - // if A is iso, GB_convert_bitmap_worker expands the iso scalar - // into its result, X or X_bitmap - - GB_OK (GB_convert_bitmap_worker (Ap, (int64_t *) I, (int64_t *) J, - (GB_void *) (need_typecast ? X_bitmap : X), NULL, A, Werk)) ; + // Extract the pattern and the values, typecasting if needed. If A is + // iso or X is NULL, GB_convert_b2s only does the symbolic work. - //---------------------------------------------------------------------- - // typecast X if needed - //---------------------------------------------------------------------- + GB_OK (GB_convert_b2s (Cp, (int64_t *) I, (int64_t *) J, + (GB_void *) X, NULL, xtype, A, Werk)) ; - if (need_typecast) + if (A->iso && X != NULL) { - // typecast the values from X_bitmap into X, using a temporary - // full anz-by-1 matrix T - ASSERT (X != NULL) ; - ASSERT (xcode != acode) ; - GB_CLEAR_STATIC_HEADER (T, &T_header) ; - GB_OK (GB_new (&T, // full, existing header - A->type, anz, 1, GB_Ap_null, true, GxB_FULL, 0, 0)) ; - T->x = X_bitmap ; - T->x_shallow = true ; - T->magic = GB_MAGIC ; - T->plen = -1 ; - T->nvec = 1 ; - ASSERT_MATRIX_OK (T, "T to cast_array", GB0) ; - GB_OK (GB_cast_array ((GB_void *) X, xcode, T, nthreads)) ; - GB_Matrix_free (&T) ; + // A is iso but a non-iso X has been requested; + // typecast the iso scalar and expand it into X + const size_t xsize = xtype->size ; + GB_void scalar [GB_VLA(xsize)] ; + GB_cast_scalar (scalar, xcode, A->x, acode, asize) ; + GB_OK (GB_iso_expand (X, anz, scalar, xtype)) ; } } @@ -219,11 +188,12 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix { if (A->iso) { - // typecast the scalar and expand it into X - size_t xsize = GB_code_size (xcode, asize) ; + // A is iso but a non-iso X has been requested; + // typecast the iso scalar and expand it into X + const size_t xsize = xtype->size ; GB_void scalar [GB_VLA(xsize)] ; GB_cast_scalar (scalar, xcode, A->x, acode, asize) ; - GB_expand_iso (X, anz, scalar, xsize) ; + GB_OK (GB_iso_expand (X, anz, scalar, xtype)) ; } else if (xcode == acode) { diff --git a/Source/extractTuples/GB_extractTuples.h b/Source/extractTuples/GB_extractTuples.h index 08f02735ca..c7f515f2ac 100644 --- a/Source/extractTuples/GB_extractTuples.h +++ b/Source/extractTuples/GB_extractTuples.h @@ -2,7 +2,7 @@ // GB_extractTuples.h: definitions for GB_extractTuples and related methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -25,7 +25,7 @@ GrB_Info GB_extractTuples // extract all tuples from a matrix GrB_Index *J_out, // array for returning col indices of tuples void *X, // array for returning values of tuples GrB_Index *p_nvals, // I,J,X size on input; # tuples on output - const GB_Type_code xcode, // type of array X + const GrB_Type xtype, // type of array X const GrB_Matrix A, // matrix to extract tuples from GB_Werk Werk ) ; diff --git a/Source/extractTuples/GB_extract_vector_list.c b/Source/extractTuples/GB_extract_vector_list.c index b3306767cf..d5419834ad 100644 --- a/Source/extractTuples/GB_extract_vector_list.c +++ b/Source/extractTuples/GB_extract_vector_list.c @@ -2,12 +2,12 @@ // GB_extract_vector_list: extract vector indices for all entries in a matrix //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: not needed, but 3 variants possible (sparse/hyper/full) +// JIT: not needed; factory possible w/ 3 variants (sparse/hyper/full) // Constructs a list of vector indices for each entry in a matrix. Creates // the output J for GB_extractTuples, and I for GB_transpose when the qsort @@ -85,9 +85,8 @@ GrB_Info GB_extract_vector_list // extract vector list from a matrix //------------------------------------------------------------------ int64_t j = GBH (Ah, k) ; - int64_t pA_start, pA_end ; - GB_get_pA (&pA_start, &pA_end, tid, k, - kfirst, klast, pstart_Aslice, Ap, avlen) ; + GB_GET_PA (pA_start, pA_end, tid, k, kfirst, klast, pstart_Aslice, + GBP (Ap, k, avlen), GBP (Ap, k+1, avlen)) ; //------------------------------------------------------------------ // extract vector indices of A(:,j) diff --git a/Source/extractTuples/GrB_Matrix_extractTuples.c b/Source/extractTuples/GrB_Matrix_extractTuples.c index 160d7b5505..b5c4b41c1b 100644 --- a/Source/extractTuples/GrB_Matrix_extractTuples.c +++ b/Source/extractTuples/GrB_Matrix_extractTuples.c @@ -2,7 +2,7 @@ // GrB_Matrix_extractTuples: extract all tuples from a matrix //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ // If any parameter I, J, and/or X is NULL, that component is not extracted. // So to extract just the row and col indices, pass I and J as non-NULL, -// and X as NULL. This is like [I,J,~] = find (A). +// and X as NULL. This is like [I,J,~] = find (A) in MATLAB. // If A is iso and X is not NULL, the iso scalar Ax [0] is expanded into X. @@ -23,7 +23,7 @@ #include "extractTuples/GB_extractTuples.h" #define GB_EXTRACT(prefix,type,T) \ -GrB_Info GB_EVAL3 (prefix, _Matrix_extractTuples_, T) /* [I,J,X] = find (A) */\ +GrB_Info GB_EVAL3 (prefix, _Matrix_extractTuples_, T) \ ( \ GrB_Index *I, /* array for returning row indices of tuples */ \ GrB_Index *J, /* array for returning col indices of tuples */ \ @@ -36,25 +36,53 @@ GrB_Info GB_EVAL3 (prefix, _Matrix_extractTuples_, T) /* [I,J,X] = find (A) */\ GB_BURBLE_START ("GrB_Matrix_extractTuples") ; \ GB_RETURN_IF_NULL_OR_FAULTY (A) ; \ GB_RETURN_IF_NULL (p_nvals) ; \ - GrB_Info info = GB_extractTuples (I, J, X, p_nvals, GB_ ## T ## _code, A, \ - Werk) ; \ + GrB_Info info = GB_extractTuples (I, J, X, p_nvals, prefix ## _ ## T, \ + A, Werk) ; \ GB_BURBLE_END ; \ GB_PRAGMA (omp flush) \ return (info) ; \ } -GB_EXTRACT (GrB, bool , BOOL ) -GB_EXTRACT (GrB, int8_t , INT8 ) -GB_EXTRACT (GrB, uint8_t , UINT8 ) -GB_EXTRACT (GrB, int16_t , INT16 ) -GB_EXTRACT (GrB, uint16_t , UINT16 ) -GB_EXTRACT (GrB, int32_t , INT32 ) -GB_EXTRACT (GrB, uint32_t , UINT32 ) -GB_EXTRACT (GrB, int64_t , INT64 ) -GB_EXTRACT (GrB, uint64_t , UINT64 ) -GB_EXTRACT (GrB, float , FP32 ) -GB_EXTRACT (GrB, double , FP64 ) -GB_EXTRACT (GxB, GxB_FC32_t, FC32 ) -GB_EXTRACT (GxB, GxB_FC64_t, FC64 ) -GB_EXTRACT (GrB, void , UDT ) +// prefix, C type of X, X type +GB_EXTRACT (GrB, bool , BOOL ) +GB_EXTRACT (GrB, int8_t , INT8 ) +GB_EXTRACT (GrB, uint8_t , UINT8 ) +GB_EXTRACT (GrB, int16_t , INT16 ) +GB_EXTRACT (GrB, uint16_t , UINT16 ) +GB_EXTRACT (GrB, int32_t , INT32 ) +GB_EXTRACT (GrB, uint32_t , UINT32 ) +GB_EXTRACT (GrB, int64_t , INT64 ) +GB_EXTRACT (GrB, uint64_t , UINT64 ) +GB_EXTRACT (GrB, float , FP32 ) +GB_EXTRACT (GrB, double , FP64 ) +GB_EXTRACT (GxB, GxB_FC32_t , FC32 ) +GB_EXTRACT (GxB, GxB_FC64_t , FC64 ) + +//------------------------------------------------------------------------------ +// GrB_Matrix_extractTuples_UDT: extract from a matrix with user-defined type +//------------------------------------------------------------------------------ + +GrB_Info GrB_Matrix_extractTuples_UDT +( + GrB_Index *I, // array for returning row indices of tuples + GrB_Index *J, // array for returning col indices of tuples + void *X, // array for returning values of tuples + GrB_Index *p_nvals, // I,J,X size on input; # tuples on output + const GrB_Matrix A // matrix to extract tuples from +) +{ + GB_WHERE1 ("GrB_Matrix_extractTuples_UDT (I, J, X, nvals, A)") ; + GB_BURBLE_START ("GrB_Matrix_extractTuples") ; + GB_RETURN_IF_NULL_OR_FAULTY (A) ; + GB_RETURN_IF_NULL (p_nvals) ; + if (A->type->code != GB_UDT_code) + { + // A must have a user-defined type + return (GrB_DOMAIN_MISMATCH) ; + } + GrB_Info info = GB_extractTuples (I, J, X, p_nvals, A->type, A, Werk) ; + GB_BURBLE_END ; + GB_PRAGMA (omp flush) + return (info) ; +} diff --git a/Source/extractTuples/GrB_Vector_extractTuples.c b/Source/extractTuples/GrB_Vector_extractTuples.c index 31328c50ed..e2a5ae65fe 100644 --- a/Source/extractTuples/GrB_Vector_extractTuples.c +++ b/Source/extractTuples/GrB_Vector_extractTuples.c @@ -2,20 +2,20 @@ // GrB_Vector_extractTuples: extract all tuples from a vector //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// Extracts all tuples from a column, like [I,~,X] = find (v). If -// any parameter I and/or X is NULL, then that component is not extracted. The +// Extracts all tuples from a column vector, like [I,~,X] = find (v). If any +// parameter I and/or X is NULL, then that component is not extracted. The // size of the I and X arrays (those that are not NULL) is given by nvals, // which must be at least as large as GrB_nvals (&nvals, v). The values in the -// typecasted to the type of X, as needed. +// vector are typecasted to the type of X, as needed. // If any parameter I and/or X is NULL, that component is not extracted. So to // extract just the row indices, pass I as non-NULL, and X as NULL. This is -// like [I,~,~] = find (v). +// like [I,~,~] = find (v) in MATLAB. // If v is iso and X is not NULL, the iso scalar vx [0] is expanded into X. @@ -36,25 +36,54 @@ GrB_Info GB_EVAL3 (prefix, _Vector_extractTuples_, T) \ GB_RETURN_IF_NULL_OR_FAULTY (v) ; \ GB_RETURN_IF_NULL (p_nvals) ; \ ASSERT (GB_VECTOR_OK (v)) ; \ - GrB_Info info = GB_extractTuples (I, NULL, X, p_nvals, GB_ ## T ## _code, \ - (GrB_Matrix) v, Werk) ; \ + GrB_Info info = GB_extractTuples (I, NULL, X, p_nvals, prefix ## _ ## T, \ + (GrB_Matrix) v, Werk) ; \ GB_BURBLE_END ; \ GB_PRAGMA (omp flush) \ return (info) ; \ } -GB_EXTRACT (GrB, bool , BOOL ) -GB_EXTRACT (GrB, int8_t , INT8 ) -GB_EXTRACT (GrB, uint8_t , UINT8 ) -GB_EXTRACT (GrB, int16_t , INT16 ) -GB_EXTRACT (GrB, uint16_t , UINT16 ) -GB_EXTRACT (GrB, int32_t , INT32 ) -GB_EXTRACT (GrB, uint32_t , UINT32 ) -GB_EXTRACT (GrB, int64_t , INT64 ) -GB_EXTRACT (GrB, uint64_t , UINT64 ) -GB_EXTRACT (GrB, float , FP32 ) -GB_EXTRACT (GrB, double , FP64 ) -GB_EXTRACT (GxB, GxB_FC32_t, FC32 ) -GB_EXTRACT (GxB, GxB_FC64_t, FC64 ) -GB_EXTRACT (GrB, void , UDT ) +// prefix, C type of X, X type +GB_EXTRACT (GrB, bool , BOOL ) +GB_EXTRACT (GrB, int8_t , INT8 ) +GB_EXTRACT (GrB, uint8_t , UINT8 ) +GB_EXTRACT (GrB, int16_t , INT16 ) +GB_EXTRACT (GrB, uint16_t , UINT16 ) +GB_EXTRACT (GrB, int32_t , INT32 ) +GB_EXTRACT (GrB, uint32_t , UINT32 ) +GB_EXTRACT (GrB, int64_t , INT64 ) +GB_EXTRACT (GrB, uint64_t , UINT64 ) +GB_EXTRACT (GrB, float , FP32 ) +GB_EXTRACT (GrB, double , FP64 ) +GB_EXTRACT (GxB, GxB_FC32_t , FC32 ) +GB_EXTRACT (GxB, GxB_FC64_t , FC64 ) + +//------------------------------------------------------------------------------ +// GrB_Vector_extractTuples_UDT: extract from a vector with user-defined type +//------------------------------------------------------------------------------ + +GrB_Info GrB_Vector_extractTuples_UDT +( + GrB_Index *I, // array for returning row indices of tuples + void *X, // array for returning values of tuples + GrB_Index *p_nvals, // I, X size on input; # tuples on output + const GrB_Vector v // vector to extract tuples from +) +{ + GB_WHERE1 ("GrB_Vector_extractTuples_UDT (I, X, nvals, v)") ; + GB_BURBLE_START ("GrB_Vector_extractTuples") ; + GB_RETURN_IF_NULL_OR_FAULTY (v) ; + GB_RETURN_IF_NULL (p_nvals) ; + ASSERT (GB_VECTOR_OK (v)) ; + if (v->type->code != GB_UDT_code) + { + // v must have a user-defined type + return (GrB_DOMAIN_MISMATCH) ; + } + GrB_Info info = GB_extractTuples (I, NULL, X, p_nvals, v->type, + (GrB_Matrix) v, Werk) ; + GB_BURBLE_END ; + GB_PRAGMA (omp flush) + return (info) ; +} diff --git a/Source/get_set/GB_desc_name_get.c b/Source/get_set/GB_desc_name_get.c new file mode 100644 index 0000000000..c40c222cd9 --- /dev/null +++ b/Source/get_set/GB_desc_name_get.c @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// GB_desc_name_get: get the name of a descriptor +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "get_set/GB_get_set.h" + +#define DNAME(d) \ +{ \ + if (desc == d) \ + { \ + return (#d) ; \ + } \ +} + +const char *GB_desc_name_get +( + GrB_Descriptor desc +) +{ + + 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 + return (desc->user_name_size > 0 ? desc->user_name : NULL) ; +} + diff --git a/Source/get_set/GB_get_set.h b/Source/get_set/GB_get_set.h index 8e91c6dcc8..f60040a3c0 100644 --- a/Source/get_set/GB_get_set.h +++ b/Source/get_set/GB_get_set.h @@ -24,6 +24,7 @@ GrB_Type_Code GB_type_code_get // return the GrB_Type_Code for the code const char *GB_type_name_get (GrB_Type type) ; const char *GB_code_name_get (GB_Type_code code, char *user_name) ; +const char *GB_desc_name_get (GrB_Descriptor desc) ; 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) ; diff --git a/Source/get_set/GB_op_enum_get.c b/Source/get_set/GB_op_enum_get.c index 978e96832c..6381af6478 100644 --- a/Source/get_set/GB_op_enum_get.c +++ b/Source/get_set/GB_op_enum_get.c @@ -29,6 +29,7 @@ GrB_Info GB_op_enum_get 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 ; + case GxB_THETA_TYPE_CODE : type = op->theta_type ; break ; default : ; return (GrB_INVALID_VALUE) ; } diff --git a/Source/get_set/GB_op_name_get.c b/Source/get_set/GB_op_name_get.c index 3fd79eca29..aec0bfbaa1 100644 --- a/Source/get_set/GB_op_name_get.c +++ b/Source/get_set/GB_op_name_get.c @@ -1688,6 +1688,7 @@ const char *GB_op_name_get (GB_Operator op) case GB_USER_unop_code : case GB_USER_idxunop_code : + case GB_USER_idxbinop_code : case GB_USER_binop_code : return (op->user_name) ; //---------------------------------------------------------------------- diff --git a/Source/get_set/GB_op_scalar_get.c b/Source/get_set/GB_op_scalar_get.c index 02f1d00855..3efe061242 100644 --- a/Source/get_set/GB_op_scalar_get.c +++ b/Source/get_set/GB_op_scalar_get.c @@ -22,13 +22,33 @@ GrB_Info GB_op_scalar_get // 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) ; + if (field == GxB_THETA) + { + // get theta from an index binary op, or a binary op created from one + if (op->theta == NULL) + { + // this op does not have a theta value + return (GrB_INVALID_VALUE) ; + } + else if (value->type != op->theta_type) + { + // scalar type must match the theta type + return (GrB_DOMAIN_MISMATCH) ; + } + return (GB_setElement ((GrB_Matrix) value, NULL, op->theta, 0, 0, + op->theta_type->code, Werk)) ; + } + else + { + // get an integer (enum) value from any op + int i ; + GrB_Info info = GB_op_enum_get (op, &i, field) ; + if (info == GrB_SUCCESS) + { + info = GB_setElement ((GrB_Matrix) value, NULL, &i, 0, 0, + GB_INT32_code, Werk) ; + } + return (info) ; } - return (info) ; } diff --git a/Source/get_set/GB_op_size_get.c b/Source/get_set/GB_op_size_get.c index b9f14c165f..f7a0c01f16 100644 --- a/Source/get_set/GB_op_size_get.c +++ b/Source/get_set/GB_op_size_get.c @@ -54,6 +54,10 @@ GrB_Info GB_op_size_get s = GB_type_name_get (op->ztype) ; break ; + case GxB_THETA_TYPE_STRING : + s = GB_type_name_get (op->theta_type) ; + break ; + default : return (GrB_INVALID_VALUE) ; } diff --git a/Source/get_set/GB_op_string_get.c b/Source/get_set/GB_op_string_get.c index 548e196557..703554faf4 100644 --- a/Source/get_set/GB_op_string_get.c +++ b/Source/get_set/GB_op_string_get.c @@ -56,6 +56,7 @@ GrB_Info GB_op_string_get 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 ; + case GxB_THETA_TYPE_STRING : type = op->theta_type ; break ; default : return (GrB_INVALID_VALUE) ; diff --git a/Source/get_set/GB_op_string_set.c b/Source/get_set/GB_op_string_set.c index a15c875a0b..b7ca4cdf89 100644 --- a/Source/get_set/GB_op_string_set.c +++ b/Source/get_set/GB_op_string_set.c @@ -20,12 +20,14 @@ GrB_Info GB_op_string_set GB_Opcode opcode = op->opcode ; bool user_defined = (opcode == GB_USER_unop_code) || (opcode == GB_USER_idxunop_code) || - (opcode == GB_USER_binop_code) ; + (opcode == GB_USER_binop_code) || + (opcode == GB_USER_idxbinop_code) ; bool jitable = (op->ztype->hash != UINT64_MAX) && (op->xtype->hash != UINT64_MAX) && - (op->ytype == NULL || op->ytype->hash != UINT64_MAX) ; + (op->ytype == NULL || op->ytype->hash != UINT64_MAX) && + (op->theta_type == NULL || op->theta_type->hash != UINT64_MAX) ; return (GB_op_or_type_string_set (user_defined, jitable, value, field, &(op->user_name), &(op->user_name_size), diff --git a/Source/get_set/GrB_Descriptor_get2.c b/Source/get_set/GrB_Descriptor_get2.c index ac239e0632..a4f882c660 100644 --- a/Source/get_set/GrB_Descriptor_get2.c +++ b/Source/get_set/GrB_Descriptor_get2.c @@ -115,15 +115,6 @@ GrB_Info GrB_Descriptor_get_Scalar // 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, @@ -145,53 +136,11 @@ GrB_Info GrB_Descriptor_get_String // 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) ; + const char *dname = GB_desc_name_get (desc) ; + if (dname != NULL) + { + strcpy (value, dname) ; } #pragma omp flush diff --git a/Source/get_set/GrB_Semiring_get.c b/Source/get_set/GrB_Semiring_get.c index 8717d1602f..a9428f5408 100644 --- a/Source/get_set/GrB_Semiring_get.c +++ b/Source/get_set/GrB_Semiring_get.c @@ -86,9 +86,10 @@ GrB_Info GrB_Semiring_get_String #pragma omp flush return (GrB_SUCCESS) ; - case GrB_INP0_TYPE_STRING : - case GrB_INP1_TYPE_STRING : - case GrB_OUTP_TYPE_STRING : + case GxB_THETA_TYPE_STRING : // theta input of multiply op + case GrB_INP0_TYPE_STRING : // x input of multiply op + case GrB_INP1_TYPE_STRING : // y input of multiply op + case GrB_OUTP_TYPE_STRING : // also the ztype of the monoid return (GB_op_string_get ((GB_Operator) (semiring->multiply), value, field)) ; @@ -173,6 +174,10 @@ GrB_Info GrB_Semiring_get_SIZE name = GB_type_name_get (semiring->multiply->ztype) ; break ; + case GxB_THETA_TYPE_STRING : + name = GB_type_name_get (semiring->multiply->theta_type) ; + break ; + case GxB_MONOID_OPERATOR : case GxB_SEMIRING_MULTIPLY : (*value) = sizeof (GrB_BinaryOp) ; diff --git a/Source/get_set/GxB_Global_Option_set.c b/Source/get_set/GxB_Global_Option_set.c index a9be33b81f..d4365a319c 100644 --- a/Source/get_set/GxB_Global_Option_set.c +++ b/Source/get_set/GxB_Global_Option_set.c @@ -567,6 +567,16 @@ GrB_Info GxB_Global_Option_set // set a global default option } break ; +// case GxB_JIT_ERROR_FALLBACK : +// +// { +// va_start (ap, field) ; +// int value = va_arg (ap, int) ; +// va_end (ap) ; +// GB_jitifyer_set_error_fallback ((bool) value) ; +// } +// break ; + case GxB_JIT_C_CONTROL : { diff --git a/Source/get_set/GxB_IndexBinaryOp_get.c b/Source/get_set/GxB_IndexBinaryOp_get.c new file mode 100644 index 0000000000..933f8b8e56 --- /dev/null +++ b/Source/get_set/GxB_IndexBinaryOp_get.c @@ -0,0 +1,137 @@ +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_get_*: get a field in a index binary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "get_set/GB_get_set.h" + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_get_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_get_Scalar +( + GxB_IndexBinaryOp op, + GrB_Scalar value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_IndexBinaryOp_get_Scalar (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL_OR_FAULTY (value) ; + ASSERT_INDEXBINARYOP_OK (op, "idxbinop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_scalar_get ((GB_Operator) op, value, field, Werk)) ; +} + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_get_String +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_get_String +( + GxB_IndexBinaryOp op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_IndexBinaryOp_get_String (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_INDEXBINARYOP_OK (op, "idxbinop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_string_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_get_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_get_INT32 +( + GxB_IndexBinaryOp op, + int32_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_IndexBinaryOp_get_INT32 (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_INDEXBINARYOP_OK (op, "idxbinop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_enum_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_get_SIZE +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_get_SIZE +( + GxB_IndexBinaryOp op, + size_t * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_IndexBinaryOp_get_SIZE (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_INDEXBINARYOP_OK (op, "idxbinop for get", GB0) ; + + //-------------------------------------------------------------------------- + // get the field + //-------------------------------------------------------------------------- + + return (GB_op_size_get ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_get_VOID +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_get_VOID +( + GxB_IndexBinaryOp op, + void * value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/Source/get_set/GxB_IndexBinaryOp_set.c b/Source/get_set/GxB_IndexBinaryOp_set.c new file mode 100644 index 0000000000..be494e0a2f --- /dev/null +++ b/Source/get_set/GxB_IndexBinaryOp_set.c @@ -0,0 +1,82 @@ +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_set_*: set a field in a index binary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "get_set/GB_get_set.h" + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_set_Scalar +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_set_Scalar +( + GxB_IndexBinaryOp op, + GrB_Scalar value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_set_String +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_set_String +( + GxB_IndexBinaryOp op, + char * value, + GrB_Field field +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_IndexBinaryOp_set_String (op, value, field)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + GB_RETURN_IF_NULL (value) ; + ASSERT_INDEXBINARYOP_OK (op, "idxbinop for set", GB0) ; + + //-------------------------------------------------------------------------- + // set the field + //-------------------------------------------------------------------------- + + return (GB_op_string_set ((GB_Operator) op, value, field)) ; +} + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_set_INT32 +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_set_INT32 +( + GxB_IndexBinaryOp op, + int32_t value, + GrB_Field field +) +{ + return (GrB_INVALID_VALUE) ; +} + +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_set_VOID +//------------------------------------------------------------------------------ + +GrB_Info GxB_IndexBinaryOp_set_VOID +( + GxB_IndexBinaryOp op, + void * value, + GrB_Field field, + size_t size +) +{ + return (GrB_INVALID_VALUE) ; +} + diff --git a/Source/get_set/GxB_Serialized_get.c b/Source/get_set/GxB_Serialized_get.c index 31a2320788..0863432585 100644 --- a/Source/get_set/GxB_Serialized_get.c +++ b/Source/get_set/GxB_Serialized_get.c @@ -112,7 +112,6 @@ static GrB_Info GB_blob_header_get // 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 @@ -188,8 +187,6 @@ static GrB_Info GB_blob_header_get // 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) ; } } diff --git a/Source/global/GB_Global.c b/Source/global/GB_Global.c index f0b53e9962..e4ed111b34 100644 --- a/Source/global/GB_Global.c +++ b/Source/global/GB_Global.c @@ -152,26 +152,26 @@ static GB_Global_struct GB_Global = // initialization flag .init_called = false, // GrB_init has not yet been called - // min dimension density - #define GB_BITSWITCH_1 ((float) 0.04) - #define GB_BITSWITCH_2 ((float) 0.05) - #define GB_BITSWITCH_3_to_4 ((float) 0.06) - #define GB_BITSWITCH_5_to_8 ((float) 0.08) - #define GB_BITSWITCH_9_to_16 ((float) 0.10) - #define GB_BITSWITCH_17_to_32 ((float) 0.20) - #define GB_BITSWITCH_33_to_64 ((float) 0.30) - #define GB_BITSWITCH_gt_than_64 ((float) 0.40) + // min dimension density + #define GB_BITMAP_SWITCH_1 ((float) 0.04) + #define GB_BITMAP_SWITCH_2 ((float) 0.05) + #define GB_BITMAP_SWITCH_3_to_4 ((float) 0.06) + #define GB_BITMAP_SWITCH_5_to_8 ((float) 0.08) + #define GB_BITMAP_SWITCH_9_to_16 ((float) 0.10) + #define GB_BITMAP_SWITCH_17_to_32 ((float) 0.20) + #define GB_BITMAP_SWITCH_33_to_64 ((float) 0.30) + #define GB_BITMAP_SWITCH_gt_than_64 ((float) 0.40) // default format .bitmap_switch = { - GB_BITSWITCH_1, - GB_BITSWITCH_2, - GB_BITSWITCH_3_to_4, - GB_BITSWITCH_5_to_8, - GB_BITSWITCH_9_to_16, - GB_BITSWITCH_17_to_32, - GB_BITSWITCH_33_to_64, - GB_BITSWITCH_gt_than_64 }, + GB_BITMAP_SWITCH_1, + GB_BITMAP_SWITCH_2, + GB_BITMAP_SWITCH_3_to_4, + GB_BITMAP_SWITCH_5_to_8, + GB_BITMAP_SWITCH_9_to_16, + GB_BITMAP_SWITCH_17_to_32, + GB_BITMAP_SWITCH_33_to_64, + GB_BITMAP_SWITCH_gt_than_64 }, .hyper_switch = GB_HYPER_SWITCH_DEFAULT, .is_csc = false, // default is GxB_BY_ROW @@ -392,14 +392,14 @@ float GB_Global_bitmap_switch_matrix_get (int64_t vlen, int64_t vdim) void GB_Global_bitmap_switch_default (void) { - GB_Global.bitmap_switch [0] = GB_BITSWITCH_1 ; - GB_Global.bitmap_switch [1] = GB_BITSWITCH_2 ; - GB_Global.bitmap_switch [2] = GB_BITSWITCH_3_to_4 ; - GB_Global.bitmap_switch [3] = GB_BITSWITCH_5_to_8 ; - GB_Global.bitmap_switch [4] = GB_BITSWITCH_9_to_16 ; - GB_Global.bitmap_switch [5] = GB_BITSWITCH_17_to_32 ; - GB_Global.bitmap_switch [6] = GB_BITSWITCH_33_to_64 ; - GB_Global.bitmap_switch [7] = GB_BITSWITCH_gt_than_64 ; + GB_Global.bitmap_switch [0] = GB_BITMAP_SWITCH_1 ; + GB_Global.bitmap_switch [1] = GB_BITMAP_SWITCH_2 ; + GB_Global.bitmap_switch [2] = GB_BITMAP_SWITCH_3_to_4 ; + GB_Global.bitmap_switch [3] = GB_BITMAP_SWITCH_5_to_8 ; + GB_Global.bitmap_switch [4] = GB_BITMAP_SWITCH_9_to_16 ; + GB_Global.bitmap_switch [5] = GB_BITMAP_SWITCH_17_to_32 ; + GB_Global.bitmap_switch [6] = GB_BITMAP_SWITCH_33_to_64 ; + GB_Global.bitmap_switch [7] = GB_BITMAP_SWITCH_gt_than_64 ; } //------------------------------------------------------------------------------ diff --git a/Source/helper/GB_helper.c b/Source/helper/GB_helper.c index 776891416a..503a6e13b8 100644 --- a/Source/helper/GB_helper.c +++ b/Source/helper/GB_helper.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // These functions are only used by the @GrB interface for // SuiteSparse:GraphBLAS. diff --git a/Source/hyper/GB_hyper.h b/Source/hyper/GB_hyper.h index 7db13c0b49..507824b746 100644 --- a/Source/hyper/GB_hyper.h +++ b/Source/hyper/GB_hyper.h @@ -42,12 +42,6 @@ GrB_Info GB_hypermatrix_prune GB_Werk Werk ) ; -GrB_Info GB_hyper_hash_build // construct A->Y if not already constructed -( - GrB_Matrix A, - GB_Werk Werk -) ; - bool GB_hyper_hash_need // return true if A needs a hyper hash ( GrB_Matrix A diff --git a/Source/builder/GB_hyper_hash_build.c b/Source/hyper/GB_hyper_hash_build.c similarity index 97% rename from Source/builder/GB_hyper_hash_build.c rename to Source/hyper/GB_hyper_hash_build.c index d9576f59fe..e6969ef53b 100644 --- a/Source/builder/GB_hyper_hash_build.c +++ b/Source/hyper/GB_hyper_hash_build.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - #define GB_FREE_WORKSPACE \ { \ GB_FREE (&I_work, I_work_size) ; \ @@ -24,13 +22,8 @@ #include "builder/GB_build.h" -GrB_Info GB_hyper_hash_build // construct A->Y if not already constructed -( - GrB_Matrix A, - GB_Werk Werk -) -{ - +GB_CALLBACK_HYPER_HASH_BUILD_PROTO (GB_hyper_hash_build) +{ //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- diff --git a/Source/hyper/GB_hyper_prune.c b/Source/hyper/GB_hyper_prune.c index 22590bee8a..953066c39a 100644 --- a/Source/hyper/GB_hyper_prune.c +++ b/Source/hyper/GB_hyper_prune.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Removes empty vectors from a hypersparse list. On input, *Ap and *Ah are // assumed to be NULL. The input arrays Ap_old and Ah_old are not modified, // and thus can be shallow content from another matrix. New hyperlists Ap and diff --git a/Source/hyper/GB_nvec_nonempty.c b/Source/hyper/GB_nvec_nonempty.c index 899533ad42..6f1d4a2b0e 100644 --- a/Source/hyper/GB_nvec_nonempty.c +++ b/Source/hyper/GB_nvec_nonempty.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // All pending tuples are ignored. If a vector has all zombies it is still // counted as non-empty. diff --git a/Source/ij/GB_ij.h b/Source/ij/GB_ij.h index 5f8b81df73..a258867140 100644 --- a/Source/ij/GB_ij.h +++ b/Source/ij/GB_ij.h @@ -53,39 +53,6 @@ GrB_Info GB_ijsort size_t *I2k_size_handle ) ; -// given k, return the kth item i = I [k] in the list -static inline int64_t GB_ijlist // get the kth item in a list of indices -( - const GrB_Index *I, // list of indices - const int64_t k, // return i = I [k], the kth item in the list - const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE, or GB_LIST - const int64_t Icolon [3] // begin:inc:end for all but GB_LIST -) -{ - if (Ikind == GB_ALL) - { - // I is ":" - return (k) ; - } - else if (Ikind == GB_RANGE) - { - // I is begin:end - return (Icolon [GxB_BEGIN] + k) ; - } - else if (Ikind == GB_STRIDE) - { - // I is begin:inc:end - // note that iinc can be negative or even zero - return (Icolon [GxB_BEGIN] + k * Icolon [GxB_INC]) ; - } - else // Ikind == GB_LIST - { - ASSERT (Ikind == GB_LIST) ; - ASSERT (I != NULL) ; - return (I [k]) ; - } -} - // given i and I, return true there is a k so that i is the kth item in I static inline bool GB_ij_is_in_list // determine if i is in the list I ( diff --git a/Source/ij/GB_ijproperties.c b/Source/ij/GB_ijproperties.c index 6cffe282b7..9153257109 100644 --- a/Source/ij/GB_ijproperties.c +++ b/Source/ij/GB_ijproperties.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // check a list of indices I and determine its properties #include "ij/GB_ij.h" diff --git a/Source/ij/GB_ijsort.c b/Source/ij/GB_ijsort.c index d64cc9f9ee..8321f5100e 100644 --- a/Source/ij/GB_ijsort.c +++ b/Source/ij/GB_ijsort.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Sort an index array and remove duplicates: /* @@ -138,7 +136,7 @@ GrB_Info GB_ijsort Count [tid] = my_count ; } - GB_cumsum (Count, ntasks, NULL, 1, NULL) ; + GB_cumsum1 (Count, ntasks) ; int64_t ni2 = Count [ntasks] ; //-------------------------------------------------------------------------- diff --git a/Source/ij/include/GB_ijlist.h b/Source/ij/include/GB_ijlist.h new file mode 100644 index 0000000000..c1b4e0676b --- /dev/null +++ b/Source/ij/include/GB_ijlist.h @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// GB_ijlist.h: return kth item, i = I [k], in an index list +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_IJLIST_H +#define GB_IJLIST_H + +// given k, return the kth item i = I [k] in the list +static inline int64_t GB_ijlist // get the kth item in a list of indices +( + const GrB_Index *I, // list of indices + const int64_t k, // return i = I [k], the kth item in the list + const int Ikind, // GB_ALL, GB_RANGE, GB_STRIDE, or GB_LIST + const int64_t Icolon [3] // begin:inc:end for all but GB_LIST +) +{ + if (Ikind == GB_ALL) + { + // I is ":" + return (k) ; + } + else if (Ikind == GB_RANGE) + { + // I is begin:end + return (Icolon [GxB_BEGIN] + k) ; + } + else if (Ikind == GB_STRIDE) + { + // I is begin:inc:end + // note that iinc can be negative or even zero + return (Icolon [GxB_BEGIN] + k * Icolon [GxB_INC]) ; + } + else // Ikind == GB_LIST + { + // ASSERT (Ikind == GB_LIST) ; + // ASSERT (I != NULL) ; + return (I [k]) ; + } +} + +#endif + diff --git a/Source/import_export/GrB_Matrix_export.c b/Source/import_export/GrB_Matrix_export.c index f65ae3242f..f51854a132 100644 --- a/Source/import_export/GrB_Matrix_export.c +++ b/Source/import_export/GrB_Matrix_export.c @@ -196,7 +196,7 @@ static GrB_Info GB_export_worker // export a matrix { // expand the iso A->x into the non-iso array Ax ASSERT (nvals > 0) ; - GB_expand_iso (Ax, nvals, A->x, A->type->size) ; + GB_OK (GB_iso_expand (Ax, nvals, A->x, A->type)) ; } else { @@ -211,8 +211,7 @@ static GrB_Info GB_export_worker // export a matrix GB_FREE_ALL ; return (GrB_INSUFFICIENT_SPACE) ; } - GB_OK (GB_extractTuples (Ap, Ai, Ax, &nvals, A->type->code, A, - Werk)) ; + GB_OK (GB_extractTuples (Ap, Ai, Ax, &nvals, A->type, A, Werk)) ; (*Ap_len) = nvals ; (*Ai_len) = nvals ; (*Ax_len) = nvals ; diff --git a/Source/include/GB_include.h b/Source/include/GB_include.h index 81c0b3463d..1052ea93f5 100644 --- a/Source/include/GB_include.h +++ b/Source/include/GB_include.h @@ -52,6 +52,7 @@ #include "include/GB_prefix.h" #include "include/GB_defaults.h" +#include "include/GB_rand.h" #ifdef GB_JIT_KERNEL @@ -62,6 +63,7 @@ // Placed in the SuiteSparse/GrB(version)/src/include folder by GrB_init, // via the JITPackage. These files are used by the CPU JIT kernels (via // this file) and the CUDA JIT kernels (CUDA/include/GB_cuda_kernel.cuh): + #include "include/GB_bytes.h" #include "include/GB_pun.h" #include "include/GB_partition.h" #include "include/GB_binary_search.h" @@ -75,19 +77,21 @@ #include "include/GB_memory_macros.h" #include "include/GB_printf_kernels.h" #include "include/GB_opaque.h" + #include "include/GB_static_header.h" #include "include/GB_werk.h" + #include "include/GB_task_struct.h" #include "include/GB_callback_proto.h" #include "include/GB_saxpy3task_struct.h" #include "include/GB_callback.h" #include "include/GB_hyper_hash_lookup.h" - // the remaining files are only used in the CPU JIT kernels: - #include "include/GB_bytes.h" + // not used by CUDA + #include "include/GB_ok.h" + #include "include/GB_ijlist.h" #include "include/GB_atomics.h" #include "include/GB_assert_kernels.h" #include "include/GB_nthreads.h" #include "include/GB_log2.h" - #include "include/GB_task_struct.h" #include "include/GB_wait_macros.h" #include "include/GB_AxB_macros.h" #include "include/GB_ek_slice_kernels.h" @@ -100,8 +104,10 @@ // include files for the GraphBLAS libary //-------------------------------------------------------------------------- + // Original location in the GraphBLAS/Source folder, for compiling // the GraphBLAS library, including PreJIT kernels: + #include "type/include/GB_bytes.h" #include "type/include/GB_pun.h" #include "slice/include/GB_partition.h" #include "math/include/GB_binary_search.h" @@ -115,18 +121,21 @@ #include "memory/include/GB_memory_macros.h" #include "print/include/GB_printf_kernels.h" #include "builtin/include/GB_opaque.h" + #include "matrix/include/GB_static_header.h" #include "werk/include/GB_werk.h" + #include "slice/include/GB_task_struct.h" #include "callback/include/GB_callback_proto.h" #include "mxm/include/GB_saxpy3task_struct.h" #include "callback/include/GB_callback.h" #include "hyper/include/GB_hyper_hash_lookup.h" - #include "type/include/GB_bytes.h" + // not used by CUDA + #include "ok/include/GB_ok.h" + #include "ij/include/GB_ijlist.h" #include "omp/include/GB_atomics.h" #include "ok/include/GB_assert_kernels.h" #include "omp/include/GB_nthreads.h" #include "math/include/GB_log2.h" - #include "slice/include/GB_task_struct.h" #include "wait/include/GB_wait_macros.h" #include "mxm/include/GB_AxB_macros.h" #include "slice/include/GB_ek_slice_kernels.h" diff --git a/Source/include/GB_rand.h b/Source/include/GB_rand.h new file mode 100644 index 0000000000..0e41856dff --- /dev/null +++ b/Source/include/GB_rand.h @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// GB_rand.h: random number generator +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_RAND_H +#define GB_RAND_H + +#define GB_BASECASE (64 * 1024) + +//------------------------------------------------------------------------------ +// random number generator for quicksort +//------------------------------------------------------------------------------ + +// https://en.wikipedia.org/wiki/Xorshift + +GB_STATIC_INLINE uint64_t GB_rand (uint64_t *state) +{ + uint64_t x = (*state) ; + x ^= x << 7 ; + x ^= x >> 9 ; + (*state) = x ; + return (x) ; +} + +#endif + diff --git a/Source/indexbinaryop/GxB_BinaryOp_new_IndexOp.c b/Source/indexbinaryop/GxB_BinaryOp_new_IndexOp.c new file mode 100644 index 0000000000..7155869541 --- /dev/null +++ b/Source/indexbinaryop/GxB_BinaryOp_new_IndexOp.c @@ -0,0 +1,104 @@ +//------------------------------------------------------------------------------ +// GxB_BinaryOp_new_IndexOp: create a new user-defined binary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" + +// GxB_BinaryOp_new_IndexOp: create a new binary op from an index binary op +GrB_Info GxB_BinaryOp_new_IndexOp +( + GrB_BinaryOp *binop_handle, // handle of binary op to create + GxB_IndexBinaryOp idxbinop, // based on this index binary op + GrB_Scalar theta // theta value to bind to the new binary op +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_BinaryOp_new_IndexOp (&binop, idxbinop, theta)") ; + GB_RETURN_IF_NULL (binop_handle) ; + (*binop_handle) = NULL ; + GB_RETURN_IF_NULL_OR_FAULTY (idxbinop) ; + GB_RETURN_IF_NULL_OR_FAULTY (theta) ; + + if (!GB_Type_compatible (idxbinop->theta_type, theta->type)) + { + GB_ERROR (GrB_DOMAIN_MISMATCH, + "Scalar of type [%s] cannot be typecast to type [%s]\n", + theta->type->name, idxbinop->theta_type->name) ; + } + + //-------------------------------------------------------------------------- + // allocate the binary op + //-------------------------------------------------------------------------- + + size_t header_size ; + GrB_BinaryOp binop = GB_CALLOC (1, struct GB_BinaryOp_opaque, &header_size); + if (binop == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + binop->header_size = header_size ; + + //-------------------------------------------------------------------------- + // create the binary op + //-------------------------------------------------------------------------- + + // copy the index binary op contents into the binary op + memcpy (binop, idxbinop, sizeof (struct GB_BinaryOp_opaque)) ; + + // remove the components owned by the index binary op + binop->user_name = NULL ; + binop->user_name_size = 0 ; + binop->defn = NULL ; + binop->defn_size = 0 ; + + bool jitable = (idxbinop->hash != UINT64_MAX) ; + + GrB_Info info = GB_op_name_and_defn ( + // output: + binop->name, &(binop->name_len), &(binop->hash), + &(binop->defn), &(binop->defn_size), + // input: + idxbinop->name, idxbinop->defn, true, jitable) ; + if (info != GrB_SUCCESS) + { + // out of memory + GB_FREE (&binop, header_size) ; + return (info) ; + } + + //-------------------------------------------------------------------------- + // copy theta into the new binary op + //-------------------------------------------------------------------------- + + binop->theta = GB_MALLOC (binop->theta_type->size, GB_void, + &(binop->theta_size)) ; + if (binop->theta == NULL) + { + // out of memory + GB_Op_free ((GB_Operator *) (&binop)) ; + return (GrB_OUT_OF_MEMORY) ; + } + + GB_cast_scalar (binop->theta, binop->theta_type->code, + theta->x, theta->type->code, theta->type->size) ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_BINARYOP_OK (binop, "new user-defined binary op (based on idxbinop)", + GB0) ; + (*binop_handle) = binop ; + return (GrB_SUCCESS) ; +} + diff --git a/Source/indexbinaryop/GxB_IndexBinaryOp_free.c b/Source/indexbinaryop/GxB_IndexBinaryOp_free.c new file mode 100644 index 0000000000..82e9bc175a --- /dev/null +++ b/Source/indexbinaryop/GxB_IndexBinaryOp_free.c @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_free: free an index_binary operator +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" + +GrB_Info GxB_IndexBinaryOp_free // free a user-created index binary operator +( + GxB_IndexBinaryOp *op // handle of index binary operator to free +) +{ + return (GB_Op_free ((GB_Operator *) op)) ; +} + diff --git a/Source/indexbinaryop/GxB_IndexBinaryOp_new.c b/Source/indexbinaryop/GxB_IndexBinaryOp_new.c new file mode 100644 index 0000000000..8b61325931 --- /dev/null +++ b/Source/indexbinaryop/GxB_IndexBinaryOp_new.c @@ -0,0 +1,138 @@ +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_new: create a new user-defined index_binary operator +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Create a new a index_binary operator: z = f (x,ix,jx, y,iy,jy, theta). The +// index_binary function signature must be: + +// void f (void *z, +// const void *x, uint64_t ix, uint64_t jx, +// const void *y, uint64_t iy, uint64_t jy, +// const void *theta) + +// and then it must recast its inputs (x and theta) and output (z) arguments +// internally as needed. When used with GrB_Vectors, jx and jy are zero. + +// If the function pointer is NULL, the function is compiled with the JIT. + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +GrB_Info GxB_IndexBinaryOp_new +( + GxB_IndexBinaryOp *op_handle, // handle for the new index binary operator + GxB_index_binary_function function, // pointer to the index binary function + GrB_Type ztype, // type of output z + GrB_Type xtype, // type of input x + GrB_Type ytype, // type of input y + GrB_Type theta_type, // type of input theta + const char *idxop_name, // name of the user function + const char *idxop_defn // definition of the user function +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_IndexBinaryOp_new (op, function, ztype, xtype, ytype" + ", theta_type, name, defn)") ; + GB_RETURN_IF_NULL (op_handle) ; + (*op_handle) = NULL ; + GB_RETURN_IF_NULL_OR_FAULTY (ztype) ; + GB_RETURN_IF_NULL_OR_FAULTY (xtype) ; + GB_RETURN_IF_NULL_OR_FAULTY (ytype) ; + GB_RETURN_IF_NULL_OR_FAULTY (theta_type) ; + + //-------------------------------------------------------------------------- + // allocate the index_binary op + //-------------------------------------------------------------------------- + + size_t header_size ; + GxB_IndexBinaryOp op = GB_CALLOC (1, struct GB_IndexBinaryOp_opaque, + &header_size) ; + if (op == NULL) + { + // out of memory + return (GrB_OUT_OF_MEMORY) ; + } + op->header_size = header_size ; + + //-------------------------------------------------------------------------- + // initialize the index_binary operator + //-------------------------------------------------------------------------- + + op->magic = GB_MAGIC ; + op->user_name = NULL ; + op->user_name_size = 0 ; + op->ztype = ztype ; + op->xtype = xtype ; + op->ytype = ytype ; + op->theta_type = theta_type ; + + op->unop_function = NULL ; + op->idxunop_function = NULL ; + op->binop_function = NULL ; + op->idxbinop_function = function ; + + op->opcode = GB_USER_idxbinop_code ; + + //-------------------------------------------------------------------------- + // get the index_binary op name and defn + //-------------------------------------------------------------------------- + + // the index_binary op is JIT'able only if all its types are jitable + bool jitable = + (ztype->hash != UINT64_MAX) && + (xtype->hash != UINT64_MAX) && + (ytype->hash != UINT64_MAX) && + (theta_type->hash != UINT64_MAX) ; + + GrB_Info info = GB_op_name_and_defn ( + // output: + op->name, &(op->name_len), &(op->hash), &(op->defn), &(op->defn_size), + // input: + idxop_name, idxop_defn, true, jitable) ; + if (info != GrB_SUCCESS) + { + // out of memory + GB_FREE (&op, header_size) ; + return (info) ; + } + + //-------------------------------------------------------------------------- + // create the function pointer, if NULL + //-------------------------------------------------------------------------- + + if (function == NULL) + { + GB_BURBLE_START ("GxB_IndexBinaryOp_new") ; + void *user_function ; + info = GB_user_op_jit (&user_function, (GB_Operator) op) ; + if (info != GrB_SUCCESS) + { + // unable to construct the function pointer + GB_Op_free ((GB_Operator *) &op) ; + // If the JIT fails, it returns GrB_NO_VALUE or GxB_JIT_ERROR. + // Convert GrB_NO_VALUE to GrB_NULL_POINTER (the function is NULL + // and cannot be compiled by the JIT). + return (info == GrB_NO_VALUE ? GrB_NULL_POINTER : info) ; + } + op->idxbinop_function = (GxB_index_binary_function) user_function ; + GB_BURBLE_END ; + } + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + ASSERT_INDEXBINARYOP_OK (op, "new user-defined index_binary op", GB0) ; + (*op_handle) = op ; + return (GrB_SUCCESS) ; +} + diff --git a/Source/indexunaryop/GxB_IndexUnaryOp_new.c b/Source/indexunaryop/GxB_IndexUnaryOp_new.c index 17d10f6c00..8e5d38dfc6 100644 --- a/Source/indexunaryop/GxB_IndexUnaryOp_new.c +++ b/Source/indexunaryop/GxB_IndexUnaryOp_new.c @@ -10,7 +10,7 @@ // Create a new a index_unary operator: z = f (x,i,j,thunk). The // index_unary function signature must be: -// void f (void *z, const void *x, int64_t i, int64_t j, const void *thunk) +// void f (void *z, const void *x, uint64_t i, uint64_t j, const void *thunk) // and then it must recast its inputs (x and thunk) and output (z) arguments // internally as needed. When used with a GrB_Vector, j is zero. @@ -49,7 +49,7 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp //-------------------------------------------------------------------------- size_t header_size ; - GrB_IndexUnaryOp op = GB_MALLOC (1, struct GB_IndexUnaryOp_opaque, + GrB_IndexUnaryOp op = GB_CALLOC (1, struct GB_IndexUnaryOp_opaque, &header_size) ; if (op == NULL) { @@ -110,7 +110,10 @@ GrB_Info GxB_IndexUnaryOp_new // create a named user-created IndexUnaryOp { // unable to construct the function pointer GB_Op_free ((GB_Operator *) &op) ; - return (GrB_NULL_POINTER) ; + // If the JIT fails, it returns GrB_NO_VALUE or GxB_JIT_ERROR. + // Convert GrB_NO_VALUE to GrB_NULL_POINTER (the function is NULL + // and cannot be compiled by the JIT). + return (info == GrB_NO_VALUE ? GrB_NULL_POINTER : info) ; } op->idxunop_function = (GxB_index_unary_function) user_function ; GB_BURBLE_END ; diff --git a/Source/init/GB_init.c b/Source/init/GB_init.c index 62eac4e653..bf51eb6a18 100644 --- a/Source/init/GB_init.c +++ b/Source/init/GB_init.c @@ -82,7 +82,7 @@ GrB_Info GB_init // start up GraphBLAS bool malloc_is_thread_safe = true ; #if defined ( GRAPHBLAS_HAS_CUDA ) - mode = GxB_NONBLOCKING_GPU ; // HACK FIXME: force GPU to be used + mode = GxB_NONBLOCKING_GPU ; // HACK Fixme for CUDA: force GPU to be used if (mode == GxB_NONBLOCKING_GPU || mode == GxB_BLOCKING_GPU) { // ignore the memory management function pointers and use rmm_wrap_* @@ -153,7 +153,9 @@ GrB_Info GB_init // start up GraphBLAS if (mode == GxB_BLOCKING_GPU || mode == GxB_NONBLOCKING_GPU) { // initialize the GPUs - GB_OK (GB_cuda_init ( )) ; + info = GB_cuda_init ( ) ; + printf ("GB_cuda_init: %d\n", info) ; + GB_OK (info) ; } else #endif @@ -200,9 +202,9 @@ GrB_Info GB_init // start up GraphBLAS #pragma omp flush #if defined ( GRAPHBLAS_HAS_CUDA ) // this hack_get setting is used by GB_ngpus_to_use: -// GB_Global_hack_set (2,0) ; // HACK FIXME: default: GPU for big enough probs - GB_Global_hack_set (2,1) ; // HACK FIXME: force the GPU always to be used -// GB_Global_hack_set (2,2) ; // HACK FIXME: force the GPU never to be used +// GB_Global_hack_set (2,0) ; // HACK Fixme for CUDA: default: GPU for big enough probs + GB_Global_hack_set (2,1) ; // HACK Fixme for CUDA: force the GPU always to be used +// GB_Global_hack_set (2,2) ; // HACK Fixme for CUDA: force the GPU never to be used #endif return (GrB_SUCCESS) ; } diff --git a/Source/init/GrB_error.c b/Source/init/GrB_error.c index bbe2f25a19..1bb5e3a18b 100644 --- a/Source/init/GrB_error.c +++ b/Source/init/GrB_error.c @@ -46,6 +46,13 @@ GrB_Info GrB_IndexUnaryOp_error (const char **error, const GrB_IndexUnaryOp op) return (GrB_SUCCESS) ; } +GrB_Info GxB_IndexBinaryOp_error (const char **error, const GxB_IndexBinaryOp op) +{ + GB_RETURN_IF_NULL (error) ; + (*error) = empty ; + return (GrB_SUCCESS) ; +} + GrB_Info GrB_Monoid_error (const char **error, const GrB_Monoid monoid) { GB_RETURN_IF_NULL (error) ; diff --git a/Source/init/GrB_init.c b/Source/init/GrB_init.c index 5deba02cac..a8d45c3ebc 100644 --- a/Source/init/GrB_init.c +++ b/Source/init/GrB_init.c @@ -12,7 +12,7 @@ // and its RMM memory manager: use a mode of GxB_BLOCKING_GPU or // GxB_NONBLOCKING_GPU. -// FIXME: rename GxB_*BLOCKING_GPU to GxB_*BLOCKING_CUDA. +// Fixme for CUDA: rename GxB_*BLOCKING_GPU to GxB_*BLOCKING_CUDA. #include "GB.h" #include "init/GB_init.h" diff --git a/Source/iso/GB_all_entries_are_iso.c b/Source/iso/GB_all_entries_are_iso.c index dda232c2c2..693ee572f7 100644 --- a/Source/iso/GB_all_entries_are_iso.c +++ b/Source/iso/GB_all_entries_are_iso.c @@ -7,12 +7,15 @@ //------------------------------------------------------------------------------ -// JIT: needed. - // Returns true if all entries in A are the same, and A can then be converted // to iso if currently non-iso. Returns false if A is bitmap, has any zombies, // or has or pending tuples, since these are more costly to check. +// User-defined types of sizes 1, 2, 4, 8, and 16 bytes can be tested by using +// the built-in uint* types of those sizes. Different sizes cannot be checked +// with a JIT since "a == b" is not defined in C11 if a and b are structs. +// Instead, memcmp (a, b, sizeof (type)) is used instead. + #include "GB.h" bool GB_all_entries_are_iso // return true if A is iso, false otherwise @@ -57,7 +60,6 @@ bool GB_all_entries_are_iso // return true if A is iso, false otherwise int64_t asize = A->type->size ; int64_t anz = GB_nnz_held (A) ; - bool iso = true ; // A is iso until proven otherwise //-------------------------------------------------------------------------- // determine the number of threads to use @@ -72,73 +74,64 @@ bool GB_all_entries_are_iso // return true if A is iso, false otherwise ntasks = GB_IMAX (ntasks, 1) ; //-------------------------------------------------------------------------- - // check if A is iso + // check if A is iso: built-in types and user-defined with sizes 1,2,4,8,16 //-------------------------------------------------------------------------- - bool done = false ; - - // TODO: disable these kernels for the compact case: - { - - #define GB_GET_FIRST_VALUE(atype_t, a, Ax) \ - const atype_t a = Ax [0] - #define GB_COMPARE_WITH_FIRST_VALUE(my_iso, a, Ax, p) \ - my_iso = my_iso & (a == Ax [p]) - - switch (asize) - { - case GB_1BYTE : // uint8, int8, bool, or 1-byte user - #define GB_A_TYPE uint8_t - #include "iso/factory/GB_all_entries_are_iso_template.c" - break ; - - case GB_2BYTE : // uint16, int16, or 2-byte user - #define GB_A_TYPE uint16_t - #include "iso/factory/GB_all_entries_are_iso_template.c" - break ; - - case GB_4BYTE : // uint32, int32, float, or 4-byte user - #define GB_A_TYPE uint32_t - #include "iso/factory/GB_all_entries_are_iso_template.c" - break ; - - case GB_8BYTE : // uint64, int64, double, float complex, - // or 8-byte user defined - #define GB_A_TYPE uint64_t - #include "iso/factory/GB_all_entries_are_iso_template.c" - break ; - - case GB_16BYTE : // double complex or 16-byte user - #define GB_A_TYPE uint64_t - #undef GB_GET_FIRST_VALUE - #define GB_GET_FIRST_VALUE(atype_t, a, Ax) \ - const atype_t a ## 0 = Ax [0] ; \ - const atype_t a ## 1 = Ax [1] ; - #undef GB_COMPARE_WITH_FIRST_VALUE - #define GB_COMPARE_WITH_FIRST_VALUE(my_iso, a, Ax, p) \ - my_iso = my_iso & (a ## 0 == Ax [2*p ]) \ - & (a ## 1 == Ax [2*p+1]) - #include "iso/factory/GB_all_entries_are_iso_template.c" - break ; - - default:; - } - } + #define GB_GET_FIRST_VALUE(atype_t, a, Ax) \ + const atype_t a = Ax [0] + #define GB_COMPARE_WITH_FIRST_VALUE(my_iso, a, Ax, p) \ + my_iso = my_iso & (a == Ax [p]) - // TODO: JIT would go here + bool iso = true ; // A is iso until proven otherwise - if (!done) - { - // with user-defined types of any size - #define GB_A_TYPE GB_void - #undef GB_GET_FIRST_VALUE - #define GB_GET_FIRST_VALUE(atype_t, a, Ax) \ - GB_void a [GB_VLA(asize)] ; \ - memcpy (a, Ax, asize) ; - #undef GB_COMPARE_WITH_FIRST_VALUE - #define GB_COMPARE_WITH_FIRST_VALUE(my_iso, a, Ax, p) \ - my_iso = my_iso & (memcmp (a, Ax + (p)*asize, asize) == 0) - #include "iso/factory/GB_all_entries_are_iso_template.c" + switch (asize) + { + case GB_1BYTE : // uint8, int8, bool, or 1-byte user + #define GB_A_TYPE uint8_t + #include "iso/factory/GB_all_entries_are_iso_template.c" + break ; + + case GB_2BYTE : // uint16, int16, or 2-byte user + #define GB_A_TYPE uint16_t + #include "iso/factory/GB_all_entries_are_iso_template.c" + break ; + + case GB_4BYTE : // uint32, int32, float, or 4-byte user + #define GB_A_TYPE uint32_t + #include "iso/factory/GB_all_entries_are_iso_template.c" + break ; + + case GB_8BYTE : // uint64, int64, double, float complex, + // or 8-byte user defined + #define GB_A_TYPE uint64_t + #include "iso/factory/GB_all_entries_are_iso_template.c" + break ; + + case GB_16BYTE : // double complex or 16-byte user + #define GB_A_TYPE uint64_t + #undef GB_GET_FIRST_VALUE + #define GB_GET_FIRST_VALUE(atype_t, a, Ax) \ + const atype_t a ## 0 = Ax [0] ; \ + const atype_t a ## 1 = Ax [1] ; + #undef GB_COMPARE_WITH_FIRST_VALUE + #define GB_COMPARE_WITH_FIRST_VALUE(my_iso, a, Ax, p) \ + my_iso = my_iso & (a ## 0 == Ax [2*(p) ]) \ + & (a ## 1 == Ax [2*(p)+1]) + #include "iso/factory/GB_all_entries_are_iso_template.c" + break ; + + default : // with user-defined types of any size + + #define GB_A_TYPE GB_void + #undef GB_GET_FIRST_VALUE + #define GB_GET_FIRST_VALUE(atype_t, a, Ax) \ + GB_void a [GB_VLA(asize)] ; \ + memcpy (a, Ax, asize) ; + #undef GB_COMPARE_WITH_FIRST_VALUE + #define GB_COMPARE_WITH_FIRST_VALUE(my_iso, a, Ax, p) \ + my_iso = my_iso & (memcmp (a, Ax + (p)*asize, asize) == 0) + #include "iso/factory/GB_all_entries_are_iso_template.c" + break ; } return (iso) ; diff --git a/Source/iso/GB_iso.h b/Source/iso/GB_iso.h index c3ed11697d..fa7221e22f 100644 --- a/Source/iso/GB_iso.h +++ b/Source/iso/GB_iso.h @@ -53,12 +53,12 @@ GrB_Info GB_convert_any_to_iso // convert non-iso matrix to iso GB_void *scalar // scalar value, of size A->type->size, or NULL ) ; -void GB_expand_iso // expand an iso scalar into an entire array +GrB_Info GB_iso_expand // expand an iso scalar into an entire array ( void *restrict X, // output array to expand into int64_t n, // # of entries in X void *restrict scalar, // scalar to expand into X - size_t size // size of the scalar and each entry of X + GrB_Type xtype // the type of the X and the scalar ) ; bool GB_all_entries_are_iso // return true if A is iso, false otherwise diff --git a/Source/iso/GB_expand_iso.c b/Source/iso/GB_iso_expand.c similarity index 77% rename from Source/iso/GB_expand_iso.c rename to Source/iso/GB_iso_expand.c index 2d3adbe75c..ad40822ab7 100644 --- a/Source/iso/GB_expand_iso.c +++ b/Source/iso/GB_iso_expand.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GB_expand_iso: expand a scalar into an entire array +// GB_iso_expand: expand a scalar into an entire array //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. @@ -7,17 +7,17 @@ //------------------------------------------------------------------------------ -// JIT: needed. - #include "GB.h" #include "iso/GB_is_nonzero.h" +#include "jitifyer/GB_stringify.h" +#include "unaryop/GB_unop.h" -void GB_expand_iso // expand an iso scalar into an entire array +GrB_Info GB_iso_expand // expand an iso scalar into an entire array ( void *restrict X, // output array to expand into int64_t n, // # of entries in X void *restrict scalar, // scalar to expand into X - size_t size // size of the scalar and each entry of X + GrB_Type xtype // the type of the X and the scalar ) { @@ -32,6 +32,8 @@ void GB_expand_iso // expand an iso scalar into an entire array // copy the scalar into X //-------------------------------------------------------------------------- + GrB_Info info = GrB_SUCCESS ; + size_t size = xtype->size ; if (GB_is_nonzero (scalar, size)) { @@ -45,7 +47,7 @@ void GB_expand_iso // expand an iso scalar into an entire array { case GB_1BYTE : // bool, uint8, int8, and UDT of size 1 - { + { uint8_t a0 = (*((uint8_t *) scalar)) ; uint8_t *restrict Z = (uint8_t *) X ; #pragma omp parallel for num_threads(nthreads) schedule(static) @@ -57,7 +59,7 @@ void GB_expand_iso // expand an iso scalar into an entire array break ; case GB_2BYTE : // uint16, int16, and UDT of size 2 - { + { uint16_t a0 = (*((uint16_t *) scalar)) ; uint16_t *restrict Z = (uint16_t *) X ; #pragma omp parallel for num_threads(nthreads) schedule(static) @@ -69,7 +71,7 @@ void GB_expand_iso // expand an iso scalar into an entire array break ; case GB_4BYTE : // uint32, int32, float, and UDT of size 4 - { + { uint32_t a0 = (*((uint32_t *) scalar)) ; uint32_t *restrict Z = (uint32_t *) X ; #pragma omp parallel for num_threads(nthreads) schedule(static) @@ -81,7 +83,7 @@ void GB_expand_iso // expand an iso scalar into an entire array break ; case GB_8BYTE : // uint64, int64, double, float complex, UDT size 8 - { + { uint64_t a0 = (*((uint64_t *) scalar)) ; uint64_t *restrict Z = (uint64_t *) X ; #pragma omp parallel for num_threads(nthreads) schedule(static) @@ -93,7 +95,7 @@ void GB_expand_iso // expand an iso scalar into an entire array break ; case GB_16BYTE : // double complex, and UDT size 16 - { + { GB_blob16 a0 = (*((GB_blob16 *) scalar)) ; GB_blob16 *restrict Z = (GB_blob16 *) X ; #pragma omp parallel for num_threads(nthreads) schedule(static) @@ -106,11 +108,23 @@ void GB_expand_iso // expand an iso scalar into an entire array default : // user-defined types of arbitrary size { - GB_void *restrict Z = (GB_void *) X ; - #pragma omp parallel for num_threads(nthreads) schedule(static) - for (p = 0 ; p < n ; p++) - { - memcpy (Z + p*size, scalar, size) ; + + // via the JIT kernel + struct GB_UnaryOp_opaque op_header ; + GB_Operator op = GB_unop_identity (xtype, &op_header) ; + info = GB_iso_expand_jit (X, n, scalar, xtype, op, nthreads) ; + + if (info == GrB_NO_VALUE) + { + // via the generic kernel + GB_void *restrict Z = (GB_void *) X ; + #pragma omp parallel for num_threads(nthreads) \ + schedule(static) + for (p = 0 ; p < n ; p++) + { + memcpy (Z + p*size, scalar, size) ; + } + info = GrB_SUCCESS ; } } break ; @@ -125,5 +139,7 @@ void GB_expand_iso // expand an iso scalar into an entire array GB_memset (X, 0, n*size, nthreads_max) ; } + + return (info) ; } diff --git a/Source/iso/GB_unop_code_iso.c b/Source/iso/GB_unop_code_iso.c index 73bfe23ba8..2792a7117f 100644 --- a/Source/iso/GB_unop_code_iso.c +++ b/Source/iso/GB_unop_code_iso.c @@ -32,6 +32,7 @@ GB_iso_code GB_unop_code_iso // return the iso status of C GB_Opcode opcode = GB_NOP_code ; if (op != NULL) opcode = op->opcode ; + ASSERT (!GB_IS_INDEXBINARYOP_CODE (opcode)) ; //-------------------------------------------------------------------------- // positional ops or user-defined idxunops never result in an iso matrix diff --git a/Source/iso/GB_unop_iso.c b/Source/iso/GB_unop_iso.c index d0c5deff03..d12bf6b265 100644 --- a/Source/iso/GB_unop_iso.c +++ b/Source/iso/GB_unop_iso.c @@ -40,7 +40,7 @@ void GB_unop_iso // Cx [0] = unop (A), binop (s,A) or binop (A,s) const size_t ssize = stype->size ; const GB_Type_code ccode = ctype->code ; const GB_Type_code acode = A->type->code ; - const GB_Type_code scode = stype->code ; + const GB_Type_code scalar_code = stype->code ; //-------------------------------------------------------------------------- // compute the C iso value @@ -64,7 +64,7 @@ void GB_unop_iso // Cx [0] = unop (A), binop (s,A) or binop (A,s) //---------------------------------------------------------------------- ASSERT_SCALAR_OK (scalar, "scalar for GB_unop_iso", GB0) ; - GB_cast_scalar (Cx, ccode, scalar->x, scode, ssize) ; + GB_cast_scalar (Cx, ccode, scalar->x, scalar_code, ssize) ; } else @@ -120,6 +120,7 @@ void GB_unop_iso // Cx [0] = unop (A), binop (s,A) or binop (A,s) size_t xsize = op->xtype->size ; size_t ysize = op->ytype->size ; GxB_binary_function fop = op->binop_function ; + ASSERT (fop != NULL) ; GB_void x [GB_VLA(xsize)] ; GB_void y [GB_VLA(ysize)] ; @@ -130,7 +131,7 @@ void GB_unop_iso // Cx [0] = unop (A), binop (s,A) or binop (A,s) // Cx [0] = binop (scalar, A) //-------------------------------------------------------------- - GB_cast_scalar (x, xcode, scalar->x, scode, ssize) ; + GB_cast_scalar (x, xcode, scalar->x, scalar_code, ssize) ; GB_cast_scalar (y, ycode, A->x, acode, asize) ; } @@ -142,7 +143,7 @@ void GB_unop_iso // Cx [0] = unop (A), binop (s,A) or binop (A,s) //-------------------------------------------------------------- GB_cast_scalar (x, xcode, A->x, acode, asize) ; - GB_cast_scalar (y, ycode, scalar->x, scode, ssize) ; + GB_cast_scalar (y, ycode, scalar->x, scalar_code, ssize) ; } diff --git a/Source/iso/factory/GB_all_entries_are_iso_template.c b/Source/iso/factory/GB_all_entries_are_iso_template.c index b88bc4589e..2f4e1bb5a7 100644 --- a/Source/iso/factory/GB_all_entries_are_iso_template.c +++ b/Source/iso/factory/GB_all_entries_are_iso_template.c @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_all_entries_are_iso_template: check if all entries in a matrix are identical +// GB_all_entries_are_iso_template: check if all entries in A are identical //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -45,7 +45,6 @@ } } } - done = true ; } #undef GB_A_TYPE diff --git a/Source/iterator/GxB_Matrix_Iterator.c b/Source/iterator/GxB_Matrix_Iterator.c index daac48e640..7f315bbba9 100644 --- a/Source/iterator/GxB_Matrix_Iterator.c +++ b/Source/iterator/GxB_Matrix_Iterator.c @@ -6,7 +6,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "GB.h" -#include "slice/factory/GB_search_for_vector_template.c" +#include "slice/include/GB_search_for_vector.h" //------------------------------------------------------------------------------ // GxB_Matrix_Iterator_attach: attach an entry iterator to a matrix diff --git a/Source/jit_kernels/include/GB_jit_kernel.h b/Source/jit_kernels/include/GB_jit_kernel.h index 2156d6a43d..a030a05551 100644 --- a/Source/jit_kernels/include/GB_jit_kernel.h +++ b/Source/jit_kernels/include/GB_jit_kernel.h @@ -77,5 +77,29 @@ #undef GB_M_TYPE #undef GB_MCAST +// accessing the S matrix for assign methods +#undef GBP_S +#undef GBH_S +#undef GBI_S +#undef GBB_S + +// accessing the Z matrix for masker methods +#undef GBP_Z +#undef GBH_Z +#undef GBI_Z +#undef GBB_Z +#undef GBX_Z +#undef GB_Z_NVALS +#undef GB_Z_NHELD + +// accessing the R matrix for masker methods +#undef GBP_R +#undef GBH_R +#undef GBI_R +#undef GBB_R +#undef GBX_R +#undef GB_R_NVALS +#undef GB_R_NHELD + #endif diff --git a/Source/jit_kernels/include/GB_jit_kernel_proto.h b/Source/jit_kernels/include/GB_jit_kernel_proto.h index 55261b0add..b74e60c6b5 100644 --- a/Source/jit_kernels/include/GB_jit_kernel_proto.h +++ b/Source/jit_kernels/include/GB_jit_kernel_proto.h @@ -48,7 +48,8 @@ GrB_Info GB_jit_kernel_add \ const int B_nthreads, \ const int B_ntasks, \ const bool M_is_A, \ - const bool M_is_B \ + const bool M_is_B, \ + const void *theta \ ) #define GB_JIT_KERNEL_APPLY_BIND1ST_PROTO(GB_jit_kernel_apply_bind1st) \ @@ -95,7 +96,8 @@ GrB_Info GB_jit_kernel_AxB_dot2 \ const int64_t *restrict B_slice, \ const int nthreads, \ const int naslice, \ - const int nbslice \ + const int nbslice, \ + const void *theta \ ) #define GB_JIT_KERNEL_AXB_DOT2N_PROTO(GB_jit_kernel_AxB_dot2n) \ @@ -109,7 +111,8 @@ GrB_Info GB_jit_kernel_AxB_dot2n \ const int64_t *restrict B_slice, \ const int nthreads, \ const int naslice, \ - const int nbslice \ + const int nbslice, \ + const void *theta \ ) #define GB_JIT_KERNEL_AXB_DOT3_PROTO(GB_jit_kernel_AxB_dot3) \ @@ -121,7 +124,8 @@ GrB_Info GB_jit_kernel_AxB_dot3 \ const GrB_Matrix B, \ const GB_task_struct *restrict TaskList, \ const int ntasks, \ - const int nthreads \ + const int nthreads, \ + const void *theta \ ) #define GB_JIT_KERNEL_AXB_DOT4_PROTO(GB_jit_kernel_AxB_dot4) \ @@ -136,7 +140,8 @@ GrB_Info GB_jit_kernel_AxB_dot4 \ const int nbslice, \ const int nthreads, \ GB_Werk Werk, \ - const GB_callback_struct *restrict my_callback \ + const GB_callback_struct *restrict my_callback, \ + const void *theta \ ) #define GB_JIT_KERNEL_AXB_SAXBIT_PROTO(GB_jit_kernel_AxB_saxbit) \ @@ -160,7 +165,8 @@ GrB_Info GB_jit_kernel_AxB_saxbit \ int8_t *restrict Wf, \ const int nthreads_max, \ double chunk, \ - const GB_callback_struct *restrict my_callback \ + const GB_callback_struct *restrict my_callback, \ + const void *theta \ ) #define GB_JIT_KERNEL_AXB_SAXPY3_PROTO(GB_jit_kernel_AxB_saxpy3) \ @@ -179,7 +185,8 @@ GrB_Info GB_jit_kernel_AxB_saxpy3 \ const int nthreads_max, \ double chunk, \ GB_Werk Werk, \ - const GB_callback_struct *restrict my_callback \ + const GB_callback_struct *restrict my_callback, \ + const void *theta \ ) #define GB_JIT_KERNEL_AXB_SAXPY4_PROTO(GB_jit_kernel_AxB_saxpy4) \ @@ -196,7 +203,8 @@ GrB_Info GB_jit_kernel_AxB_saxpy4 \ const int64_t *restrict A_slice, \ const int64_t *restrict H_slice, \ GB_void *restrict Wcx, \ - int8_t *restrict Wf \ + int8_t *restrict Wf, \ + const void *theta \ ) #define GB_JIT_KERNEL_AXB_SAXPY5_PROTO(GB_jit_kernel_AxB_saxpy5) \ @@ -209,7 +217,8 @@ GrB_Info GB_jit_kernel_AxB_saxpy5 \ const int nthreads, \ const int64_t *restrict B_slice, \ bool cpu_has_avx2, \ - bool cpu_has_avx512f \ + bool cpu_has_avx512f, \ + const void *theta \ ) #define GB_JIT_KERNEL_BUILD_PROTO(GB_jit_kernel_build) \ @@ -276,8 +285,8 @@ GrB_Info GB_jit_kernel_concat_sparse \ #define GB_JIT_KERNEL_CONVERT_S2B_PROTO(GB_jit_kernel_convert_s2b) \ GrB_Info GB_jit_kernel_convert_s2b \ ( \ - GB_void *Ax_new, \ - int8_t *restrict Ab, \ + GB_void *restrict Cx_new, \ + int8_t *restrict Cb, \ const GrB_Matrix A, \ const int64_t *A_ek_slicing, \ const int A_ntasks, \ @@ -296,7 +305,8 @@ GrB_Info GB_jit_kernel_emult_02 \ const int64_t *restrict Cp_kfirst, \ const int64_t *A_ek_slicing, \ const int A_ntasks, \ - const int A_nthreads \ + const int A_nthreads, \ + const void *theta \ ) #define GB_JIT_KERNEL_EMULT_03_PROTO(GB_jit_kernel_emult_03) \ @@ -311,7 +321,8 @@ GrB_Info GB_jit_kernel_emult_03 \ const int64_t *restrict Cp_kfirst, \ const int64_t *B_ek_slicing, \ const int B_ntasks, \ - const int B_nthreads \ + const int B_nthreads, \ + const void *theta \ ) #define GB_JIT_KERNEL_EMULT_04_PROTO(GB_jit_kernel_emult_04) \ @@ -325,7 +336,8 @@ GrB_Info GB_jit_kernel_emult_04 \ const int64_t *restrict Cp_kfirst, \ const int64_t *M_ek_slicing, \ const int M_ntasks, \ - const int M_nthreads \ + const int M_nthreads, \ + const void *theta \ ) #define GB_JIT_KERNEL_EMULT_08_PROTO(GB_jit_kernel_emult_08) \ @@ -342,7 +354,8 @@ GrB_Info GB_jit_kernel_emult_08 \ const int64_t *restrict C_to_B, \ const GB_task_struct *restrict TaskList, \ const int C_ntasks, \ - const int C_nthreads \ + const int C_nthreads, \ + const void *theta \ ) #define GB_JIT_KERNEL_EMULT_BITMAP_PROTO(GB_jit_kernel_emult_bitmap) \ @@ -358,7 +371,8 @@ GrB_Info GB_jit_kernel_emult_bitmap \ const int M_ntasks, \ const int M_nthreads, \ const int C_nthreads, \ - const GB_callback_struct *restrict my_callback \ + const GB_callback_struct *restrict my_callback, \ + const void *theta \ ) #define GB_JIT_KERNEL_EWISE_FULLA_PROTO(GB_jit_kernel_ewise_fulla) \ @@ -476,20 +490,29 @@ GrB_Info GB_jit_kernel_split_sparse \ GrB_Info GB_jit_kernel_subassign_any \ ( \ GrB_Matrix C, \ + const bool C_replace, \ const GrB_Index *I, \ const int64_t ni, \ const int64_t nI, \ + const int Ikind, \ const int64_t Icolon [3], \ const GrB_Index *J, \ const int64_t nj, \ const int64_t nJ, \ + const int Jkind, \ const int64_t Jcolon [3], \ const GrB_Matrix M, \ + const bool Mask_comp, \ + const bool Mask_struct, \ + const GrB_BinaryOp accum, \ const GrB_Matrix A, \ const void *scalar, \ + const GrB_Type scalar_type, \ + const GrB_Matrix S, \ + const int assign_kind, \ + GB_Werk Werk, \ const int nthreads_max, \ double chunk, \ - GB_Werk Werk, \ const GB_callback_struct *restrict my_callback \ ) @@ -554,7 +577,138 @@ GrB_Info GB_jit_kernel_union \ const int B_nthreads, \ const int B_ntasks, \ const bool M_is_A, \ - const bool M_is_B \ + const bool M_is_B, \ + const void *theta \ +) + +#define GB_JIT_KERNEL_MASKER_PHASE1_PROTO(GB_jit_kernel_masker1) \ +GrB_Info GB_jit_kernel_masker1 \ +( \ + int64_t *Rp, \ + int64_t *Rnvec_nonempty, \ + GB_task_struct *restrict TaskList, \ + const int R_ntasks, \ + const int R_nthreads, \ + const int64_t Rnvec, \ + const int64_t *restrict Rh, \ + const int64_t *restrict R_to_M, \ + const int64_t *restrict R_to_C, \ + const int64_t *restrict R_to_Z, \ + const GrB_Matrix M, \ + const bool Mask_comp, \ + const bool Mask_struct, \ + const GrB_Matrix C, \ + const GrB_Matrix Z \ +) + +#define GB_JIT_KERNEL_MASKER_PHASE2_PROTO(GB_jit_kernel_masker2) \ +GrB_Info GB_jit_kernel_masker2 \ +( \ + GrB_Matrix R, \ + const GB_task_struct *restrict TaskList, \ + const int R_ntasks, \ + const int R_nthreads, \ + const int64_t *restrict R_to_M, \ + const int64_t *restrict R_to_C, \ + const int64_t *restrict R_to_Z, \ + const GrB_Matrix M, \ + const bool Mask_comp, \ + const bool Mask_struct, \ + const GrB_Matrix C, \ + const GrB_Matrix Z, \ + const int64_t *restrict C_ek_slicing, \ + const int C_nthreads, \ + const int C_ntasks, \ + const int64_t *restrict M_ek_slicing, \ + const int M_nthreads, \ + const int M_ntasks \ +) + +#define GB_JIT_KERNEL_SUBREF_SPARSE_PROTO(GB_jit_kernel_subref_sparse) \ +GrB_Info GB_jit_kernel_subref_sparse \ +( \ + GrB_Matrix C, \ + const GB_task_struct *restrict TaskList, \ + const int ntasks, \ + const int nthreads, \ + const bool post_sort, \ + const int64_t *Mark, \ + const int64_t *Inext, \ + const int64_t *restrict Ap_start, \ + const int64_t *restrict Ap_end, \ + const int64_t nI, \ + const int64_t Icolon [3], \ + const GrB_Matrix A, \ + const GrB_Index *I, \ + const GB_callback_struct *restrict my_callback \ +) + +#define GB_JIT_KERNEL_BITMAP_SUBREF_PROTO(GB_jit_kernel_bitmap_subref) \ +GrB_Info GB_jit_kernel_bitmap_subref \ +( \ + GrB_Matrix C, \ + GrB_Matrix A, \ + const GrB_Index *I, \ + const int64_t nI, \ + const int Ikind, \ + const int64_t Icolon [3], \ + const GrB_Index *J, \ + const int64_t nJ, \ + const int Jkind, \ + const int64_t Jcolon [3], \ + GB_Werk Werk, \ + const int nthreads_max, \ + double chunk, \ + const GB_callback_struct *restrict my_callback \ +) + +#define GB_JIT_KERNEL_ISO_EXPAND_PROTO(GB_jit_kernel_iso_expand) \ +GrB_Info GB_jit_kernel_iso_expand \ +( \ + void *restrict X, \ + const int64_t n, \ + const void *restrict scalar, \ + const int nthreads \ +) + +#define GB_JIT_KERNEL_UNJUMBLE_PROTO(GB_jit_kernel_unjumble) \ +GrB_Info GB_jit_kernel_unjumble \ +( \ + const GrB_Matrix A, \ + const int64_t *A_slice, \ + const int ntasks, \ + const int nthreads \ +) + +#define GB_JIT_KERNEL_CONVERT_B2S_PROTO(GB_jit_kernel_convert_b2s) \ +GrB_Info GB_jit_kernel_convert_b2s \ +( \ + const int64_t *restrict Cp, \ + int64_t *restrict Ci, \ + int64_t *restrict Cj, \ + GB_void *restrict Cx_new, \ + const GrB_Matrix A, \ + const int64_t *restrict W, \ + const int nthreads \ +) + +#define GB_JIT_KERNEL_KRONER_PROTO(GB_jit_kernel_kroner) \ +GrB_Info GB_jit_kernel_kroner \ +( \ + GrB_Matrix C, \ + const GrB_Matrix A, \ + const GrB_Matrix B, \ + const int nthreads, \ + const void *theta \ +) + +#define GB_JIT_KERNEL_SORT_PROTO(GB_jit_kernel_sort) \ +GrB_Info GB_jit_kernel_sort \ +( \ + GrB_Matrix C, \ + int nthreads, \ + GB_Werk Werk, \ + const GB_callback_struct *restrict my_callback \ ) //------------------------------------------------------------------------------ @@ -639,6 +793,18 @@ GrB_Info GB_jit_kernel_select_bitmap \ int32_t blocksz \ ) \ +#define GB_JIT_CUDA_KERNEL_SELECT_SPARSE_PROTO(GB_jit_kernel_select_sparse) \ +GrB_Info GB_jit_kernel_select_sparse \ +( \ + GrB_Matrix C, \ + GrB_Matrix A, \ + const GB_void *ythunk, \ + cudaStream_t stream, \ + int32_t gridsz, \ + int32_t blocksz, \ + const GB_callback_struct *restrict my_callback \ +) + #define GB_JIT_CUDA_KERNEL_DOT3_PROTO(GB_jit_kernel_AxB_dot3) \ GrB_Info GB_jit_kernel_AxB_dot3 \ ( \ @@ -649,7 +815,8 @@ GrB_Info GB_jit_kernel_AxB_dot3 \ cudaStream_t stream, \ int device, \ int number_of_sms, \ - const GB_callback_struct *restrict my_callback \ + const GB_callback_struct *restrict my_callback, \ + const void *theta \ ) //------------------------------------------------------------------------------ @@ -674,6 +841,7 @@ GrB_Info GB_jit_kernel_AxB_dot3 \ #define JIT_CONF(g) GB_JIT_KERNEL_CONCAT_FULL_PROTO(g) ; #define JIT_CONS(g) GB_JIT_KERNEL_CONCAT_SPARSE_PROTO(g) ; #define JIT_CS2B(g) GB_JIT_KERNEL_CONVERT_S2B_PROTO(g) ; +#define JIT_CB2S(g) GB_JIT_KERNEL_CONVERT_B2S_PROTO(g) ; #define JIT_EM2(g) GB_JIT_KERNEL_EMULT_02_PROTO(g) ; #define JIT_EM3(g) GB_JIT_KERNEL_EMULT_03_PROTO(g) ; #define JIT_EM4(g) GB_JIT_KERNEL_EMULT_04_PROTO(g) ; @@ -696,6 +864,14 @@ GrB_Info GB_jit_kernel_AxB_dot3 \ #define JIT_UNI(g) GB_JIT_KERNEL_UNION_PROTO(g) ; #define JIT_UOP(g) GB_JIT_KERNEL_USER_OP_PROTO(g) ; #define JIT_UTYP(g) GB_JIT_KERNEL_USER_TYPE_PROTO(g) ; +#define JIT_MAS1(g) GB_JIT_KERNEL_MASKER_PHASE1_PROTO(g) ; +#define JIT_MAS2(g) GB_JIT_KERNEL_MASKER_PHASE2_PROTO(g) ; +#define JIT_SREF(g) GB_JIT_KERNEL_SUBREF_SPARSE_PROTO(g) ; +#define JIT_BREF(g) GB_JIT_KERNEL_BITMAP_SUBREF_PROTO(g) ; +#define JIT_ISOE(g) GB_JIT_KERNEL_ISO_EXPAND_PROTO(g) ; +#define JIT_UNJU(g) GB_JIT_KERNEL_UNJUMBLE_PROTO(g) ; +#define JIT_SORT(g) GB_JIT_KERNEL_SORT_PROTO(g) ; +#define JIT_KRON(g) GB_JIT_KERNEL_KRONER_PROTO(g) ; #define JIT_Q(q) GB_JIT_QUERY_PROTO(q) ; //------------------------------------------------------------------------------ @@ -705,5 +881,19 @@ GrB_Info GB_jit_kernel_AxB_dot3 \ #define JIT_CUDA_RED(g) GB_JIT_CUDA_KERNEL_REDUCE_PROTO(g) ; #define JIT_CUDA_DOT3(g) GB_JIT_CUDA_KERNEL_DOT3_PROTO(g) ; +//------------------------------------------------------------------------------ +// GB_GET_CALLBACK: get function pointer from the callback struct for JIT kernel +//------------------------------------------------------------------------------ + +#undef GB_GET_CALLBACK +#ifdef GB_JIT_RUNTIME + // JIT kernels (CPU and CUDA) require the function pointers + #define GB_GET_CALLBACK(function) \ + function ## _f function = my_callback->function ## _func ; +#else + // PreJIT kernels link against -lgraphblas and do not need function pointers + #define GB_GET_CALLBACK(function) +#endif + #endif diff --git a/Source/jit_kernels/template/GB_jit_kernel_AxB_dot4.c b/Source/jit_kernels/template/GB_jit_kernel_AxB_dot4.c index 3c359e790a..30378d226e 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_AxB_dot4.c +++ b/Source/jit_kernels/template/GB_jit_kernel_AxB_dot4.c @@ -12,11 +12,9 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT4_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_DOT4_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; - GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; - #endif + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_malloc_memory) ; #include "template/GB_AxB_dot4_meta.c" return (GrB_SUCCESS) ; diff --git a/Source/jit_kernels/template/GB_jit_kernel_AxB_saxbit.c b/Source/jit_kernels/template/GB_jit_kernel_AxB_saxbit.c index c3b0ea7f1c..9286e68f3e 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_AxB_saxbit.c +++ b/Source/jit_kernels/template/GB_jit_kernel_AxB_saxbit.c @@ -12,11 +12,8 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXBIT_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXBIT_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_bitmap_M_scatter_f GB_bitmap_M_scatter = - my_callback->GB_bitmap_M_scatter_func ; - #endif + GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; #include "template/GB_AxB_saxbit_template.c" return (GrB_SUCCESS) ; diff --git a/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy3.c b/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy3.c index 1425727e51..ac1caa6c37 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy3.c +++ b/Source/jit_kernels/template/GB_jit_kernel_AxB_saxpy3.c @@ -14,13 +14,10 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXPY3_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_AXB_SAXPY3_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_AxB_saxpy3_cumsum_f GB_AxB_saxpy3_cumsum = - my_callback->GB_AxB_saxpy3_cumsum_func ; - GB_bix_alloc_f GB_bix_alloc = my_callback->GB_bix_alloc_func ; - GB_qsort_1_f GB_qsort_1 = my_callback->GB_qsort_1_func ; - #endif + GB_GET_CALLBACK (GB_AxB_saxpy3_cumsum) ; + GB_GET_CALLBACK (GB_bix_alloc) ; + GB_GET_CALLBACK (GB_qsort_1) ; ASSERT (GB_IS_SPARSE (C) || GB_IS_HYPERSPARSE (C)) ; #include "template/GB_AxB_saxpy3_template.c" diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1.c new file mode 100644 index 0000000000..63c8ee01dd --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_1.c: C bitmap, M bitmap/full, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + #include "template/GB_bitmap_assign_1_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1_whole.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1_whole.c new file mode 100644 index 0000000000..efade273f8 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_1_whole.c @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_1_whole.c: C bitmap, M bitmap/full, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + + #include "template/GB_bitmap_assign_1_whole_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2.c new file mode 100644 index 0000000000..e1c5bde4c0 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_2.c: C bitmap, M bitmap/full, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + #include "template/GB_bitmap_assign_2_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2_whole.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2_whole.c new file mode 100644 index 0000000000..15845918fd --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_2_whole.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_2_whole.c: C bitmap, M bitmap/full, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_memset) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + + #include "template/GB_bitmap_assign_2_whole_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3.c new file mode 100644 index 0000000000..a565c6cf2c --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_3.c: C bitmap, M sparse/hyper, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + #include "template/GB_bitmap_assign_3_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3_whole.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3_whole.c new file mode 100644 index 0000000000..6d8712b1d8 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_3_whole.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_3_whole.c: C bitmap, M sparse/hyper, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + + #include "template/GB_bitmap_assign_3_whole_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4.c new file mode 100644 index 0000000000..7d74fd4bc7 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_4.c: C bitmap, M sparse/hyper, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + #include "template/GB_bitmap_assign_4_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4_whole.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4_whole.c new file mode 100644 index 0000000000..441a863f88 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_4_whole.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_4_whole.c: C bitmap, M sparse/hyper, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_memset) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + + #include "template/GB_bitmap_assign_4_whole_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5.c new file mode 100644 index 0000000000..829f330748 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_5.c: C bitmap, no M, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + #include "template/GB_bitmap_assign_5_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5_whole.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5_whole.c new file mode 100644 index 0000000000..eece762172 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_5_whole.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_5_whole.c: C bitmap, no M, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_bitmap_assign_to_full) ; + + #include "template/GB_bitmap_assign_5_whole_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6.c new file mode 100644 index 0000000000..e04a2013f1 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_6.c: C bitmap, no M, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_memset) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + #include "template/GB_bitmap_assign_6_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6b_whole.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6b_whole.c new file mode 100644 index 0000000000..7252b4a77b --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_6b_whole.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_6b_whole.c: C bitmap, no M, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_memset) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + + #include "template/GB_bitmap_assign_6b_whole_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7.c new file mode 100644 index 0000000000..19eecc840e --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_7.c: C bitmap, !M sparse/hyper, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_memset) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + #include "template/GB_bitmap_assign_7_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7_whole.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7_whole.c new file mode 100644 index 0000000000..cef93fc999 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_7_whole.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_7_whole.c: C bitmap, !M sparse/hyper, with accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + + #include "template/GB_bitmap_assign_7_whole_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8.c new file mode 100644 index 0000000000..e7061484e6 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_8.c: C bitmap, !M sparse/hyper, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_memset) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + #include "template/GB_bitmap_assign_8_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8_whole.c b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8_whole.c new file mode 100644 index 0000000000..ac9c69f318 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_bitmap_assign_8_whole.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_bitmap_assign_8_whole.c: C bitmap, !M sparse/hyper, no accum +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + + #include "template/GB_bitmap_assign_8_whole_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_build.c b/Source/jit_kernels/template/GB_jit_kernel_build.c index 395daddb7f..0a6434eccb 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_build.c +++ b/Source/jit_kernels/template/GB_jit_kernel_build.c @@ -10,8 +10,8 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_BUILD_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_BUILD_PROTO (GB_jit_kernel) { - GB_T_TYPE *restrict Tx = (GB_T_TYPE *) Tx_void ; - const GB_S_TYPE *restrict Sx = (GB_S_TYPE *) Sx_void ; + GB_Tx_TYPE *restrict Tx = (GB_Tx_TYPE *) Tx_void ; + const GB_Sx_TYPE *restrict Sx = (GB_Sx_TYPE *) Sx_void ; #include "template/GB_bld_template.c" return (GrB_SUCCESS) ; } diff --git a/Source/jit_kernels/template/GB_jit_kernel_concat_bitmap.c b/Source/jit_kernels/template/GB_jit_kernel_concat_bitmap.c index 1f9ae289dd..7dc9270202 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_concat_bitmap.c +++ b/Source/jit_kernels/template/GB_jit_kernel_concat_bitmap.c @@ -13,12 +13,10 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_CONCAT_BITMAP_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_CONCAT_BITMAP_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_ek_slice_f GB_ek_slice = my_callback->GB_ek_slice_func ; - GB_werk_pop_f GB_werk_pop = my_callback->GB_werk_pop_func ; - GB_werk_push_f GB_werk_push = my_callback->GB_werk_push_func ; - #endif + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; #include "template/GB_concat_bitmap_template.c" return (GrB_SUCCESS) ; diff --git a/Source/jit_kernels/template/GB_jit_kernel_convert_b2s.c b/Source/jit_kernels/template/GB_jit_kernel_convert_b2s.c new file mode 100644 index 0000000000..904fe480a2 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_convert_b2s.c @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_convert_b2s.c: convert sparse to bitmap +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// cij = op (aij) +#define GB_COPY(Cx,pC,Ax,pA) GB_UNOP (Cx, pC, Ax, pA, 0, , , ) + +GB_JIT_GLOBAL GB_JIT_KERNEL_CONVERT_B2S_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_CONVERT_B2S_PROTO (GB_jit_kernel) +{ + #include "template/GB_convert_b2s_template.c" + return (GrB_SUCCESS) ; +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_convert_s2b.c b/Source/jit_kernels/template/GB_jit_kernel_convert_s2b.c index d509b8d883..9144bddeb3 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_convert_s2b.c +++ b/Source/jit_kernels/template/GB_jit_kernel_convert_s2b.c @@ -8,7 +8,7 @@ //------------------------------------------------------------------------------ // cij = op (aij) -#define GB_COPY(Axnew,pnew,Ax,p) GB_UNOP (Axnew, pnew, Ax, p, A_iso, i, j, y) +#define GB_COPY(Cx,pC,Ax,pA) GB_UNOP (Cx, pC, Ax, pA, 0, , , ) GB_JIT_GLOBAL GB_JIT_KERNEL_CONVERT_S2B_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_CONVERT_S2B_PROTO (GB_jit_kernel) diff --git a/Source/jit_kernels/template/GB_jit_kernel_emult_bitmap.c b/Source/jit_kernels/template/GB_jit_kernel_emult_bitmap.c index 043ca3564f..88d7b81746 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_emult_bitmap.c +++ b/Source/jit_kernels/template/GB_jit_kernel_emult_bitmap.c @@ -10,11 +10,8 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_BITMAP_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_EMULT_BITMAP_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_bitmap_M_scatter_whole_f GB_bitmap_M_scatter_whole = - my_callback->GB_bitmap_M_scatter_whole_func ; - #endif + GB_GET_CALLBACK (GB_bitmap_M_scatter_whole) ; #include "template/GB_emult_bitmap_template.c" return (GrB_SUCCESS) ; diff --git a/Source/jit_kernels/template/GB_jit_kernel_iso_expand.c b/Source/jit_kernels/template/GB_jit_kernel_iso_expand.c new file mode 100644 index 0000000000..e38f00b68c --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_iso_expand.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_iso_expand.c: expand an iso scalar into an array +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_ISO_EXPAND_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_ISO_EXPAND_PROTO (GB_jit_kernel) +{ + GB_A_TYPE *restrict Z = (GB_A_TYPE *) X ; + GB_A_TYPE x = (* ((GB_A_TYPE *) scalar)) ; + int64_t p ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (p = 0 ; p < n ; p++) + { + Z [p] = x ; + } + return (GrB_SUCCESS) ; +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_kroner.c b/Source/jit_kernels/template/GB_jit_kernel_kroner.c new file mode 100644 index 0000000000..1fb0f0af82 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_kroner.c @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_kroner.c: kronecker product +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "include/GB_search_for_vector.h" + +GB_JIT_GLOBAL GB_JIT_KERNEL_KRONER_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_KRONER_PROTO (GB_jit_kernel) +{ + #include "template/GB_kroner_template.c" + return (GrB_SUCCESS) ; +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_masker_phase1.c b/Source/jit_kernels/template/GB_jit_kernel_masker_phase1.c new file mode 100644 index 0000000000..4f7ea116f0 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_masker_phase1.c @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_masker_phase1.c: count # of entries in R for R = masker(C,M,Z) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_MASKER_PHASE1_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_MASKER_PHASE1_PROTO (GB_jit_kernel) +{ + #define GB_PHASE_1_OF_2 + #include "template/GB_masker_template.c" + return (GrB_SUCCESS) ; +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_masker_phase2.c b/Source/jit_kernels/template/GB_jit_kernel_masker_phase2.c new file mode 100644 index 0000000000..1f418f1723 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_masker_phase2.c @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_masker_phase2.c: R = masker(C,M,Z) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_MASKER_PHASE2_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_MASKER_PHASE2_PROTO (GB_jit_kernel) +{ + #define GB_PHASE_2_OF_2 + #include "template/GB_masker_template.c" + return (GrB_SUCCESS) ; +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_reduce.c b/Source/jit_kernels/template/GB_jit_kernel_reduce.c index 5c7ad514a8..538df780f7 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_reduce.c +++ b/Source/jit_kernels/template/GB_jit_kernel_reduce.c @@ -8,15 +8,15 @@ //------------------------------------------------------------------------------ // The GB_jitifyer constructs a *.c file with macro definitions specific to the -// problem instance, such as the excerpts for the GB_jit__reduce__ac1fbb2 -// kernel, below, which a kernel that computes the scalar reduce of a double -// matrix in bitmap form, using the GrB_PLUS_FP64_MONOID. The code ac1fbb2 is -// computed by GB_enumify_reduce. The macros are followed by an #include with -// this file, to define the kernel routine itself. The kernel is always called +// problem instance, such as the GB_jit__reduce__14bb2 kernel, below, which a +// kernel that computes the scalar reduce of a double matrix in bitmap form, +// using the GrB_PLUS_FP64_MONOID. The hex code 14bb2 is computed by +// GB_enumify_reduce. The macros are followed by an #include with this file, +// to define the kernel routine itself. The kernel is always called // GB_jit_kernel, regardless of what it computes. However, if this kernel is // copied into GraphBLAS/PreJit, the name GB_jit_kernel is replaced with its -// full name, GB_jit__reduce__ac1fbb2, which then appears as a compiled -// function in libgraphblas.so when the GraphBLAS library itself is recompiled. +// full name, GB_jit__reduce__14bb2, which then appears as a compiled function +// in libgraphblas.so when the GraphBLAS library itself is recompiled. // The GB_jit_query function provides a mechanism for GraphBLAS to query the // kernels it has already compiled. When a compiled kernel is loaded, its @@ -28,12 +28,10 @@ #ifdef for_comments_only // only so vim will add color to the code below: - // example file: GB_jit__reduce__ac1fbb2.c - //-------------------------------------------------------------------------- - // GB_jit__reduce__ac1fbb2.c + // GB_jit__reduce__14bb2.c //-------------------------------------------------------------------------- - // SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, + // SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -75,8 +73,8 @@ #define GBB_A(Ab,p) Ab [p] #define GB_A_NVALS(e) int64_t e = A->nvals #define GB_A_NHELD(e) int64_t e = (A->vlen * A->vdim) - #define GB_A_ISO 0 #define GB_A_HAS_ZOMBIES 0 + #define GB_A_ISO 0 #define GB_A_TYPE double #define GB_A2TYPE double #define GB_DECLAREA(a) double a @@ -87,15 +85,15 @@ #include "include/GB_monoid_shared_definitions.h" #ifndef GB_JIT_RUNTIME - #define GB_jit_kernel GB_jit__reduce__ac1fbb2 - #define GB_jit_query GB_jit__reduce__ac1fbb2_query + #define GB_jit_kernel GB_jit__reduce__14bb2 + #define GB_jit_query GB_jit__reduce__14bb2_query #endif #include "template/GB_jit_kernel_reduce.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0x5bb300ab9fd9b50c ; - v [0] = 9 ; v [1] = 3 ; v [2] = 0 ; + (*hash) = 0x753d2d93e48ef09e ; + v [0] = 9 ; v [1] = 4 ; v [2] = 1 ; defn [0] = NULL ; defn [1] = NULL ; defn [2] = NULL ; @@ -133,10 +131,10 @@ */ // This macro is used because the identical prototype must appear in many -// places, but with different function names. For example, if this kernel -// is copied into GraphBLAS/PreJIT, then this macro is used to define the -// GB_jit__reduce__ac1fbb2 function, with the same set of parameters as -// given by the GB_JIT_KERNEL_REDUCE_PROTO macro above. +// places, but with different function names. For example, if this kernel is +// copied into GraphBLAS/PreJIT, then this macro is used to define the +// GB_jit__reduce__14bb2 function, with the same set of parameters as given by +// the GB_JIT_KERNEL_REDUCE_PROTO macro above. GB_JIT_GLOBAL GB_JIT_KERNEL_REDUCE_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_REDUCE_PROTO (GB_jit_kernel) diff --git a/Source/jit_kernels/template/GB_jit_kernel_select_phase1.c b/Source/jit_kernels/template/GB_jit_kernel_select_phase1.c index 900aa02c9a..b6d60dbe5c 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_select_phase1.c +++ b/Source/jit_kernels/template/GB_jit_kernel_select_phase1.c @@ -10,11 +10,8 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_PHASE1_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_PHASE1_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_ek_slice_merge1_f GB_ek_slice_merge1 = - my_callback->GB_ek_slice_merge1_func ; - #endif + GB_GET_CALLBACK (GB_ek_slice_merge1) ; #if GB_DEPENDS_ON_Y GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; diff --git a/Source/jit_kernels/template/GB_jit_kernel_select_phase2.c b/Source/jit_kernels/template/GB_jit_kernel_select_phase2.c index 2c79c7d197..53998a2d05 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_select_phase2.c +++ b/Source/jit_kernels/template/GB_jit_kernel_select_phase2.c @@ -14,7 +14,7 @@ GB_JIT_GLOBAL GB_JIT_KERNEL_SELECT_PHASE2_PROTO (GB_jit_kernel) #if GB_DEPENDS_ON_Y GB_Y_TYPE y = *((GB_Y_TYPE *) ythunk) ; #endif - #include "template/GB_select_phase2.c" + #include "template/GB_select_phase2_template.c" return (GrB_SUCCESS) ; } diff --git a/Source/jit_kernels/template/GB_jit_kernel_sort.c b/Source/jit_kernels/template/GB_jit_kernel_sort.c new file mode 100644 index 0000000000..c3cfbf3b53 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_sort.c @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_sort.c: JIT kernel to sort a matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "include/GB_cumsum1.h" +#include "include/GB_rand.h" + +// sort macros: +#define GB_SORT(func) GB_jit_kernel_sort_ ## func +#define GB_SORT_UDT 0 +#define GB_ADDR(A,i) ((A) + (i)) +#define GB_GET(x,A,i) GB_DECLAREC (x) ; GB_GETC (x, A, i, ) +#define GB_COPY(A,i,B,j) A [i] = B [j] +#define GB_SIZE sizeof (GB_C_TYPE) +#define GB_SWAP(A,i,j) { GB_C_TYPE t = A [i] ; A [i] = A [j] ; A [j] = t ; } +#define GB_LT(less,a,i,b,j) \ +{ \ + GB_BINOP (less, a, b, , ) ; /* less = (a < b) */ \ + if (!less) \ + { \ + /* check for equality and tie-break on index */ \ + bool more ; \ + GB_BINOP (more, b, a, , ) ; /* more = (b < a) */ \ + less = (more) ? false : ((i) < (j)) ; \ + } \ +} + +#include "template/GB_sort_template.c" + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_01.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_01.c new file mode 100644 index 0000000000..3c2cd0dab1 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_01.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_01.c: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_01_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_02.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_02.c new file mode 100644 index 0000000000..eccaba4f3a --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_02.c @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_02.c: C(I,J) = A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_add_phase0) ; + GB_GET_CALLBACK (GB_ewise_slice) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_02_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_03.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_03.c new file mode 100644 index 0000000000..b2400fc2b3 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_03.c @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_03.c: C(I,J) += scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_03_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_04.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_04.c new file mode 100644 index 0000000000..21804b6811 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_04.c @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_04.c: C(I,J) += A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_add_phase0) ; + GB_GET_CALLBACK (GB_ewise_slice) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_04_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_05.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_05.c new file mode 100644 index 0000000000..938c791edf --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_05.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_05.c: C(I,J) = scalar ; no S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_subassign_one_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_05_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_05d.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_05d.c index 24785b0c1e..ad5f5389e7 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_subassign_05d.c +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_05d.c @@ -7,32 +7,18 @@ //------------------------------------------------------------------------------ -// Method 05d: C(:,:) = scalar ; no S, C is dense - -// M: present -// Mask_comp: false -// Mask_struct: true or false -// C_replace: false -// accum: NULL -// A: scalar, already cast to C->type -// S: none -// I: NULL -// J: NULL - -// C can have any sparsity structure, but it must be entirely dense with -// all entries present. +// Unlike most jit kernels for assign, the scalar has already been typecasted +// to C->type. GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; - GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; - GB_ek_slice_f GB_ek_slice = my_callback->GB_ek_slice_func ; - GB_werk_pop_f GB_werk_pop = my_callback->GB_werk_pop_func ; - GB_werk_push_f GB_werk_push = my_callback->GB_werk_push_func ; - #endif + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_malloc_memory) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; GB_C_TYPE cwork = (*((GB_C_TYPE *) scalar)) ; #include "template/GB_subassign_05d_template.c" diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_06d.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_06d.c index eb8dcfb359..12f317b64e 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_subassign_06d.c +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_06d.c @@ -7,39 +7,16 @@ //------------------------------------------------------------------------------ -// Method 06d: C(:,:) = A ; no S, C is dense, M and A are aliased - -// M: present, and aliased to A -// Mask_comp: false -// Mask_struct: true or false -// C_replace: false -// accum: NULL -// A: matrix, and aliased to M -// S: none -// I: NULL -// J: NULL - -// C must be bitmap or as-if-full. No entries are deleted and thus no zombies -// are introduced into C. C can be hypersparse, sparse, bitmap, or full, and -// its sparsity structure does not change. If C is hypersparse, sparse, or -// full, then the pattern does not change (all entries are present, and this -// does not change), and these cases can all be treated the same (as if full). -// If C is bitmap, new entries can be inserted into the bitmap C->b. - -// C and A can have any sparsity structure. - GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; - GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; - GB_ek_slice_f GB_ek_slice = my_callback->GB_ek_slice_func ; - GB_werk_pop_f GB_werk_pop = my_callback->GB_werk_pop_func ; - GB_werk_push_f GB_werk_push = my_callback->GB_werk_push_func ; - GB_memset_f GB_memset = my_callback->GB_memset_func ; - #endif + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_malloc_memory) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_memset) ; #include "template/GB_subassign_06d_template.c" return (GrB_SUCCESS) ; diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_06n.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_06n.c new file mode 100644 index 0000000000..60d514eb3e --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_06n.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_06n.c: C(I,J) = A ; no S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_subassign_one_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_06n_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_06s.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_06s.c new file mode 100644 index 0000000000..b43b55d649 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_06s.c @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_06s.c: C(I,J) = A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_add_phase0) ; + GB_GET_CALLBACK (GB_ewise_slice) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_06s_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_07.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_07.c new file mode 100644 index 0000000000..381bbb92e8 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_07.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_07.c: C(I,J) += scalar ; no S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_subassign_one_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_07_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_08n.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_08n.c new file mode 100644 index 0000000000..4eb6085534 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_08n.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_08n.c: C(I,J) += A ; no S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + GB_GET_CALLBACK (GB_subassign_08n_slice) ; + + #include "template/GB_subassign_08n_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_08s.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_08s.c new file mode 100644 index 0000000000..245b5557e8 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_08s.c @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_08s.c: C(I,J) += A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_add_phase0) ; + GB_GET_CALLBACK (GB_ewise_slice) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_08s_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_09.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_09.c new file mode 100644 index 0000000000..bee6c2cd29 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_09.c @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_09.c: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_add_phase0) ; + GB_GET_CALLBACK (GB_ewise_slice) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_09_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_10.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_10.c new file mode 100644 index 0000000000..d653801ca4 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_10.c @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_10.c: C(I,J) = A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_add_phase0) ; + GB_GET_CALLBACK (GB_ewise_slice) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_10_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_11.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_11.c new file mode 100644 index 0000000000..6a9aeaf8bb --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_11.c @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_11.c: C(I,J) += A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_add_phase0) ; + GB_GET_CALLBACK (GB_ewise_slice) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_11_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_12.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_12.c new file mode 100644 index 0000000000..b5e00d1737 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_12.c @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_12.c: C(I,J) += A ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_add_phase0) ; + GB_GET_CALLBACK (GB_ewise_slice) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_12_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_13.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_13.c new file mode 100644 index 0000000000..989aaf0646 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_13.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_13.c: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_13_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_15.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_15.c new file mode 100644 index 0000000000..d25a9f157d --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_15.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_15.c: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_15_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_17.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_17.c new file mode 100644 index 0000000000..d52acf2479 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_17.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_17.c: C(I,J) = scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_17_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_19.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_19.c new file mode 100644 index 0000000000..144c59fe27 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_19.c @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subassign_19.c: C(I,J) += scalar ; using S +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) +{ + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_hyper_hash_build) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + GB_GET_CALLBACK (GB_Pending_ensure) ; + + #include "template/GB_subassign_19_template.c" +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_22.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_22.c index adc1339d7e..3a8fe8505c 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_subassign_22.c +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_22.c @@ -7,29 +7,18 @@ //------------------------------------------------------------------------------ -// Method 22: C += scalar, where C is dense - -// M: not present -// Mask_comp: false -// Mask_struct: ignored -// C_replace: false -// accum: present -// A: scalar, already cast to accum->ytype -// S: none -// I: NULL -// J: NULL +// Unlike most jit kernels for assign, the input scalar is already typecast +// to the op->ytype. GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; - GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; - GB_ek_slice_f GB_ek_slice = my_callback->GB_ek_slice_func ; - GB_werk_pop_f GB_werk_pop = my_callback->GB_werk_pop_func ; - GB_werk_push_f GB_werk_push = my_callback->GB_werk_push_func ; - #endif + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_malloc_memory) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; GB_Y_TYPE ywork = (*((GB_Y_TYPE *) scalar)) ; #include "template/GB_subassign_22_template.c" diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_23.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_23.c index cfa0fc49e8..5ecf70ae11 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_subassign_23.c +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_23.c @@ -7,31 +7,15 @@ //------------------------------------------------------------------------------ -// Method 23: C += A, where C is dense - -// M: NULL -// Mask_comp: false -// Mask_struct: ignored -// C_replace: false -// accum: present -// A: matrix -// S: none -// I: NULL -// J: NULL - -// C and A can have any sparsity structure, but C must be as-if-full. - GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; - GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; - GB_ek_slice_f GB_ek_slice = my_callback->GB_ek_slice_func ; - GB_werk_pop_f GB_werk_pop = my_callback->GB_werk_pop_func ; - GB_werk_push_f GB_werk_push = my_callback->GB_werk_push_func ; - #endif + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_malloc_memory) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; #include "template/GB_subassign_23_template.c" return (GrB_SUCCESS) ; diff --git a/Source/jit_kernels/template/GB_jit_kernel_subassign_25.c b/Source/jit_kernels/template/GB_jit_kernel_subassign_25.c index 25998425f6..1c76a0fe34 100644 --- a/Source/jit_kernels/template/GB_jit_kernel_subassign_25.c +++ b/Source/jit_kernels/template/GB_jit_kernel_subassign_25.c @@ -7,37 +7,15 @@ //------------------------------------------------------------------------------ -// Method 25: C(:,:) = A ; C is empty, M structural, A bitmap/as-if-full - -// M: present -// Mask_comp: false -// Mask_struct: true -// C_replace: effectively false (not relevant since C is empty) -// accum: NULL -// A: matrix -// S: none -// I: NULL -// J: NULL - -// C and M are sparse or hypersparse. A can have any sparsity structure, even -// bitmap, but it must either be bitmap, or as-if-full. M may be jumbled. If -// so, C is constructed as jumbled. C is reconstructed with the same structure -// as M and can have any sparsity structure on input. The only constraint on C -// is nnz(C) is zero on input. - -// C is iso if A is iso - GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) ; GB_JIT_GLOBAL GB_JIT_KERNEL_SUBASSIGN_PROTO (GB_jit_kernel) { - #ifdef GB_JIT_RUNTIME // get callback functions - GB_free_memory_f GB_free_memory = my_callback->GB_free_memory_func ; - GB_malloc_memory_f GB_malloc_memory = my_callback->GB_malloc_memory_func ; - GB_ek_slice_f GB_ek_slice = my_callback->GB_ek_slice_func ; - GB_werk_pop_f GB_werk_pop = my_callback->GB_werk_pop_func ; - GB_werk_push_f GB_werk_push = my_callback->GB_werk_push_func ; - #endif + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_malloc_memory) ; + GB_GET_CALLBACK (GB_ek_slice) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; #include "template/GB_subassign_25_template.c" return (GrB_SUCCESS) ; diff --git a/Source/jit_kernels/template/GB_jit_kernel_subref_bitmap.c b/Source/jit_kernels/template/GB_jit_kernel_subref_bitmap.c new file mode 100644 index 0000000000..308675baf2 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subref_bitmap.c @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subref_bitmap.c: A = C(I,J) where C and A are bitmap/full +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "include/GB_subref_method.h" + +#undef GB_FREE_ALL +#define GB_FREE_ALL \ +{ \ + GB_FREE_WORK (&TaskList_IxJ, TaskList_IxJ_size) ; \ +} + +GB_JIT_GLOBAL GB_JIT_KERNEL_BITMAP_SUBREF_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_BITMAP_SUBREF_PROTO (GB_jit_kernel) +{ + + //-------------------------------------------------------------------------- + // get callback functions, C, and A, and declare workspace + //-------------------------------------------------------------------------- + + GrB_Info info = GrB_SUCCESS ; + + // get callback functions + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_subassign_IxJ_slice) ; + + // declare the TaskList_IxJ workspace + GB_task_struct *TaskList_IxJ = NULL ; size_t TaskList_IxJ_size = 0 ; + int ntasks_IxJ = 0, nthreads_IxJ = 0 ; + + // get C and A + #ifdef GB_C_IS_BITMAP + const int8_t *restrict Ab = A->b ; + int8_t *restrict Cb = C->b ; + #endif + const int64_t vlen = A->vlen ; + #define GB_COPY_ENTRY(pC,pA) Cx [pC] = Ax [pA] ; + const GB_C_TYPE *restrict Ax = (GB_C_TYPE *) A->x ; + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; + + //-------------------------------------------------------------------------- + // C = A(I,J) where C and A are bitmap/full + //-------------------------------------------------------------------------- + + #include "template/GB_bitmap_subref_template.c" + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + GB_FREE_ALL ; + return (GrB_SUCCESS) ; +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_subref_sparse.c b/Source/jit_kernels/template/GB_jit_kernel_subref_sparse.c new file mode 100644 index 0000000000..6ebecde644 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_subref_sparse.c @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_subref_sparse.c: C = A(I,J) where C and A are sparse/hyper +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "include/GB_subref_method.h" +#include "include/GB_qsort_1b_kernel.h" + +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBREF_SPARSE_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SUBREF_SPARSE_PROTO (GB_jit_kernel) +{ + + // get C and A + const int64_t *restrict Cp = C->p ; + int64_t *restrict Ci = C->i ; + #define GB_COPY_RANGE(pC,pA,len) \ + memcpy (Cx + (pC), Ax + (pA), (len) * sizeof (GB_C_TYPE)) ; + #define GB_COPY_ENTRY(pC,pA) Cx [pC] = Ax [pA] ; + const GB_C_TYPE *restrict Ax = (GB_C_TYPE *) A->x ; + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; + #define GB_QSORT_1B(Ci,Cx,pC,clen) GB_qsort_1b_kernel (Ci+pC, Cx+pC, clen) + + // C = A(I,J) where C and A are sparse/hyper + #define GB_PHASE_2_OF_2 + #include "template/GB_subref_template.c" + + return (GrB_SUCCESS) ; +} + diff --git a/Source/jit_kernels/template/GB_jit_kernel_unjumble.c b/Source/jit_kernels/template/GB_jit_kernel_unjumble.c new file mode 100644 index 0000000000..9a48d95c12 --- /dev/null +++ b/Source/jit_kernels/template/GB_jit_kernel_unjumble.c @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// GB_jit_kernel_unjumble.c: sort the vectors of a sparse/hyper matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "include/GB_qsort_1b_kernel.h" + +GB_JIT_GLOBAL GB_JIT_KERNEL_UNJUMBLE_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_UNJUMBLE_PROTO (GB_jit_kernel) +{ + // get A + const int64_t *restrict Ap = A->p ; + int64_t *restrict Ai = A->i ; + GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; + // sort its vectors + #define GB_QSORT GB_qsort_1b_kernel (Ai+pA_start, Ax+pA_start, aknz) + #include "template/GB_unjumbled_template.c" + return (GrB_SUCCESS) ; +} + diff --git a/Source/jit_wrappers/GB_AxB_dot2_jit.c b/Source/jit_wrappers/GB_AxB_dot2_jit.c index 57d4c26742..710ab350ce 100644 --- a/Source/jit_wrappers/GB_AxB_dot2_jit.c +++ b/Source/jit_wrappers/GB_AxB_dot2_jit.c @@ -46,6 +46,7 @@ GrB_Info GB_AxB_dot2_jit // C=A'*B, dot2 method, via the JIT //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed //-------------------------------------------------------------------------- + void *dl_function ; GrB_Info info = GB_jitifyer_load (&dl_function, GB_jit_mxm_family, "AxB_dot2", @@ -59,6 +60,6 @@ GrB_Info GB_AxB_dot2_jit // C=A'*B, dot2 method, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, A_slice, B, B_slice, nthreads, naslice, - nbslice)) ; + nbslice, semiring->multiply->theta)) ; } diff --git a/Source/jit_wrappers/GB_AxB_dot2n_jit.c b/Source/jit_wrappers/GB_AxB_dot2n_jit.c index e3ac8637b7..32bc8c0946 100644 --- a/Source/jit_wrappers/GB_AxB_dot2n_jit.c +++ b/Source/jit_wrappers/GB_AxB_dot2n_jit.c @@ -60,6 +60,6 @@ GrB_Info GB_AxB_dot2n_jit // C=A*B, dot2n method, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, A, A_slice, B, B_slice, nthreads, naslice, - nbslice)) ; + nbslice, semiring->multiply->theta)) ; } diff --git a/Source/jit_wrappers/GB_AxB_dot3_jit.c b/Source/jit_wrappers/GB_AxB_dot3_jit.c index 72381dde43..8b474a195f 100644 --- a/Source/jit_wrappers/GB_AxB_dot3_jit.c +++ b/Source/jit_wrappers/GB_AxB_dot3_jit.c @@ -55,6 +55,7 @@ GrB_Info GB_AxB_dot3_jit // C=A'B, dot3, via the JIT //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, M, A, B, TaskList, ntasks, nthreads)) ; + return (GB_jit_kernel (C, M, A, B, TaskList, ntasks, nthreads, + semiring->multiply->theta)) ; } diff --git a/Source/jit_wrappers/GB_AxB_dot4_jit.c b/Source/jit_wrappers/GB_AxB_dot4_jit.c index 84f4c8f73f..051297113b 100644 --- a/Source/jit_wrappers/GB_AxB_dot4_jit.c +++ b/Source/jit_wrappers/GB_AxB_dot4_jit.c @@ -59,6 +59,6 @@ GrB_Info GB_AxB_dot4_jit // C+=A'*B, dot4 method, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, B, A_slice, B_slice, naslice, nbslice, - nthreads, Werk, &GB_callback)) ; + nthreads, Werk, &GB_callback, semiring->multiply->theta)) ; } diff --git a/Source/jit_wrappers/GB_AxB_saxbit_jit.c b/Source/jit_wrappers/GB_AxB_saxbit_jit.c index dacb388b49..56cabbf6ae 100644 --- a/Source/jit_wrappers/GB_AxB_saxbit_jit.c +++ b/Source/jit_wrappers/GB_AxB_saxbit_jit.c @@ -37,7 +37,7 @@ GrB_Info GB_AxB_saxbit_jit // C=A*B, saxbit, via the JIT GB_void *restrict Wcx, int8_t *restrict Wf ) -{ +{ //-------------------------------------------------------------------------- // encodify the problem @@ -72,6 +72,6 @@ GrB_Info GB_AxB_saxbit_jit // C=A*B, saxbit, via the JIT return (GB_jit_kernel (C, M, A, B, ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, use_atomics, M_ek_slicing, M_nthreads, M_ntasks, A_slice, H_slice, Wcx, Wf, - nthreads_max, chunk, &GB_callback)) ; + nthreads_max, chunk, &GB_callback, semiring->multiply->theta)) ; } diff --git a/Source/jit_wrappers/GB_AxB_saxpy3_jit.c b/Source/jit_wrappers/GB_AxB_saxpy3_jit.c index 4529a7c4c3..55f5246318 100644 --- a/Source/jit_wrappers/GB_AxB_saxpy3_jit.c +++ b/Source/jit_wrappers/GB_AxB_saxpy3_jit.c @@ -66,6 +66,6 @@ GrB_Info GB_AxB_saxpy3_jit // C=A*B, saxpy3, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, M_in_place, A, B, (GB_saxpy3task_struct *) SaxpyTasks, ntasks, nfine, nthreads, do_sort, - nthreads_max, chunk, Werk, &GB_callback)) ; + nthreads_max, chunk, Werk, &GB_callback, semiring->multiply->theta)) ; } diff --git a/Source/jit_wrappers/GB_AxB_saxpy4_jit.c b/Source/jit_wrappers/GB_AxB_saxpy4_jit.c index 8a587fea91..8800c6d6a7 100644 --- a/Source/jit_wrappers/GB_AxB_saxpy4_jit.c +++ b/Source/jit_wrappers/GB_AxB_saxpy4_jit.c @@ -63,6 +63,7 @@ GrB_Info GB_AxB_saxpy4_jit // C+=A*B, saxpy4 method, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, B, ntasks, nthreads, nfine_tasks_per_vector, - use_coarse_tasks, use_atomics, A_slice, H_slice, Wcx, Wf)) ; + use_coarse_tasks, use_atomics, A_slice, H_slice, Wcx, Wf, + semiring->multiply->theta)) ; } diff --git a/Source/jit_wrappers/GB_AxB_saxpy5_jit.c b/Source/jit_wrappers/GB_AxB_saxpy5_jit.c index 0bf6c7019e..6cbde0170f 100644 --- a/Source/jit_wrappers/GB_AxB_saxpy5_jit.c +++ b/Source/jit_wrappers/GB_AxB_saxpy5_jit.c @@ -59,6 +59,6 @@ GrB_Info GB_AxB_saxpy5_jit // C+=A*B, saxpy5 method, via the JIT bool cpu_has_avx512f = GB_Global_cpu_features_avx512f ( ) ; GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, B, ntasks, nthreads, B_slice, - cpu_has_avx2, cpu_has_avx512f)) ; + cpu_has_avx2, cpu_has_avx512f, semiring->multiply->theta)) ; } diff --git a/Source/jit_wrappers/GB_add_jit.c b/Source/jit_wrappers/GB_add_jit.c index 1661057d28..36dab767a2 100644 --- a/Source/jit_wrappers/GB_add_jit.c +++ b/Source/jit_wrappers/GB_add_jit.c @@ -22,6 +22,7 @@ GrB_Info GB_add_jit // C=A+B, C<#M>=A+B, add, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const bool Ch_is_Mh, @@ -52,7 +53,7 @@ GrB_Info GB_add_jit // C=A+B, C<#M>=A+B, add, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_ADD, false, false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, false, A, B) ; + binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -77,6 +78,7 @@ GrB_Info GB_add_jit // C=A+B, C<#M>=A+B, add, via the JIT return (GB_jit_kernel (C, M, A, B, Ch_is_Mh, C_to_M, C_to_A, C_to_B, TaskList, C_ntasks, C_nthreads, M_ek_slicing, M_nthreads, M_ntasks, A_ek_slicing, A_nthreads, A_ntasks, - B_ek_slicing, B_nthreads, B_ntasks, M_is_A, M_is_B)) ; + B_ek_slicing, B_nthreads, B_ntasks, M_is_A, M_is_B, + binaryop->theta)) ; } diff --git a/Source/jit_wrappers/GB_apply_bind1st_jit.c b/Source/jit_wrappers/GB_apply_bind1st_jit.c index d967c9a395..ae59c08b80 100644 --- a/Source/jit_wrappers/GB_apply_bind1st_jit.c +++ b/Source/jit_wrappers/GB_apply_bind1st_jit.c @@ -34,7 +34,7 @@ GrB_Info GB_apply_bind1st_jit // Cx = op (x,B), apply bind1st via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_APPLYBIND1, false, false, false, GxB_FULL, ctype, NULL, false, false, - binaryop, false, NULL, B) ; + binaryop, false, false, NULL, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_apply_bind2nd_jit.c b/Source/jit_wrappers/GB_apply_bind2nd_jit.c index bea0b0fc26..040af3528c 100644 --- a/Source/jit_wrappers/GB_apply_bind2nd_jit.c +++ b/Source/jit_wrappers/GB_apply_bind2nd_jit.c @@ -34,7 +34,7 @@ GrB_Info GB_apply_bind2nd_jit // Cx = op (x,B), apply bind2nd via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_APPLYBIND2, false, false, false, GxB_FULL, ctype, NULL, false, false, - binaryop, false, A, NULL) ; + binaryop, false, false, A, NULL) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_apply_unop_jit.c b/Source/jit_wrappers/GB_apply_unop_jit.c index dbe1810120..787a04696e 100644 --- a/Source/jit_wrappers/GB_apply_unop_jit.c +++ b/Source/jit_wrappers/GB_apply_unop_jit.c @@ -35,7 +35,8 @@ GrB_Info GB_apply_unop_jit // Cx = op (A), apply unop via the JIT GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_APPLYUNOP, GxB_FULL, false, ctype, op, flipij, A) ; + GB_JIT_KERNEL_APPLYUNOP, GxB_FULL, false, ctype, op, flipij, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_colscale_jit.c b/Source/jit_wrappers/GB_colscale_jit.c index 5bea4ee582..8b18b06316 100644 --- a/Source/jit_wrappers/GB_colscale_jit.c +++ b/Source/jit_wrappers/GB_colscale_jit.c @@ -36,7 +36,7 @@ GrB_Info GB_colscale_jit // C=A*D, colscale, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_COLSCALE, false, false, false, GB_sparsity (C), C->type, NULL, false, false, - binaryop, flipxy, A, D) ; + binaryop, false, flipxy, A, D) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -51,7 +51,7 @@ GrB_Info GB_colscale_jit // C=A*D, colscale, via the JIT //-------------------------------------------------------------------------- // call the jit kernel and return result - //------------------------------------------------------------------ + //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, A, D, A_ek_slicing, A_ntasks, A_nthreads)) ; diff --git a/Source/jit_wrappers/GB_concat_bitmap_jit.c b/Source/jit_wrappers/GB_concat_bitmap_jit.c index 3125b09596..5179df9410 100644 --- a/Source/jit_wrappers/GB_concat_bitmap_jit.c +++ b/Source/jit_wrappers/GB_concat_bitmap_jit.c @@ -32,7 +32,8 @@ GrB_Info GB_concat_bitmap_jit // concatenate A into a bitmap matrix C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONCAT_BITMAP, GxB_BITMAP, true, C->type, op, false, A) ; + GB_JIT_KERNEL_CONCAT_BITMAP, GxB_BITMAP, true, C->type, op, false, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_concat_full_jit.c b/Source/jit_wrappers/GB_concat_full_jit.c index b648c74bb9..45bb6f17c3 100644 --- a/Source/jit_wrappers/GB_concat_full_jit.c +++ b/Source/jit_wrappers/GB_concat_full_jit.c @@ -32,7 +32,8 @@ GrB_Info GB_concat_full_jit // concatenate A into a full matrix C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONCAT_FULL, GxB_FULL, true, C->type, op, false, A) ; + GB_JIT_KERNEL_CONCAT_FULL, GxB_FULL, true, C->type, op, false, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_concat_sparse_jit.c b/Source/jit_wrappers/GB_concat_sparse_jit.c index c682a91ea2..777663460b 100644 --- a/Source/jit_wrappers/GB_concat_sparse_jit.c +++ b/Source/jit_wrappers/GB_concat_sparse_jit.c @@ -34,7 +34,8 @@ GrB_Info GB_concat_sparse_jit // concatenate A into a sparse matrix C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONCAT_SPARSE, GxB_SPARSE, true, C->type, op, false, A) ; + GB_JIT_KERNEL_CONCAT_SPARSE, GxB_SPARSE, true, C->type, op, false, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_convert_b2s_jit.c b/Source/jit_wrappers/GB_convert_b2s_jit.c new file mode 100644 index 0000000000..fbb6955dee --- /dev/null +++ b/Source/jit_wrappers/GB_convert_b2s_jit.c @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// GB_convert_b2s_jit: JIT kernel to convert bitmap to sparse +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_CONVERT_B2S_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_convert_b2s_jit // extract CSC/CSR or triplets from bitmap +( + // input: + const int64_t *restrict Cp, // vector pointers for CSC/CSR form + // outputs: + int64_t *restrict Ci, // indices for CSC/CSR or triplet form + int64_t *restrict Cj, // vector indices for triplet form + GB_void *restrict Cx, // values for CSC/CSR or triplet form + // inputs: not modified + const GrB_Type ctype, // type of Cx + GB_Operator op, + const GrB_Matrix A, // matrix to extract; not modified + const int64_t *restrict W, // workspace + int nthreads // # of threads to use +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_apply (&encoding, &suffix, + GB_JIT_KERNEL_CONVERT_B2S, GxB_SPARSE, false, ctype, op, false, + GxB_BITMAP, true, A->type, A->iso, 0) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_apply_family, "convert_b2s", + hash, &encoding, suffix, NULL, NULL, + op, ctype, A->type, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (Cp, Ci, Cj, Cx, A, W, nthreads)) ; +} + diff --git a/Source/jit_wrappers/GB_convert_s2b_jit.c b/Source/jit_wrappers/GB_convert_s2b_jit.c index 91ce75535a..981313b70e 100644 --- a/Source/jit_wrappers/GB_convert_s2b_jit.c +++ b/Source/jit_wrappers/GB_convert_s2b_jit.c @@ -18,8 +18,8 @@ typedef GB_JIT_KERNEL_CONVERT_S2B_PROTO ((*GB_jit_dl_function)) ; GrB_Info GB_convert_s2b_jit // convert sparse to bitmap ( // output: - GB_void *Ax_new, - int8_t *Ab, + GB_void *Cx, + int8_t *Cb, // input: GB_Operator op, const GrB_Matrix A, @@ -36,7 +36,8 @@ GrB_Info GB_convert_s2b_jit // convert sparse to bitmap GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_CONVERTS2B, GxB_FULL, false, A->type, op, false, A) ; + GB_JIT_KERNEL_CONVERT_S2B, GxB_FULL, false, A->type, op, false, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -54,6 +55,6 @@ GrB_Info GB_convert_s2b_jit // convert sparse to bitmap //-------------------------------------------------------------------------- GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (Ax_new, Ab, A, A_ek_slicing, A_ntasks, A_nthreads)) ; + return (GB_jit_kernel (Cx, Cb, A, A_ek_slicing, A_ntasks, A_nthreads)) ; } diff --git a/Source/jit_wrappers/GB_emult_02_jit.c b/Source/jit_wrappers/GB_emult_02_jit.c index b062cca3cd..6ef8a8b8a2 100644 --- a/Source/jit_wrappers/GB_emult_02_jit.c +++ b/Source/jit_wrappers/GB_emult_02_jit.c @@ -22,6 +22,7 @@ GrB_Info GB_emult_02_jit // C<#M>=A.*B, emult_02, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *restrict Cp_kfirst, @@ -40,7 +41,7 @@ GrB_Info GB_emult_02_jit // C<#M>=A.*B, emult_02, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT2, true, false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, false, A, B) ; + binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -59,6 +60,6 @@ GrB_Info GB_emult_02_jit // C<#M>=A.*B, emult_02, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, Mask_comp, A, B, - Cp_kfirst, A_ek_slicing, A_ntasks, A_nthreads)) ; + Cp_kfirst, A_ek_slicing, A_ntasks, A_nthreads, binaryop->theta)) ; } diff --git a/Source/jit_wrappers/GB_emult_03_jit.c b/Source/jit_wrappers/GB_emult_03_jit.c index babe9bee5b..d3f97aace6 100644 --- a/Source/jit_wrappers/GB_emult_03_jit.c +++ b/Source/jit_wrappers/GB_emult_03_jit.c @@ -22,6 +22,7 @@ GrB_Info GB_emult_03_jit // C<#M>=A.*B, emult_03, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *restrict Cp_kfirst, @@ -40,7 +41,7 @@ GrB_Info GB_emult_03_jit // C<#M>=A.*B, emult_03, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT3, true, false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, false, A, B) ; + binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -59,6 +60,6 @@ GrB_Info GB_emult_03_jit // C<#M>=A.*B, emult_03, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, Mask_comp, A, B, Cp_kfirst, - B_ek_slicing, B_ntasks, B_nthreads)) ; + B_ek_slicing, B_ntasks, B_nthreads, binaryop->theta)) ; } diff --git a/Source/jit_wrappers/GB_emult_04_jit.c b/Source/jit_wrappers/GB_emult_04_jit.c index ae8972ccaa..e957f66e80 100644 --- a/Source/jit_wrappers/GB_emult_04_jit.c +++ b/Source/jit_wrappers/GB_emult_04_jit.c @@ -21,6 +21,7 @@ GrB_Info GB_emult_04_jit // C=A.*B, emult_04, via the JIT const GrB_Matrix M, const bool Mask_struct, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *restrict Cp_kfirst, @@ -39,7 +40,7 @@ GrB_Info GB_emult_04_jit // C=A.*B, emult_04, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT4, true, false, false, C_sparsity, C->type, M, Mask_struct, false, - binaryop, false, A, B) ; + binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -58,6 +59,6 @@ GrB_Info GB_emult_04_jit // C=A.*B, emult_04, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, A, B, Cp_kfirst, M_ek_slicing, - M_ntasks, M_nthreads)) ; + M_ntasks, M_nthreads, binaryop->theta)) ; } diff --git a/Source/jit_wrappers/GB_emult_08_jit.c b/Source/jit_wrappers/GB_emult_08_jit.c index 2c5aed8421..6aefe8aea7 100644 --- a/Source/jit_wrappers/GB_emult_08_jit.c +++ b/Source/jit_wrappers/GB_emult_08_jit.c @@ -22,6 +22,7 @@ GrB_Info GB_emult_08_jit // C<#M>=A.*B, emult_08, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *restrict C_to_M, @@ -42,7 +43,7 @@ GrB_Info GB_emult_08_jit // C<#M>=A.*B, emult_08, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT8, true, false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, false, A, B) ; + binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -61,6 +62,6 @@ GrB_Info GB_emult_08_jit // C<#M>=A.*B, emult_08, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, Mask_comp, A, B, C_to_M, C_to_A, - C_to_B, TaskList, C_ntasks, C_nthreads)) ; + C_to_B, TaskList, C_ntasks, C_nthreads, binaryop->theta)) ; } diff --git a/Source/jit_wrappers/GB_emult_bitmap_jit.c b/Source/jit_wrappers/GB_emult_bitmap_jit.c index 228e37cba3..e27f1105af 100644 --- a/Source/jit_wrappers/GB_emult_bitmap_jit.c +++ b/Source/jit_wrappers/GB_emult_bitmap_jit.c @@ -21,6 +21,7 @@ GrB_Info GB_emult_bitmap_jit // C<#M>=A.*B, emult_bitmap, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *M_ek_slicing, @@ -39,7 +40,7 @@ GrB_Info GB_emult_bitmap_jit // C<#M>=A.*B, emult_bitmap, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EMULT_BITMAP, true, false, false, GxB_BITMAP, C->type, M, Mask_struct, Mask_comp, - binaryop, false, A, B) ; + binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -58,6 +59,6 @@ GrB_Info GB_emult_bitmap_jit // C<#M>=A.*B, emult_bitmap, via the JIT GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; return (GB_jit_kernel (C, M, Mask_struct, Mask_comp, A, B, M_ek_slicing, - M_ntasks, M_nthreads, C_nthreads, &GB_callback)) ; + M_ntasks, M_nthreads, C_nthreads, &GB_callback, binaryop->theta)) ; } diff --git a/Source/jit_wrappers/GB_ewise_fulla_jit.c b/Source/jit_wrappers/GB_ewise_fulla_jit.c index e385a01669..5b41489553 100644 --- a/Source/jit_wrappers/GB_ewise_fulla_jit.c +++ b/Source/jit_wrappers/GB_ewise_fulla_jit.c @@ -33,7 +33,7 @@ GrB_Info GB_ewise_fulla_jit // C+=A+B via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EWISEFA, false, false, false, GxB_FULL, C->type, NULL, false, false, - binaryop, false, A, B) ; + binaryop, false, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_ewise_fulln_jit.c b/Source/jit_wrappers/GB_ewise_fulln_jit.c index c4e036cf44..dbbcf7b011 100644 --- a/Source/jit_wrappers/GB_ewise_fulln_jit.c +++ b/Source/jit_wrappers/GB_ewise_fulln_jit.c @@ -33,7 +33,7 @@ GrB_Info GB_ewise_fulln_jit // C=A+B via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_EWISEFN, false, false, false, GxB_FULL, C->type, NULL, false, false, - binaryop, false, A, B) ; + binaryop, false, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_iso_expand_jit.c b/Source/jit_wrappers/GB_iso_expand_jit.c new file mode 100644 index 0000000000..98a8a72401 --- /dev/null +++ b/Source/jit_wrappers/GB_iso_expand_jit.c @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// GB_iso_expand_jit: JIT kernel to expand an iso scalar into an array +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_ISO_EXPAND_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_iso_expand_jit // expand an iso scalar into an entire array +( + void *restrict X, // output array to expand into + const int64_t n, // # of entries in X + const void *restrict scalar, // scalar to expand into X + const GrB_Type xtype, // the type of the X and the scalar + const GB_Operator op, // identity operator + const int nthreads // # of threads to use +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_apply (&encoding, &suffix, + GB_JIT_KERNEL_ISO_EXPAND, GxB_FULL, false, xtype, op, false, + GxB_FULL, false, xtype, true, 0) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_apply_family, "iso_expand", + hash, &encoding, suffix, NULL, NULL, + op, xtype, xtype, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (X, n, scalar, nthreads)) ; +} + diff --git a/Source/jit_wrappers/GB_kroner_jit.c b/Source/jit_wrappers/GB_kroner_jit.c new file mode 100644 index 0000000000..06ca2a5e86 --- /dev/null +++ b/Source/jit_wrappers/GB_kroner_jit.c @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// GB_kroner_jit: kronecker product +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_KRONER_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_kroner_jit +( + // output: + GrB_Matrix C, + // input: + const GrB_BinaryOp binaryop, + const bool flipij, + const GrB_Matrix A, + const GrB_Matrix B, + const int nthreads +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + // C is sparse, hypersparse, or full, where sparse/hypersparse leads to + // the same kernel, so C is treated as if sparse. C->h is constructed + // in the caller, not in the JIT kernel. + int C_sparsity = (GB_IS_SPARSE (C) || GB_IS_HYPERSPARSE (C)) ? + GxB_HYPERSPARSE : GxB_FULL ; + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_ewise (&encoding, &suffix, + GB_JIT_KERNEL_KRONER, /* is_ewisemult: */ false, /* C_iso: */ C->iso, + /* C_in_iso: */ false, C_sparsity, C->type, /* M: */ NULL, true, false, + binaryop, flipij, false, A, B) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_ewise_family, "kroner", + hash, &encoding, suffix, NULL, NULL, + (GB_Operator) binaryop, C->type, A->type, B->type) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (C, A, B, nthreads, binaryop->theta)) ; +} + diff --git a/Source/jit_wrappers/GB_masker_phase1_jit.c b/Source/jit_wrappers/GB_masker_phase1_jit.c new file mode 100644 index 0000000000..46e28212d1 --- /dev/null +++ b/Source/jit_wrappers/GB_masker_phase1_jit.c @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +// GB_masker_phase1_jit: find # of entries in R = masker (C,M,Z) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_MASKER_PHASE1_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_masker_phase1_jit // count nnz in each R(:,j) +( + // computed by phase1: + int64_t *Rp, // output of size Rnvec+1 + int64_t *Rnvec_nonempty, // # of non-empty vectors in R + // tasks from phase1a: + GB_task_struct *restrict TaskList, // array of structs + const int R_ntasks, // # of tasks + const int R_nthreads, // # of threads to use + // analysis from phase0: + const int64_t Rnvec, + const int64_t *restrict Rh, + const int64_t *restrict R_to_M, + const int64_t *restrict R_to_C, + const int64_t *restrict R_to_Z, + // original input: + const GrB_Matrix M, // required mask + const bool Mask_comp, // if true, then M is complemented + const bool Mask_struct, // if true, use the only structure of M + const GrB_Matrix C, + const GrB_Matrix Z +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_masker (&encoding, &suffix, + GB_JIT_KERNEL_MASKER_PHASE1, NULL, M, Mask_struct, Mask_comp, C, Z) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_masker_family, "masker_phase1", + hash, &encoding, suffix, NULL, NULL, NULL, NULL, NULL, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (Rp, Rnvec_nonempty, TaskList, R_ntasks, R_nthreads, + Rnvec, Rh, R_to_M, R_to_C, R_to_Z, M, Mask_comp, Mask_struct, C, Z)) ; +} + diff --git a/Source/jit_wrappers/GB_masker_phase2_jit.c b/Source/jit_wrappers/GB_masker_phase2_jit.c new file mode 100644 index 0000000000..05ca83ba22 --- /dev/null +++ b/Source/jit_wrappers/GB_masker_phase2_jit.c @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// GB_masker_phase2_jit: construct R = masker (C,M,Z) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_MASKER_PHASE2_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_masker_phase2_jit // phase2 for R = masker (C,M,Z) +( + GrB_Matrix R, // output matrix, static header + // tasks from phase1a: + const GB_task_struct *restrict TaskList, // array of structs + const int R_ntasks, // # of tasks + const int R_nthreads, // # of threads to use + // analysis from phase0: + const int64_t *restrict R_to_M, + const int64_t *restrict R_to_C, + const int64_t *restrict R_to_Z, + // original input: + const GrB_Matrix M, // required mask + const bool Mask_comp, // if true, then M is complemented + const bool Mask_struct, // if true, use the only structure of M + const GrB_Matrix C, + const GrB_Matrix Z, + const int64_t *restrict C_ek_slicing, + const int C_nthreads, + const int C_ntasks, + const int64_t *restrict M_ek_slicing, + const int M_nthreads, + const int M_ntasks +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_masker (&encoding, &suffix, + GB_JIT_KERNEL_MASKER_PHASE2, R, M, Mask_struct, Mask_comp, C, Z) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_masker_family, "masker_phase2", + hash, &encoding, suffix, NULL, NULL, NULL, R->type, NULL, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (R, TaskList, R_ntasks, R_nthreads, + R_to_M, R_to_C, R_to_Z, M, Mask_comp, Mask_struct, C, Z, + C_ek_slicing, C_ntasks, C_nthreads, + M_ek_slicing, M_ntasks, M_nthreads)) ; +} + diff --git a/Source/jit_wrappers/GB_rowscale_jit.c b/Source/jit_wrappers/GB_rowscale_jit.c index 2d11073765..17a47cdac2 100644 --- a/Source/jit_wrappers/GB_rowscale_jit.c +++ b/Source/jit_wrappers/GB_rowscale_jit.c @@ -34,7 +34,7 @@ GrB_Info GB_rowscale_jit // C=D*B, rowscale, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_ROWSCALE, false, false, false, GB_sparsity (C), C->type, NULL, false, false, - binaryop, flipxy, D, B) ; + binaryop, false, flipxy, D, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_sort_jit.c b/Source/jit_wrappers/GB_sort_jit.c new file mode 100644 index 0000000000..9a71f7b4a0 --- /dev/null +++ b/Source/jit_wrappers/GB_sort_jit.c @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// GB_sort_jit: sort a matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_SORT_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_sort_jit +( + // input/output: + GrB_Matrix C, + // input: + const GrB_BinaryOp binaryop, + int nthreads, + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_sort (&encoding, &suffix, + GB_JIT_KERNEL_SORT, C, binaryop) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_sort_family, "sort", + hash, &encoding, suffix, NULL, NULL, + (GB_Operator) binaryop, C->type, NULL, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (C, nthreads, Werk, &GB_callback)) ; +} + diff --git a/Source/jit_wrappers/GB_split_bitmap_jit.c b/Source/jit_wrappers/GB_split_bitmap_jit.c index 22ab90fe5c..4960ed5545 100644 --- a/Source/jit_wrappers/GB_split_bitmap_jit.c +++ b/Source/jit_wrappers/GB_split_bitmap_jit.c @@ -32,7 +32,8 @@ GrB_Info GB_split_bitmap_jit // split A into a bitmap tile C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_SPLIT_BITMAP, GxB_BITMAP, true, C->type, op, false, A) ; + GB_JIT_KERNEL_SPLIT_BITMAP, GxB_BITMAP, true, C->type, op, false, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_split_full_jit.c b/Source/jit_wrappers/GB_split_full_jit.c index baf9b388fd..a094ea3cc1 100644 --- a/Source/jit_wrappers/GB_split_full_jit.c +++ b/Source/jit_wrappers/GB_split_full_jit.c @@ -32,7 +32,8 @@ GrB_Info GB_split_full_jit // split A into a full tile C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_SPLIT_FULL, GxB_FULL, true, C->type, op, false, A) ; + GB_JIT_KERNEL_SPLIT_FULL, GxB_FULL, true, C->type, op, false, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_split_sparse_jit.c b/Source/jit_wrappers/GB_split_sparse_jit.c index cb6a1bb9f8..fb29aab8dc 100644 --- a/Source/jit_wrappers/GB_split_sparse_jit.c +++ b/Source/jit_wrappers/GB_split_sparse_jit.c @@ -35,7 +35,8 @@ GrB_Info GB_split_sparse_jit // split A into a sparse tile C GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_SPLIT_SPARSE, GxB_SPARSE, true, C->type, op, false, A) ; + GB_JIT_KERNEL_SPLIT_SPARSE, GxB_SPARSE, true, C->type, op, false, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_subassign_jit.c b/Source/jit_wrappers/GB_subassign_jit.c index f728fa9888..7d9d8c625e 100644 --- a/Source/jit_wrappers/GB_subassign_jit.c +++ b/Source/jit_wrappers/GB_subassign_jit.c @@ -40,6 +40,8 @@ GrB_Info GB_subassign_jit const GrB_Matrix A, // NULL for scalar assignment const void *scalar, const GrB_Type scalar_type, + // S matrix: + const GrB_Matrix S, // NULL if not constructed // kind and kernel: const int assign_kind, // row assign, col assign, assign, or subassign const int assign_kernel, // GB_JIT_KERNEL_SUBASSIGN_01, ... etc @@ -54,9 +56,9 @@ GrB_Info GB_subassign_jit GB_jit_encoding encoding ; char *suffix ; - uint64_t hash = GB_encodify_assign (&encoding, &suffix, - assign_kernel, C, C_replace, Ikind, Jkind, M, Mask_struct, - Mask_comp, accum, A, scalar_type, assign_kind) ; + uint64_t hash = GB_encodify_assign (&encoding, &suffix, assign_kernel, + C, C_replace, Ikind, Jkind, M, Mask_comp, Mask_struct, accum, + A, scalar_type, S, assign_kind) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -71,15 +73,19 @@ GrB_Info GB_subassign_jit (GB_Operator) accum, C->type, atype, NULL) ; if (info != GrB_SUCCESS) return (info) ; - double chunk = GB_Context_chunk ( ) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - //-------------------------------------------------------------------------- // call the jit kernel and return result //-------------------------------------------------------------------------- + double chunk = GB_Context_chunk ( ) ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; - return (GB_jit_kernel (C, I, ni, nI, Icolon, J, nj, nJ, Jcolon, M, A, - scalar, nthreads_max, chunk, Werk, &GB_callback)) ; + return (GB_jit_kernel (C, C_replace, + I, ni, nI, Ikind, Icolon, + J, nj, nJ, Jkind, Jcolon, + M, Mask_comp, Mask_struct, + accum, A, scalar, scalar_type, S, assign_kind, Werk, + nthreads_max, chunk, &GB_callback)) ; } diff --git a/Source/jit_wrappers/GB_subref_bitmap_jit.c b/Source/jit_wrappers/GB_subref_bitmap_jit.c new file mode 100644 index 0000000000..c23180def6 --- /dev/null +++ b/Source/jit_wrappers/GB_subref_bitmap_jit.c @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +// GB_subref_bitmap_jit: JIT kernel for GB_bitmap_subref, C=A(I,J) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_BITMAP_SUBREF_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_subref_bitmap_jit +( + // input/output: + GrB_Matrix C, + // input: + GrB_Matrix A, + // I: + const GrB_Index *I, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + // J: + const GrB_Index *J, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + GB_Werk Werk +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_subref (&encoding, &suffix, + GB_JIT_KERNEL_BITMAP_SUBREF, C, Ikind, Jkind, false, false, A) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_subref_family, "subref_bitmap", + hash, &encoding, suffix, NULL, NULL, + NULL, C->type, NULL, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + double chunk = GB_Context_chunk ( ) ; + int nthreads_max = GB_Context_nthreads_max ( ) ; + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (C, A, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, + Werk, nthreads_max, chunk, &GB_callback)) ; +} + diff --git a/Source/jit_wrappers/GB_subref_sparse_jit.c b/Source/jit_wrappers/GB_subref_sparse_jit.c new file mode 100644 index 0000000000..1d1c7c17ea --- /dev/null +++ b/Source/jit_wrappers/GB_subref_sparse_jit.c @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// GB_subref_sparse_jit: C=A(I,J) when C and A are sparse/hypersparse +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_SUBREF_SPARSE_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_subref_sparse_jit +( + // output matrix + GrB_Matrix C, // same type as A + // from phase1: + const GB_task_struct *restrict TaskList, // list of tasks + const int ntasks, // # of tasks + const int nthreads, // # of threads to use + const bool post_sort, // true if post-sort needed + const int64_t *Mark, // for I inverse buckets, size A->vlen + const int64_t *Inext, // for I inverse buckets, size nI + const bool I_has_duplicates, // true if I has duplicates + // from phase0: + const int64_t *restrict Ap_start, + const int64_t *restrict Ap_end, + const bool need_qsort, + const int Ikind, + const int64_t nI, + const int64_t Icolon [3], + // original input: + const GrB_Matrix A, + const GrB_Index *I +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_subref (&encoding, &suffix, + GB_JIT_KERNEL_SUBREF_SPARSE, C, Ikind, 0, + need_qsort, I_has_duplicates, A) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_subref_family, "subref_sparse", + hash, &encoding, suffix, NULL, NULL, + NULL, C->type, NULL, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (C, TaskList, ntasks, nthreads, post_sort, Mark, + Inext, Ap_start, Ap_end, nI, Icolon, A, I, &GB_callback)) ; +} + diff --git a/Source/jit_wrappers/GB_transpose_bind1st_jit.c b/Source/jit_wrappers/GB_transpose_bind1st_jit.c index 18f19d3f3a..776c7065f4 100644 --- a/Source/jit_wrappers/GB_transpose_bind1st_jit.c +++ b/Source/jit_wrappers/GB_transpose_bind1st_jit.c @@ -36,7 +36,7 @@ GrB_Info GB_transpose_bind1st_jit uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_TRANSBIND1, false, false, false, GB_sparsity (C), C->type, NULL, false, false, - binaryop, false, NULL, A) ; + binaryop, false, false, NULL, A) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_transpose_bind2nd_jit.c b/Source/jit_wrappers/GB_transpose_bind2nd_jit.c index d9303fa51f..501d9e07c9 100644 --- a/Source/jit_wrappers/GB_transpose_bind2nd_jit.c +++ b/Source/jit_wrappers/GB_transpose_bind2nd_jit.c @@ -36,7 +36,7 @@ GrB_Info GB_transpose_bind2nd_jit uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_TRANSBIND2, false, false, false, GB_sparsity (C), C->type, NULL, false, false, - binaryop, false, A, NULL) ; + binaryop, false, false, A, NULL) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_transpose_unop_jit.c b/Source/jit_wrappers/GB_transpose_unop_jit.c index 05a3bb985f..0372c27229 100644 --- a/Source/jit_wrappers/GB_transpose_unop_jit.c +++ b/Source/jit_wrappers/GB_transpose_unop_jit.c @@ -33,7 +33,8 @@ GrB_Info GB_transpose_unop_jit // C = op (A'), transpose unop via the JIT GB_jit_encoding encoding ; char *suffix ; uint64_t hash = GB_encodify_apply (&encoding, &suffix, - GB_JIT_KERNEL_TRANSUNOP, GB_sparsity (C), true, C->type, op, false, A) ; + GB_JIT_KERNEL_TRANSUNOP, GB_sparsity (C), true, C->type, op, false, + GB_sparsity (A), true, A->type, A->iso, A->nzombies) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed diff --git a/Source/jit_wrappers/GB_union_jit.c b/Source/jit_wrappers/GB_union_jit.c index eccb15d56e..838549bb50 100644 --- a/Source/jit_wrappers/GB_union_jit.c +++ b/Source/jit_wrappers/GB_union_jit.c @@ -22,6 +22,7 @@ GrB_Info GB_union_jit // C=A+B, C<#M>=A+B, eWiseUnion, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const GB_void *alpha_scalar_in, @@ -54,7 +55,7 @@ GrB_Info GB_union_jit // C=A+B, C<#M>=A+B, eWiseUnion, via the JIT uint64_t hash = GB_encodify_ewise (&encoding, &suffix, GB_JIT_KERNEL_UNION, false, false, false, C_sparsity, C->type, M, Mask_struct, Mask_comp, - binaryop, false, A, B) ; + binaryop, flipij, false, A, B) ; //-------------------------------------------------------------------------- // get the kernel function pointer, loading or compiling it if needed @@ -79,6 +80,7 @@ GrB_Info GB_union_jit // C=A+B, C<#M>=A+B, eWiseUnion, via the JIT return (GB_jit_kernel (C, M, A, B, alpha_scalar_in, beta_scalar_in, Ch_is_Mh, C_to_M, C_to_A, C_to_B, TaskList, C_ntasks, C_nthreads, M_ek_slicing, M_nthreads, M_ntasks, A_ek_slicing, A_nthreads, A_ntasks, - B_ek_slicing, B_nthreads, B_ntasks, M_is_A, M_is_B)) ; + B_ek_slicing, B_nthreads, B_ntasks, M_is_A, M_is_B, + binaryop->theta)) ; } diff --git a/Source/jit_wrappers/GB_unjumble_jit.c b/Source/jit_wrappers/GB_unjumble_jit.c new file mode 100644 index 0000000000..6b7fc552fe --- /dev/null +++ b/Source/jit_wrappers/GB_unjumble_jit.c @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// GB_unjumble_jit: JIT kernel to sort the vectors of a sparse/hyper matrix +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +typedef GB_JIT_KERNEL_UNJUMBLE_PROTO ((*GB_jit_dl_function)) ; + +GrB_Info GB_unjumble_jit +( + // input/output: + const GrB_Matrix A, + const GB_Operator op, // identity op, unused + const int64_t *A_slice, + const int ntasks, + const int nthreads +) +{ + + //-------------------------------------------------------------------------- + // encodify the problem + //-------------------------------------------------------------------------- + + GB_jit_encoding encoding ; + char *suffix ; + uint64_t hash = GB_encodify_apply (&encoding, &suffix, + GB_JIT_KERNEL_UNJUMBLE, GxB_FULL, false, A->type, op, false, + GxB_SPARSE, true, A->type, false, 0) ; + + //-------------------------------------------------------------------------- + // get the kernel function pointer, loading or compiling it if needed + //-------------------------------------------------------------------------- + + void *dl_function ; + GrB_Info info = GB_jitifyer_load (&dl_function, + GB_jit_apply_family, "unjumble", + hash, &encoding, suffix, NULL, NULL, + op, A->type, A->type, NULL) ; + if (info != GrB_SUCCESS) return (info) ; + + //-------------------------------------------------------------------------- + // call the jit kernel and return result + //-------------------------------------------------------------------------- + + GB_jit_dl_function GB_jit_kernel = (GB_jit_dl_function) dl_function ; + return (GB_jit_kernel (A, A_slice, ntasks, nthreads)) ; +} + diff --git a/Source/jitifyer/GB_demacrofy_name.c b/Source/jitifyer/GB_demacrofy_name.c index 8357c0ba11..9eab764006 100644 --- a/Source/jitifyer/GB_demacrofy_name.c +++ b/Source/jitifyer/GB_demacrofy_name.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GB_demacrofy_name: parse a kernel name for its kname, scode, and suffix +// GB_demacrofy_name: parse a kernel name for its kname, method_code, and suffix //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. @@ -15,11 +15,11 @@ // // namespace__kname__012345 // -// where "012345" is a hexadecimal printing of the scode. Note the double -// underscores that precede the scode and the suffix. +// where "012345" is a hexadecimal printing of the method_code. Note the double +// underscores that precede the method_code and the suffix. // // GB_demacrofy_name parses the kernel_name of a PreJIT kernel, extracting -// the namespace, kname, scode (as a uint64_t), and suffix. NUL characters +// the namespace, kname, method_code (as a uint64_t), and suffix. NUL characters // are inserted into kernel_name where the dots appear: // // namespace._kname._012345._suffix @@ -39,7 +39,7 @@ GrB_Info GB_demacrofy_name // output char **name_space, // namespace for the kernel_name char **kname, // kname for the kernel_name - uint64_t *scode, // enumify'd code of the kernel + uint64_t *method_code, // enumify'd code of the kernel char **suffix // suffix for the kernel_name (NULL if none) ) { @@ -51,12 +51,12 @@ GrB_Info GB_demacrofy_name ASSERT (kernel_name != NULL) ; ASSERT (name_space != NULL) ; ASSERT (kname != NULL) ; - ASSERT (scode != NULL) ; + ASSERT (method_code != NULL) ; ASSERT (suffix != NULL) ; (*name_space) = NULL ; (*kname) = NULL ; - (*scode) = 0 ; + (*method_code) = 0 ; (*suffix) = NULL ; // remains NULL if kernel uses only builtin types/ops //-------------------------------------------------------------------------- @@ -72,7 +72,7 @@ GrB_Info GB_demacrofy_name int ndouble = 0 ; (*name_space) = kernel_name ; - char *scode_string = NULL ; + char *method_code_string = NULL ; for (int k = 1 ; k < len - 1 ; k++) { @@ -92,8 +92,8 @@ GrB_Info GB_demacrofy_name } else if (ndouble == 2) { - // save the start of the scode component of the kernel_name - scode_string = &(kernel_name [k]) ; + // save start of the method_code component of the kernel_name + method_code_string = &(kernel_name [k]) ; } else if (ndouble == 3) { @@ -113,17 +113,17 @@ GrB_Info GB_demacrofy_name } //-------------------------------------------------------------------------- - // parse the scode_string + // parse the method_code_string //-------------------------------------------------------------------------- - uint64_t scode_result = 0 ; - if (sscanf (scode_string, "%" SCNx64, &scode_result) != 1) + uint64_t method_code_result = 0 ; + if (sscanf (method_code_string, "%" SCNx64, &method_code_result) != 1) { - // didn't find the scode: kernel_name is invalid; ignore this kernel + // didn't find method_code: kernel_name is invalid; ignore this kernel return (GrB_NO_VALUE) ; } - (*scode) = scode_result ; + (*method_code) = method_code_result ; return (GrB_SUCCESS) ; } diff --git a/Source/jitifyer/GB_encodify_apply.c b/Source/jitifyer/GB_encodify_apply.c index bd3221cd27..5f470b6fe7 100644 --- a/Source/jitifyer/GB_encodify_apply.c +++ b/Source/jitifyer/GB_encodify_apply.c @@ -2,7 +2,7 @@ // GB_encodify_apply: encode an apply problem, including types and op //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -18,12 +18,20 @@ uint64_t GB_encodify_apply // encode an apply problem char **suffix, // suffix for user-defined kernel // input: const GB_jit_kcode kcode, // kernel to encode + // C matrix: const int C_sparsity, const bool C_is_matrix, // true for C=op(A), false for Cx=op(A) const GrB_Type ctype, - const GB_Operator op, + // operator: + const GB_Operator op, // not JIT'd if NULL const bool flipij, - const GrB_Matrix A + // A matrix: +// const GrB_Matrix A + const int A_sparsity, + const bool A_is_matrix, + const GrB_Type atype, + const bool A_iso, + const int64_t A_nzombies ) { @@ -45,7 +53,7 @@ uint64_t GB_encodify_apply // encode an apply problem encoding->kcode = kcode ; GB_enumify_apply (&encoding->code, C_sparsity, C_is_matrix, ctype, op, - flipij, A) ; + flipij, A_sparsity, A_is_matrix, atype, A_iso, A_nzombies) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/Source/jitifyer/GB_encodify_assign.c b/Source/jitifyer/GB_encodify_assign.c index 3879ff95ea..6c520aaa17 100644 --- a/Source/jitifyer/GB_encodify_assign.c +++ b/Source/jitifyer/GB_encodify_assign.c @@ -26,13 +26,15 @@ uint64_t GB_encodify_assign // encode an assign problem int Jkind, // ditto // M matrix: GrB_Matrix M, // may be NULL - bool Mask_struct, // mask is structural bool Mask_comp, // mask is complemented + bool Mask_struct, // mask is structural // operator: GrB_BinaryOp accum, // the accum operator (may be NULL) // A matrix or scalar GrB_Matrix A, // NULL for scalar assignment GrB_Type scalar_type, + // S matrix: + GrB_Matrix S, // may be NULL int assign_kind // 0: assign, 1: subassign, 2: row, 3: col ) { @@ -56,7 +58,7 @@ uint64_t GB_encodify_assign // encode an assign problem encoding->kcode = kcode ; GB_enumify_assign (&encoding->code, C, C_replace, Ikind, Jkind, - M, Mask_struct, Mask_comp, accum, A, scalar_type, assign_kind) ; + M, Mask_comp, Mask_struct, accum, A, scalar_type, S, assign_kind) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/Source/jitifyer/GB_encodify_ewise.c b/Source/jitifyer/GB_encodify_ewise.c index 03a6f5385b..70e94d06ea 100644 --- a/Source/jitifyer/GB_encodify_ewise.c +++ b/Source/jitifyer/GB_encodify_ewise.c @@ -27,6 +27,7 @@ uint64_t GB_encodify_ewise // encode an ewise problem const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const bool flipxy, const GrB_Matrix A, // NULL for apply bind1st const GrB_Matrix B // NULL for apply bind2nd @@ -49,14 +50,14 @@ uint64_t GB_encodify_ewise // encode an ewise problem // primary encoding of the problem //-------------------------------------------------------------------------- - // only eWiseAdd can copy entries directly from A or B into C - bool can_copy_to_C = (kcode == GB_JIT_KERNEL_ADD) ; + bool is_eWiseAdd = (kcode == GB_JIT_KERNEL_ADD) ; bool is_eWiseUnion = (kcode == GB_JIT_KERNEL_UNION) ; + bool is_kron = (kcode == GB_JIT_KERNEL_KRONER) ; encoding->kcode = kcode ; - GB_enumify_ewise (&encoding->code, is_eWiseMult, is_eWiseUnion, - can_copy_to_C, C_iso, C_in_iso, C_sparsity, ctype, M, Mask_struct, - Mask_comp, binaryop, flipxy, A, B) ; + GB_enumify_ewise (&encoding->code, is_eWiseMult, is_eWiseUnion, is_kron, + is_eWiseAdd, C_iso, C_in_iso, C_sparsity, ctype, M, Mask_struct, + Mask_comp, binaryop, flipij, flipxy, A, B) ; //-------------------------------------------------------------------------- // determine the suffix and its length diff --git a/Source/jitifyer/GB_encodify_masker.c b/Source/jitifyer/GB_encodify_masker.c new file mode 100644 index 0000000000..0eb8003864 --- /dev/null +++ b/Source/jitifyer/GB_encodify_masker.c @@ -0,0 +1,68 @@ +//------------------------------------------------------------------------------ +// GB_encodify_masker: encode a masker problem, including types +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// FUTURE: allow the types of R, C, and Z to differ. + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +uint64_t GB_encodify_masker // encode a masker problem +( + // output: + GB_jit_encoding *encoding, // unique encoding of the entire problem, + // except for the suffix + char **suffix, // suffix for user-defined kernel + // input: + const GB_jit_kcode kcode, // kernel to encode + const GrB_Matrix R, + const GrB_Matrix M, + const bool Mask_struct, + const bool Mask_comp, + const GrB_Matrix C, + const GrB_Matrix Z +) +{ + + //-------------------------------------------------------------------------- + // check if the R->type is JIT'able + //-------------------------------------------------------------------------- + + GrB_Type rtype = (R == NULL) ? NULL : R->type ; + if (R != NULL && rtype->hash == UINT64_MAX) + { + // cannot JIT this type + memset (encoding, 0, sizeof (GB_jit_encoding)) ; + (*suffix) = NULL ; + return (UINT64_MAX) ; + } + + //-------------------------------------------------------------------------- + // primary encoding of the problem + //-------------------------------------------------------------------------- + + encoding->kcode = kcode ; + GB_enumify_masker (&encoding->code, R, M, Mask_struct, Mask_comp, C, Z) ; + + //-------------------------------------------------------------------------- + // determine the suffix and its length + //-------------------------------------------------------------------------- + + // if hash is zero, it denotes a builtin type + uint64_t hash = (rtype == NULL) ? 0 : rtype->hash ; + encoding->suffix_len = (hash == 0) ? 0 : rtype->name_len ; + (*suffix) = (hash == 0) ? NULL : rtype->name ; + + //-------------------------------------------------------------------------- + // compute the hash of the entire problem + //-------------------------------------------------------------------------- + + hash = hash ^ GB_jitifyer_hash_encoding (encoding) ; + return ((hash == 0 || hash == UINT64_MAX) ? GB_MAGIC : hash) ; +} + diff --git a/Source/jitifyer/GB_encodify_sort.c b/Source/jitifyer/GB_encodify_sort.c new file mode 100644 index 0000000000..fa12dd2139 --- /dev/null +++ b/Source/jitifyer/GB_encodify_sort.c @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// GB_encodify_sort: encode a sort problem, including types and op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +uint64_t GB_encodify_sort // encode a sort problem +( + // output: + GB_jit_encoding *encoding, // unique encoding of the entire problem, + // except for the suffix + char **suffix, // suffix for user-defined kernel + // input: + const GB_jit_kcode kcode, // kernel to encode + // input/output + GrB_Matrix C, + // input: + const GrB_BinaryOp binaryop +) +{ + + //-------------------------------------------------------------------------- + // check if the binaryop is JIT'able + //-------------------------------------------------------------------------- + + if (binaryop != NULL && binaryop->hash == UINT64_MAX) + { + // cannot JIT this binaryop + memset (encoding, 0, sizeof (GB_jit_encoding)) ; + (*suffix) = NULL ; + return (UINT64_MAX) ; + } + + //-------------------------------------------------------------------------- + // primary encoding of the problem + //-------------------------------------------------------------------------- + + encoding->kcode = kcode ; + GB_enumify_sort (&encoding->code, C, binaryop) ; + + //-------------------------------------------------------------------------- + // determine the suffix and its length + //-------------------------------------------------------------------------- + + // if hash is zero, it denotes a builtin binary operator + uint64_t hash = binaryop->hash ; + encoding->suffix_len = (hash == 0) ? 0 : binaryop->name_len ; + (*suffix) = (hash == 0) ? NULL : binaryop->name ; + + //-------------------------------------------------------------------------- + // compute the hash of the entire problem + //-------------------------------------------------------------------------- + + hash = hash ^ GB_jitifyer_hash_encoding (encoding) ; + return ((hash == 0 || hash == UINT64_MAX) ? GB_MAGIC : hash) ; +} + diff --git a/Source/jitifyer/GB_encodify_subref.c b/Source/jitifyer/GB_encodify_subref.c new file mode 100644 index 0000000000..6d91292fdd --- /dev/null +++ b/Source/jitifyer/GB_encodify_subref.c @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// GB_encodify_subref: encode a subref problem +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +uint64_t GB_encodify_subref // encode an subref problem +( + // output: + GB_jit_encoding *encoding, // unique encoding of the entire problem, + // except for the suffix + char **suffix, // suffix for user-defined kernel + // input: + const GB_jit_kcode kcode, // kernel to encode + // C matrix: + GrB_Matrix C, + // index types: + int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list + int Jkind, // ditto, or 0 if not used + bool need_qsort, // true if qsort needs to be called + bool I_has_duplicates, // true if I has duplicate entries + // A matrix: + GrB_Matrix A +) +{ + + //-------------------------------------------------------------------------- + // check if the C->type is JIT'able + //-------------------------------------------------------------------------- + + if (C->type->hash == UINT64_MAX) + { + // cannot JIT this type + memset (encoding, 0, sizeof (GB_jit_encoding)) ; + (*suffix) = NULL ; + return (UINT64_MAX) ; + } + + //-------------------------------------------------------------------------- + // primary encoding of the problem + //-------------------------------------------------------------------------- + + encoding->kcode = kcode ; + GB_enumify_subref (&encoding->code, + C, Ikind, Jkind, need_qsort, I_has_duplicates, A) ; + + //-------------------------------------------------------------------------- + // determine the suffix and its length + //-------------------------------------------------------------------------- + + // if hash is zero, it denotes a builtin type + uint64_t hash = C->type->hash ; + encoding->suffix_len = (hash == 0) ? 0 : C->type->name_len ; + (*suffix) = (hash == 0) ? NULL : C->type->name ; + + //-------------------------------------------------------------------------- + // compute the hash of the entire problem + //-------------------------------------------------------------------------- + + hash = hash ^ GB_jitifyer_hash_encoding (encoding) ; + return ((hash == 0 || hash == UINT64_MAX) ? GB_MAGIC : hash) ; +} + diff --git a/Source/jitifyer/GB_encodify_user_type.c b/Source/jitifyer/GB_encodify_user_type.c index fc3835a15a..ba394530dd 100644 --- a/Source/jitifyer/GB_encodify_user_type.c +++ b/Source/jitifyer/GB_encodify_user_type.c @@ -2,7 +2,7 @@ // GB_encodify_user_type: encode a user type //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/jitifyer/GB_enumify_apply.c b/Source/jitifyer/GB_enumify_apply.c index a7e15b11cd..80811ad0a6 100644 --- a/Source/jitifyer/GB_enumify_apply.c +++ b/Source/jitifyer/GB_enumify_apply.c @@ -2,7 +2,7 @@ // GB_enumify_apply: enumerate a GrB_apply problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -17,20 +17,25 @@ void GB_enumify_apply // enumerate an apply or tranpose/apply problem ( // output: - uint64_t *scode, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: // C matrix: - int C_sparsity, // sparse, hyper, bitmap, or full. For apply + const int C_sparsity, // sparse, hyper, bitmap, or full. For apply // without transpose, Cx = op(A) is computed where // Cx is just C->x, so the caller uses 'full' when // C is sparse, hyper, or full. - bool C_is_matrix, // true for C=op(A), false for Cx=op(A) - GrB_Type ctype, // C=((ctype) T) is the final typecast + const bool C_is_matrix, // true for C=op(A), false for Cx=op(A) + const GrB_Type ctype, // C=((ctype) T) is the final typecast // operator: const GB_Operator op, // unary/index-unary to apply; not binaryop - bool flipij, // if true, flip i,j for user idxunop + const bool flipij, // if true, flip i,j for user idxunop // A matrix: - const GrB_Matrix A // input matrix +// const GrB_Matrix A // input matrix + const int A_sparsity, + const bool A_is_matrix, + const GrB_Type atype, + const bool A_iso, + const int64_t A_nzombies ) { @@ -73,7 +78,7 @@ void GB_enumify_apply // enumerate an apply or tranpose/apply problem // enumify the types of C and A //-------------------------------------------------------------------------- - int acode = (xcode == 0) ? 0 : (A->type->code) ; // 0 to 14 + int acode = (xcode == 0) ? 0 : (atype->code) ; // 0 to 14 int ccode = ctype->code ; // 0 to 14 //-------------------------------------------------------------------------- @@ -82,19 +87,22 @@ void GB_enumify_apply // enumerate an apply or tranpose/apply problem int csparsity, asparsity ; GB_enumify_sparsity (&csparsity, C_sparsity) ; - GB_enumify_sparsity (&asparsity, GB_sparsity (A)) ; + GB_enumify_sparsity (&asparsity, A_sparsity) ; // was GB_sparsity (A) ; int C_mat = (C_is_matrix) ? 1 : 0 ; - int A_iso_code = (A->iso) ? 1 : 0 ; - int A_zombies = (A->nzombies > 0) ? 1 : 0 ; + int A_mat = (A_is_matrix) ? 1 : 0 ; + int A_iso_code = (A_iso) ? 1 : 0 ; + int A_zombies = (A_nzombies > 0) ? 1 : 0 ; //-------------------------------------------------------------------------- - // construct the apply scode + // construct the apply method_code //-------------------------------------------------------------------------- - // total scode bits: 38 bits (10 hex digits) + // total method_code bits: 39 bits (10 hex digits) - (*scode) = + (*method_code) = // range bits + // A properties (1 hex digit) + GB_LSHIFT (A_mat , 38) | // 0 or 1 1 GB_LSHIFT (A_zombies , 37) | // 0 or 1 1 GB_LSHIFT (A_iso_code , 36) | // 0 or 1 1 @@ -117,6 +125,5 @@ void GB_enumify_apply // enumerate an apply or tranpose/apply problem // sparsity structures of C and A (1 hex digit) GB_LSHIFT (csparsity , 2) | // 0 to 3 2 GB_LSHIFT (asparsity , 0) ; // 0 to 3 2 - } diff --git a/Source/jitifyer/GB_enumify_assign.c b/Source/jitifyer/GB_enumify_assign.c index f3883f6ac0..427d4bd4be 100644 --- a/Source/jitifyer/GB_enumify_assign.c +++ b/Source/jitifyer/GB_enumify_assign.c @@ -15,49 +15,9 @@ // GB_bitmap_assign or GB_subassigner to do the actual work, or related methods // that do not need a JIT (GB_*assign_zombie, in particular). -// GB_bitmap_assign and GB_subassigner will not call the JIT directly. -// Instead, they call one of the many assign/subassign kernels, each of which -// will have a JIT variant (39 of them): -// -// GB_subassign_01 -// GB_subassign_02 -// GB_subassign_03 -// GB_subassign_04 -// GB_subassign_05 -// GB_subassign_05d -// GB_subassign_06d -// GB_subassign_06n -// GB_subassign_06s_and_14 -// GB_subassign_07 -// GB_subassign_08n -// GB_subassign_08s_and_16 -// GB_subassign_09 -// GB_subassign_10_and_18 -// GB_subassign_11 -// GB_subassign_12_and_20 -// GB_subassign_13 -// GB_subassign_15 -// GB_subassign_17 -// GB_subassign_19 -// GB_subassign_22 -// GB_subassign_23 -// GB_subassign_25 -// GB_bitmap_assign_M_accum -// GB_bitmap_assign_M_accum_whole -// GB_bitmap_assign_M_noaccum -// GB_bitmap_assign_M_noaccum_whole -// GB_bitmap_assign_fullM_accum -// GB_bitmap_assign_fullM_accum_whole -// GB_bitmap_assign_fullM_noaccum -// GB_bitmap_assign_fullM_noaccum_whole -// GB_bitmap_assign_noM_accum -// GB_bitmap_assign_noM_accum_whole -// GB_bitmap_assign_noM_noaccum -// GB_bitmap_assign_noM_noaccum_whole -// GB_bitmap_assign_notM_accum -// GB_bitmap_assign_notM_accum_whole -// GB_bitmap_assign_notM_noaccum -// GB_bitmap_assign_notM_noaccum_whole +// GB_bitmap_assign and GB_subassigner do not call the JIT directly. Instead, +// they call one of the many assign/subassign kernels, each of which has a JIT +// variant. #include "GB.h" #include "jitifyer/GB_stringify.h" @@ -65,7 +25,7 @@ void GB_enumify_assign // enumerate a GrB_assign problem ( // output: - uint64_t *scode, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: // C matrix: GrB_Matrix C, @@ -75,13 +35,15 @@ void GB_enumify_assign // enumerate a GrB_assign problem int Jkind, // ditto // M matrix: GrB_Matrix M, // may be NULL - bool Mask_struct, // mask is structural bool Mask_comp, // mask is complemented + bool Mask_struct, // mask is structural // operator: GrB_BinaryOp accum, // the accum operator (may be NULL) // A matrix or scalar GrB_Matrix A, // NULL for scalar assignment GrB_Type scalar_type, + // S matrix: + GrB_Matrix S, // may be MULL int assign_kind // 0: assign, 1: subassign, 2: row, 3: col ) { @@ -96,11 +58,12 @@ void GB_enumify_assign // enumerate a GrB_assign problem ASSERT (atype != NULL) ; //-------------------------------------------------------------------------- - // get the types of X, Y, and Z + // enumify the accum operator, if present, and get the types of x,y,z //-------------------------------------------------------------------------- GB_Opcode accum_opcode ; GB_Type_code xcode, ycode, zcode ; + int accum_code ; if (accum == NULL) { @@ -109,6 +72,8 @@ void GB_enumify_assign // enumerate a GrB_assign problem xcode = 0 ; ycode = 0 ; zcode = 0 ; + // accum_code is 63 if no accum is present + accum_code = 0x3F ; } else { @@ -116,39 +81,15 @@ void GB_enumify_assign // enumerate a GrB_assign problem xcode = accum->xtype->code ; ycode = accum->ytype->code ; zcode = accum->ztype->code ; + if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) + { + // rename the operator + accum_opcode = GB_boolean_rename (accum_opcode) ; + } + // accum_code is 0 to 52 if accum is present + accum_code = (accum_opcode - GB_USER_binop_code) & 0x3F ; } - //-------------------------------------------------------------------------- - // rename redundant boolean operators - //-------------------------------------------------------------------------- - - // consider z = op(x,y) where both x and y are boolean: - // DIV becomes FIRST - // RDIV becomes SECOND - // MIN and TIMES become LAND - // MAX and PLUS become LOR - // NE, ISNE, RMINUS, and MINUS become LXOR - // ISEQ becomes EQ - // ISGT becomes GT - // ISLT becomes LT - // ISGE becomes GE - // ISLE becomes LE - - if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) - { - // rename the operator - accum_opcode = GB_boolean_rename (accum_opcode) ; - } - - //-------------------------------------------------------------------------- - // enumify the accum operator, if present - //-------------------------------------------------------------------------- - - // accum_ecode is 255 if no accum is present - - int accum_ecode ; - GB_enumify_binop (&accum_ecode, accum_opcode, xcode, false) ; - //-------------------------------------------------------------------------- // enumify the types //-------------------------------------------------------------------------- @@ -176,31 +117,39 @@ void GB_enumify_assign // enumerate a GrB_assign problem int C_sparsity = GB_sparsity (C) ; int M_sparsity = (M == NULL) ? 0 : GB_sparsity (M) ; int A_sparsity = (A == NULL) ? 0 : GB_sparsity (A) ; + int S_sparsity = (S == NULL) ? 0 : GB_sparsity (S) ; + int S_present = (S != NULL) ; - int csparsity, msparsity, asparsity ; + int csparsity, msparsity, asparsity, ssparsity ; GB_enumify_sparsity (&csparsity, C_sparsity) ; GB_enumify_sparsity (&msparsity, M_sparsity) ; GB_enumify_sparsity (&asparsity, A_sparsity) ; + GB_enumify_sparsity (&ssparsity, S_sparsity) ; int C_repl = (C_replace) ? 1 : 0 ; //-------------------------------------------------------------------------- - // construct the assign scode + // construct the assign method_code, //-------------------------------------------------------------------------- - // total scode bits: 47 (12 hex digits) + // total method_code bits: 48 (12 hex digits) - (*scode) = + (*method_code) = // range bits - // assign_kind, Ikind, and Jkind (2 hex digits) - GB_LSHIFT (C_repl , 46) | // 0 to 1 1 - GB_LSHIFT (assign_kind, 44) | // 0 to 3 2 + // C_replace, S present, scalar assign, A iso (1 hex digit) + GB_LSHIFT (C_repl , 47) | // 0 to 1 1 + GB_LSHIFT (S_present , 46) | // 0 to 1 1 + GB_LSHIFT (s_assign , 45) | // 0 to 1 1 + GB_LSHIFT (A_iso_code , 44) | // 0 or 1 1 + + // Ikind, Jkind (1 hex digit) GB_LSHIFT (Ikind , 42) | // 0 to 3 2 GB_LSHIFT (Jkind , 40) | // 0 to 3 2 - // accum, z = f(x,y) (5 hex digits) - GB_LSHIFT (accum_ecode, 32) | // 0 to 255 8 + // accum, z = f(x,y) (5 hex digits), and assign_kind + GB_LSHIFT (assign_kind, 38) | // 0 to 3 2 + GB_LSHIFT (accum_code , 32) | // 0 to 63 6 GB_LSHIFT (zcode , 28) | // 0 to 14 4 GB_LSHIFT (xcode , 24) | // 0 to 14 4 GB_LSHIFT (ycode , 20) | // 0 to 14 4 @@ -212,13 +161,10 @@ void GB_enumify_assign // enumerate a GrB_assign problem GB_LSHIFT (ccode , 12) | // 0 to 14 4 GB_LSHIFT (acode , 8) | // 1 to 14 4 - // sparsity structures of C, M, and A (2 hex digits), - // iso status of A and scalar assignment + // sparsity structures of C, M, S, and A (2 hex digits), GB_LSHIFT (csparsity , 6) | // 0 to 3 2 GB_LSHIFT (msparsity , 4) | // 0 to 3 2 - GB_LSHIFT (s_assign , 3) | // 0 to 1 1 - GB_LSHIFT (A_iso_code , 2) | // 0 or 1 1 + GB_LSHIFT (ssparsity , 2) | // 0 to 3 2 GB_LSHIFT (asparsity , 0) ; // 0 to 3 2 - } diff --git a/Source/jitifyer/GB_enumify_binop.c b/Source/jitifyer/GB_enumify_binop.c index 2ddf544d40..cf8fa8f790 100644 --- a/Source/jitifyer/GB_enumify_binop.c +++ b/Source/jitifyer/GB_enumify_binop.c @@ -20,7 +20,8 @@ void GB_enumify_binop // input: GB_Opcode opcode, // opcode of GraphBLAS operator to convert into a macro GB_Type_code xcode, // op->xtype->code of the operator - bool for_semiring // true for A*B, false for A+B or A.*B + bool for_semiring, // true for A*B multiplier, false otherwise + bool is_kron // true for kronecker ) { @@ -30,10 +31,11 @@ void GB_enumify_binop { //---------------------------------------------------------------------- - // user-defined operator + // user-defined operators //---------------------------------------------------------------------- case GB_USER_binop_code : + case GB_USER_idxbinop_code : e = 0 ; break ; @@ -455,35 +457,35 @@ void GB_enumify_binop case GB_FIRSTI_binop_code : // z = i - e = 134 ; break ; + e = is_kron ? 150 : 134 ; break ; case GB_FIRSTI1_binop_code : // z = i+1 - e = 137 ; break ; + e = is_kron ? 151 : 137 ; break ; case GB_FIRSTJ_binop_code : // z = for_semiring ? (k) : (j) - e = for_semiring ? 135 : 136 ; break ; + e = for_semiring ? 135 : (is_kron ? 152 : 136) ; break ; case GB_FIRSTJ1_binop_code : // z = for_semiring ? (k+1) : (j+1) - e = for_semiring ? 138 : 139 ; break ; + e = for_semiring ? 138 : (is_kron ? 153 : 139) ; break ; case GB_SECONDI_binop_code : // z = for_semiring ? (k) : (i) - e = for_semiring ? 135 : 134 ; break ; + e = for_semiring ? 135 : (is_kron ? 154 : 134) ; break ; case GB_SECONDI1_binop_code : // z = for_semiring ? (k+1) : (i+1) - e = for_semiring ? 138 : 137 ; break ; + e = for_semiring ? 138 : (is_kron ? 155 : 137) ; break ; case GB_SECONDJ_binop_code : // z = j - e = 136 ; break ; + e = is_kron ? 156 : 136 ; break ; case GB_SECONDJ1_binop_code : // z = j+1 - e = 139 ; break ; + e = is_kron ? 157 : 139 ; break ; case GB_NOP_code : // no operator present diff --git a/Source/jitifyer/GB_enumify_build.c b/Source/jitifyer/GB_enumify_build.c index 31e8577211..de1db91369 100644 --- a/Source/jitifyer/GB_enumify_build.c +++ b/Source/jitifyer/GB_enumify_build.c @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------ -// Enumify an build operation. +// Enumify a build operation. #include "GB.h" #include "jitifyer/GB_stringify.h" @@ -15,7 +15,7 @@ void GB_enumify_build // enumerate a GB_build problem ( // output: - uint64_t *build_code, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: GrB_BinaryOp dup, // operator for duplicates GrB_Type ttype, // type of Tx @@ -34,23 +34,6 @@ void GB_enumify_build // enumerate a GB_build problem GB_Type_code zcode = dup->ztype->code ; GB_Type_code tcode = ttype->code ; GB_Type_code scode = stype->code ; - - //-------------------------------------------------------------------------- - // rename redundant boolean operators - //-------------------------------------------------------------------------- - - // consider z = op(x,y) where both x and y are boolean: - // DIV becomes FIRST - // RDIV becomes SECOND - // MIN and TIMES become LAND - // MAX and PLUS become LOR - // NE, ISNE, RMINUS, and MINUS become LXOR - // ISEQ becomes EQ - // ISGT becomes GT - // ISLT becomes LT - // ISGE becomes GE - // ISLE becomes LE - if (xcode == GB_BOOL_code) { // rename the operator @@ -61,19 +44,18 @@ void GB_enumify_build // enumerate a GB_build problem // enumify the dup binary operator //-------------------------------------------------------------------------- - int dup_ecode ; - GB_enumify_binop (&dup_ecode, dup_opcode, xcode, false) ; + int dup_code = (dup_opcode - GB_USER_binop_code) & 0x3F ; //-------------------------------------------------------------------------- - // construct the build_code + // construct the method_code //-------------------------------------------------------------------------- - // total build_code bits: 28 (7 hex digits) + // total method_code bits: 26 (7 hex digits) - (*build_code) = + (*method_code) = // range bits // dup, z = f(x,y) (5 hex digits) - GB_LSHIFT (dup_ecode , 20) | // 0 to 254 8 + GB_LSHIFT (dup_code , 20) | // 0 to 52 6 GB_LSHIFT (zcode , 16) | // 0 to 14 4 GB_LSHIFT (xcode , 12) | // 0 to 14 4 GB_LSHIFT (ycode , 8) | // 0 to 14 4 diff --git a/Source/jitifyer/GB_enumify_cuda_atomic.c b/Source/jitifyer/GB_enumify_cuda_atomic.c index 24830a8d2d..8e0c302741 100644 --- a/Source/jitifyer/GB_enumify_cuda_atomic.c +++ b/Source/jitifyer/GB_enumify_cuda_atomic.c @@ -10,7 +10,7 @@ #include "GB.h" #include "jitifyer/GB_stringify.h" -bool GB_enumify_cuda_atomic +bool GB_enumify_cuda_atomic // returns has_cheeseburger ( // output: const char **a, // CUDA atomic function name @@ -18,7 +18,7 @@ bool GB_enumify_cuda_atomic const char **cuda_type, // CUDA atomic type // input: GrB_Monoid monoid, // monoid to query - int add_ecode, // binary op as an enum + GB_Opcode add_opcode, size_t zsize, // ztype->size int zcode // ztype->code ) @@ -33,12 +33,13 @@ bool GB_enumify_cuda_atomic (*cuda_type) = NULL ; bool has_cheeseburger = false ; - switch (add_ecode) + switch (add_opcode) { // user defined monoid: can apply GB_ADD via atomicCAS if the ztype has // 32 or 64 bits - case 0 : +// case 0 : + case GB_USER_binop_code : // user defined binary op (*user_monoid_atomically) = (zsize == sizeof (uint32_t) || @@ -46,8 +47,9 @@ bool GB_enumify_cuda_atomic break ; // FIRST, ANY, SECOND: atomic write (not double complex) - case 1 : - case 2 : +// case 1 : +// case 2 : + case GB_ANY_binop_code : // z = x or y, selected arbitrarily switch (zcode) { @@ -68,9 +70,10 @@ bool GB_enumify_cuda_atomic break ; // MIN (real only) - case 3 : - case 4 : - case 5 : +// case 3 : +// case 4 : +// case 5 : + case GB_MIN_binop_code : // z = min(x,y) switch (zcode) { @@ -89,9 +92,10 @@ bool GB_enumify_cuda_atomic break ; // MAX (real only) - case 6 : - case 7 : - case 8 : +// case 6 : +// case 7 : +// case 8 : + case GB_MAX_binop_code : // z = max(x,y) switch (zcode) { @@ -110,9 +114,10 @@ bool GB_enumify_cuda_atomic break ; // PLUS: all types - case 9 : - case 10 : - case 11 : +// case 9 : +// case 10 : +// case 11 : + case GB_PLUS_binop_code : // z = x + y switch (zcode) { @@ -133,8 +138,9 @@ bool GB_enumify_cuda_atomic break ; // TIMES: all real types, and float complex (but not double complex) - case 12 : - case 14 : +// case 12 : +// case 14 : + case GB_TIMES_binop_code : // z = x * y switch (zcode) { @@ -155,8 +161,10 @@ bool GB_enumify_cuda_atomic // BOR: z = (x | y), bitwise or, // logical LOR (via upscale to uint32_t and BOR) - case 17 : - case 19 : +// case 17 : +// case 19 : + case GB_LOR_binop_code : // z = (x != 0) || (y != 0) + case GB_BOR_binop_code : // z = (x | y), bitwise or switch (zcode) { @@ -171,8 +179,10 @@ bool GB_enumify_cuda_atomic // BAND: z = (x & y), bitwise and // logical LAND (via upscale to uint32_t and BAND) - case 18 : - case 20 : +// case 18 : +// case 20 : + case GB_BAND_binop_code : // z = (x & y), bitwise and + case GB_LAND_binop_code : // z = (x != 0) && (y != 0) switch (zcode) { @@ -186,8 +196,10 @@ bool GB_enumify_cuda_atomic break ; // BXOR: z = (x ^ y), bitwise xor, and boolean LXOR - case 16 : - case 21 : +// case 16 : +// case 21 : + case GB_LXOR_binop_code : // z = (x != 0) != (y != 0) + case GB_BXOR_binop_code : // z = (x ^ y), bitwise xor switch (zcode) { @@ -201,8 +213,10 @@ bool GB_enumify_cuda_atomic break ; // BXNOR: z = ~(x ^ y), bitwise xnor, and boolean LXNOR - case 15 : - case 22 : +// case 15 : +// case 22 : + case GB_EQ_binop_code : // z = (x == y), is LXNOR for bool + case GB_BXNOR_binop_code : // z = ~(x ^ y), bitwise xnor switch (zcode) { @@ -219,6 +233,10 @@ bool GB_enumify_cuda_atomic default: break ; } + //-------------------------------------------------------------------------- + // has_cheeseburger: true if monoid can be done atomically in CUDA + //-------------------------------------------------------------------------- + if (monoid == NULL || zcode == 0) { diff --git a/Source/jitifyer/GB_enumify_ewise.c b/Source/jitifyer/GB_enumify_ewise.c index d94d5fdabb..cefe831c96 100644 --- a/Source/jitifyer/GB_enumify_ewise.c +++ b/Source/jitifyer/GB_enumify_ewise.c @@ -20,11 +20,12 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem ( // output: - uint64_t *scode, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: - bool is_eWiseMult, // if true, method is emult + bool is_eWiseMult, // if true, method is eWiseMult bool is_eWiseUnion, // if true, method is eWiseUnion - bool can_copy_to_C, // if true C(i,j)=A(i,j) can bypass the op + bool is_kronecker, // if true, method is kronecker + bool is_eWiseAdd, // if true, method is eWiseAdd // C matrix: bool C_iso, // if true, C is iso on output bool C_in_iso, // if true, C is iso on input @@ -36,7 +37,8 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem bool Mask_comp, // mask is complemented // operator: GrB_BinaryOp binaryop, // the binary operator to enumify - bool flipxy, // multiplier is: op(a,b) or op(b,a) + bool flipij, // multiplier is: op(a,b,i,j) or op(a,b,j,i) + bool flipxy, // multiplier is: op(a,b,i,j) or op(b,a,j,i) // A and B: GrB_Matrix A, // NULL for unary apply with binop, bind 1st GrB_Matrix B // NULL for unary apply with binop, bind 2nd @@ -47,6 +49,7 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem // get the types of A, B, and M //-------------------------------------------------------------------------- + ASSERT_BINARYOP_OK (binaryop, "binaryop to enumify", GB0) ; GrB_Type atype = (A == NULL) ? NULL : A->type ; GrB_Type btype = (B == NULL) ? NULL : B->type ; GrB_Type mtype = (M == NULL) ? NULL : M->type ; @@ -55,14 +58,14 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem // get the types of X, Y, and Z, and handle the C_iso case, and GB_wait //-------------------------------------------------------------------------- - GB_Opcode binaryop_opcode ; + GB_Opcode opcode ; GB_Type_code xcode, ycode, zcode ; ASSERT (binaryop != NULL) ; if (C_iso) { // values of C are not computed by the kernel - binaryop_opcode = GB_PAIR_binop_code ; + opcode = GB_PAIR_binop_code ; xcode = 0 ; ycode = 0 ; zcode = 0 ; @@ -70,32 +73,15 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem else { // normal case - binaryop_opcode = binaryop->opcode ; + opcode = binaryop->opcode ; xcode = binaryop->xtype->code ; ycode = binaryop->ytype->code ; zcode = binaryop->ztype->code ; - } - - //-------------------------------------------------------------------------- - // rename redundant boolean operators - //-------------------------------------------------------------------------- - - // consider z = op(x,y) where both x and y are boolean: - // DIV becomes FIRST - // RDIV becomes SECOND - // MIN and TIMES become LAND - // MAX and PLUS become LOR - // NE, ISNE, RMINUS, and MINUS become LXOR - // ISEQ becomes EQ - // ISGT becomes GT - // ISLT becomes LT - // ISGE becomes GE - // ISLE becomes LE - - if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) - { - // rename the operator - binaryop_opcode = GB_boolean_rename (binaryop_opcode) ; + if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) + { + // rename the operator + opcode = GB_boolean_rename (opcode) ; + } } //-------------------------------------------------------------------------- @@ -104,12 +90,13 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem // These 1st, 2nd, and pair operators are all handled by the flip, so if // flipxy is still true, all of these booleans will be false. - bool op_is_first = (binaryop_opcode == GB_FIRST_binop_code ) ; - bool op_is_second = (binaryop_opcode == GB_SECOND_binop_code) ; - bool op_is_pair = (binaryop_opcode == GB_PAIR_binop_code) ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (binaryop_opcode) ; + 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) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; - if (op_is_positional || op_is_pair || C_iso) + if (op_is_builtin_positional || op_is_pair || C_iso) { // x and y are not used xcode = 0 ; @@ -129,22 +116,17 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem bool A_is_pattern = false ; bool B_is_pattern = false ; - if (is_eWiseMult || is_eWiseUnion) + if (is_eWiseMult || is_eWiseUnion || is_kronecker) { A_is_pattern = (xcode == 0) ; // A is not needed if x is not used - B_is_pattern = (ycode == 0) ; // B is not needed if x is not used + B_is_pattern = (ycode == 0) ; // B is not needed if y is not used } //-------------------------------------------------------------------------- // enumify the binary operator //-------------------------------------------------------------------------- - int binop_ecode ; - GB_enumify_binop (&binop_ecode, binaryop_opcode, xcode, false) ; - - int is_union = (is_eWiseUnion) ? 1 : 0 ; - int is_emult = (is_eWiseMult ) ? 1 : 0 ; - int copy_to_C = (can_copy_to_C) ? 1 : 0 ; + int binop_code = (opcode - GB_USER_binop_code) & 0x3F ; //-------------------------------------------------------------------------- // enumify the types @@ -185,31 +167,27 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem GB_enumify_sparsity (&bsparsity, B_sparsity) ; //-------------------------------------------------------------------------- - // construct the ewise scode + // construct the ewise method_code //-------------------------------------------------------------------------- - // total scode bits: 51 (13 hex digits) + // total method_code bits: 47 (12 hex digits); 17 bits to spare. - (*scode) = + (*method_code) = // range bits - // method (3 bits) (1 hex digit, 0 to 7) - GB_LSHIFT (is_emult , 50) | // 0 or 1 1 - GB_LSHIFT (is_union , 49) | // 0 or 1 1 - GB_LSHIFT (copy_to_C , 48) | // 0 or 1 1 - - // C in, A and B iso properites, flipxy (1 hex digit) - GB_LSHIFT (C_in_iso_cd, 47) | // 0 or 1 1 - GB_LSHIFT (A_iso_code , 46) | // 0 or 1 1 - GB_LSHIFT (B_iso_code , 45) | // 0 or 1 1 - GB_LSHIFT (flipxy , 44) | // 0 or 1 1 + // C in, A and B iso properites (3 bits) (1 hex digit) + GB_LSHIFT (C_in_iso_cd, 46) | // 0 or 1 1 + GB_LSHIFT (A_iso_code , 45) | // 0 or 1 1 + GB_LSHIFT (B_iso_code , 44) | // 0 or 1 1 // binaryop, z = f(x,y) (5 hex digits) - GB_LSHIFT (binop_ecode, 36) | // 0 to 254 8 + GB_LSHIFT (flipxy , 43) | // 0 or 1 1 + GB_LSHIFT (flipij , 42) | // 0 or 1 1 + GB_LSHIFT (binop_code , 36) | // 0 to 52 6 GB_LSHIFT (zcode , 32) | // 0 to 14 4 GB_LSHIFT (xcode , 28) | // 0 to 14 4 GB_LSHIFT (ycode , 24) | // 0 to 14 4 - // mask (one hex digit) + // mask (1 hex digit) GB_LSHIFT (mask_ecode , 20) | // 0 to 13 4 // types of C, A, and B (3 hex digits) diff --git a/Source/jitifyer/GB_enumify_identity.c b/Source/jitifyer/GB_enumify_identity.c index 563b20fdb0..c42df666bb 100644 --- a/Source/jitifyer/GB_enumify_identity.c +++ b/Source/jitifyer/GB_enumify_identity.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GB_enumify_identity: return ecode for identity value of an op of a monoid +// GB_enumify_identity: return ecode for identity value of an op of a monoid //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. diff --git a/Source/jitifyer/GB_enumify_mask.c b/Source/jitifyer/GB_enumify_mask.c index 05f2e72374..b991a31c55 100644 --- a/Source/jitifyer/GB_enumify_mask.c +++ b/Source/jitifyer/GB_enumify_mask.c @@ -2,7 +2,7 @@ // GB_enumify_mask: return mask_ecode to define mask macros //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ diff --git a/Source/jitifyer/GB_enumify_masker.c b/Source/jitifyer/GB_enumify_masker.c new file mode 100644 index 0000000000..b8e277b71b --- /dev/null +++ b/Source/jitifyer/GB_enumify_masker.c @@ -0,0 +1,91 @@ +//------------------------------------------------------------------------------ +// GB_enumify_masker: enumerate a masker problem +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +uint64_t GB_enumify_masker // enumify a masker problem +( + // output: + uint64_t *method_code, // unique encoding of the entire operation + // input: + const GrB_Matrix R, // NULL for phase 1 + const GrB_Matrix M, + const bool Mask_struct, + const bool Mask_comp, + const GrB_Matrix C, + const GrB_Matrix Z +) +{ + + //-------------------------------------------------------------------------- + // get the types of R, C, and Z + //-------------------------------------------------------------------------- + + GrB_Type rtype = (R == NULL) ? NULL : R->type ; + ASSERT (GB_IMPLIES (R != NULL, rtype == C->type)) ; + ASSERT (GB_IMPLIES (R != NULL, rtype == Z->type)) ; + + //-------------------------------------------------------------------------- + // enumify the types + //-------------------------------------------------------------------------- + + int rcode = (rtype == NULL) ? 0 : rtype->code ; // 0 to 14 + int C_iso_code = (C->iso || rtype == NULL) ? 1 : 0 ; + int Z_iso_code = (Z->iso || rtype == NULL) ? 1 : 0 ; + + //-------------------------------------------------------------------------- + // enumify the mask + //-------------------------------------------------------------------------- + + int mtype_code = M->type->code ; // 0 to 14 + int mask_ecode ; + GB_enumify_mask (&mask_ecode, mtype_code, Mask_struct, Mask_comp) ; + + //-------------------------------------------------------------------------- + // enumify the sparsity structures of R, M, C, and Z + //-------------------------------------------------------------------------- + + int R_sparsity = GB_sparsity (R) ; + int M_sparsity = GB_sparsity (M) ; + int C_sparsity = GB_sparsity (C) ; + int Z_sparsity = GB_sparsity (Z) ; + + int rsparsity, msparsity, csparsity, zsparsity ; + GB_enumify_sparsity (&rsparsity, R_sparsity) ; + GB_enumify_sparsity (&msparsity, M_sparsity) ; + GB_enumify_sparsity (&csparsity, C_sparsity) ; + GB_enumify_sparsity (&zsparsity, Z_sparsity) ; + + //-------------------------------------------------------------------------- + // construct the masker method_code + //-------------------------------------------------------------------------- + + // total method_code bits: 18 (5 hex digits) + + (*method_code) = + // range bits + // C and Z iso properites (1 hex digit) + GB_LSHIFT (C_iso_code , 17) | // 0 or 1 1 + GB_LSHIFT (Z_iso_code , 16) | // 0 or 1 1 + + // mask (1 hex digit) + GB_LSHIFT (mask_ecode , 12) | // 0 to 13 4 + + // type of R (1 hex digit) + GB_LSHIFT (rcode , 8) | // 0 to 14 4 + + // sparsity structures of R, M, C, and Z (2 hex digits) + GB_LSHIFT (rsparsity , 6) | // 0 to 3 2 + GB_LSHIFT (msparsity , 4) | // 0 to 3 2 + GB_LSHIFT (csparsity , 2) | // 0 to 3 2 + GB_LSHIFT (zsparsity , 0) ; // 0 to 3 2 + +} + diff --git a/Source/jitifyer/GB_enumify_monoid.c b/Source/jitifyer/GB_enumify_monoid.c deleted file mode 100644 index dac8563363..0000000000 --- a/Source/jitifyer/GB_enumify_monoid.c +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_enumify_monoid: enumify a monoid -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#include "GB.h" -#include "jitifyer/GB_stringify.h" - -void GB_enumify_monoid // enumerate a monoid -( - // outputs: - int *add_ecode, // binary op as an enum - int *id_ecode, // identity value as an enum - int *term_ecode, // terminal value as an enum - // inputs: - int add_opcode, // binary operator of the monoid - int zcode // type of the monoid (x, y, and z) -) -{ - - GB_enumify_binop (add_ecode, add_opcode, zcode, false) ; - ASSERT (*add_ecode < 32) ; - GB_enumify_identity (id_ecode, add_opcode, zcode) ; - GB_enumify_terminal (term_ecode, add_opcode, zcode) ; -} - diff --git a/Source/jitifyer/GB_enumify_mxm.c b/Source/jitifyer/GB_enumify_mxm.c index 023c114c07..7f5d0b85c6 100644 --- a/Source/jitifyer/GB_enumify_mxm.c +++ b/Source/jitifyer/GB_enumify_mxm.c @@ -2,7 +2,7 @@ // GB_enumify_mxm: enumerate a GrB_mxm problem //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -23,7 +23,7 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem ( // output: // future:: may need to become 2 x uint64 - uint64_t *scode, // unique encoding of the entire semiring + uint64_t *method_code, // unique encoding of the entire semiring // input: // C matrix: bool C_iso, // C output iso: if true, semiring is ANY_PAIR_BOOL @@ -47,6 +47,7 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem // get the semiring //-------------------------------------------------------------------------- + ASSERT_SEMIRING_OK (semiring, "semiring for enumify_mxm", GB0) ; GrB_Monoid add = semiring->add ; GrB_BinaryOp mult = semiring->multiply ; GrB_BinaryOp addop = add->op ; @@ -78,20 +79,10 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem // rename redundant boolean operators //-------------------------------------------------------------------------- - // consider z = op(x,y) where both x and y are boolean: - // DIV becomes FIRST - // RDIV becomes SECOND - // MIN and TIMES become LAND - // MAX and PLUS become LOR - // NE, ISNE, RMINUS, and MINUS become LXOR - // ISEQ becomes EQ - // ISGT becomes GT - // ISLT becomes LT - // ISGE becomes GE - // ISLE becomes LE - if (C_iso) { + add_opcode = GB_ANY_binop_code ; + mult_opcode = GB_PAIR_binop_code ; zcode = 0 ; } else if (zcode == GB_BOOL_code) @@ -115,7 +106,7 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem bool op_is_first = (mult_opcode == GB_FIRST_binop_code ) ; bool op_is_second = (mult_opcode == GB_SECOND_binop_code) ; bool op_is_pair = (mult_opcode == GB_PAIR_binop_code) ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (mult_opcode) ; + bool op_is_positional = GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (mult_opcode) ; if (op_is_second || op_is_pair || op_is_positional || C_iso) { // x is not used @@ -133,15 +124,15 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem // enumify the multiplier //-------------------------------------------------------------------------- - int mult_ecode ; - GB_enumify_binop (&mult_ecode, mult_opcode, xcode, true) ; + int mult_code = (mult_opcode - GB_USER_binop_code) & 0x3F ; //-------------------------------------------------------------------------- // enumify the monoid //-------------------------------------------------------------------------- - int add_ecode, id_ecode, term_ecode ; - GB_enumify_monoid (&add_ecode, &id_ecode, &term_ecode, add_opcode, zcode) ; + ASSERT (add_opcode >= GB_USER_binop_code) ; + ASSERT (add_opcode <= GB_BXNOR_binop_code) ; + int add_code = (add_opcode - GB_USER_binop_code) & 0xF ; //-------------------------------------------------------------------------- // enumify the types @@ -178,18 +169,15 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem GB_enumify_sparsity (&bsparsity, B_sparsity) ; //-------------------------------------------------------------------------- - // construct the semiring scode + // construct the semiring method_code //-------------------------------------------------------------------------- - // total scode bits: 63 (16 hex digits) + // total method_code bits: 50 (13 hex digits): 14 bits to spare. - (*scode) = + (*method_code) = // range bits - // monoid (4 hex digits) -// GB_LSHIFT (0 , 63) | // unused 1 - GB_LSHIFT (add_ecode , 58) | // 0 to 22 5 - GB_LSHIFT (id_ecode , 53) | // 0 to 31 5 - GB_LSHIFT (term_ecode , 48) | // 0 to 31 5 + // monoid (4 bits, 1 hex digit) + GB_LSHIFT (add_code , 48) | // 0 to 13 4 // C in, A, B iso properties, flipxy (1 hex digit) GB_LSHIFT (C_in_iso_cd, 47) | // 0 or 1 1 @@ -198,12 +186,13 @@ void GB_enumify_mxm // enumerate a GrB_mxm problem GB_LSHIFT (flipxy , 44) | // 0 to 1 1 // multiplier, z = f(x,y) or f(y,x) (5 hex digits) - GB_LSHIFT (mult_ecode , 36) | // 0 to 254 8 + // 2 bits unused here (42 and 43) + GB_LSHIFT (mult_code , 36) | // 0 to 52 6 GB_LSHIFT (zcode , 32) | // 0 to 14 4 GB_LSHIFT (xcode , 28) | // 0 to 14 4 GB_LSHIFT (ycode , 24) | // 0 to 14 4 - // mask (one hex digit) + // mask (1 hex digit) GB_LSHIFT (mask_ecode , 20) | // 0 to 13 4 // types of C, A, and B (3 hex digits) diff --git a/Source/jitifyer/GB_enumify_reduce.c b/Source/jitifyer/GB_enumify_reduce.c index f39672bf66..bea680a459 100644 --- a/Source/jitifyer/GB_enumify_reduce.c +++ b/Source/jitifyer/GB_enumify_reduce.c @@ -15,7 +15,7 @@ void GB_enumify_reduce // enumerate a GrB_reduce problem ( // output: - uint64_t *rcode, // unique encoding of the entire problem + uint64_t *method_code, // unique encoding of the entire problem // input: GrB_Monoid monoid, // the monoid to enumify GrB_Matrix A // input matrix to monoid @@ -61,15 +61,15 @@ void GB_enumify_reduce // enumerate a GrB_reduce problem // enumify the monoid //-------------------------------------------------------------------------- - int red_ecode, id_ecode, term_ecode ; - GB_enumify_monoid (&red_ecode, &id_ecode, &term_ecode, reduce_opcode, - zcode) ; + ASSERT (reduce_opcode >= GB_USER_binop_code) ; + ASSERT (reduce_opcode <= GB_BXNOR_binop_code) ; + int red_code = (reduce_opcode - GB_USER_binop_code) & 0xF ; const char *a = NULL, *cuda_type = NULL ; bool user_monoid_atomically = false ; bool has_cheeseburger = GB_enumify_cuda_atomic (&a, &user_monoid_atomically, &cuda_type, - monoid, red_ecode, ztype->size, zcode) ; + monoid, reduce_opcode, ztype->size, zcode) ; int cheese = (has_cheeseburger) ? 1 : 0 ; //-------------------------------------------------------------------------- @@ -82,18 +82,16 @@ void GB_enumify_reduce // enumerate a GrB_reduce problem int azombies = (A->nzombies > 0) ? 1 : 0 ; //-------------------------------------------------------------------------- - // construct the reduction rcode + // construct the reduction method_code //-------------------------------------------------------------------------- - // total rcode bits: 28 (7 hex digits) + // total method_code bits: 17 (5 hex digits) - (*rcode) = + (*method_code) = // range bits - // monoid: 16 bits (4 hex digits) - GB_LSHIFT (cheese , 27) | // 0 to 1 1 - GB_LSHIFT (red_ecode , 22) | // 0 to 22 5 - GB_LSHIFT (id_ecode , 17) | // 0 to 31 5 - GB_LSHIFT (term_ecode , 12) | // 0 to 31 5 + // monoid: 5 bits (2 hex digits) + GB_LSHIFT (cheese , 16) | // 0 to 1 1 + GB_LSHIFT (red_code , 12) | // 0 to 13 4 // type of the monoid: 1 hex digit GB_LSHIFT (zcode , 8) | // 0 to 14 4 diff --git a/Source/jitifyer/GB_enumify_select.c b/Source/jitifyer/GB_enumify_select.c index f7878092ad..6309e279c5 100644 --- a/Source/jitifyer/GB_enumify_select.c +++ b/Source/jitifyer/GB_enumify_select.c @@ -16,7 +16,7 @@ void GB_enumify_select // enumerate a GrB_selectproblem ( // output: - uint64_t *scode, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: bool C_iso, bool in_place_A, @@ -97,12 +97,12 @@ void GB_enumify_select // enumerate a GrB_selectproblem int inplace = (in_place_A) ? 1 : 0 ; //-------------------------------------------------------------------------- - // construct the select scode + // construct the select method_code //-------------------------------------------------------------------------- - // total scode bits: 38 (10 hex digits) + // total method_code bits: 38 (10 hex digits) - (*scode) = + (*method_code) = // range bits // iso of A aand C (2 bits) GB_LSHIFT (C_iso_code , 37) | // 0 or 1 1 diff --git a/Source/jitifyer/GB_enumify_sort.c b/Source/jitifyer/GB_enumify_sort.c new file mode 100644 index 0000000000..d230bf2a9d --- /dev/null +++ b/Source/jitifyer/GB_enumify_sort.c @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// GB_enumify_sort: enumerate a GxB_sort problem +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// C is sparse or hypersparse, but the algorithm doesn't access C->h, and works +// identically for both cases. So the JIT kernel can treat C as if sparse. + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +void GB_enumify_sort // enumerate a GxB_sort problem +( + // output: + uint64_t *method_code, // unique encoding of the entire operation + // input: + GrB_Matrix C, // matrix to sort + // comparator op: + GrB_BinaryOp binaryop // the binary operator for the comparator +) +{ + + //-------------------------------------------------------------------------- + // get the type of C + //-------------------------------------------------------------------------- + + GrB_Type ctype = C->type ; + int ccode = ctype->code ; // 1 to 14 + + //-------------------------------------------------------------------------- + // get the type of X and the opcode + //-------------------------------------------------------------------------- + + ASSERT (binaryop != NULL) ; + + GB_Opcode opcode = binaryop->opcode ; + GB_Type_code xcode = binaryop->xtype->code ; + + // the comparator op, z=f(x,y) must have a ztype of boolean, + // and the x and y types must match + ASSERT (binaryop->xtype == binaryop->ytype) ; + ASSERT (binaryop->ztype == GrB_BOOL) ; + + if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) + { + // rename the operator + opcode = GB_boolean_rename (opcode) ; + } + + //-------------------------------------------------------------------------- + // enumify the binary operator + //-------------------------------------------------------------------------- + + int binop_code = (opcode - GB_USER_binop_code) & 0x3F ; + + //-------------------------------------------------------------------------- + // construct the sort method_code + //-------------------------------------------------------------------------- + + // total method_code bits: 14 (4 hex digits) + + (*method_code) = + // range bits + // binaryop, z = f(x,y) (3 hex digits) + GB_LSHIFT (binop_code , 12) | // 0 to 52 6 + GB_LSHIFT (xcode , 8) | // 1 to 14 4 + + // type of C (1 hex digit) + GB_LSHIFT (ccode , 0) ; // 1 to 14 4 +} + diff --git a/Source/jitifyer/GB_enumify_subref.c b/Source/jitifyer/GB_enumify_subref.c new file mode 100644 index 0000000000..357f01d1b0 --- /dev/null +++ b/Source/jitifyer/GB_enumify_subref.c @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// GB_enumify_subref: enumerate a GrB_extract problem +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// Enumify a subref operation: C = A(I,J) + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +void GB_enumify_subref // enumerate a GrB_extract problem +( + // output: + uint64_t *method_code, // unique encoding of the entire operation + // C matrix: + GrB_Matrix C, + // index types: + int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list + int Jkind, // ditto, or 0 if not used + bool need_qsort, // true if qsort needs to be called + bool I_has_duplicates, // true if I has duplicate entries + // A matrix: + GrB_Matrix A +) +{ + + //-------------------------------------------------------------------------- + // get the type of C (same as the type of A) and enumify it + //-------------------------------------------------------------------------- + + GrB_Type ctype = C->type ; + ASSERT (!C->iso) ; + int ccode = ctype->code ; // 1 to 14 + + //-------------------------------------------------------------------------- + // enumify the sparsity structures of C and A + //-------------------------------------------------------------------------- + + int C_sparsity = GB_sparsity (C) ; + int A_sparsity = GB_sparsity (A) ; + int csparsity, asparsity ; + GB_enumify_sparsity (&csparsity, C_sparsity) ; + GB_enumify_sparsity (&asparsity, A_sparsity) ; + + int needqsort = (need_qsort) ? 1 : 0 ; + int ihasdupl = (I_has_duplicates) ? 1 : 0 ; + + //-------------------------------------------------------------------------- + // construct the subref method_code + //-------------------------------------------------------------------------- + + // total method_code bits: 14 (4 hex digits) + + (*method_code) = + // range bits + /// need_qsort, I_has_duplicates (1 hex digit) + GB_LSHIFT (ihasdupl , 13) | // 0 to 1 1 + GB_LSHIFT (needqsort , 12) | // 0 to 1 1 + + // Ikind, Jkind (1 hex digit) + GB_LSHIFT (Ikind , 10) | // 0 to 3 2 + GB_LSHIFT (Jkind , 8) | // 0 to 3 2 + + // type of C and A (1 hex digit) + GB_LSHIFT (ccode , 4) | // 1 to 14 4 + + // sparsity structures of C and A (1 hex digit) + GB_LSHIFT (csparsity , 2) | // 0 to 3 2 + GB_LSHIFT (asparsity , 0) ; // 0 to 3 2 + +} + diff --git a/Source/jitifyer/GB_jitifyer.c b/Source/jitifyer/GB_jitifyer.c index 5a36a8888c..716a9c59a7 100644 --- a/Source/jitifyer/GB_jitifyer.c +++ b/Source/jitifyer/GB_jitifyer.c @@ -280,7 +280,7 @@ void GB_jitifyer_sanitize (char *string, size_t len) // GraphBLAS can continue without the JIT. GrB_Info GB_jitifyer_init (void) -{ +{ //-------------------------------------------------------------------------- // initialize the JIT control @@ -429,10 +429,10 @@ GrB_Info GB_jitifyer_init (void) char *name_space = NULL ; char *kname = NULL ; - uint64_t scode = 0 ; + uint64_t method_code = 0 ; char *suffix = NULL ; GrB_Info info = GB_demacrofy_name (kernel_name, &name_space, &kname, - &scode, &suffix) ; + &method_code, &suffix) ; if (info != GrB_SUCCESS || !GB_STRING_MATCH (name_space, "GB_jit")) { @@ -468,7 +468,7 @@ GrB_Info GB_jitifyer_init (void) else if (IS ("concat_bitmap")) c = GB_JIT_KERNEL_CONCAT_BITMAP ; else if (IS ("concat_full" )) c = GB_JIT_KERNEL_CONCAT_FULL ; else if (IS ("concat_sparse")) c = GB_JIT_KERNEL_CONCAT_SPARSE ; - else if (IS ("convert_s2b" )) c = GB_JIT_KERNEL_CONVERTS2B ; + else if (IS ("convert_s2b" )) c = GB_JIT_KERNEL_CONVERT_S2B ; else if (IS ("emult_02" )) c = GB_JIT_KERNEL_EMULT2 ; else if (IS ("emult_03" )) c = GB_JIT_KERNEL_EMULT3 ; else if (IS ("emult_04" )) c = GB_JIT_KERNEL_EMULT4 ; @@ -484,18 +484,71 @@ GrB_Info GB_jitifyer_init (void) else if (IS ("split_bitmap" )) c = GB_JIT_KERNEL_SPLIT_BITMAP ; else if (IS ("split_full" )) c = GB_JIT_KERNEL_SPLIT_FULL ; else if (IS ("split_sparse" )) c = GB_JIT_KERNEL_SPLIT_SPARSE ; + else if (IS ("subassign_05d")) c = GB_JIT_KERNEL_SUBASSIGN_05d ; else if (IS ("subassign_06d")) c = GB_JIT_KERNEL_SUBASSIGN_06d ; else if (IS ("subassign_22" )) c = GB_JIT_KERNEL_SUBASSIGN_22 ; else if (IS ("subassign_23" )) c = GB_JIT_KERNEL_SUBASSIGN_23 ; else if (IS ("subassign_25" )) c = GB_JIT_KERNEL_SUBASSIGN_25 ; + else if (IS ("trans_bind1st")) c = GB_JIT_KERNEL_TRANSBIND1 ; else if (IS ("trans_bind2nd")) c = GB_JIT_KERNEL_TRANSBIND2 ; else if (IS ("trans_unop" )) c = GB_JIT_KERNEL_TRANSUNOP ; else if (IS ("union" )) c = GB_JIT_KERNEL_UNION ; else if (IS ("user_op" )) c = GB_JIT_KERNEL_USEROP ; else if (IS ("user_type" )) c = GB_JIT_KERNEL_USERTYPE ; - else if (IS ("cuda_reduce" )) c = GB_JIT_CUDA_KERNEL_REDUCE ; + + // added for v9.4.1: + else if (IS ("subassign_01" )) c = GB_JIT_KERNEL_SUBASSIGN_01 ; + else if (IS ("subassign_02" )) c = GB_JIT_KERNEL_SUBASSIGN_02 ; + else if (IS ("subassign_03" )) c = GB_JIT_KERNEL_SUBASSIGN_03 ; + else if (IS ("subassign_04" )) c = GB_JIT_KERNEL_SUBASSIGN_04 ; + else if (IS ("subassign_05" )) c = GB_JIT_KERNEL_SUBASSIGN_05 ; + else if (IS ("subassign_06n")) c = GB_JIT_KERNEL_SUBASSIGN_06n ; + else if (IS ("subassign_06s")) c = GB_JIT_KERNEL_SUBASSIGN_06s ; + else if (IS ("subassign_07" )) c = GB_JIT_KERNEL_SUBASSIGN_07 ; + else if (IS ("subassign_08n")) c = GB_JIT_KERNEL_SUBASSIGN_08n ; + else if (IS ("subassign_08s")) c = GB_JIT_KERNEL_SUBASSIGN_08s ; + else if (IS ("subassign_09" )) c = GB_JIT_KERNEL_SUBASSIGN_09 ; + else if (IS ("subassign_10" )) c = GB_JIT_KERNEL_SUBASSIGN_10 ; + else if (IS ("subassign_11" )) c = GB_JIT_KERNEL_SUBASSIGN_11 ; + else if (IS ("subassign_12" )) c = GB_JIT_KERNEL_SUBASSIGN_12 ; + else if (IS ("subassign_13" )) c = GB_JIT_KERNEL_SUBASSIGN_13 ; + else if (IS ("subassign_15" )) c = GB_JIT_KERNEL_SUBASSIGN_15 ; + else if (IS ("subassign_17" )) c = GB_JIT_KERNEL_SUBASSIGN_17 ; + else if (IS ("subassign_19" )) c = GB_JIT_KERNEL_SUBASSIGN_19 ; + + else if (IS ("bitmap_assign_1" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_1 ; + else if (IS ("bitmap_assign_1_whole" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_1_WHOLE ; + else if (IS ("bitmap_assign_2" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_2 ; + else if (IS ("bitmap_assign_2_whole" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_2_WHOLE ; + else if (IS ("bitmap_assign_3" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_3 ; + else if (IS ("bitmap_assign_3_whole" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_3_WHOLE ; + else if (IS ("bitmap_assign_4" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_4 ; + else if (IS ("bitmap_assign_4_whole" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_4_WHOLE ; + else if (IS ("bitmap_assign_5" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_5 ; + else if (IS ("bitmap_assign_5_whole" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_5_WHOLE ; + else if (IS ("bitmap_assign_6" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_6 ; + else if (IS ("bitmap_assign_6b_whole")) c = GB_JIT_KERNEL_BITMAP_ASSIGN_6b_WHOLE ; + else if (IS ("bitmap_assign_7" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_7 ; + else if (IS ("bitmap_assign_7_whole" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_7_WHOLE ; + else if (IS ("bitmap_assign_8" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_8 ; + else if (IS ("bitmap_assign_8_whole" )) c = GB_JIT_KERNEL_BITMAP_ASSIGN_8_WHOLE ; + + else if (IS ("masker_phase1")) c = GB_JIT_KERNEL_MASKER_PHASE1 ; + else if (IS ("masker_phase2")) c = GB_JIT_KERNEL_MASKER_PHASE2 ; + + else if (IS ("subref_sparse")) c = GB_JIT_KERNEL_SUBREF_SPARSE ; + else if (IS ("subref_bitmap")) c = GB_JIT_KERNEL_BITMAP_SUBREF ; + + else if (IS ("iso_expand" )) c = GB_JIT_KERNEL_ISO_EXPAND ; + else if (IS ("unjumble" )) c = GB_JIT_KERNEL_UNJUMBLE ; + else if (IS ("convert_b2s" )) c = GB_JIT_KERNEL_CONVERT_B2S ; + else if (IS ("kroner" )) c = GB_JIT_KERNEL_KRONER ; + else if (IS ("sort" )) c = GB_JIT_KERNEL_SORT ; + + // add CUDA PreJIT kernels here (future): +// else if (IS ("cuda_reduce" )) c = GB_JIT_CUDA_KERNEL_REDUCE ; else { // PreJIT error: kernel_name is invalid; ignore this kernel @@ -504,7 +557,7 @@ GrB_Info GB_jitifyer_init (void) #undef IS encoding->kcode = c ; - encoding->code = scode ; + encoding->code = method_code ; encoding->suffix_len = (int32_t) GB_STRLEN (suffix) ; //---------------------------------------------------------------------- @@ -717,7 +770,7 @@ GrB_Info GB_jitifyer_extract_JITpackage (GrB_Info error_condition) if (dst == NULL) { // JITPackage error: out of memory; disable the JIT - GB_jit_control = GxB_JIT_RUN ; + GB_jit_control = GxB_JIT_PAUSE ; return (GrB_OUT_OF_MEMORY) ; } @@ -803,7 +856,7 @@ GxB_JIT_Control GB_jitifyer_get_control (void) //------------------------------------------------------------------------------ void GB_jitifyer_set_control (int control) -{ +{ #pragma omp critical (GB_jitifyer_worker) { control = GB_IMAX (control, (int) GxB_JIT_OFF) ; @@ -1550,6 +1603,8 @@ GrB_Info GB_jitifyer_load if (hash == UINT64_MAX) { // The kernel may not be compiled; it does not have a valid definition. + // This is not a JIT failure. It is an expected error if the strings + // (name & defn) are NULL, so always fallback to the generic case. GBURBLE ("(jit: undefined) ") ; return (GrB_NO_VALUE) ; } @@ -1557,6 +1612,7 @@ GrB_Info GB_jitifyer_load if ((GB_jit_control == GxB_JIT_OFF) || (GB_jit_control == GxB_JIT_PAUSE)) { // The JIT control has disabled all JIT kernels. Punt to generic. + // This is not a JIT failure. return (GrB_NO_VALUE) ; } @@ -1589,6 +1645,9 @@ GrB_Info GB_jitifyer_load // No kernels may be loaded or compiled, but existing kernels // already loaded may be run (handled above if dl_function was // found). This kernel was not loaded, so punt to generic. + // This is not a JIT failure since the JIT control is already + // set to 'run', and the kernel is not already loaded. So always + // fallback to the generic kernel. return (GrB_NO_VALUE) ; } } @@ -1634,6 +1693,11 @@ GrB_Info GB_jitifyer_load2_worker // look up the kernel in the hash table //-------------------------------------------------------------------------- + // e->prejit_index >= 0 denotes an unchecked prejit kernel: + #define GB_PREJIT_CHECKED(i) (-(i)-2) + // ensure that e->prejit_index is >= 0, to denote that it's unchecked: + #define GB_PREJIT_UNCHECKED(i) (((i) < 0) ? GB_PREJIT_CHECKED(i) : (i)) + int64_t k1 = -1, kk = -1 ; (*dl_function) = GB_jitifyer_lookup (hash, encoding, suffix, &k1, &kk) ; if ((*dl_function) != NULL) @@ -1654,10 +1718,10 @@ GrB_Info GB_jitifyer_load2_worker monoid, op, type1, type2, type3) ; if (ok) { - // PreJIT kernel is fine; flag it as checked by flipping - // its prejit_index. + // PreJIT kernel is fine; flag it as checked by marking + // its prejit_index as negative. GBURBLE ("(prejit: ok) ") ; - e->prejit_index = GB_FLIP (k1) ; + e->prejit_index = GB_PREJIT_CHECKED (k1) ; return (GrB_SUCCESS) ; } else @@ -1724,6 +1788,9 @@ GrB_Info GB_jitifyer_load2_worker // No kernels may be loaded or compiled, but existing kernels already // loaded may be run (handled above if dl_function was found). This // kernel was not loaded, so punt to generic. + // This is not a JIT failure since the JIT control is already + // set to 'run', and the kernel is not already loaded. So always + // fallback to the generic kernel. return (GrB_NO_VALUE) ; } @@ -1734,68 +1801,80 @@ GrB_Info GB_jitifyer_load2_worker #ifndef NJIT GB_Operator op1 = NULL ; GB_Operator op2 = NULL ; - int scode_digits = 0 ; + int method_code_digits = 0 ; switch (family) { case GB_jit_apply_family : op1 = op ; - scode_digits = 10 ; + method_code_digits = 10 ; break ; case GB_jit_assign_family : op1 = op ; - scode_digits = 12 ; + method_code_digits = 12 ; break ; case GB_jit_build_family : op1 = op ; - scode_digits = 7 ; + method_code_digits = 7 ; break ; case GB_jit_ewise_family : op1 = op ; - scode_digits = 13 ; + method_code_digits = 12 ; break ; case GB_jit_mxm_family : monoid = semiring->add ; op1 = (GB_Operator) semiring->add->op ; op2 = (GB_Operator) semiring->multiply ; - scode_digits = 16 ; + method_code_digits = 13 ; break ; case GB_jit_reduce_family : op1 = (GB_Operator) monoid->op ; - scode_digits = 7 ; + method_code_digits = 5 ; break ; case GB_jit_select_family : op1 = op ; - scode_digits = 10 ; + method_code_digits = 10 ; break ; case GB_jit_user_type_family : - scode_digits = 1 ; + method_code_digits = 1 ; break ; case GB_jit_user_op_family : - scode_digits = 1 ; + method_code_digits = 1 ; op1 = op ; break ; + case GB_jit_masker_family : + method_code_digits = 5 ; + break ; + + case GB_jit_subref_family : + method_code_digits = 4 ; + break ; + + case GB_jit_sort_family : + method_code_digits = 4 ; + break ; + default: ; } char kernel_name [GB_KLEN] ; - GB_macrofy_name (kernel_name, "GB_jit", kname, scode_digits, + GB_macrofy_name (kernel_name, "GB_jit", kname, method_code_digits, encoding->code, suffix) ; //-------------------------------------------------------------------------- // lock the kernel //-------------------------------------------------------------------------- - // FIXME: add kernel_name to the lock filename. If the lock fails, + // TODO: add kernel_name to the lock filename. If the lock fails, // sleep for 1 second and try again repeatedly, with a timeout limit of // (say) 60 seconds. @@ -1806,10 +1885,12 @@ GrB_Info GB_jitifyer_load2_worker int fd_klock = -1 ; if (!GB_file_open_and_lock (GB_jit_temp, &fp_klock, &fd_klock)) { - // JIT error: unable to lock the kernel + // JIT failure: unable to lock the kernel // disable the JIT to avoid repeated load errors GB_jit_control = GxB_JIT_RUN ; - return (GrB_NO_VALUE) ; + // report the error: punt to generic or panic + GBURBLE ("\n(jit failure: cannot create a file I/O lock)\n") ; + return (GxB_JIT_ERROR) ; } //-------------------------------------------------------------------------- @@ -1911,7 +1992,9 @@ GrB_Info GB_jitifyer_load_worker if (GB_jit_control < GxB_JIT_ON) { - // No new kernels may be compiled, so punt to generic. + // No new kernels may be compiled, so punt to generic. This is not + // a JIT failure. It is an expected condition because of the JIT + // control, so always allow a fallback to the generic kernel. GBURBLE ("(jit: not compiled) ") ; return (GrB_NO_VALUE) ; } @@ -1934,8 +2017,8 @@ GrB_Info GB_jitifyer_load_worker GB_macrofy_preface (fp, kernel_name, GB_jit_C_preface, GB_jit_CUDA_preface, kcode) ; // macrofy the kernel operators, types, and matrix formats - GB_macrofy_family (fp, family, encoding->code, semiring, - monoid, op, type1, type2, type3) ; + GB_macrofy_family (fp, family, encoding->code, encoding->kcode, + semiring, monoid, op, type1, type2, type3) ; // #include the kernel, renaming it for the PreJIT fprintf (fp, "#ifndef GB_JIT_RUNTIME\n" "#define GB_jit_kernel %s\n" @@ -1985,12 +2068,12 @@ GrB_Info GB_jitifyer_load_worker if (dl_handle == NULL) { // unable to create the kernel source or open lib*.so file - GBURBLE ("(jit: compiler error; compilation disabled) ") ; // disable the JIT to avoid repeated compilation errors GB_jit_control = GxB_JIT_LOAD ; // remove the compiled library remove (GB_jit_temp) ; - return (GrB_NO_VALUE) ; // FIXME: use another error code? + GBURBLE ("\n(jit failure: compiler error; compilation disabled)\n"); + return (GxB_JIT_ERROR) ; } } @@ -2014,26 +2097,27 @@ GrB_Info GB_jitifyer_load_worker if ((*dl_function) == NULL) { // JIT error: dlsym unable to find GB_jit_kernel: punt to generic - GBURBLE ("(jit: load error; JIT loading disabled) ") ; GB_file_dlclose (dl_handle) ; dl_handle = NULL ; // disable the JIT to avoid repeated loading errors GB_jit_control = GxB_JIT_RUN ; // remove the compiled library remove (GB_jit_temp) ; - return (GrB_NO_VALUE) ; // FIXME: use another error code? + GBURBLE ("\n(jit failure: load error; compilation disabled)\n") ; + return (GxB_JIT_ERROR) ; } // insert the new kernel into the hash table if (!GB_jitifyer_insert (hash, encoding, suffix, dl_handle, (*dl_function), -1)) { - // JIT error: unable to add kernel to hash table: punt to generic + // JIT error: unable to add kernel to hash table GB_file_dlclose (dl_handle) ; dl_handle = NULL ; // disable the JIT to avoid repeated errors GB_jit_control = GxB_JIT_PAUSE ; // remove the compiled library remove (GB_jit_temp) ; - return (GrB_NO_VALUE) ; + // report the error: punt to generic or panic + return (GrB_OUT_OF_MEMORY) ; } return (GrB_SUCCESS) ; @@ -2138,7 +2222,7 @@ bool GB_jitifyer_insert // return true if successful, false if failure } memset (GB_jit_table, 0, siz) ; GB_jit_table_size = GB_JITIFIER_INITIAL_SIZE ; - GB_jit_table_bits = GB_JITIFIER_INITIAL_SIZE - 1 ; + GB_jit_table_bits = GB_JITIFIER_INITIAL_SIZE - 1 ; GB_jit_table_allocated = siz ; } @@ -2280,7 +2364,7 @@ void GB_jitifyer_table_free (bool freeall) if (e->dl_handle == NULL) { // flag the PreJIT kernel as unchecked - e->prejit_index = GB_UNFLIP (e->prejit_index) ; + e->prejit_index = GB_PREJIT_UNCHECKED (e->prejit_index) ; } // free it if permitted if (freeall || (e->dl_handle != NULL && @@ -2499,17 +2583,17 @@ void GB_jitifyer_nvcc_compile (char *kernel_name, uint32_t bucket) // compile: "sh -c \"" // execute with POSIX shell - // FIXME: use GB_CUDA_COMPILER here: + // Fixme for CUDA: use GB_CUDA_COMPILER here: "nvcc " // compiler command "-forward-unknown-to-host-compiler " "-DGB_JIT_RUNTIME=1 " // nvcc flags - // FIXME: add GB_CUDA_INC here: + // Fixme for CUDA: add GB_CUDA_INC here: "-I/usr/local/cuda/include -std=c++17 " - // FIXME: use GB_CUDA_ARCHITECTURES here: + // Fixme for CUDA: use GB_CUDA_ARCHITECTURES here: " -arch=sm_60 " " -fPIC " - // FIXME: add GB_CUDA_FLAGS here: - " -O3 " // HACK FIXME (for CUDA) + // Fixme for CUDA: add GB_CUDA_FLAGS here: + " -O3 " // HACK Fixme for CUDA "-I'%s/src' " // include source directory "-I'%s/src/template' " "-I'%s/src/include' " diff --git a/Source/jitifyer/GB_jitifyer.h b/Source/jitifyer/GB_jitifyer.h index cbdb1b2bab..cd563169a5 100644 --- a/Source/jitifyer/GB_jitifyer.h +++ b/Source/jitifyer/GB_jitifyer.h @@ -2,7 +2,7 @@ // GB_jitifyer.h: definitions for the CPU and CUDA jitifyer //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -32,13 +32,16 @@ typedef enum { GB_jit_reduce_family = 1, // kcode 1 GB_jit_mxm_family = 2, // kcodes 2 to 9 - GB_jit_ewise_family = 3, // kcodes 10 to 24 - GB_jit_apply_family = 4, // kcodes 25 to 33 + GB_jit_ewise_family = 3, // kcodes 10 to 24, 83 + GB_jit_apply_family = 4, // kcodes 25 to 33, 84 to 86 GB_jit_build_family = 5, // kcode 34 GB_jit_select_family = 6, // kcodes 35 to 37 GB_jit_user_op_family = 7, // kcode 38 GB_jit_user_type_family = 8, // kcode 39 - GB_jit_assign_family = 9, // kcodes 40 to 44 (future:: to 78) + GB_jit_assign_family = 9, // kcodes 40 to 78 + GB_jit_masker_family = 10, // kcodes 79 to 80 + GB_jit_subref_family = 11, // kcodes 81 to 82 + GB_jit_sort_family = 12, // kcode 87 } GB_jit_family ; @@ -80,17 +83,21 @@ typedef enum GB_JIT_KERNEL_APPLYBIND2 = 22, // GB_apply_op, bind2nd GB_JIT_KERNEL_TRANSBIND1 = 23, // GB_transpose_op, bind1st GB_JIT_KERNEL_TRANSBIND2 = 24, // GB_transpose_op, bind2nd + GB_JIT_KERNEL_KRONER = 83, // GB_kroner // apply (unary and idxunary op) methods: GB_JIT_KERNEL_APPLYUNOP = 25, // GB_apply_op, GB_cast_array GB_JIT_KERNEL_TRANSUNOP = 26, // GB_transpose_op, GB_transpose_ix - GB_JIT_KERNEL_CONVERTS2B = 27, // GB_convert_2sb + GB_JIT_KERNEL_CONVERT_S2B = 27, // GB_convert_s2b GB_JIT_KERNEL_CONCAT_SPARSE = 28, // GB_concat_sparse GB_JIT_KERNEL_CONCAT_FULL = 29, // GB_concat_full GB_JIT_KERNEL_CONCAT_BITMAP = 30, // GB_concat_bitmap GB_JIT_KERNEL_SPLIT_SPARSE = 31, // GB_split_sparse GB_JIT_KERNEL_SPLIT_FULL = 32, // GB_split_full GB_JIT_KERNEL_SPLIT_BITMAP = 33, // GB_split_bitmap + GB_JIT_KERNEL_CONVERT_B2S = 84, // GB_convert_b2s + GB_JIT_KERNEL_ISO_EXPAND = 85, // GB_iso_expand + GB_JIT_KERNEL_UNJUMBLE = 86, // GB_unjumble // build method: GB_JIT_KERNEL_BUILD = 34, // GB_builder @@ -110,12 +117,6 @@ typedef enum GB_JIT_KERNEL_SUBASSIGN_22 = 42, // GB_subassign_22 GB_JIT_KERNEL_SUBASSIGN_23 = 43, // GB_subassign_23 GB_JIT_KERNEL_SUBASSIGN_25 = 44, // GB_subassign_25 - - //-------------------------------------------------------------------------- - // future:: the following kernels have not been implemented yet - //-------------------------------------------------------------------------- - - // future:: assign/subassign methods: continued GB_JIT_KERNEL_SUBASSIGN_01 = 45, // GB_subassign_01 GB_JIT_KERNEL_SUBASSIGN_02 = 46, // GB_subassign_02 GB_JIT_KERNEL_SUBASSIGN_03 = 47, // GB_subassign_03 @@ -134,40 +135,32 @@ typedef enum GB_JIT_KERNEL_SUBASSIGN_15 = 60, // GB_subassign_15 GB_JIT_KERNEL_SUBASSIGN_17 = 61, // GB_subassign_17 GB_JIT_KERNEL_SUBASSIGN_19 = 62, // GB_subassign_19 - - // future:: bitmap assign/subassign: - GB_JIT_KERNEL_ASSIGN_BITMAP_M_ACC = 63, // GB_bitmap_assign_M_accum - GB_JIT_KERNEL_ASSIGN_BITMAP_M_ACC_WHOLE = 64, // GB_bitmap_assign_M_accum_whole - GB_JIT_KERNEL_ASSIGN_BITMAP_M_NOACC = 65, // GB_bitmap_assign_M_noaccum - GB_JIT_KERNEL_ASSIGN_BITMAP_M_NOACC_WHOLE = 66, // GB_bitmap_assign_M_noaccum_whole - GB_JIT_KERNEL_ASSIGN_BITMAP_FM_ACC = 67, // GB_bitmap_assign_fullM_accum - GB_JIT_KERNEL_ASSIGN_BITMAP_FM_ACC_WHOLE = 68, // GB_bitmap_assign_fullM_accum_whole - GB_JIT_KERNEL_ASSIGN_BITMAP_FM_NOACC = 69, // GB_bitmap_assign_fullM_noaccum - GB_JIT_KERNEL_ASSIGN_BITMAP_FM_NOACC_WHOLE = 70, // GB_bitmap_assign_fullM_noaccum_whole - GB_JIT_KERNEL_ASSIGN_BITMAP_NOM_ACC = 71, // GB_bitmap_assign_noM_accum - GB_JIT_KERNEL_ASSIGN_BITMAP_NOM_ACC_WHOLE = 72, // GB_bitmap_assign_noM_accum_whole - GB_JIT_KERNEL_ASSIGN_BITMAP_NOM_NOACC = 73, // GB_bitmap_assign_noM_noaccum - GB_JIT_KERNEL_ASSIGN_BITMAP_NOM_NOACC_WHOLE = 74, // GB_bitmap_assign_noM_noaccum_whole - GB_JIT_KERNEL_ASSIGN_BITMAP_NM_ACC = 75, // GB_bitmap_assign_notM_accum - GB_JIT_KERNEL_ASSIGN_BITMAP_NM_ACC_WHOLE = 76, // GB_bitmap_assign_notM_accum_whole - GB_JIT_KERNEL_ASSIGN_BITMAP_NM_NOACC = 77, // GB_bitmap_assign_notM_noaccum - GB_JIT_KERNEL_ASSIGN_BITMAP_NM_NOACC_WHOLE = 78, // GB_bitmap_assign_notM_noaccum_whole - - // future:: subref methods: - GB_JIT_KERNEL_SUBREF = 79, // GB_bitmap_subref - GB_JIT_KERNEL_SUBREF_PHASE3 = 80, // GB_subref_phase3 - - // future:: masker methods: - GB_JIT_KERNEL_MASKER_PHASE1 = 81, // GB_masker_phase1 - GB_JIT_KERNEL_MASKER_PHASE2 = 82, // GB_masker_phase2 - - // future:: Kronecker: - GB_JIT_KERNEL_KRONER = 83, // GB_kroner - - // future:: utilities: - GB_JIT_KERNEL_CHECKISO = 84, // GB_all_entries_are_iso - GB_JIT_KERNEL_CONVERTBITMAP = 85, // GB_convert_bitmap_worker - GB_JIT_KERNEL_EXPANDISO = 86, // GB_expand_iso + GB_JIT_KERNEL_BITMAP_ASSIGN_1 = 63, // GB_bitmap_assign_1 + GB_JIT_KERNEL_BITMAP_ASSIGN_1_WHOLE = 64, // GB_bitmap_assign_1_whole + GB_JIT_KERNEL_BITMAP_ASSIGN_2 = 65, // GB_bitmap_assign_2 + GB_JIT_KERNEL_BITMAP_ASSIGN_2_WHOLE = 66, // GB_bitmap_assign_2_whole + GB_JIT_KERNEL_BITMAP_ASSIGN_3 = 67, // GB_bitmap_assign_3 + GB_JIT_KERNEL_BITMAP_ASSIGN_3_WHOLE = 68, // GB_bitmap_assign_3_whole + GB_JIT_KERNEL_BITMAP_ASSIGN_4 = 69, // GB_bitmap_assign_4 + GB_JIT_KERNEL_BITMAP_ASSIGN_4_WHOLE = 70, // GB_bitmap_assign_4_whole + GB_JIT_KERNEL_BITMAP_ASSIGN_5 = 71, // GB_bitmap_assign_5 + GB_JIT_KERNEL_BITMAP_ASSIGN_5_WHOLE = 72, // GB_bitmap_assign_5_whole + GB_JIT_KERNEL_BITMAP_ASSIGN_6 = 73, // GB_bitmap_assign_6 + GB_JIT_KERNEL_BITMAP_ASSIGN_6b_WHOLE = 74, // GB_bitmap_assign_6b_whole + GB_JIT_KERNEL_BITMAP_ASSIGN_7 = 75, // GB_bitmap_assign_7 + GB_JIT_KERNEL_BITMAP_ASSIGN_7_WHOLE = 76, // GB_bitmap_assign_7_whole + GB_JIT_KERNEL_BITMAP_ASSIGN_8 = 77, // GB_bitmap_assign_8 + GB_JIT_KERNEL_BITMAP_ASSIGN_8_WHOLE = 78, // GB_bitmap_assign_8_whole + + // masker methods: + GB_JIT_KERNEL_MASKER_PHASE1 = 79, // GB_masker_phase1 + GB_JIT_KERNEL_MASKER_PHASE2 = 80, // GB_masker_phase2 + + // subref methods: + GB_JIT_KERNEL_SUBREF_SPARSE = 81, // GB_subref_sparse + GB_JIT_KERNEL_BITMAP_SUBREF = 82, // GB_bitmap_subref + + // sort methods: GB_JIT_KERNEL_SORT = 87, // GB_sort //-------------------------------------------------------------------------- @@ -195,7 +188,8 @@ typedef enum //... (up to 9 apply methods?) // select methods: - GB_JIT_CUDA_KERNEL_SELECT_BITMAP = 1035 + GB_JIT_CUDA_KERNEL_SELECT_BITMAP = 1035, + GB_JIT_CUDA_KERNEL_SELECT_SPARSE = 1036 } GB_jit_kcode ; diff --git a/Source/jitifyer/GB_macrofy_apply.c b/Source/jitifyer/GB_macrofy_apply.c index 394f831feb..67bbb032a1 100644 --- a/Source/jitifyer/GB_macrofy_apply.c +++ b/Source/jitifyer/GB_macrofy_apply.c @@ -2,7 +2,7 @@ // GB_macrofy_apply: construct all macros for apply methods //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ void GB_macrofy_apply // construct all macros for GrB_apply // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, // operator: const GB_Operator op, // unary/index-unary to apply; not binaryop GrB_Type ctype, @@ -24,31 +24,33 @@ void GB_macrofy_apply // construct all macros for GrB_apply { //-------------------------------------------------------------------------- - // extract the apply scode + // extract the apply method_code //-------------------------------------------------------------------------- - int A_zombies = GB_RSHIFT (scode, 37, 1) ; - int A_iso = GB_RSHIFT (scode, 36, 1) ; + // A properties (3 bits, 1 digit) + int A_mat = GB_RSHIFT (method_code, 38, 1) ; + int A_zombies = GB_RSHIFT (method_code, 37, 1) ; + int A_iso = GB_RSHIFT (method_code, 36, 1) ; // C kind, i/j dependency and flipij (4 bits) - int C_mat = GB_RSHIFT (scode, 35, 1) ; - int i_dep = GB_RSHIFT (scode, 34, 1) ; - int j_dep = GB_RSHIFT (scode, 33, 1) ; - bool flipij = GB_RSHIFT (scode, 32, 1) ; + int C_mat = GB_RSHIFT (method_code, 35, 1) ; + int i_dep = GB_RSHIFT (method_code, 34, 1) ; + int j_dep = GB_RSHIFT (method_code, 33, 1) ; + bool flipij = GB_RSHIFT (method_code, 32, 1) ; // op, z = f(x,i,j,y) (5 hex digits) - int unop_ecode = GB_RSHIFT (scode, 24, 8) ; -// int zcode = GB_RSHIFT (scode, 20, 4) ; - int xcode = GB_RSHIFT (scode, 16, 4) ; - int ycode = GB_RSHIFT (scode, 12, 4) ; + int unop_ecode = GB_RSHIFT (method_code, 24, 8) ; +// int zcode = GB_RSHIFT (method_code, 20, 4) ; + int xcode = GB_RSHIFT (method_code, 16, 4) ; + int ycode = GB_RSHIFT (method_code, 12, 4) ; // types of C and A (2 hex digits) -// int ccode = GB_RSHIFT (scode, 8, 4) ; - int acode = GB_RSHIFT (scode, 4, 4) ; +// int ccode = GB_RSHIFT (method_code, 8, 4) ; + int acode = GB_RSHIFT (method_code, 4, 4) ; // sparsity structures of C and A (1 hex digit) - int csparsity = GB_RSHIFT (scode, 2, 2) ; - int asparsity = GB_RSHIFT (scode, 0, 2) ; + int csparsity = GB_RSHIFT (method_code, 2, 2) ; + int asparsity = GB_RSHIFT (method_code, 0, 2) ; //-------------------------------------------------------------------------- // describe the operator @@ -89,6 +91,9 @@ void GB_macrofy_apply // construct all macros for GrB_apply GB_macrofy_type (fp, "Z", "_", ztype_name) ; GB_macrofy_type (fp, "X", "_", xtype_name) ; GB_macrofy_type (fp, "Y", "_", ytype_name) ; + fprintf (fp, "#define GB_DECLAREZ(zwork) %s zwork\n", ztype_name) ; + fprintf (fp, "#define GB_DECLAREX(xwork) %s xwork\n", xtype_name) ; + fprintf (fp, "#define GB_DECLAREY(ywork) %s ywork\n", ytype_name) ; //-------------------------------------------------------------------------- // construct macros for the unary operator @@ -114,8 +119,17 @@ void GB_macrofy_apply // construct all macros for GrB_apply if (ctype == ztype && no_typecast_of_A) { // no typecasting - fprintf (fp, " GB_UNARYOP (Cx [pC], Ax [%s], %s, %s, %s)\n", - pA, i, j, y) ; + if (op->opcode == GB_IDENTITY_unop_code) + { + // identity operator, no typecasting + fprintf (fp, " Cx [pC] = Ax [%s]\n", pA) ; + } + else + { + // any operator, no typecsting + fprintf (fp, " GB_UNARYOP (Cx [pC], Ax [%s], %s, %s, %s)\n", + pA, i, j, y) ; + } } else if (ctype == ztype) { @@ -156,28 +170,40 @@ void GB_macrofy_apply // construct all macros for GrB_apply if (C_mat) { - // C = op(A'), for unary op with transpose + // C = op(A) where C is a matrix GB_macrofy_output (fp, "c", "C", "C", ctype, ztype, csparsity, false, false) ; } else { - // Cx = op(A) for unary or index unary op apply, no transpose + // Cx = op(A) where Cx is an array of type ztype + ASSERT (ctype == ztype) ; fprintf (fp, "\n// C type:\n") ; GB_macrofy_type (fp, "C", "_", ctype->name) ; } //-------------------------------------------------------------------------- - // construct the macros for A + // construct the macros for A array or matrix //-------------------------------------------------------------------------- - GB_macrofy_input (fp, "a", "A", "A", true, xtype, - atype, asparsity, acode, A_iso, A_zombies) ; + if (A_mat) + { + // C or Cx = op(A) for a matrix A + GB_macrofy_input (fp, "a", "A", "A", true, xtype, + atype, asparsity, acode, A_iso, A_zombies) ; + } + else + { + // Cx = op(Ax) for arrays Cx and Ax (no typecast of A to xtype) + ASSERT (no_typecast_of_A) ; + fprintf (fp, "\n// A type:\n") ; + GB_macrofy_type (fp, "A", "_", atype->name) ; + } //-------------------------------------------------------------------------- // include the final default definitions //-------------------------------------------------------------------------- - fprintf (fp, "\n#include \"include/GB_apply_shared_definitions.h\"\n") ; + fprintf (fp, "\n#include \"include/GB_kernel_shared_definitions.h\"\n") ; } diff --git a/Source/jitifyer/GB_macrofy_assign.c b/Source/jitifyer/GB_macrofy_assign.c index 2ab7ebae83..6dc3fec942 100644 --- a/Source/jitifyer/GB_macrofy_assign.c +++ b/Source/jitifyer/GB_macrofy_assign.c @@ -15,7 +15,7 @@ void GB_macrofy_assign // construct all macros for GrB_assign // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, GrB_BinaryOp accum, // accum operator to macrofy GrB_Type ctype, GrB_Type atype // matrix or scalar type @@ -23,42 +23,45 @@ void GB_macrofy_assign // construct all macros for GrB_assign { //-------------------------------------------------------------------------- - // extract the assign scode + // extract the assign method_code //-------------------------------------------------------------------------- - // assign_kind, Ikind, and Jkind (2 hex digits) - int C_repl = GB_RSHIFT (scode, 46, 1) ; - int assign_kind = GB_RSHIFT (scode, 44, 2) ; - int Ikind = GB_RSHIFT (scode, 42, 2) ; - int Jkind = GB_RSHIFT (scode, 40, 2) ; + // C_replace, S present, scalar assign, A iso (1 hex digit) + int C_replace = GB_RSHIFT (method_code, 47, 1) ; + int S_present = GB_RSHIFT (method_code, 46, 1) ; + bool s_assign = GB_RSHIFT (method_code, 45, 1) ; + int A_iso = GB_RSHIFT (method_code, 44, 1) ; - // binary operator (5 hex digits) - int accum_ecode = GB_RSHIFT (scode, 32, 8) ; -// int zcode = GB_RSHIFT (scode, 28, 4) ; -// int xcode = GB_RSHIFT (scode, 24, 4) ; -// int ycode = GB_RSHIFT (scode, 20, 4) ; + // Ikind, Jkind (1 hex digit) + int Ikind = GB_RSHIFT (method_code, 42, 2) ; + int Jkind = GB_RSHIFT (method_code, 40, 2) ; + + // accum operator and assign_kind (5 hex digits) + int assign_kind = GB_RSHIFT (method_code, 38, 2) ; +// int accum_code = GB_RSHIFT (method_code, 32, 6) ; +// int zcode = GB_RSHIFT (method_code, 28, 4) ; + int xcode = GB_RSHIFT (method_code, 24, 4) ; +// int ycode = GB_RSHIFT (method_code, 20, 4) ; // mask (one hex digit) - int mask_ecode = GB_RSHIFT (scode, 16, 4) ; + int mask_ecode = GB_RSHIFT (method_code, 16, 4) ; // types of C and A (or scalar type) (2 hex digits) - int ccode = GB_RSHIFT (scode, 12, 4) ; // if 0: C is iso - int acode = GB_RSHIFT (scode, 8, 4) ; - - bool C_iso = (ccode == 0) ; + int ccode = GB_RSHIFT (method_code, 12, 4) ; // if 0: C is iso + int acode = GB_RSHIFT (method_code, 8, 4) ; // sparsity structures of C, M, and A (2 hex digits), - // iso status of A and scalar assignment - int csparsity = GB_RSHIFT (scode, 6, 2) ; - int msparsity = GB_RSHIFT (scode, 4, 2) ; - bool s_assign = GB_RSHIFT (scode, 3, 1) ; - int A_iso = GB_RSHIFT (scode, 2, 1) ; - int asparsity = GB_RSHIFT (scode, 0, 2) ; + int csparsity = GB_RSHIFT (method_code, 6, 2) ; + int msparsity = GB_RSHIFT (method_code, 4, 2) ; + int ssparsity = GB_RSHIFT (method_code, 2, 2) ; + int asparsity = GB_RSHIFT (method_code, 0, 2) ; //-------------------------------------------------------------------------- // describe the assignment //-------------------------------------------------------------------------- + bool C_iso = (ccode == 0) ; + #define SLEN 512 char description [SLEN] ; bool Mask_comp = (mask_ecode % 2 == 1) ; @@ -73,10 +76,19 @@ void GB_macrofy_assign // construct all macros for GrB_assign case 2 : M_sparsity = GxB_BITMAP ; break ; case 3 : M_sparsity = GxB_FULL ; break ; } - GB_assign_describe (description, SLEN, C_repl, Ikind, Jkind, + + switch (assign_kind) + { + case GB_ASSIGN : fprintf (fp, "// assign: " ) ; break ; + case GB_SUBASSIGN : fprintf (fp, "// subassign: " ) ; break ; + case GB_ROW_ASSIGN : fprintf (fp, "// row assign: " ) ; break ; + case GB_COL_ASSIGN : fprintf (fp, "// col assign: " ) ; break ; + default:; + } + GB_assign_describe (description, SLEN, C_replace, Ikind, Jkind, M_is_null, M_sparsity, Mask_comp, Mask_struct, accum, s_assign, assign_kind) ; - fprintf (fp, "// assign/subassign: %s\n", description) ; + fprintf (fp, "%s\n", description) ; fprintf (fp, "#define GB_ASSIGN_KIND ") ; switch (assign_kind) @@ -88,6 +100,8 @@ void GB_macrofy_assign // construct all macros for GrB_assign default:; } + fprintf (fp, "#define GB_SCALAR_ASSIGN %d\n", s_assign ? 1 : 0) ; + fprintf (fp, "#define GB_I_KIND ") ; switch (Ikind) { @@ -108,7 +122,7 @@ void GB_macrofy_assign // construct all macros for GrB_assign default:; } - fprintf (fp, "#define GB_C_REPLACE %d\n", C_repl) ; + fprintf (fp, "#define GB_C_REPLACE %d\n", C_replace) ; //-------------------------------------------------------------------------- // describe the accum operator @@ -117,6 +131,7 @@ void GB_macrofy_assign // construct all macros for GrB_assign GrB_Type xtype, ytype, ztype ; const char *xtype_name, *ytype_name, *ztype_name ; + fprintf (fp, "\n// accum: ") ; if (accum == NULL) { // accum operator is not present @@ -126,7 +141,7 @@ void GB_macrofy_assign // construct all macros for GrB_assign xtype = NULL ; ytype = NULL ; ztype = NULL ; - fprintf (fp, "// accum: not present\n\n") ; + fprintf (fp, "not present\n\n") ; } else { @@ -140,13 +155,13 @@ void GB_macrofy_assign // construct all macros for GrB_assign if (accum->hash == 0) { // builtin operator - fprintf (fp, "// accum: (%s, %s)\n\n", accum->name, xtype_name) ; + fprintf (fp, "(%s, %s)\n\n", accum->name, xtype_name) ; } else { // user-defined operator fprintf (fp, - "// accum: %s, ztype: %s, xtype: %s, ytype: %s\n\n", + "%s, ztype: %s, xtype: %s, ytype: %s\n\n", accum->name, ztype_name, xtype_name, ytype_name) ; } } @@ -172,17 +187,31 @@ void GB_macrofy_assign // construct all macros for GrB_assign // construct macros for the accum operator //-------------------------------------------------------------------------- + bool did_accum_scalar = false ; + bool did_accum_aij = false ; + bool need_copy_c_to_xwork = false ; + if (accum != NULL) { fprintf (fp, "\n// accum operator:\n") ; - GB_macrofy_binop (fp, "GB_ACCUM_OP", false, true, false, accum_ecode, - C_iso, accum, NULL, NULL, NULL) ; + + GB_Opcode accum_opcode = accum->opcode ; + if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) + { + // rename the operator + accum_opcode = GB_boolean_rename (accum_opcode) ; + } + int accum_ecode ; + GB_enumify_binop (&accum_ecode, accum_opcode, xcode, false, false) ; + GB_macrofy_binop (fp, "GB_ACCUM_OP", false, false, true, false, false, + accum_ecode, C_iso, accum, NULL, NULL, NULL) ; char *yname = "ywork" ; if (s_assign) { - fprintf (fp, "#define GB_ACCUMULATE_scalar(Cx,pC,ywork)") ; + did_accum_scalar = true ; + fprintf (fp, "#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso)") ; if (C_iso) { fprintf (fp, "\n") ; @@ -196,7 +225,9 @@ void GB_macrofy_assign // construct all macros for GrB_assign } else { - fprintf (fp, "#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork)") ; + did_accum_aij = true ; + fprintf (fp, + "#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso)") ; if (C_iso) { fprintf (fp, "\n") ; @@ -235,6 +266,7 @@ void GB_macrofy_assign // construct all macros for GrB_assign else { // xwork = (xtype) Cx [pC] + need_copy_c_to_xwork = true ; xname = "xwork" ; fprintf (fp, " GB_DECLAREX (xwork) ; \\\n" @@ -271,6 +303,18 @@ void GB_macrofy_assign // construct all macros for GrB_assign } } + if (!did_accum_scalar) + { + fprintf (fp, "#define GB_ACCUMULATE_scalar(Cx,pC,ywork,C_iso)" + " /* unused */\n") ; + } + + if (!did_accum_aij) + { + fprintf (fp, "#define GB_ACCUMULATE_aij(Cx,pC,Ax,pA,A_iso,ywork,C_iso)" + " /* unused */\n") ; + } + //-------------------------------------------------------------------------- // macros for the C matrix //-------------------------------------------------------------------------- @@ -289,21 +333,28 @@ void GB_macrofy_assign // construct all macros for GrB_assign } fprintf (fp, "#define GB_DECLAREC(cwork) %s cwork\n", ctype->name) ; + if (s_assign) { // cwork = (ctype) scalar - GB_macrofy_cast_input (fp, "GB_COPY_scalar_to_cwork", "cwork", "scalar", - "scalar", ctype, atype) ; + GB_macrofy_cast_input (fp, "GB_COPY_scalar_to_cwork", "cwork", + "scalar", "(*((GB_A_TYPE *) scalar))", ctype, atype) ; // C(i,j) = (ctype) scalar, already typecasted to cwork - fprintf (fp, "#define GB_COPY_scalar_to_C(Cx,pC,cwork)%s", + fprintf (fp, "#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso)%s", C_iso ? "\n" : " Cx [pC] = cwork\n") ; + // no copy of A(i,j) to cwork + fprintf (fp, "#define GB_COPY_aij_to_cwork(cwork,Ax,pA,A_iso)" + " /* unused */\n") ; + // no copy of A(i,j) to C(i,j) + fprintf (fp, "#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso)" + " /* unused */\n") ; } else { // C(i,j) = (ctype) A(i,j) GB_macrofy_cast_copy (fp, "C", "A", (C_iso) ? NULL : ctype, atype, A_iso) ; - fprintf (fp, "#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork)"); + fprintf (fp, "#define GB_COPY_aij_to_C(Cx,pC,Ax,pA,A_iso,cwork,C_iso)"); if (C_iso) { fprintf (fp, "\n"); @@ -320,16 +371,21 @@ void GB_macrofy_assign // construct all macros for GrB_assign } // cwork = (ctype) A(i,j) GB_macrofy_cast_input (fp, "GB_COPY_aij_to_cwork", "cwork", - "Ax,p,iso", A_iso ? "Ax [0]" : "Ax [p]", ctype, atype) ; + "Ax,p,A_iso", A_iso ? "Ax [0]" : "Ax [p]", ctype, atype) ; + // no copy of cwork to C + fprintf (fp, "#define GB_COPY_cwork_to_C(Cx,pC,cwork,C_iso)" + " /* unused */\n") ; + // no copy of scalar to cwork + fprintf (fp, "#define GB_COPY_scalar_to_cwork(cwork,scalar)" + " /* unused */\n") ; } - // xwork = (xtype) C(i,j) - if (C_iso) - { - fprintf (fp, "#define GB_COPY_C_to_xwork(xwork,Cx,pC)\n"); - } - else + // xwork = (xtype) C(i,j), if needed + if (need_copy_c_to_xwork) { + ASSERT (accum != NULL) ; + ASSERT (!C_iso) ; + ASSERT (xtype != ctype) ; GB_macrofy_cast_input (fp, "GB_COPY_C_to_xwork", "xwork", "Cx,p", "Cx [p]", xtype, ctype) ; } @@ -344,6 +400,9 @@ void GB_macrofy_assign // construct all macros for GrB_assign // construct the macros for A or the scalar, including typecast to Y type //-------------------------------------------------------------------------- + bool did_scalar_to_ywork = false ; + bool did_aij_to_ywork = false ; + if (s_assign) { // scalar assignment @@ -352,10 +411,14 @@ void GB_macrofy_assign // construct all macros for GrB_assign if (accum != NULL) { // accum is present - // ywork = (ytype) scalar + // ywork = (ytype) scalar GB_macrofy_cast_input (fp, "GB_COPY_scalar_to_ywork", "ywork", - "scalar", "scalar", ytype, atype) ; + "scalar", "(*((GB_A_TYPE *) scalar))", ytype, atype) ; + did_scalar_to_ywork = true ; } + GB_macrofy_sparsity (fp, "A", -1) ; // unused macros + fprintf (fp, "#define GB_A_NVALS(e) int64_t e = 1 ; /* unused */\n") ; + fprintf (fp, "#define GB_A_NHELD(e) int64_t e = 1 ; /* unused */\n") ; } else { @@ -365,12 +428,40 @@ void GB_macrofy_assign // construct all macros for GrB_assign if (accum != NULL) { // accum is present - // ywork = (ytype) A(i,j) + // ywork = (ytype) A(i,j) fprintf (fp, "#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso) " "GB_GETA (ywork, Ax, pA, A_iso)\n") ; + did_aij_to_ywork = true ; } } + if (!did_scalar_to_ywork) + { + fprintf (fp, "#define GB_COPY_scalar_to_ywork(ywork,scalar)" + " /* unused */\n") ; + } + + if (!did_aij_to_ywork) + { + fprintf (fp, "#define GB_COPY_aij_to_ywork(ywork,Ax,pA,A_iso)" + " /* unused */\n") ; + } + + //-------------------------------------------------------------------------- + // construct the macros for S + //-------------------------------------------------------------------------- + + if (S_present) + { + GB_macrofy_sparsity (fp, "S", ssparsity) ; + fprintf (fp, "#define GB_S_CONSTRUCTED 1\n") ; + } + else + { + fprintf (fp, "\n// S matrix: not constructed\n") ; + fprintf (fp, "#define GB_S_CONSTRUCTED 0\n") ; + } + //-------------------------------------------------------------------------- // include the final default definitions //-------------------------------------------------------------------------- diff --git a/Source/jitifyer/GB_macrofy_binop.c b/Source/jitifyer/GB_macrofy_binop.c index abaa771106..3890e25e9b 100644 --- a/Source/jitifyer/GB_macrofy_binop.c +++ b/Source/jitifyer/GB_macrofy_binop.c @@ -17,14 +17,16 @@ void GB_macrofy_binop FILE *fp, // input: const char *macro_name, + bool flipij, // if true: op is f(x,y,j,i) for ewise ops bool flipxy, // if true: op is f(y,x) for a semiring bool is_monoid_or_build, // if true: additive operator for monoid, // or binary op for GrB_Matrix_build, or // accum operator bool is_ewise, // if true: binop for ewise methods - int ecode, + bool is_kron, // if true: binop for kronecker + int ecode, // binary operator ecode from GB_enumify_binop bool C_iso, // if true: C is iso - GrB_BinaryOp op, // NULL if C is iso + GrB_BinaryOp op, // output: const char **f_handle, // basic expression z=f(x,y) const char **u_handle, // update z=f(z,y) for the CPU @@ -50,6 +52,10 @@ void GB_macrofy_binop } fprintf (fp, "#define %s(z,x,y)\n", macro_name) ; } + else if (is_kron) + { + fprintf (fp, "#define %s(z,x,ix,jx,y,iy,jy)\n", macro_name) ; + } else { fprintf (fp, "#define %s(z,x,y,i%s,j)\n", macro_name, karg) ; @@ -71,19 +77,57 @@ void GB_macrofy_binop // additive/build operator: no i,k,j parameters, never flipped fprintf (fp, "#define %s(z,x,y) ", macro_name) ; } + else if (is_kron) + { + // operator for kronecker + if (flipij) + { + fprintf (fp, "#define %s(z,x,jx,ix,y,jy,iy) ", macro_name) ; + } + else + { + fprintf (fp, "#define %s(z,x,ix,jx,y,iy,jy) ", macro_name) ; + } + } else if (flipxy) { - // flipped multiplicative or ewise operator - // note: no positional operands for user-defined ops (yet) + // flipped multiplicative operator (flip both xy and ij) + ASSERT (!is_ewise) ; fprintf (fp, "#define %s(z,y,x,j%s,i) ", macro_name, karg) ; } + else if (flipij) + { + // i,j flipped ewise operator (just flip ij, do not flip xy) + ASSERT (is_ewise) ; + fprintf (fp, "#define %s(z,x,y,j,i) ", macro_name) ; + } else { // unflipped multiplicative or ewise operator fprintf (fp, "#define %s(z,x,y,i%s,j) ", macro_name, karg) ; } - fprintf (fp, " %s (&(z), &(x), &(y))\n", op->name) ; + if (GB_IS_INDEXBINARYOP_CODE (op->opcode)) + { + // user-defined index binary op + ASSERT (!is_monoid_or_build) ; + if (is_kron) + { + fprintf (fp, " %s (&(z), &(x),ix,jx, &(y),iy,jy, theta)\n", + op->name) ; + } + else + { + const char *xindices = is_ewise ? "i,j" : "i,k" ; + const char *yindices = is_ewise ? "i,j" : "k,j" ; + fprintf (fp, " %s (&(z), &(x),%s, &(y),%s, theta)\n", + op->name, xindices, yindices) ; + } + } + else + { + fprintf (fp, " %s (&(z), &(x), &(y))\n", op->name) ; + } if (is_monoid_or_build && op->ztype == op->xtype) { @@ -691,7 +735,7 @@ void GB_macrofy_binop case 149 : f = "z = GxB_CMPLX (1,0)" ; break ; //------------------------------------------------------------------ - // positional ops + // builtin positional ops //------------------------------------------------------------------ // in a semiring: cij += aik * bkj @@ -700,13 +744,23 @@ void GB_macrofy_binop // in an ewise operation: cij = aij + bij // firsti is i, firstj is j, secondi i, secondj is j - case 134 : f = "z = (i)" ; break ; - case 135 : f = "z = (k)" ; break ; - case 136 : f = "z = (j)" ; break ; + case 134 : f = "z = (i)" ; break ; + case 135 : f = "z = (k)" ; break ; + case 136 : f = "z = (j)" ; break ; case 137 : f = "z = (i) + 1" ; break ; case 138 : f = "z = (k) + 1" ; break ; case 139 : f = "z = (j) + 1" ; break ; + // for kron, all these ops are unique: + case 150 : f = "z = (ix)" ; break ; // firsti + case 151 : f = "z = (ix)+1" ; break ; // firsti1 + case 152 : f = "z = (jx)" ; break ; // firstj + case 153 : f = "z = (jx)+1" ; break ; // firstj1 + case 154 : f = "z = (iy)" ; break ; // secondi + case 155 : f = "z = (iy)+1" ; break ; // secondi1 + case 156 : f = "z = (jy)" ; break ; // secondj + case 157 : f = "z = (jy)+1" ; break ; // secondj1 + //------------------------------------------------------------------ // no-op: same as second operator //------------------------------------------------------------------ @@ -747,6 +801,20 @@ void GB_macrofy_binop } } } + else if (is_kron) + { + // operator for kronecker + if (flipij) + { + fprintf (fp, "#define %s(z,x,jx,ix,y,jy,iy) %s\n", + macro_name, f) ; + } + else + { + fprintf (fp, "#define %s(z,x,ix,jx,y,iy,jy) %s\n", + macro_name, f) ; + } + } else if (flipxy) { // flipped multiplicative or ewise operator diff --git a/Source/jitifyer/GB_macrofy_build.c b/Source/jitifyer/GB_macrofy_build.c index 2747843de5..d53934b4d5 100644 --- a/Source/jitifyer/GB_macrofy_build.c +++ b/Source/jitifyer/GB_macrofy_build.c @@ -15,7 +15,7 @@ void GB_macrofy_build // construct all macros for GB_build // output: FILE *fp, // target file to write, already open // input: - uint64_t build_code, // unique encoding of the entire problem + uint64_t method_code, // unique encoding of the entire problem GrB_BinaryOp dup, // dup binary operator to macrofy GrB_Type ttype, // type of Tx GrB_Type stype // type of Sx @@ -23,18 +23,18 @@ void GB_macrofy_build // construct all macros for GB_build { //-------------------------------------------------------------------------- - // extract the build_code + // extract the method_code //-------------------------------------------------------------------------- // dup, z = f(x,y) (5 hex digits) - int dup_ecode = GB_RSHIFT (build_code, 20, 8) ; -// int zcode = GB_RSHIFT (build_code, 16, 4) ; -// int xcode = GB_RSHIFT (build_code, 12, 4) ; -// int ycode = GB_RSHIFT (build_code, 8, 4) ; +// int dup_code = GB_RSHIFT (method_code, 20, 6) ; +// int zcode = GB_RSHIFT (method_code, 16, 4) ; + int xcode = GB_RSHIFT (method_code, 12, 4) ; +// int ycode = GB_RSHIFT (method_code, 8, 4) ; // types of S and T (2 hex digits) -// int tcode = GB_RSHIFT (build_code, 4, 4) ; -// int scode = GB_RSHIFT (build_code, 0, 4) ; +// int tcode = GB_RSHIFT (method_code, 4, 4) ; +// int scode = GB_RSHIFT (method_code, 0, 4) ; //-------------------------------------------------------------------------- // describe the operator @@ -50,6 +50,13 @@ void GB_macrofy_build // construct all macros for GB_build const char *ztype_name = ztype->name ; const char *ttype_name = ttype->name ; const char *stype_name = stype->name ; + GB_Opcode dup_opcode = dup->opcode ; + if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) + { + // rename the operator + dup_opcode = GB_boolean_rename (dup_opcode) ; + } + if (dup->hash == 0) { // builtin operator @@ -60,7 +67,7 @@ void GB_macrofy_build // construct all macros for GB_build // user-defined operator, or created by GB_build fprintf (fp, "// op: %s%s, ztype: %s, xtype: %s, ytype: %s\n\n", - (dup->opcode == GB_SECOND_binop_code) ? "2nd_" : "", + (dup_opcode == GB_SECOND_binop_code) ? "2nd_" : "", dup->name, ztype_name, xtype_name, ytype_name) ; } @@ -75,17 +82,20 @@ void GB_macrofy_build // construct all macros for GB_build GB_macrofy_type (fp, "X", "_", xtype_name) ; GB_macrofy_type (fp, "Y", "_", ytype_name) ; - fprintf (fp, "\n// S and T data types:\n") ; - GB_macrofy_type (fp, "T", "_", ttype_name) ; - GB_macrofy_type (fp, "S", "_", stype_name) ; + fprintf (fp, "\n// Sx and Tx data types:\n") ; + GB_macrofy_type (fp, "Tx", "_", ttype_name) ; + GB_macrofy_type (fp, "Sx", "_", stype_name) ; //-------------------------------------------------------------------------- // construct macros for the binary operator //-------------------------------------------------------------------------- + int dup_ecode ; + GB_enumify_binop (&dup_ecode, dup_opcode, xcode, false, false) ; + fprintf (fp, "\n// binary dup operator:\n") ; - GB_macrofy_binop (fp, "GB_DUP", false, true, false, dup_ecode, false, dup, - NULL, NULL, NULL) ; + GB_macrofy_binop (fp, "GB_DUP", false, false, true, false, false, + dup_ecode, false, dup, NULL, NULL, NULL) ; fprintf (fp, "\n// build copy/dup methods:\n") ; @@ -107,7 +117,7 @@ void GB_macrofy_build // construct all macros for GB_build //---------------------------------------------------------------------- fprintf (fp, "#define GB_BLD_DUP(Tx,p,Sx,k)") ; - if (dup->opcode != GB_FIRST_binop_code) + if (dup_opcode != GB_FIRST_binop_code) { fprintf (fp, " GB_UPDATE (Tx [p], Sx [k])") ; } diff --git a/Source/jitifyer/GB_macrofy_ewise.c b/Source/jitifyer/GB_macrofy_ewise.c index a9fbd072a1..67096df427 100644 --- a/Source/jitifyer/GB_macrofy_ewise.c +++ b/Source/jitifyer/GB_macrofy_ewise.c @@ -15,7 +15,8 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, + uint64_t kcode, GrB_BinaryOp binaryop, // binaryop to macrofy GrB_Type ctype, GrB_Type atype, // NULL for apply bind1st @@ -24,41 +25,44 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise { //-------------------------------------------------------------------------- - // extract the binaryop scode + // extract the ewise method_code //-------------------------------------------------------------------------- - // method (3 bits) -// bool is_emult = GB_RSHIFT (scode, 50, 1) ; -// bool is_union = GB_RSHIFT (scode, 49, 1) ; - bool copy_to_C = GB_RSHIFT (scode, 48, 1) ; - - // C in, A, and B iso-valued and flipxy (one hex digit) - bool C_in_iso = GB_RSHIFT (scode, 47, 1) ; - int A_iso_code = GB_RSHIFT (scode, 46, 1) ; - int B_iso_code = GB_RSHIFT (scode, 45, 1) ; - bool flipxy = GB_RSHIFT (scode, 44, 1) ; + // C in, A, and B iso-valued (1 hex digit) + bool C_in_iso = GB_RSHIFT (method_code, 46, 1) ; + int A_iso_code = GB_RSHIFT (method_code, 45, 1) ; + int B_iso_code = GB_RSHIFT (method_code, 44, 1) ; // binary operator (5 hex digits) - int binop_ecode = GB_RSHIFT (scode, 36, 8) ; -// int zcode = GB_RSHIFT (scode, 32, 4) ; - int xcode = GB_RSHIFT (scode, 28, 4) ; - int ycode = GB_RSHIFT (scode, 24, 4) ; + bool flipxy = GB_RSHIFT (method_code, 43, 1) ; + bool flipij = GB_RSHIFT (method_code, 42, 1) ; + int binop_code = GB_RSHIFT (method_code, 36, 6) ; +// int zcode = GB_RSHIFT (method_code, 32, 4) ; + int xcode = GB_RSHIFT (method_code, 28, 4) ; + int ycode = GB_RSHIFT (method_code, 24, 4) ; - // mask (one hex digit) - int mask_ecode = GB_RSHIFT (scode, 20, 4) ; + // mask (1 hex digit) + int mask_ecode = GB_RSHIFT (method_code, 20, 4) ; // types of C, A, and B (3 hex digits) - int ccode = GB_RSHIFT (scode, 16, 4) ; // if 0: C is iso - int acode = GB_RSHIFT (scode, 12, 4) ; // if 0: A is pattern - int bcode = GB_RSHIFT (scode, 8, 4) ; // if 0: B is pattern + int ccode = GB_RSHIFT (method_code, 16, 4) ; // if 0: C is iso + int acode = GB_RSHIFT (method_code, 12, 4) ; // if 0: A is pattern + int bcode = GB_RSHIFT (method_code, 8, 4) ; // if 0: B is pattern bool C_iso = (ccode == 0) ; // formats of C, M, A, and B (2 hex digits) - int csparsity = GB_RSHIFT (scode, 6, 2) ; - int msparsity = GB_RSHIFT (scode, 4, 2) ; - int asparsity = GB_RSHIFT (scode, 2, 2) ; - int bsparsity = GB_RSHIFT (scode, 0, 2) ; + int csparsity = GB_RSHIFT (method_code, 6, 2) ; + int msparsity = GB_RSHIFT (method_code, 4, 2) ; + int asparsity = GB_RSHIFT (method_code, 2, 2) ; + int bsparsity = GB_RSHIFT (method_code, 0, 2) ; + + //-------------------------------------------------------------------------- + // get the method + //-------------------------------------------------------------------------- + + bool is_eadd = (kcode == GB_JIT_KERNEL_ADD) ; + bool is_kron = (kcode == GB_JIT_KERNEL_KRONER) ; //-------------------------------------------------------------------------- // describe the operator @@ -68,9 +72,11 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise const char *xtype_name, *ytype_name, *ztype_name ; ASSERT_BINARYOP_OK (binaryop, "binaryop to macrofy", GB0) ; + GB_Opcode opcode ; if (C_iso) { // values of C are not computed by the kernel + opcode = GB_PAIR_binop_code ; xtype_name = "GB_void" ; ytype_name = "GB_void" ; ztype_name = "GB_void" ; @@ -82,6 +88,12 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise else { // general case + opcode = binaryop->opcode ; + if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) + { + // rename the operator + opcode = GB_boolean_rename (opcode) ; + } xtype = binaryop->xtype ; ytype = binaryop->ytype ; ztype = binaryop->ztype ; @@ -91,20 +103,27 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise if (binaryop->hash == 0) { // builtin operator - fprintf (fp, "// op: (%s%s, %s)\n\n", - binaryop->name, flipxy ? " (flipped)" : "", xtype_name) ; + fprintf (fp, "// op: (%s%s%s, %s)\n\n", + binaryop->name, + flipij ? " (flipped ij)" : "", + flipxy ? " (flipped xy)" : "", + xtype_name) ; } else { // user-defined operator, or created by GB_wait fprintf (fp, - "// op: %s%s%s, ztype: %s, xtype: %s, ytype: %s\n\n", - (binaryop->opcode == GB_SECOND_binop_code) ? "2nd_" : "", - binaryop->name, flipxy ? " (flipped)" : "", + "// op: %s%s%s%s, ztype: %s, xtype: %s, ytype: %s\n\n", + (opcode == GB_SECOND_binop_code) ? "2nd_" : "", + binaryop->name, + flipij ? " (flipped ij)" : "", + flipxy ? " (flipped xy)" : "", ztype_name, xtype_name, ytype_name) ; } } + ASSERT (opcode == (binop_code + GB_USER_binop_code)) ; + //-------------------------------------------------------------------------- // construct the typedefs //-------------------------------------------------------------------------- @@ -126,19 +145,25 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise // construct macros for the binary operator //-------------------------------------------------------------------------- - fprintf (fp, "\n// binary operator%s:\n", flipxy ? " (flipped)" : "") ; - GB_macrofy_binop (fp, "GB_BINOP", flipxy, false, true, binop_ecode, C_iso, - binaryop, NULL, NULL, NULL) ; + int binop_ecode ; + GB_enumify_binop (&binop_ecode, opcode, xcode, false, is_kron) ; + + fprintf (fp, "\n// binary operator%s%s:\n", + flipij ? " (flipped ij)" : "", + flipxy ? " (flipped xy)" : "") ; + GB_macrofy_binop (fp, is_kron ? "GB_KRONOP" : "GB_BINOP", + flipij, flipxy, false, true, is_kron, + binop_ecode, C_iso, binaryop, NULL, NULL, NULL) ; - if (binaryop->opcode == GB_SECOND_binop_code) + if (opcode == GB_SECOND_binop_code) { fprintf (fp, "#define GB_OP_IS_SECOND 1\n") ; } - GB_macrofy_cast_copy (fp, "C", "A", (C_iso || !copy_to_C) ? NULL : ctype, + GB_macrofy_cast_copy (fp, "C", "A", (C_iso || !is_eadd) ? NULL : ctype, (acode == 0 || acode == 15) ? NULL : atype, A_iso_code) ; - GB_macrofy_cast_copy (fp, "C", "B", (C_iso || !copy_to_C) ? NULL : ctype, + GB_macrofy_cast_copy (fp, "C", "B", (C_iso || !is_eadd) ? NULL : ctype, (bcode == 0 || bcode == 15) ? NULL : btype, B_iso_code) ; //-------------------------------------------------------------------------- @@ -148,23 +173,39 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise GB_macrofy_output (fp, "c", "C", "C", ctype, ztype, csparsity, C_iso, C_in_iso) ; - fprintf (fp, "#define GB_EWISEOP(Cx,p,aij,bij,i,j)") ; - if (C_iso) + if (is_kron) { - fprintf (fp, "\n") ; - } - else if (ctype == ztype) - { - fprintf (fp, " GB_BINOP (Cx [p], aij, bij, i, j)\n") ; + fprintf (fp, "#define GB_KRONECKER_OP(Cx,p,a,ia,ja,b,ib,jb)") ; + if (C_iso) + { + fprintf (fp, "\n") ; + } + else + { + ASSERT (ctype == ztype) ; + fprintf (fp, " GB_KRONOP (Cx [p], a,ia,ja, b,ib,jb)\n") ; + } } else - { - fprintf (fp, " \\\n" - "{ \\\n" - " GB_Z_TYPE z ; \\\n" - " GB_BINOP (z, aij, bij, i, j) ; \\\n" - " GB_PUTC (z, Cx, p) ; \\\n" - "}\n") ; + { + fprintf (fp, "#define GB_EWISEOP(Cx,p,aij,bij,i,j)") ; + if (C_iso) + { + fprintf (fp, "\n") ; + } + else if (ctype == ztype) + { + fprintf (fp, " GB_BINOP (Cx [p], aij, bij, i, j)\n") ; + } + else + { + fprintf (fp, " \\\n" + "{ \\\n" + " GB_Z_TYPE z ; \\\n" + " GB_BINOP (z, aij, bij, i, j) ; \\\n" + " GB_PUTC (z, Cx, p) ; \\\n" + "}\n") ; + } } //-------------------------------------------------------------------------- diff --git a/Source/jitifyer/GB_macrofy_family.c b/Source/jitifyer/GB_macrofy_family.c index 50631bffc3..2e918e2b57 100644 --- a/Source/jitifyer/GB_macrofy_family.c +++ b/Source/jitifyer/GB_macrofy_family.c @@ -16,7 +16,8 @@ void GB_macrofy_family FILE *fp, // target file to write, already open // input: GB_jit_family family, // family to macrofy - uint64_t scode, // encoding of the specific problem + uint64_t method_code, // encoding of the specific problem + uint64_t kcode, // kernel code GrB_Semiring semiring, // semiring (for mxm family only) GrB_Monoid monoid, // monoid (for reduce family only) GB_Operator op, // unary/index_unary/binary op @@ -30,42 +31,54 @@ void GB_macrofy_family { case GB_jit_apply_family : - GB_macrofy_apply (fp, scode, op, type1, type2) ; + GB_macrofy_apply (fp, method_code, op, type1, type2) ; break ; case GB_jit_assign_family : - GB_macrofy_assign (fp, scode, (GrB_BinaryOp) op, type1, type2) ; + GB_macrofy_assign (fp, method_code, (GrB_BinaryOp) op, type1, type2) ; break ; case GB_jit_build_family : - GB_macrofy_build (fp, scode, (GrB_BinaryOp) op, type1, type2) ; + GB_macrofy_build (fp, method_code, (GrB_BinaryOp) op, type1, type2) ; break ; case GB_jit_ewise_family : - GB_macrofy_ewise (fp, scode, (GrB_BinaryOp) op, type1, type2, + GB_macrofy_ewise (fp, method_code, kcode, (GrB_BinaryOp) op, type1, type2, type3) ; break ; case GB_jit_mxm_family : - GB_macrofy_mxm (fp, scode, semiring, type1, type2, type3) ; + GB_macrofy_mxm (fp, method_code, semiring, type1, type2, type3) ; break ; case GB_jit_reduce_family : - GB_macrofy_reduce (fp, scode, monoid, type1) ; + GB_macrofy_reduce (fp, method_code, monoid, type1) ; break ; case GB_jit_select_family : - GB_macrofy_select (fp, scode, (GrB_IndexUnaryOp) op, type1) ; + GB_macrofy_select (fp, method_code, (GrB_IndexUnaryOp) op, type1) ; break ; - case GB_jit_user_op_family : + case GB_jit_user_op_family : GB_macrofy_user_op (fp, op) ; break ; - case GB_jit_user_type_family : + case GB_jit_user_type_family : GB_macrofy_user_type (fp, type1) ; break ; + case GB_jit_masker_family : + GB_macrofy_masker (fp, method_code, type1) ; + break ; + + case GB_jit_subref_family : + GB_macrofy_subref (fp, method_code, type1) ; + break ; + + case GB_jit_sort_family : + GB_macrofy_sort (fp, method_code, op, type1) ; + break ; + default: ; } } diff --git a/Source/jitifyer/GB_macrofy_input.c b/Source/jitifyer/GB_macrofy_input.c index 45679089f9..fa66136874 100644 --- a/Source/jitifyer/GB_macrofy_input.c +++ b/Source/jitifyer/GB_macrofy_input.c @@ -47,7 +47,6 @@ void GB_macrofy_input { GB_macrofy_sparsity (fp, Aname, asparsity) ; GB_macrofy_nvals (fp, Aname, asparsity, A_iso_code) ; - fprintf (fp, "#define GB_%s_ISO %d\n", Aname, A_iso_code) ; if (azombies >= 0) { // if negative, do not create the macro at all. Typically this @@ -55,16 +54,18 @@ void GB_macrofy_input // delete zombies, it means A always has zombies. fprintf (fp, "#define GB_A_HAS_ZOMBIES %d\n", azombies) ; } - if (A_is_pattern) - { - // values of A are not accessed - fprintf (fp, "#define GB_%s_IS_PATTERN 1\n", Aname) ; - GB_macrofy_type (fp, Aname, "_", "void") ; - } - else - { - GB_macrofy_type (fp, Aname, "_", atype->name) ; - } + } + + fprintf (fp, "#define GB_%s_ISO %d\n", Aname, A_iso_code) ; + if (A_is_pattern) + { + // values of A are not accessed + fprintf (fp, "#define GB_%s_IS_PATTERN 1\n", Aname) ; + GB_macrofy_type (fp, Aname, "_", "void") ; + } + else + { + GB_macrofy_type (fp, Aname, "_", atype->name) ; } //-------------------------------------------------------------------------- @@ -78,11 +79,8 @@ void GB_macrofy_input // no need to access the values of A //---------------------------------------------------------------------- - if (do_matrix_macros) - { - // aij is not needed as input to the operator - GB_macrofy_type (fp, Aname, "2", "void") ; - } + // aij is not needed as input to the operator + GB_macrofy_type (fp, Aname, "2", "void") ; fprintf (fp, "#define GB_DECLARE%s(%s)\n", Amacro, aname) ; fprintf (fp, "#define GB_GET%s(%s,%sx,p,iso)\n", Amacro, aname, Aname) ; @@ -107,10 +105,7 @@ void GB_macrofy_input // float aij ; // float w [32] ; - if (do_matrix_macros) - { - GB_macrofy_type (fp, Aname, "2", a2type->name) ; - } + GB_macrofy_type (fp, Aname, "2", a2type->name) ; fprintf (fp, "#define GB_DECLARE%s(%s) %s %s\n", Amacro, aname, a2type->name, aname) ; diff --git a/Source/jitifyer/GB_macrofy_mask.c b/Source/jitifyer/GB_macrofy_mask.c index 563cc6bfe0..b53238a5af 100644 --- a/Source/jitifyer/GB_macrofy_mask.c +++ b/Source/jitifyer/GB_macrofy_mask.c @@ -2,7 +2,7 @@ // GB_macrofy_mask: return string to define mask macros //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -230,6 +230,5 @@ void GB_macrofy_mask fprintf (fp, "#error undefined mask behavior\n") ; break ; } - } diff --git a/Source/jitifyer/GB_macrofy_masker.c b/Source/jitifyer/GB_macrofy_masker.c new file mode 100644 index 0000000000..ee3cc659f0 --- /dev/null +++ b/Source/jitifyer/GB_macrofy_masker.c @@ -0,0 +1,135 @@ +//------------------------------------------------------------------------------ +// GB_macrofy_masker: construct all macros for masker methods +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +void GB_macrofy_masker // construct all macros for GrB_eWise +( + // output: + FILE *fp, // target file to write, already open + // input: + uint64_t method_code, + GrB_Type rtype +) +{ + + //-------------------------------------------------------------------------- + // extract the masker method_code + //-------------------------------------------------------------------------- + + // C and Z iso properties (1 hex digit) + int C_iso = GB_RSHIFT (method_code, 17, 1) ; + int Z_iso = GB_RSHIFT (method_code, 16, 1) ; + + // mask (1 hex digit) + int mask_ecode = GB_RSHIFT (method_code, 12, 4) ; + + // type of R (1 hex digit) + int rcode = GB_RSHIFT (method_code, 8, 4) ; + + // formats of R, M, C, and Z (2 hex digits) + int rsparsity = GB_RSHIFT (method_code, 6, 2) ; + int msparsity = GB_RSHIFT (method_code, 4, 2) ; + int csparsity = GB_RSHIFT (method_code, 2, 2) ; + int zsparsity = GB_RSHIFT (method_code, 0, 2) ; + + //-------------------------------------------------------------------------- + // construct the macros for the values of R + //-------------------------------------------------------------------------- + + fprintf (fp, "// masker: %s\n", (rtype == NULL) ? "" : rtype->name) ; + if (rtype != NULL) + { + + //---------------------------------------------------------------------- + // construct the typedefs + //---------------------------------------------------------------------- + + GB_macrofy_typedefs (fp, rtype, NULL, NULL, NULL, NULL, NULL) ; + GB_macrofy_type (fp, "R", "_", rtype->name) ; + + //---------------------------------------------------------------------- + // macros for copying entries into R + //---------------------------------------------------------------------- + + // copy a single value from C to R + fprintf (fp, "#define GB_COPY_C_TO_R(Rx,pR,Cx,pC,C_iso,rsize) " + "Rx [pR] = Cx [%s]\n", C_iso ? "0" : "pC") ; + + // copy a single value from Z to R + fprintf (fp, "#define GB_COPY_Z_TO_R(Rx,pR,Zx,pZ,Z_iso,rsize) " + "Rx [pR] = Zx [%s]\n", Z_iso ? "0" : "pZ") ; + + // copy a range of values from C to R + fprintf (fp, + "#define GB_COPY_C_TO_R_RANGE(Rx,pR,Cx,pC,C_iso,rsize,cjnz) \\\n" + "{ \\\n") ; + if (C_iso) + { + fprintf (fp, + " for (int64_t k = 0 ; k < cjnz ; k++) \\\n" + " { \\\n" + " Rx [pR+k] = Cx [0] ; \\\n" + " } \\\n") ; + } + else + { + fprintf (fp, + " /* Rx [pR:pR+cjnz-1] = Cx [pC:pC+cjnz-1] */ \\\n" + " memcpy (Rx +(pR), Cx +(pC), (cjnz)*rsize) ; \\\n") ; + } + fprintf (fp, "}\n") ; + + // copy a range of values from Z to R + fprintf (fp, + "#define GB_COPY_Z_TO_R_RANGE(Rx,pR,Zx,pZ,Z_iso,rsize,zjnz) \\\n" + "{ \\\n") ; + if (Z_iso) + { + fprintf (fp, + " for (int64_t k = 0 ; k < zjnz ; k++) \\\n" + " { \\\n" + " Rx [pR+k] = Zx [0] ; \\\n" + " } \\\n") ; + } + else + { + fprintf (fp, + " /* Rx [pR:pR+zjnz-1] = Zx [pZ:pZ+zjnz-1] */ \\\n" + " memcpy (Rx +(pR), Zx +(pZ), (zjnz)*rsize) ; \\\n") ; + } + fprintf (fp, "}\n") ; + } + + GB_macrofy_sparsity (fp, "R", rsparsity) ; + GB_macrofy_nvals (fp, "R", rsparsity, false) ; + fprintf (fp, "#define GB_R_ISO 0\n") ; + + //-------------------------------------------------------------------------- + // construct the macros for C, M, and Z + //-------------------------------------------------------------------------- + + GB_macrofy_sparsity (fp, "C", csparsity) ; + GB_macrofy_nvals (fp, "C", csparsity, C_iso) ; + fprintf (fp, "#define GB_C_ISO %d\n", C_iso) ; + + GB_macrofy_mask (fp, mask_ecode, "M", msparsity) ; + + GB_macrofy_sparsity (fp, "Z", zsparsity) ; + GB_macrofy_nvals (fp, "Z", zsparsity, Z_iso) ; + fprintf (fp, "#define GB_Z_ISO %d\n", Z_iso) ; + + //-------------------------------------------------------------------------- + // include the final default definitions + //-------------------------------------------------------------------------- + + fprintf (fp, "\n#include \"include/GB_masker_shared_definitions.h\"\n") ; +} + diff --git a/Source/jitifyer/GB_macrofy_monoid.c b/Source/jitifyer/GB_macrofy_monoid.c index d4716c1c04..9299670765 100644 --- a/Source/jitifyer/GB_macrofy_monoid.c +++ b/Source/jitifyer/GB_macrofy_monoid.c @@ -14,9 +14,6 @@ void GB_macrofy_monoid // construct the macros for a monoid ( FILE *fp, // File to write macros, assumed open already // inputs: - int add_ecode, // binary op as an enum - int id_ecode, // identity value as an enum - int term_ecode, // terminal value as an enum (<= 28 is terminal) bool C_iso, // true if C is iso GrB_Monoid monoid, // monoid to macrofy bool disable_terminal_condition, // if true, a builtin monoid is assumed @@ -29,18 +26,35 @@ void GB_macrofy_monoid // construct the macros for a monoid ) { + //-------------------------------------------------------------------------- + // get the monoid + //-------------------------------------------------------------------------- + GrB_BinaryOp op = monoid->op ; const char *ztype_name = C_iso ? "void" : op->ztype->name ; int zcode = C_iso ? 0 : op->ztype->code ; size_t zsize = C_iso ? 0 : op->ztype->size ; GB_Opcode opcode = C_iso ? 0 : op->opcode ; + if (C_iso) + { + opcode = GB_ANY_binop_code ; + zcode = 0 ; + } + else if (zcode == GB_BOOL_code) + { + // rename the monoid + opcode = GB_boolean_rename (opcode) ; + } + //-------------------------------------------------------------------------- // create macros for the additive operator //-------------------------------------------------------------------------- - GB_macrofy_binop (fp, "GB_ADD", false, true, false, add_ecode, C_iso, - op, NULL, u_expression, g_expression) ; + int add_ecode ; + GB_enumify_binop (&add_ecode, opcode, zcode, false, false) ; + GB_macrofy_binop (fp, "GB_ADD", false, false, true, false, false, + add_ecode, C_iso, op, NULL, u_expression, g_expression) ; //-------------------------------------------------------------------------- // create macros for the identity value @@ -54,41 +68,48 @@ void GB_macrofy_monoid // construct the macros for a monoid fprintf (fp, "#define GB_DECLARE_IDENTITY(z)\n") ; fprintf (fp, "#define GB_DECLARE_IDENTITY_CONST(z)\n") ; } - else if (id_ecode <= 28) + else { - // built-in monoid: a simple assignment - const char *id_val = GB_macrofy_id (id_ecode, zsize, &has_byte, &byte) ; - #define SLEN (256 + GxB_MAX_NAME_LEN) - char id [SLEN] ; - if (zcode == GB_FC32_code) - { - snprintf (id, SLEN, "%s z = GxB_CMPLXF (%s,0)", - ztype_name, id_val) ; - } - else if (zcode == GB_FC64_code) - { - snprintf (id, SLEN, "%s z = GxB_CMPLX (%s,0)", - ztype_name, id_val) ; + int id_ecode ; + GB_enumify_identity (&id_ecode, opcode, zcode) ; + + if (id_ecode <= 28) + { + // built-in monoid: a simple assignment + const char *id_val = GB_macrofy_id (id_ecode, zsize, + &has_byte, &byte) ; + #define SLEN (256 + GxB_MAX_NAME_LEN) + char id [SLEN] ; + if (zcode == GB_FC32_code) + { + snprintf (id, SLEN, "%s z = GxB_CMPLXF (%s,0)", + ztype_name, id_val) ; + } + else if (zcode == GB_FC64_code) + { + snprintf (id, SLEN, "%s z = GxB_CMPLX (%s,0)", + ztype_name, id_val) ; + } + else + { + snprintf (id, SLEN, "%s z = %s", ztype_name, id_val) ; + } + fprintf (fp, "#define GB_DECLARE_IDENTITY(z) %s\n", id) ; + fprintf (fp, "#define GB_DECLARE_IDENTITY_CONST(z) const %s\n", id); + if (has_byte) + { + fprintf (fp, "#define GB_HAS_IDENTITY_BYTE 1\n") ; + fprintf (fp, "#define GB_IDENTITY_BYTE 0x%02x\n", (int) byte) ; + } } else { - snprintf (id, SLEN, "%s z = %s", ztype_name, id_val) ; + // user-defined monoid: all we have are the bytes + GB_macrofy_bytes (fp, "IDENTITY", "z", + ztype_name, (uint8_t *) (monoid->identity), zsize, true) ; + fprintf (fp, "#define GB_DECLARE_IDENTITY_CONST(z) " + "GB_DECLARE_IDENTITY(z)\n") ; } - fprintf (fp, "#define GB_DECLARE_IDENTITY(z) %s\n", id) ; - fprintf (fp, "#define GB_DECLARE_IDENTITY_CONST(z) const %s\n", id) ; - if (has_byte) - { - fprintf (fp, "#define GB_HAS_IDENTITY_BYTE 1\n") ; - fprintf (fp, "#define GB_IDENTITY_BYTE 0x%02x\n", (int) byte) ; - } - } - else - { - // user-defined monoid: all we have are the bytes - GB_macrofy_bytes (fp, "IDENTITY", "z", - ztype_name, (uint8_t *) (monoid->identity), zsize, true) ; - fprintf (fp, "#define GB_DECLARE_IDENTITY_CONST(z) " - "GB_DECLARE_IDENTITY(z)\n") ; } //-------------------------------------------------------------------------- @@ -110,6 +131,16 @@ void GB_macrofy_monoid // construct the macros for a monoid bool monoid_is_terminal = false ; + int term_ecode ; + if (C_iso) + { + term_ecode = 18 ; + } + else + { + GB_enumify_terminal (&term_ecode, opcode, zcode) ; + } + bool is_any_monoid = (term_ecode == 18) ; if (is_any_monoid || C_iso) { @@ -377,13 +408,13 @@ void GB_macrofy_monoid // construct the macros for a monoid fprintf (fp, "#define GB_Z_HAS_ATOMIC_UPDATE 1\n") ; if (omp_atomic_version == 4) { - // OpenMP 4.0 has an omp pragram but not OpenMP 2.0. + // OpenMP 4.0 has an omp pragram but not OpenMP 2.0. fprintf (fp, "#define GB_Z_HAS_OMP_ATOMIC_UPDATE " "(!GB_COMPILER_MSC)\n") ; } else if (omp_atomic_version == 2) { - // this update has an omp pragm + // this update has an omp pragma fprintf (fp, "#define GB_Z_HAS_OMP_ATOMIC_UPDATE 1\n") ; } } @@ -395,7 +426,7 @@ void GB_macrofy_monoid // construct the macros for a monoid const char *a = NULL, *cuda_type = NULL ; bool user_monoid_atomically = false ; GB_enumify_cuda_atomic (&a, &user_monoid_atomically, &cuda_type, - monoid, add_ecode, zsize, zcode) ; + monoid, opcode, zsize, zcode) ; if (monoid == NULL || zcode == 0) { diff --git a/Source/jitifyer/GB_macrofy_mxm.c b/Source/jitifyer/GB_macrofy_mxm.c index eaca02cfa3..bca3701768 100644 --- a/Source/jitifyer/GB_macrofy_mxm.c +++ b/Source/jitifyer/GB_macrofy_mxm.c @@ -19,7 +19,7 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, GrB_Semiring semiring, // the semiring to macrofy GrB_Type ctype, GrB_Type atype, @@ -28,41 +28,38 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm { //-------------------------------------------------------------------------- - // extract the semiring scode + // extract the semiring method_code //-------------------------------------------------------------------------- - // monoid (4 hex digits) -// int unused = GB_RSHIFT (scode, 63, 1) ; - int add_ecode = GB_RSHIFT (scode, 58, 5) ; - int id_ecode = GB_RSHIFT (scode, 53, 5) ; - int term_ecode = GB_RSHIFT (scode, 48, 5) ; -// bool is_term = (term_ecode < 30) ; + // monoid (4 bits, 1 hex digit) +// int add_code = GB_RSHIFT (method_code, 48, 5) ; // C in, A, B iso-valued and flipxy (one hex digit) - bool C_in_iso = GB_RSHIFT (scode, 47, 1) ; - int A_iso_code = GB_RSHIFT (scode, 46, 1) ; - int B_iso_code = GB_RSHIFT (scode, 45, 1) ; - bool flipxy = GB_RSHIFT (scode, 44, 1) ; + bool C_in_iso = GB_RSHIFT (method_code, 47, 1) ; + int A_iso_code = GB_RSHIFT (method_code, 46, 1) ; + int B_iso_code = GB_RSHIFT (method_code, 45, 1) ; + bool flipxy = GB_RSHIFT (method_code, 44, 1) ; // multiplier (5 hex digits) - int mult_ecode = GB_RSHIFT (scode, 36, 8) ; - int zcode = GB_RSHIFT (scode, 32, 4) ; // if 0: C is iso - int xcode = GB_RSHIFT (scode, 28, 4) ; // if 0: ignored - int ycode = GB_RSHIFT (scode, 24, 4) ; // if 0: ignored + // 2 bits unused here (42 and 43) +// int mult_code = GB_RSHIFT (method_code, 36, 6) ; + int zcode = GB_RSHIFT (method_code, 32, 4) ; // if 0: C is iso + int xcode = GB_RSHIFT (method_code, 28, 4) ; // if 0: ignored + int ycode = GB_RSHIFT (method_code, 24, 4) ; // if 0: ignored // mask (one hex digit) - int mask_ecode = GB_RSHIFT (scode, 20, 4) ; + int mask_ecode = GB_RSHIFT (method_code, 20, 4) ; // types of C, A, and B (3 hex digits) - int ccode = GB_RSHIFT (scode, 16, 4) ; // if 0: C is iso - int acode = GB_RSHIFT (scode, 12, 4) ; // if 0: A is pattern - int bcode = GB_RSHIFT (scode, 8, 4) ; // if 0: B is pattern + int ccode = GB_RSHIFT (method_code, 16, 4) ; // if 0: C is iso + int acode = GB_RSHIFT (method_code, 12, 4) ; // if 0: A is pattern + int bcode = GB_RSHIFT (method_code, 8, 4) ; // if 0: B is pattern // formats of C, M, A, and B (2 hex digits) - int csparsity = GB_RSHIFT (scode, 6, 2) ; - int msparsity = GB_RSHIFT (scode, 4, 2) ; - int asparsity = GB_RSHIFT (scode, 2, 2) ; - int bsparsity = GB_RSHIFT (scode, 0, 2) ; + int csparsity = GB_RSHIFT (method_code, 6, 2) ; + int msparsity = GB_RSHIFT (method_code, 4, 2) ; + int asparsity = GB_RSHIFT (method_code, 2, 2) ; + int bsparsity = GB_RSHIFT (method_code, 0, 2) ; //-------------------------------------------------------------------------- // construct the semiring name @@ -71,22 +68,36 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm GrB_Monoid monoid = semiring->add ; GrB_BinaryOp mult = semiring->multiply ; GrB_BinaryOp addop = monoid->op ; + GB_Opcode mult_opcode = mult->opcode ; + GB_Opcode add_opcode = addop->opcode ; bool C_iso = (ccode == 0) ; if (C_iso) { // C is iso; no operators are used + add_opcode = GB_ANY_binop_code ; + mult_opcode = GB_PAIR_binop_code ; + xcode = 0 ; + ycode = 0 ; + zcode = 0 ; fprintf (fp, "// semiring: symbolic only (C is iso)\n") ; } else { // general case + fprintf (fp, "// semiring: (%s, %s%s, %s)\n", addop->name, mult->name, flipxy ? " (flipped)" : "", mult->xtype->name) ; } + if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) + { + // rename the multiplicative operator + mult_opcode = GB_boolean_rename (mult_opcode) ; + } + //-------------------------------------------------------------------------- // construct the typedefs //-------------------------------------------------------------------------- @@ -110,25 +121,27 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm // turn off terminal condition for builtin monoids coupled with positional // multiply operators - bool is_positional = GB_IS_BINARYOP_CODE_POSITIONAL (mult->opcode) ; + bool is_positional = GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (mult_opcode) ; fprintf (fp, "\n// monoid:\n") ; const char *u_expr, *g_expr ; GB_macrofy_type (fp, "Z", "_", (zcode == 0) ? "GB_void" : ztype->name) ; - GB_macrofy_monoid (fp, add_ecode, id_ecode, term_ecode, C_iso, monoid, - is_positional, &u_expr, &g_expr) ; + GB_macrofy_monoid (fp, C_iso, monoid, is_positional, &u_expr, &g_expr) ; //-------------------------------------------------------------------------- // construct macros for the multiply operator //-------------------------------------------------------------------------- + int mult_ecode ; + GB_enumify_binop (&mult_ecode, mult_opcode, xcode, true, false) ; + fprintf (fp, "\n// multiplicative operator%s:\n", flipxy ? " (flipped)" : "") ; const char *f_expr ; GB_macrofy_type (fp, "X", "_", (xcode == 0) ? "GB_void" : xtype->name) ; GB_macrofy_type (fp, "Y", "_", (ycode == 0) ? "GB_void" : ytype->name) ; - GB_macrofy_binop (fp, "GB_MULT", flipxy, false, false, mult_ecode, C_iso, - mult, &f_expr, NULL, NULL) ; + GB_macrofy_binop (fp, "GB_MULT", false, flipxy, false, false, false, + mult_ecode, C_iso, mult, &f_expr, NULL, NULL) ; //-------------------------------------------------------------------------- // multiply-add operator @@ -138,9 +151,9 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm bool is_bool = (zcode == GB_BOOL_code) ; bool is_float = (zcode == GB_FP32_code) ; bool is_double = (zcode == GB_FP64_code) ; - bool is_first = (mult->opcode == GB_FIRST_binop_code) ; - bool is_second = (mult->opcode == GB_SECOND_binop_code) ; - bool is_pair = (mult->opcode == GB_PAIR_binop_code) ; + bool is_first = (mult_opcode == GB_FIRST_binop_code) ; + bool is_second = (mult_opcode == GB_SECOND_binop_code) ; + bool is_pair = (mult_opcode == GB_PAIR_binop_code) ; if (C_iso) { @@ -214,14 +227,19 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm fprintf (fp, "\n// special cases:\n") ; - if (mult->opcode == GB_PAIR_binop_code) + if (C_iso) + { + // ANY_PAIR_* (C is iso in this case, type is BOOL) + fprintf (fp, "#define GB_IS_ANY_PAIR_SEMIRING 1\n") ; + } + else if (mult_opcode == GB_PAIR_binop_code) { //---------------------------------------------------------------------- // ANY_PAIR, PLUS_PAIR, and related semirings //---------------------------------------------------------------------- - bool is_plus = (addop->opcode == GB_PLUS_binop_code) ; + bool is_plus = (add_opcode == GB_PLUS_binop_code) ; if (is_plus && (zcode >= GB_INT8_code && zcode <= GB_FP64_code)) { @@ -254,42 +272,37 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm default:; } } - else if (C_iso) - { - // ANY_PAIR_* (C is iso in this case, type is BOOL) - fprintf (fp, "#define GB_IS_ANY_PAIR_SEMIRING 1\n") ; - } - else if (addop->opcode == GB_LXOR_binop_code) + else if (add_opcode == GB_LXOR_binop_code) { // semiring is lxor_pair_bool fprintf (fp, "#define GB_IS_LXOR_PAIR_SEMIRING 1\n") ; } } - else if (mult->opcode == GB_FIRSTJ_binop_code - || mult->opcode == GB_FIRSTJ1_binop_code - || mult->opcode == GB_SECONDI_binop_code - || mult->opcode == GB_SECONDI1_binop_code) + else if (mult_opcode == GB_FIRSTJ_binop_code + || mult_opcode == GB_FIRSTJ1_binop_code + || mult_opcode == GB_SECONDI_binop_code + || mult_opcode == GB_SECONDI1_binop_code) { //---------------------------------------------------------------------- // MIN_FIRSTJ and MAX_FIRSTJ //---------------------------------------------------------------------- - if (addop->opcode == GB_MIN_binop_code) + if (add_opcode == GB_MIN_binop_code) { // semiring is min_firstj or min_firstj1 fprintf (fp, "#define GB_IS_MIN_FIRSTJ_SEMIRING 1\n") ; } - else if (addop->opcode == GB_MAX_binop_code) + else if (add_opcode == GB_MAX_binop_code) { // semiring is max_firstj or max_firstj1 fprintf (fp, "#define GB_IS_MAX_FIRSTJ_SEMIRING 1\n") ; } } - else if (addop->opcode == GB_PLUS_binop_code && - mult->opcode == GB_TIMES_binop_code && + else if (add_opcode == GB_PLUS_binop_code && + mult_opcode == GB_TIMES_binop_code && (zcode == GB_FP32_code || zcode == GB_FP64_code)) { @@ -305,7 +318,7 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm // special case multiply ops //-------------------------------------------------------------------------- - switch (mult->opcode) + switch (mult_opcode) { case GB_PAIR_binop_code : fprintf (fp, "#define GB_IS_PAIR_MULTIPLIER 1\n") ; @@ -339,7 +352,7 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm fprintf (fp, "#define GB_IS_SECONDJ_MULTIPLIER 1\n") ; break ; - default: ; + default: ; } //-------------------------------------------------------------------------- @@ -363,11 +376,11 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm // if flipxy true: A is typecasted to y, and B is typecasted to x. GB_macrofy_input (fp, "a", "A", "A", true, - flipxy ? mult->ytype : mult->xtype, + flipxy ? ytype : xtype, atype, asparsity, acode, A_iso_code, -1) ; GB_macrofy_input (fp, "b", "B", "B", true, - flipxy ? mult->xtype : mult->ytype, + flipxy ? xtype : ytype, btype, bsparsity, bcode, B_iso_code, -1) ; //-------------------------------------------------------------------------- diff --git a/Source/jitifyer/GB_macrofy_name.c b/Source/jitifyer/GB_macrofy_name.c index beb03963e0..11a96cdd0c 100644 --- a/Source/jitifyer/GB_macrofy_name.c +++ b/Source/jitifyer/GB_macrofy_name.c @@ -15,9 +15,9 @@ // // namespace__kname__012345 // -// where "012345" is a hexadecimal printing of the scode. Note the double -// underscores (2 or 3 of them). These are used by GB_demacrofy_name for -// parsing the kernel_name of a PreJIT kernel. +// where "012345" is a hexadecimal printing of the method_code. Note the +// double underscores (2 or 3 of them). These are used by GB_demacrofy_name +// for parsing the kernel_name of a PreJIT kernel. // // The suffix is used only for user-defined types and operators. @@ -31,8 +31,8 @@ void GB_macrofy_name // input const char *name_space, // namespace for the kernel_name const char *kname, // kname for the kernel_name - int scode_digits, // # of hexadecimal digits printed - uint64_t scode, // enumify'd code of the kernel + int method_code_digits, // # of hexadecimal digits printed + uint64_t method_code, // enumify'd code of the kernel const char *suffix // suffix for the kernel_name (NULL if none) ) { @@ -40,13 +40,13 @@ void GB_macrofy_name { // kernel uses only built-in types and operators snprintf (kernel_name, GB_KLEN-1, "%s__%s__%0*" PRIx64, - name_space, kname, scode_digits, scode) ; + name_space, kname, method_code_digits, method_code) ; } else { // kernel uses at least one built-in types and/or operator snprintf (kernel_name, GB_KLEN-1, "%s__%s__%0*" PRIx64 "__%s", - name_space, kname, scode_digits, scode, suffix) ; + name_space, kname, method_code_digits, method_code, suffix) ; } } diff --git a/Source/jitifyer/GB_macrofy_preface.c b/Source/jitifyer/GB_macrofy_preface.c index 491edd038c..3246024fae 100644 --- a/Source/jitifyer/GB_macrofy_preface.c +++ b/Source/jitifyer/GB_macrofy_preface.c @@ -18,7 +18,7 @@ void GB_macrofy_preface char *CUDA_preface, // user-provided preface for CUDA JIT kernels GB_jit_kcode kcode ) -{ +{ const char *date = GxB_IMPLEMENTATION_DATE ; int len = (int) strlen (date) ; diff --git a/Source/jitifyer/GB_macrofy_reduce.c b/Source/jitifyer/GB_macrofy_reduce.c index 8a06120521..0fb5d172eb 100644 --- a/Source/jitifyer/GB_macrofy_reduce.c +++ b/Source/jitifyer/GB_macrofy_reduce.c @@ -25,11 +25,8 @@ void GB_macrofy_reduce // construct all macros for GrB_reduce to scalar //-------------------------------------------------------------------------- // monoid -// int cheese = GB_RSHIFT (rcode, 27, 1) ; - int red_ecode = GB_RSHIFT (rcode, 22, 5) ; - int id_ecode = GB_RSHIFT (rcode, 17, 5) ; - int term_ecode = GB_RSHIFT (rcode, 12, 5) ; -// bool is_term = (term_ecode < 30) ; +// int cheese = GB_RSHIFT (rcode, 16, 1) ; +// int red_code = GB_RSHIFT (rcode, 12, 4) ; // type of the monoid int zcode = GB_RSHIFT (rcode, 8, 4) ; @@ -62,8 +59,7 @@ void GB_macrofy_reduce // construct all macros for GrB_reduce to scalar fprintf (fp, "\n// monoid:\n") ; GB_macrofy_type (fp, "Z", "_", monoid->op->ztype->name) ; - GB_macrofy_monoid (fp, red_ecode, id_ecode, term_ecode, false, monoid, - false, NULL, NULL) ; + GB_macrofy_monoid (fp, false, monoid, false, NULL, NULL) ; fprintf (fp, "#define GB_GETA_AND_UPDATE(z,Ax,p)") ; if (atype == monoid->op->ztype) diff --git a/Source/jitifyer/GB_macrofy_select.c b/Source/jitifyer/GB_macrofy_select.c index 6e406bf020..db5860468b 100644 --- a/Source/jitifyer/GB_macrofy_select.c +++ b/Source/jitifyer/GB_macrofy_select.c @@ -15,7 +15,7 @@ void GB_macrofy_select // construct all macros for GrB_select // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, // operator: const GrB_IndexUnaryOp op, GrB_Type atype @@ -23,32 +23,32 @@ void GB_macrofy_select // construct all macros for GrB_select { //-------------------------------------------------------------------------- - // extract the select scode + // extract the select method_code //-------------------------------------------------------------------------- // iso of A and C (2 bits) - bool C_iso = GB_RSHIFT (scode, 37, 1) ; - bool A_iso = GB_RSHIFT (scode, 36, 1) ; + bool C_iso = GB_RSHIFT (method_code, 37, 1) ; + bool A_iso = GB_RSHIFT (method_code, 36, 1) ; // inplace, i/j dependency and flipij (4 bits) -// int inplace = GB_RSHIFT (scode, 35, 1) ; - int i_dep = GB_RSHIFT (scode, 34, 1) ; - int j_dep = GB_RSHIFT (scode, 33, 1) ; - bool flipij = GB_RSHIFT (scode, 32, 1) ; +// int inplace = GB_RSHIFT (method_code, 35, 1) ; + int i_dep = GB_RSHIFT (method_code, 34, 1) ; + int j_dep = GB_RSHIFT (method_code, 33, 1) ; + bool flipij = GB_RSHIFT (method_code, 32, 1) ; // op, z = f(x,i,j,y) (5 hex digits) - int idxop_ecode = GB_RSHIFT (scode, 24, 8) ; - int zcode = GB_RSHIFT (scode, 20, 4) ; - int xcode = GB_RSHIFT (scode, 16, 4) ; - int ycode = GB_RSHIFT (scode, 12, 4) ; + int idxop_ecode = GB_RSHIFT (method_code, 24, 8) ; + int zcode = GB_RSHIFT (method_code, 20, 4) ; + int xcode = GB_RSHIFT (method_code, 16, 4) ; + int ycode = GB_RSHIFT (method_code, 12, 4) ; // types of C and A (2 hex digits) -// int ccode = GB_RSHIFT (scode, 8, 4) ; - int acode = GB_RSHIFT (scode, 4, 4) ; +// int ccode = GB_RSHIFT (method_code, 8, 4) ; + int acode = GB_RSHIFT (method_code, 4, 4) ; // sparsity structures of C and A (1 hex digit) -// int csparsity = GB_RSHIFT (scode, 2, 2) ; - int asparsity = GB_RSHIFT (scode, 0, 2) ; +// int csparsity = GB_RSHIFT (method_code, 2, 2) ; + int asparsity = GB_RSHIFT (method_code, 0, 2) ; //-------------------------------------------------------------------------- // describe the operator @@ -205,7 +205,7 @@ void GB_macrofy_select // construct all macros for GrB_select else { // C and A are both non-iso - // this would need to typcase if A and C had different types + // this would need to typecast if A and C had different types ASSERT (!A_iso) ; fprintf (fp, " Cx [pC] = Ax [pA]\n") ; } diff --git a/Source/jitifyer/GB_macrofy_sort.c b/Source/jitifyer/GB_macrofy_sort.c new file mode 100644 index 0000000000..0f59821b8c --- /dev/null +++ b/Source/jitifyer/GB_macrofy_sort.c @@ -0,0 +1,84 @@ +//------------------------------------------------------------------------------ +// GB_macrofy_sort: construct all macros for sort methods +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +void GB_macrofy_sort // construct all macros for GxB_sort +( + // output: + FILE *fp, // target file to write, already open + // input: + uint64_t method_code, + GrB_BinaryOp binaryop, // binaryop to macrofy + GrB_Type ctype +) +{ + + //-------------------------------------------------------------------------- + // extract the binaryop method_code + //-------------------------------------------------------------------------- + + // binary operator (14 bits, 3 hex digits) +// int binop_code = GB_RSHIFT (method_code, 12, 6) ; + int xcode = GB_RSHIFT (method_code, 8, 4) ; + + // type of C (1 hex digit) + int ccode = GB_RSHIFT (method_code, 0, 4) ; // 1 to 14, C is not iso + + //-------------------------------------------------------------------------- + // describe the operator + //-------------------------------------------------------------------------- + + ASSERT_BINARYOP_OK (binaryop, "binaryop to macrofy", GB0) ; + + GrB_Type xtype = binaryop->xtype ; + const char *xtype_name = xtype->name ; + + fprintf (fp, "// comparator: (%s, %s)\n\n", binaryop->name, xtype_name) ; + + //-------------------------------------------------------------------------- + // construct the typedefs + //-------------------------------------------------------------------------- + + GB_macrofy_typedefs (fp, ctype, xtype, NULL, NULL, NULL, NULL) ; + + fprintf (fp, "// comparator input type:\n") ; + GB_macrofy_type (fp, "X", "_", xtype_name) ; + + //-------------------------------------------------------------------------- + // construct macros for the binary operator + //-------------------------------------------------------------------------- + + GB_Opcode opcode = binaryop->opcode ; + if (xcode == GB_BOOL_code) // && (ycode == GB_BOOL_code) + { + // rename the operator + opcode = GB_boolean_rename (opcode) ; + } + int binop_ecode ; + GB_enumify_binop (&binop_ecode, opcode, xcode, false, false) ; + + fprintf (fp, "\n// binary operator:\n") ; + GB_macrofy_binop (fp, "GB_BINOP", false, false, false, true, false, + binop_ecode, false, binaryop, NULL, NULL, NULL) ; + + //-------------------------------------------------------------------------- + // macros for the C matrix + //-------------------------------------------------------------------------- + + GB_macrofy_input (fp, "c", "C", "C", true, xtype, ctype, 1, ccode, 0, -1) ; + + //-------------------------------------------------------------------------- + // include the final default definitions + //-------------------------------------------------------------------------- + + fprintf (fp, "\n#include \"include/GB_kernel_shared_definitions.h\"\n") ; +} + diff --git a/Source/jitifyer/GB_macrofy_sparsity.c b/Source/jitifyer/GB_macrofy_sparsity.c index 27381562be..4f0f0b8d43 100644 --- a/Source/jitifyer/GB_macrofy_sparsity.c +++ b/Source/jitifyer/GB_macrofy_sparsity.c @@ -87,7 +87,21 @@ void GB_macrofy_sparsity // construct macros for sparsity structure matrix_name, matrix_name, matrix_name, matrix_name) ; break ; - default:; + default : // unused + fprintf ( fp, "unused\n" + "#define GB_%s_IS_HYPER 0\n" + "#define GB_%s_IS_SPARSE 0\n" + "#define GB_%s_IS_BITMAP 0\n" + "#define GB_%s_IS_FULL 1\n" + "#define GBP_%s(%sp,k,vlen) 0\n" + "#define GBH_%s(%sh,k) (k)\n" + "#define GBI_%s(%si,p,vlen) 0\n" + "#define GBB_%s(%sb,p) 1\n", + matrix_name, matrix_name, matrix_name, matrix_name, + matrix_name, matrix_name, matrix_name, matrix_name, + matrix_name, matrix_name, matrix_name, matrix_name) ; + break ; + } } diff --git a/Source/jitifyer/GB_macrofy_subref.c b/Source/jitifyer/GB_macrofy_subref.c new file mode 100644 index 0000000000..482f17227e --- /dev/null +++ b/Source/jitifyer/GB_macrofy_subref.c @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// GB_macrofy_subref: construct all macros for subref methods +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "jitifyer/GB_stringify.h" + +void GB_macrofy_subref // construct all macros for GrB_extract +( + // output: + FILE *fp, // target file to write, already open + // input: + uint64_t method_code, + GrB_Type ctype +) +{ + + //-------------------------------------------------------------------------- + // extract the subref method_code + //-------------------------------------------------------------------------- + + // need_qsort, I_has_duplicates (1 hex digit) + int ihasdupl = GB_RSHIFT (method_code, 13, 1) ; + int needqsort = GB_RSHIFT (method_code, 12, 1) ; + + // Ikind, Jkind (1 hex digit) + int Ikind = GB_RSHIFT (method_code, 10, 2) ; + int Jkind = GB_RSHIFT (method_code, 8, 2) ; + + // type of C and A (1 hex digit) + int ccode = GB_RSHIFT (method_code, 4, 4) ; + + // sparsity structures of C and A (1 hex digit) + int csparsity = GB_RSHIFT (method_code, 2, 2) ; + int asparsity = GB_RSHIFT (method_code, 0, 2) ; + + //-------------------------------------------------------------------------- + // describe the subref + //-------------------------------------------------------------------------- + + fprintf (fp, "// subref: C=A(I,J) where C and A are %s\n", + (asparsity <= 1) ? "sparse/hypersparse" : "bitmap/full") ; + + fprintf (fp, "#define GB_I_KIND ") ; + switch (Ikind) + { + case GB_ALL : fprintf (fp, "GB_ALL\n" ) ; break ; + case GB_RANGE : fprintf (fp, "GB_RANGE\n" ) ; break ; + case GB_STRIDE : fprintf (fp, "GB_STRIDE\n" ) ; break ; + case GB_LIST : fprintf (fp, "GB_LIST\n" ) ; break ; + default:; + } + if (asparsity <= 1) + { + // C and A are sparse/hypersparse + // Jkind not needed for sparse subsref + fprintf (fp, "#define GB_NEED_QSORT %d\n", needqsort) ; + fprintf (fp, "#define GB_I_HAS_DUPLICATES %d\n", ihasdupl) ; + } + else + { + // C and A are bitmap/full + // need_qsort, I_has_duplicates not needed for bitmap subsref + fprintf (fp, "#define GB_J_KIND ") ; + switch (Jkind) + { + case GB_ALL : fprintf (fp, "GB_ALL\n" ) ; break ; + case GB_RANGE : fprintf (fp, "GB_RANGE\n" ) ; break ; + case GB_STRIDE : fprintf (fp, "GB_STRIDE\n" ) ; break ; + case GB_LIST : fprintf (fp, "GB_LIST\n" ) ; break ; + default:; + } + } + + //-------------------------------------------------------------------------- + // construct the typedefs + //-------------------------------------------------------------------------- + + GB_macrofy_typedefs (fp, ctype, NULL, NULL, NULL, NULL, NULL) ; + + //-------------------------------------------------------------------------- + // construct the macros for C and A + //-------------------------------------------------------------------------- + + GB_macrofy_sparsity (fp, "C", csparsity) ; + GB_macrofy_nvals (fp, "C", csparsity, false) ; + GB_macrofy_type (fp, "C", "_", ctype->name) ; + + GrB_Type atype = ctype ; // C and A have the same type + GB_macrofy_sparsity (fp, "A", asparsity) ; + GB_macrofy_nvals (fp, "A", asparsity, false) ; + GB_macrofy_type (fp, "A", "_", atype->name) ; + + //-------------------------------------------------------------------------- + // include the final default definitions + //-------------------------------------------------------------------------- + + fprintf (fp, "\n#include \"include/GB_kernel_shared_definitions.h\"\n") ; +} + diff --git a/Source/jitifyer/GB_macrofy_type.c b/Source/jitifyer/GB_macrofy_type.c index 934096e859..1763fbee75 100644 --- a/Source/jitifyer/GB_macrofy_type.c +++ b/Source/jitifyer/GB_macrofy_type.c @@ -14,7 +14,7 @@ void GB_macrofy_type ( FILE *fp, // input: - const char *what, // typically X, Y, Z, A, B, or C + const char *what, // typically X, Y, Z, A, B, C, Tx, Sx, etc const char *what2, // typically "_" or "2" const char *name // name of the type ) diff --git a/Source/jitifyer/GB_stringify.h b/Source/jitifyer/GB_stringify.h index 4835afb534..f7a16f746a 100644 --- a/Source/jitifyer/GB_stringify.h +++ b/Source/jitifyer/GB_stringify.h @@ -47,8 +47,8 @@ void GB_macrofy_name // input const char *name_space, // namespace for the kernel_name const char *kname, // kname for the kernel_name - int scode_digits, // # of hexadecimal digits printed - uint64_t scode, // enumify'd code of the kernel + int method_code_digits, // # of hexadecimal digits printed + uint64_t method_code, // enumify'd code of the kernel const char *suffix // suffix for the kernel_name (NULL if none) ) ; @@ -60,7 +60,7 @@ GrB_Info GB_demacrofy_name // output char **name_space, // namespace for the kernel_name char **kname, // kname for the kernel_name - uint64_t *scode, // enumify'd code of the kernel + uint64_t *method_code, // enumify'd code of the kernel char **suffix // suffix for the kernel_name (NULL if none) ) ; @@ -83,7 +83,7 @@ uint64_t GB_encodify_reduce // encode a GrB_reduce problem void GB_enumify_reduce // enumerate a GrB_reduce problem ( // output: - uint64_t *rcode, // unique encoding of the entire problem + uint64_t *method_code, // unique encoding of the entire problem // input: GrB_Monoid monoid, // the monoid to enumify GrB_Matrix A // input matrix to monoid @@ -134,6 +134,7 @@ uint64_t GB_encodify_ewise // encode an ewise problem const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const bool flipxy, const GrB_Matrix A, const GrB_Matrix B @@ -142,10 +143,11 @@ uint64_t GB_encodify_ewise // encode an ewise problem void GB_enumify_ewise // enumerate a GrB_eWise problem ( // output: - uint64_t *scode, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: bool is_eWiseMult, // if true, method is emult bool is_eWiseUnion, // if true, method is eWiseUnion + bool is_kron, // if true, method is kron bool can_copy_to_C, // if true C(i,j)=A(i,j) can bypass the op // C matrix: bool C_iso, // if true, C is iso on output @@ -158,7 +160,8 @@ void GB_enumify_ewise // enumerate a GrB_eWise problem bool Mask_comp, // mask is complemented // operator: GrB_BinaryOp binaryop, // the binary operator to enumify - bool flipxy, // multiplier is: op(a,b) or op(b,a) + bool flipij, // multiplier is: op(a,b,i,j) or op(a,b,j,i) + bool flipxy, // multiplier is: op(a,b,i,j) or op(b,a,j,i) // A and B: GrB_Matrix A, // NULL for unary apply with binop, bind 1st GrB_Matrix B // NULL for unary apply with binop, bind 2nd @@ -169,11 +172,12 @@ void GB_macrofy_ewise // construct all macros for GrB_eWise // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, + uint64_t kcode, GrB_BinaryOp binaryop, // binaryop to macrofy GrB_Type ctype, - GrB_Type atype, - GrB_Type btype + GrB_Type atype, // NULL for apply bind1st + GrB_Type btype // NULL for apply bind2nd ) ; GrB_Info GB_add_jit // C=A+B, C<#M>=A+B, add, via the JIT @@ -186,6 +190,7 @@ GrB_Info GB_add_jit // C=A+B, C<#M>=A+B, add, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const bool Ch_is_Mh, @@ -216,6 +221,7 @@ GrB_Info GB_union_jit // C=A+B, C<#M>=A+B, eWiseUnion, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const GB_void *alpha_scalar_in, @@ -248,6 +254,7 @@ GrB_Info GB_emult_08_jit // C<#M>=A.*B, emult_08, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *restrict C_to_M, @@ -268,6 +275,7 @@ GrB_Info GB_emult_02_jit // C<#M>=A.*B, emult_02, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *restrict Cp_kfirst, @@ -286,6 +294,7 @@ GrB_Info GB_emult_03_jit // C<#M>=A.*B, emult_03, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *restrict Cp_kfirst, @@ -303,6 +312,7 @@ GrB_Info GB_emult_04_jit // C=A.*B, emult_04, via the JIT const GrB_Matrix M, const bool Mask_struct, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *restrict Cp_kfirst, @@ -320,6 +330,7 @@ GrB_Info GB_emult_bitmap_jit // C<#M>=A.*B, emult_bitmap, via the JIT const bool Mask_struct, const bool Mask_comp, const GrB_BinaryOp binaryop, + const bool flipij, const GrB_Matrix A, const GrB_Matrix B, const int64_t *M_ek_slicing, @@ -406,7 +417,7 @@ uint64_t GB_encodify_mxm // encode a GrB_mxm problem void GB_enumify_mxm // enumerate a GrB_mxm problem ( // output: // future:: may need to become 2 x uint64 - uint64_t *scode, // unique encoding of the entire semiring + uint64_t *method_code, // unique encoding of the entire semiring // input: // C matrix: bool C_iso, // C output iso: if true, semiring is ANY_PAIR_BOOL @@ -430,7 +441,7 @@ void GB_macrofy_mxm // construct all macros for GrB_mxm // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, GrB_Semiring semiring, // the semiring to macrofy GrB_Type ctype, GrB_Type atype, @@ -625,27 +636,13 @@ void GB_macrofy_mask // enumify and macrofy a monoid //------------------------------------------------------------------------------ -void GB_enumify_monoid // enumerate a monoid -( - // outputs: - int *add_ecode, // binary op as an enum - int *id_ecode, // identity value as an enum - int *term_ecode, // terminal value as an enum - // inputs: - int add_opcode, // must be a built-in binary operator from a monoid - int zcode // type of the monoid (x, y, and z) -) ; - void GB_macrofy_monoid // construct the macros for a monoid ( FILE *fp, // File to write macros, assumed open already // inputs: - int add_ecode, // binary op as an enum - int id_ecode, // identity value as an enum - int term_ecode, // terminal value as an enum (<= 28 is terminal) bool C_iso, // true if C is iso GrB_Monoid monoid, // monoid to macrofy - bool disable_terminal_condition, // if true, the monoid is assumed + bool disable_terminal_condition, // if true, a builtin monoid is assumed // to be non-terminal. For the (times, firstj, int64) // semiring, times is normally a terminal monoid, but // it's not worth exploiting in GrB_mxm. @@ -654,7 +651,7 @@ void GB_macrofy_monoid // construct the macros for a monoid const char **g_expression ) ; -bool GB_enumify_cuda_atomic // return true if CUDA can do it atomically +bool GB_enumify_cuda_atomic // returns has_cheeseburger ( // output: const char **a, // CUDA atomic function name @@ -662,7 +659,7 @@ bool GB_enumify_cuda_atomic // return true if CUDA can do it atomically const char **cuda_type, // CUDA atomic type // input: GrB_Monoid monoid, // monoid to query - int add_ecode, // binary op as an enum + GB_Opcode add_opcode, size_t zsize, // ztype->size int zcode // ztype->code ) ; @@ -688,11 +685,12 @@ void GB_macrofy_query void GB_enumify_binop ( // output: - int *ecode, // enumerated operator, range 0 to 110; -1 on failure + int *ecode, // enumerated operator, range 0 to 255 // input: GB_Opcode opcode, // opcode of GraphBLAS operator to convert into a macro - GB_Type_code zcode, // op->xtype->code of the operator - bool for_semiring // true for A*B, false for A+B or A.*B + GB_Type_code xcode, // op->xtype->code of the operator + bool for_semiring, // true for A*B multiplier, false otherwise + bool is_kron // true for kronecker ) ; void GB_macrofy_binop @@ -700,14 +698,16 @@ void GB_macrofy_binop FILE *fp, // input: const char *macro_name, + bool flipij, // if true: op is f(x,y,j,i) for ewise ops bool flipxy, // if true: op is f(y,x) for a semiring bool is_monoid_or_build, // if true: additive operator for monoid, // or binary op for GrB_Matrix_build, or // accum operator bool is_ewise, // if true: binop for ewise methods - int ecode, + bool is_kron, // if true: binop for kronecker + int ecode, // binary operator ecode from GB_enumify_binop bool C_iso, // if true: C is iso - GrB_BinaryOp op, // NULL if C is iso + GrB_BinaryOp op, // output: const char **f_handle, // basic expression z=f(x,y) const char **u_handle, // update z=f(z,y) for the CPU @@ -816,13 +816,13 @@ void GB_macrofy_output // monoid identity and terminal values //------------------------------------------------------------------------------ -void GB_enumify_identity // return enum of identity value +void GB_enumify_identity ( // output: - int *ecode, // enumerated identity, 0 to 17 (-1 if fail) - // input: + int *ecode, // enumerated identity, 0 to 31 + // inputs: GB_Opcode opcode, // built-in binary opcode of a monoid - GB_Type_code zcode // type code used in the opcode we want + GB_Type_code zcode // type code of the operator ) ; const char *GB_macrofy_id // return string encoding the value @@ -847,13 +847,13 @@ void GB_macrofy_bytes bool is_identity // true for the identity value ) ; -void GB_enumify_terminal // return enum of terminal value +void GB_enumify_terminal // enumify the terminal value ( // output: - int *ecode, // enumerated terminal, 0 to 31 (-1 if fail) + int *ecode, // enumerated terminal, 0 to 31 // input: GB_Opcode opcode, // built-in binary opcode of a monoid - GB_Type_code zcode // type code used in the opcode we want + GB_Type_code zcode // type code of the operator ) ; //------------------------------------------------------------------------------ @@ -878,7 +878,7 @@ void GB_macrofy_sparsity // construct macros for sparsity structure int sparsity ) ; -void GB_macrofy_nvals +void GB_macrofy_nvals ( FILE *fp, // input: @@ -919,20 +919,25 @@ void GB_macrofy_type void GB_enumify_apply // enumerate an apply or tranpose/apply problem ( // output: - uint64_t *scode, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: // C matrix: - int C_sparsity, // sparse, hyper, bitmap, or full. For apply + const int C_sparsity, // sparse, hyper, bitmap, or full. For apply // without transpose, Cx = op(A) is computed where // Cx is just C->x, so the caller uses 'full' when // C is sparse, hyper, or full. - bool C_is_matrix, // true for C=op(A), false for Cx=op(A) - GrB_Type ctype, // C=((ctype) T) is the final typecast + const bool C_is_matrix, // true for C=op(A), false for Cx=op(A) + const GrB_Type ctype, // C=((ctype) T) is the final typecast // operator: const GB_Operator op, // unary/index-unary to apply; not binaryop - bool flipij, // if true, flip i,j for user idxunop + const bool flipij, // if true, flip i,j for user idxunop // A matrix: - const GrB_Matrix A // input matrix +// const GrB_Matrix A // input matrix + const int A_sparsity, + const bool A_is_matrix, + const GrB_Type atype, + const bool A_iso, + const int64_t A_nzombies ) ; void GB_enumify_unop // enumify a GrB_UnaryOp or GrB_IndexUnaryOp @@ -964,7 +969,7 @@ void GB_macrofy_apply // construct all macros for GrB_apply // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, // operator: const GB_Operator op, // unary/index-unary to apply; not binaryop GrB_Type ctype, @@ -979,12 +984,20 @@ uint64_t GB_encodify_apply // encode an apply problem char **suffix, // suffix for user-defined kernel // input: const GB_jit_kcode kcode, // kernel to encode + // C matrix: const int C_sparsity, const bool C_is_matrix, // true for C=op(A), false for Cx=op(A) const GrB_Type ctype, - const GB_Operator op, + // operator: + const GB_Operator op, // not JIT'd if NULL const bool flipij, - const GrB_Matrix A + // A matrix: +// const GrB_Matrix A + const int A_sparsity, + const bool A_is_matrix, + const GrB_Type atype, + const bool A_iso, + const int64_t A_nzombies ) ; GrB_Info GB_apply_unop_jit // Cx = op (A), apply unop via the JIT @@ -1080,6 +1093,22 @@ GrB_Info GB_convert_s2b_jit // convert sparse to bitmap const int A_nthreads ) ; +GrB_Info GB_convert_b2s_jit // extract CSC/CSR or triplets from bitmap +( + // input: + const int64_t *restrict Cp, // vector pointers for CSC/CSR form + // outputs: + int64_t *restrict Ci, // indices for CSC/CSR or triplet form + int64_t *restrict Cj, // vector indices for triplet form + GB_void *restrict Cx, // values for CSC/CSR or triplet form + // inputs: not modified + const GrB_Type ctype, // type of Cx + GB_Operator op, + const GrB_Matrix A, // matrix to extract; not modified + const int64_t *restrict W, // workspace + int nthreads // # of threads to use +) ; + GrB_Info GB_concat_sparse_jit // concatenate A into a sparse matrix C ( // input/output @@ -1177,7 +1206,7 @@ uint64_t GB_encodify_build // encode an build problem void GB_enumify_build // enumerate a GB_build problem ( // output: - uint64_t *build_code, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: GrB_BinaryOp dup, // operator for duplicates GrB_Type ttype, // type of Tx @@ -1189,7 +1218,7 @@ void GB_macrofy_build // construct all macros for GB_build // output: FILE *fp, // target file to write, already open // input: - uint64_t build_code, // unique encoding of the entire problem + uint64_t method_code, // unique encoding of the entire problem GrB_BinaryOp dup, // dup binary operator to macrofy GrB_Type ttype, // type of Tx GrB_Type stype // type of Sx @@ -1236,7 +1265,7 @@ uint64_t GB_encodify_select // encode an select problem void GB_enumify_select // enumerate a GrB_selectproblem ( // output: - uint64_t *scode, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: bool C_iso, bool in_place_A, @@ -1252,7 +1281,7 @@ void GB_macrofy_select // construct all macros for GrB_select // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, // operator: const GrB_IndexUnaryOp op, GrB_Type atype @@ -1316,7 +1345,7 @@ GrB_Info GB_select_phase2_jit // select phase2 void GB_enumify_assign // enumerate a GrB_assign problem ( // output: - uint64_t *scode, // unique encoding of the entire operation + uint64_t *method_code, // unique encoding of the entire operation // input: // C matrix: GrB_Matrix C, @@ -1326,13 +1355,15 @@ void GB_enumify_assign // enumerate a GrB_assign problem int Jkind, // ditto // M matrix: GrB_Matrix M, // may be NULL - bool Mask_struct, // mask is structural bool Mask_comp, // mask is complemented + bool Mask_struct, // mask is structural // operator: GrB_BinaryOp accum, // the accum operator (may be NULL) - // A matrix + // A matrix or scalar GrB_Matrix A, // NULL for scalar assignment GrB_Type scalar_type, + // S matrix: + GrB_Matrix S, // may be MULL int assign_kind // 0: assign, 1: subassign, 2: row, 3: col ) ; @@ -1341,7 +1372,7 @@ void GB_macrofy_assign // construct all macros for GrB_assign // output: FILE *fp, // target file to write, already open // input: - uint64_t scode, + uint64_t method_code, GrB_BinaryOp accum, // accum operator to macrofy GrB_Type ctype, GrB_Type atype // matrix or scalar type @@ -1363,13 +1394,15 @@ uint64_t GB_encodify_assign // encode an assign problem int Jkind, // ditto // M matrix: GrB_Matrix M, // may be NULL - bool Mask_struct, // mask is structural bool Mask_comp, // mask is complemented + bool Mask_struct, // mask is structural // operator: GrB_BinaryOp accum, // the accum operator (may be NULL) // A matrix or scalar GrB_Matrix A, // NULL for scalar assignment GrB_Type scalar_type, + // S matrix: + GrB_Matrix S, // may be NULL int assign_kind // 0: assign, 1: subassign, 2: row, 3: col ) ; @@ -1401,6 +1434,8 @@ GrB_Info GB_subassign_jit const GrB_Matrix A, // NULL for scalar assignment const void *scalar, const GrB_Type scalar_type, + // S matrix: + const GrB_Matrix S, // NULL if not constructed // kind and kernel: const int assign_kind, // row assign, col assign, assign, or subassign const int assign_kernel, // GB_JIT_KERNEL_SUBASSIGN_01, ... etc @@ -1464,6 +1499,278 @@ GrB_Info GB_user_type_jit // construct a user type in a JIT kernel const GrB_Type type // user-defined type ) ; +//------------------------------------------------------------------------------ +// masker +//------------------------------------------------------------------------------ + +GrB_Info GB_masker_phase1_jit // count nnz in each R(:,j) +( + // computed by phase1: + int64_t *Rp, // output of size Rnvec+1 + int64_t *Rnvec_nonempty, // # of non-empty vectors in R + // tasks from phase1a: + GB_task_struct *restrict TaskList, // array of structs + const int R_ntasks, // # of tasks + const int R_nthreads, // # of threads to use + // analysis from phase0: + const int64_t Rnvec, + const int64_t *restrict Rh, + const int64_t *restrict R_to_M, + const int64_t *restrict R_to_C, + const int64_t *restrict R_to_Z, + // original input: + const GrB_Matrix M, // required mask + const bool Mask_comp, // if true, then M is complemented + const bool Mask_struct, // if true, use the only structure of M + const GrB_Matrix C, + const GrB_Matrix Z +) ; + +GrB_Info GB_masker_phase2_jit // phase2 for R = masker (C,M,Z) +( + GrB_Matrix R, // output matrix, static header + // tasks from phase1a: + const GB_task_struct *restrict TaskList, // array of structs + const int R_ntasks, // # of tasks + const int R_nthreads, // # of threads to use + // analysis from phase0: + const int64_t *restrict R_to_M, + const int64_t *restrict R_to_C, + const int64_t *restrict R_to_Z, + // original input: + const GrB_Matrix M, // required mask + const bool Mask_comp, // if true, then M is complemented + const bool Mask_struct, // if true, use the only structure of M + const GrB_Matrix C, + const GrB_Matrix Z, + const int64_t *restrict C_ek_slicing, + const int C_nthreads, + const int C_ntasks, + const int64_t *restrict M_ek_slicing, + const int M_nthreads, + const int M_ntasks +) ; + +uint64_t GB_encodify_masker // encode a masker problem +( + // output: + GB_jit_encoding *encoding, // unique encoding of the entire problem, + // except for the suffix + char **suffix, // suffix for user-defined kernel + // input: + const GB_jit_kcode kcode, // kernel to encode + const GrB_Matrix R, + const GrB_Matrix M, + const bool Mask_struct, + const bool Mask_comp, + const GrB_Matrix C, + const GrB_Matrix Z +) ; + +uint64_t GB_enumify_masker // enumify a masker problem +( + // output: + uint64_t *method_code, // unique encoding of the entire operation + // input: + const GrB_Matrix R, + const GrB_Matrix M, + const bool Mask_struct, + const bool Mask_comp, + const GrB_Matrix C, + const GrB_Matrix Z +) ; + +void GB_macrofy_masker // construct all macros for GrB_eWise +( + // output: + FILE *fp, // target file to write, already open + // input: + uint64_t method_code, + GrB_Type rtype +) ; + +//------------------------------------------------------------------------------ +// subref methods, C = A(I,J) +//------------------------------------------------------------------------------ + +uint64_t GB_encodify_subref // encode an subref problem +( + // output: + GB_jit_encoding *encoding, // unique encoding of the entire problem, + // except for the suffix + char **suffix, // suffix for user-defined kernel + // input: + const GB_jit_kcode kcode, // kernel to encode + // C matrix: + GrB_Matrix C, + // index types: + int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list + int Jkind, // ditto, or 0 if not used + bool need_qsort, // true if qsort needs to be called + bool I_has_duplicates, // true if I has duplicate entries + // A matrix: + GrB_Matrix A +) ; + +void GB_enumify_subref // enumerate a GrB_extract problem +( + // output: + uint64_t *method_code, // unique encoding of the entire operation + // C matrix: + GrB_Matrix C, + // index types: + int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list + int Jkind, // ditto, or 0 if not used + bool need_qsort, // true if qsort needs to be called + bool I_has_duplicates, // true if I has duplicate entries + // A matrix: + GrB_Matrix A +) ; + +void GB_macrofy_subref // construct all macros for GrB_extract +( + // output: + FILE *fp, // target file to write, already open + // input: + uint64_t method_code, + GrB_Type ctype +) ; + +GrB_Info GB_subref_sparse_jit +( + // output matrix + GrB_Matrix C, // same type as A + // from phase1: + const GB_task_struct *restrict TaskList, // list of tasks + const int ntasks, // # of tasks + const int nthreads, // # of threads to use + const bool post_sort, // true if post-sort needed + const int64_t *Mark, // for I inverse buckets, size A->vlen + const int64_t *Inext, // for I inverse buckets, size nI + const bool I_has_duplicates, // true if I has duplicates + // from phase0: + const int64_t *restrict Ap_start, + const int64_t *restrict Ap_end, + const bool need_qsort, + const int Ikind, + const int64_t nI, + const int64_t Icolon [3], + // original input: + const GrB_Matrix A, + const GrB_Index *I +) ; + +GrB_Info GB_subref_bitmap_jit +( + // input/output: + GrB_Matrix C, + // input: + GrB_Matrix A, + // I: + const GrB_Index *I, + const int64_t nI, + const int Ikind, + const int64_t Icolon [3], + // J: + const GrB_Index *J, + const int64_t nJ, + const int Jkind, + const int64_t Jcolon [3], + GB_Werk Werk +) ; + +//------------------------------------------------------------------------------ +// iso_expand +//------------------------------------------------------------------------------ + +GrB_Info GB_iso_expand_jit // expand an iso scalar into an entire array +( + void *restrict X, // output array to expand into + const int64_t n, // # of entries in X + const void *restrict scalar, // scalar to expand into X + const GrB_Type xtype, // the type of the X and the scalar + const GB_Operator op, // identity operator + const int nthreads // # of threads to use +) ; + +//------------------------------------------------------------------------------ +// unjumble +//------------------------------------------------------------------------------ + +GrB_Info GB_unjumble_jit +( + // input/output: + const GrB_Matrix A, + const GB_Operator op, // identity op, unused + const int64_t *A_slice, + const int ntasks, + const int nthreads +) ; + +//------------------------------------------------------------------------------ +// sort +//------------------------------------------------------------------------------ + +uint64_t GB_encodify_sort // encode a sort problem +( + // output: + GB_jit_encoding *encoding, // unique encoding of the entire problem, + // except for the suffix + char **suffix, // suffix for user-defined kernel + // input: + const GB_jit_kcode kcode, // kernel to encode + // input/output + GrB_Matrix C, + // input: + const GrB_BinaryOp binaryop +) ; + +void GB_enumify_sort // enumerate a GxB_sort problem +( + // output: + uint64_t *method_code, // unique encoding of the entire operation + // input: + GrB_Matrix C, // matrix to sort + // comparator op: + GrB_BinaryOp binaryop // the binary operator for the comparator +) ; + +GrB_Info GB_sort_jit +( + // input/output: + GrB_Matrix C, + // input: + const GrB_BinaryOp binaryop, + int nthreads, + GB_Werk Werk +) ; + +void GB_macrofy_sort // construct all macros for GxB_sort +( + // output: + FILE *fp, // target file to write, already open + // input: + uint64_t method_code, + GrB_BinaryOp binaryop, // binaryop to macrofy + GrB_Type ctype +) ; + +//------------------------------------------------------------------------------ +// kronecker product +//------------------------------------------------------------------------------ + +GrB_Info GB_kroner_jit +( + // output: + GrB_Matrix C, + // input: + const GrB_BinaryOp binaryop, + const bool flipij, + const GrB_Matrix A, + const GrB_Matrix B, + const int nthreads +) ; + //------------------------------------------------------------------------------ // macrofy for all methods //------------------------------------------------------------------------------ @@ -1474,7 +1781,8 @@ void GB_macrofy_family FILE *fp, // target file to write, already open // input: GB_jit_family family, // family to macrofy - uint64_t scode, // encoding of the specific problem + uint64_t method_code, // encoding of the specific problem + uint64_t kcode, // kernel code GrB_Semiring semiring, // semiring (for mxm family only) GrB_Monoid monoid, // monoid (for reduce family only) GB_Operator op, // unary/index_unary/binary op diff --git a/Source/kronecker/GB_kron.c b/Source/kronecker/GB_kron.c index 6085bd6685..5c6aaadb80 100644 --- a/Source/kronecker/GB_kron.c +++ b/Source/kronecker/GB_kron.c @@ -2,7 +2,7 @@ // GB_kron: C = accum (C, kron(A,B)) //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -115,23 +115,18 @@ GrB_Info GB_kron // C = accum (C, kron(A,B)) bool T_is_csc = C->is_csc ; if (T_is_csc != A->is_csc) { - // Flip the sense of A_transpose + // Negate A_transpose A_transpose = !A_transpose ; } if (T_is_csc != B->is_csc) { - // Flip the sense of B_transpose + // Negate B_transpose B_transpose = !B_transpose ; } - if (!T_is_csc) - { - if (GB_OP_IS_POSITIONAL (op)) - { - // positional ops must be flipped, with i and j swapped - op = GB_positional_binop_ijflip (op) ; - } - } + // do not flipij the builtin positional ops (FIRSTI, and friends); + // this is no longer needed with the new index binary ops. + bool flipij = (!T_is_csc) ; bool A_is_pattern, B_is_pattern ; GB_binop_pattern (&A_is_pattern, &B_is_pattern, false, op->opcode) ; @@ -160,7 +155,7 @@ GrB_Info GB_kron // C = accum (C, kron(A,B)) //-------------------------------------------------------------------------- GB_CLEAR_STATIC_HEADER (T, &T_header) ; - GB_OK (GB_kroner (T, T_is_csc, op, + GB_OK (GB_kroner (T, T_is_csc, op, flipij, A_transpose ? AT : A, A_is_pattern, B_transpose ? BT : B, B_is_pattern, Werk)) ; diff --git a/Source/kronecker/GB_kron.h b/Source/kronecker/GB_kron.h index 9dbe92fce6..35000f4b40 100644 --- a/Source/kronecker/GB_kron.h +++ b/Source/kronecker/GB_kron.h @@ -2,7 +2,7 @@ // GB_kron.h: definitions for GB_kron //------------------------------------------------------------------------------ -// 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,6 +32,7 @@ GrB_Info GB_kroner // C = kron (A,B) GrB_Matrix C, // output matrix (static header) const bool C_is_csc, // desired format of C const GrB_BinaryOp op, // multiply operator + const bool flipij, // if true, i and j are flipped: z=(x,y,j,i) const GrB_Matrix A, // input matrix bool A_is_pattern, // true if values of A are not used const GrB_Matrix B, // input matrix diff --git a/Source/kronecker/GB_kroner.c b/Source/kronecker/GB_kroner.c index 5efb61662a..2033e78171 100644 --- a/Source/kronecker/GB_kroner.c +++ b/Source/kronecker/GB_kroner.c @@ -2,27 +2,15 @@ // GB_kroner: Kronecker product, C = kron (A,B) //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -// JIT: needed. - // C = kron(A,B) where op determines the binary multiplier to use. The type of -// A and B are compatible with the x and y inputs of z=op(x,y), but can be -// different. The type of C is the type of z. C is hypersparse if either A -// or B are hypersparse. - -// FUTURE: this would be faster with built-in types and operators. - -// FUTURE: at most one thread is used for each vector of C=kron(A,B). The -// matrix C is normally very large, but if both A and B are n-by-1, then C is -// n^2-by-1 and only a single thread is used. A better method for this case -// would construct vectors of C in parallel. - -// FUTURE: each vector C(:,k) takes O(nnz(C(:,k))) work, but this is not -// accounted for in the parallel load-balancing. +// C is the ztype of the operator. C is hypersparse if either A or B are +// hypersparse, full if both A and B are full, or sparse otherwise. C is never +// constructed as bitmap. #define GB_FREE_WORKSPACE \ { \ @@ -30,20 +18,23 @@ GB_Matrix_free (&Bwork) ; \ } -#define GB_FREE_ALL \ -{ \ - GB_FREE_WORKSPACE ; \ - GB_phybix_free (C) ; \ +#define GB_FREE_ALL \ +{ \ + GB_FREE_WORKSPACE ; \ + GB_phybix_free (C) ; \ } #include "kronecker/GB_kron.h" -#include "ewise/GB_emult.h" +#include "emult/GB_emult.h" +#include "slice/include/GB_search_for_vector.h" +#include "jitifyer/GB_stringify.h" GrB_Info GB_kroner // C = kron (A,B) ( GrB_Matrix C, // output matrix const bool C_is_csc, // desired format of C const GrB_BinaryOp op, // multiply operator + const bool flipij, // if true, i and j are flipped: z=(x,y,j,i) const GrB_Matrix A_in, // input matrix bool A_is_pattern, // true if values of A are not used const GrB_Matrix B_in, // input matrix @@ -110,22 +101,18 @@ GrB_Info GB_kroner // C = kron (A,B) const int64_t *restrict Ap = A->p ; const int64_t *restrict Ah = A->h ; const int64_t *restrict Ai = A->i ; - const GB_void *restrict Ax = A_is_pattern ? NULL : ((GB_void *) A->x) ; - const int64_t asize = A->type->size ; const int64_t avlen = A->vlen ; const int64_t avdim = A->vdim ; - int64_t anvec = A->nvec ; - int64_t anz = GB_nnz (A) ; + const int64_t anvec = A->nvec ; + const int64_t anz = GB_nnz (A) ; const int64_t *restrict Bp = B->p ; const int64_t *restrict Bh = B->h ; const int64_t *restrict Bi = B->i ; - const GB_void *restrict Bx = B_is_pattern ? NULL : ((GB_void *) B->x) ; - const int64_t bsize = B->type->size ; const int64_t bvlen = B->vlen ; const int64_t bvdim = B->vdim ; - int64_t bnvec = B->nvec ; - int64_t bnz = GB_nnz (B) ; + const int64_t bnvec = B->nvec ; + const int64_t bnz = GB_nnz (B) ; //-------------------------------------------------------------------------- // determine the number of threads to use @@ -172,63 +159,30 @@ GrB_Info GB_kroner // C = kron (A,B) // C is hypersparse if either A or B are hypersparse. It is never bitmap. bool C_is_hyper = (cvdim > 1) && (Ah != NULL || Bh != NULL) ; bool C_is_full = GB_as_if_full (A) && GB_as_if_full (B) ; - int sparsity = C_is_full ? GxB_FULL : + int C_sparsity = C_is_full ? GxB_FULL : ((C_is_hyper) ? GxB_HYPERSPARSE : GxB_SPARSE) ; // set C->iso = C_iso OK GB_OK (GB_new_bix (&C, // full, sparse, or hyper; existing header ctype, (int64_t) cvlen, (int64_t) cvdim, GB_Ap_malloc, C_is_csc, - sparsity, true, B->hyper_switch, cnvec, cnzmax, true, C_iso)) ; + C_sparsity, true, B->hyper_switch, cnvec, cnzmax, true, C_iso)) ; //-------------------------------------------------------------------------- - // get C and the operator + // compute the column counts of C: Cp and Ch if C is hypersparse //-------------------------------------------------------------------------- int64_t *restrict Cp = C->p ; int64_t *restrict Ch = C->h ; - int64_t *restrict Ci = C->i ; - GB_void *restrict Cx = (GB_void *) C->x ; - int64_t *restrict Cx_int64 = NULL ; - int32_t *restrict Cx_int32 = NULL ; - - GxB_binary_function fmult = op->binop_function ; - GB_Opcode opcode = op->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; - GB_cast_function cast_A = NULL, cast_B = NULL ; - if (!A_is_pattern) - { - cast_A = GB_cast_factory (op->xtype->code, A->type->code) ; - } - if (!B_is_pattern) - { - cast_B = GB_cast_factory (op->ytype->code, B->type->code) ; - } - - int64_t offset = 0 ; - bool depends_on_j = false ; - if (op_is_positional) - { - offset = GB_positional_offset (opcode, NULL, &depends_on_j) ; - Cx_int64 = (int64_t *) Cx ; - Cx_int32 = (int32_t *) Cx ; - } - bool is64 = (ctype == GrB_INT64) ; - - //-------------------------------------------------------------------------- - // compute the column counts of C, and C->h if C is hypersparse - //-------------------------------------------------------------------------- - - int64_t kC ; if (!C_is_full) { // C is sparse or hypersparse - #pragma omp parallel for num_threads(nthreads) schedule(guided) + int64_t kC ; + #pragma omp parallel for num_threads(nthreads) schedule(static) for (kC = 0 ; kC < cnvec ; kC++) { const int64_t kA = kC / bnvec ; const int64_t kB = kC % bnvec ; - // get A(:,jA), the (kA)th vector of A const int64_t jA = GBH (Ah, kA) ; const int64_t aknz = (Ap == NULL) ? avlen : (Ap [kA+1] - Ap [kA]) ; @@ -252,12 +206,12 @@ GrB_Info GB_kroner // C = kron (A,B) C->magic = GB_MAGIC ; //-------------------------------------------------------------------------- - // C = kron (A,B) where C is iso and full + // C = kron (A,B) where C is iso and/or full full //-------------------------------------------------------------------------- if (C_iso) - { - // Cx [0] = cscalar = op (A,B) + { + // C->x [0] = cscalar = op (A,B) memcpy (C->x, cscalar, csize) ; if (C_is_full) { @@ -268,143 +222,109 @@ GrB_Info GB_kroner // C = kron (A,B) } } + //-------------------------------------------------------------------------- + // quick return if C is empty + //-------------------------------------------------------------------------- + + int64_t cnz = GB_nnz (C) ; + if (cnz == 0) + { + GB_FREE_WORKSPACE ; + return (GrB_SUCCESS) ; + } + //-------------------------------------------------------------------------- // C = kron (A,B) //-------------------------------------------------------------------------- - const bool A_iso = A->iso ; - const bool B_iso = B->iso ; - - #pragma omp parallel for num_threads(nthreads) schedule(guided) - for (kC = 0 ; kC < cnvec ; kC++) - { - int64_t kA = kC / bnvec ; - int64_t kB = kC % bnvec ; - - // get B(:,jB), the (kB)th vector of B - int64_t jB = GBH (Bh, kB) ; - int64_t pB_start = GBP (Bp, kB, bvlen) ; - int64_t pB_end = GBP (Bp, kB+1, bvlen) ; - int64_t bknz = pB_start - pB_end ; - if (bknz == 0) continue ; - GB_void bwork [GB_VLA(bsize)] ; - if (!B_is_pattern && B_iso) + // via the JIT kernel + info = GB_kroner_jit (C, op, flipij, A, B, nthreads) ; + + if (info == GrB_NO_VALUE) + { + // via the generic kernel + #define GB_A_TYPE GB_void + #define GB_B_TYPE GB_void + #define GB_C_TYPE GB_void + #define GB_A_ISO A_iso + #define GB_B_ISO B_iso + #define GB_C_ISO C_iso + const bool A_iso = A->iso ; + const bool B_iso = B->iso ; + const int64_t asize = A->type->size ; + const int64_t bsize = B->type->size ; + + GxB_binary_function fmult = op->binop_function ; + GxB_index_binary_function fmult_idx = op->idxbinop_function ; + const void *theta = op->theta ; + GB_cast_function cast_A = NULL, cast_B = NULL ; + if (!A_is_pattern) + { + cast_A = GB_cast_factory (op->xtype->code, A->type->code) ; + } + if (!B_is_pattern) { - cast_B (bwork, Bx, bsize) ; + cast_B = GB_cast_factory (op->ytype->code, B->type->code) ; } - // get C(:,jC), the (kC)th vector of C - // int64_t kC = kA * bnvec + kB ; - int64_t pC = GBP (Cp, kC, cvlen) ; + #define GB_C_IS_FULL C_is_full - // get A(:,jA), the (kA)th vector of A - int64_t jA = GBH (Ah, kA) ; - int64_t pA_start = GBP (Ap, kA, avlen) ; - int64_t pA_end = GBP (Ap, kA+1, avlen) ; - GB_void awork [GB_VLA(asize)] ; - if (!A_is_pattern && A_iso) - { - cast_A (awork, Ax, asize) ; + #define GB_DECLAREA(a) GB_void a [GB_VLA(asize)] + #define GB_DECLAREB(b) GB_void b [GB_VLA(bsize)] + + #define GB_GETA(a,Ax,p,iso) \ + { \ + if (!A_is_pattern) \ + { \ + cast_A (a, Ax + (p)*asize, asize) ; \ + } \ } - for (int64_t pA = pA_start ; pA < pA_end ; pA++) - { - // awork = A(iA,jA), typecasted to op->xtype - int64_t iA = GBI (Ai, pA, avlen) ; - int64_t iAblock = iA * bvlen ; - if (!A_is_pattern && !A_iso) - { - cast_A (awork, Ax + (pA*asize), asize) ; - } - for (int64_t pB = pB_start ; pB < pB_end ; pB++) - { - // bwork = B(iB,jB), typecasted to op->ytype - int64_t iB = GBI (Bi, pB, bvlen) ; - if (!B_is_pattern && !B_iso) - { - cast_B (bwork, Bx +(pB*bsize), bsize) ; - } - // C(iC,jC) = A(iA,jA) * B(iB,jB) - if (!C_is_full) - { - int64_t iC = iAblock + iB ; - Ci [pC] = iC ; - } - if (op_is_positional) - { - // positional binary operator - switch (opcode) - { - case GB_FIRSTI_binop_code : - // z = first_i(A(iA,jA),y) == iA - case GB_FIRSTI1_binop_code : - // z = first_i1(A(iA,jA),y) == iA+1 - if (is64) - { - Cx_int64 [pC] = iA + offset ; - } - else - { - Cx_int32 [pC] = (int32_t) (iA + offset) ; - } - break ; - case GB_FIRSTJ_binop_code : - // z = first_j(A(iA,jA),y) == jA - case GB_FIRSTJ1_binop_code : - // z = first_j1(A(iA,jA),y) == jA+1 - if (is64) - { - Cx_int64 [pC] = jA + offset ; - } - else - { - Cx_int32 [pC] = (int32_t) (jA + offset) ; - } - break ; - case GB_SECONDI_binop_code : - // z = second_i(x,B(iB,jB)) == iB - case GB_SECONDI1_binop_code : - // z = second_i1(x,B(iB,jB)) == iB+1 - if (is64) - { - Cx_int64 [pC] = iB + offset ; - } - else - { - Cx_int32 [pC] = (int32_t) (iB + offset) ; - } - break ; - case GB_SECONDJ_binop_code : - // z = second_j(x,B(iB,jB)) == jB - case GB_SECONDJ1_binop_code : - // z = second_j1(x,B(iB,jB)) == jB+1 - if (is64) - { - Cx_int64 [pC] = jB + offset ; - } - else - { - Cx_int32 [pC] = (int32_t) (jB + offset) ; - } - break ; - default: ; - } - } - else if (!C_iso) - { - // standard binary operator - fmult (Cx +(pC*csize), awork, bwork) ; - } - pC++ ; - } + #define GB_GETB(b,Bx,p,iso) \ + { \ + if (!B_is_pattern) \ + { \ + cast_B (b, Bx + (p)*bsize, bsize) ; \ + } \ } + + #define GB_KRONECKER_OP(Cx,pC,a,ix,jx,b,iy,jy) \ + { \ + if (fmult != NULL) \ + { \ + /* standard binary operator */ \ + fmult (Cx +(pC)*csize, a, b) ; \ + } \ + else \ + { \ + /* index binary operator */ \ + if (flipij) \ + { \ + fmult_idx (Cx +(pC)*csize, \ + a, jx, ix, b, jy, iy, theta) ; \ + } \ + else \ + { \ + fmult_idx (Cx +(pC)*csize, \ + a, ix, jx, b, iy, jy, theta) ; \ + } \ + } \ + } + + #define GB_GENERIC + #include "ewise/include/GB_ewise_shared_definitions.h" + #include "kronecker/template/GB_kroner_template.c" + info = GrB_SUCCESS ; } //-------------------------------------------------------------------------- // remove empty vectors from C, if hypersparse //-------------------------------------------------------------------------- - GB_OK (GB_hypermatrix_prune (C, Werk)) ; + if (info == GrB_SUCCESS) + { + GB_OK (GB_hypermatrix_prune (C, Werk)) ; + } //-------------------------------------------------------------------------- // return result @@ -412,6 +332,6 @@ GrB_Info GB_kroner // C = kron (A,B) ASSERT_MATRIX_OK (C, "C=kron(A,B)", GB0) ; GB_FREE_WORKSPACE ; - return (GrB_SUCCESS) ; + return (info) ; } diff --git a/Source/kronecker/GrB_kronecker.c b/Source/kronecker/GrB_kronecker.c index 1fb668abfa..ba14efd270 100644 --- a/Source/kronecker/GrB_kronecker.c +++ b/Source/kronecker/GrB_kronecker.c @@ -2,7 +2,7 @@ // GrB_kronecker: Kronecker product //------------------------------------------------------------------------------ -// 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/Source/kronecker/template/GB_kroner_template.c b/Source/kronecker/template/GB_kroner_template.c new file mode 100644 index 0000000000..db2d2943ca --- /dev/null +++ b/Source/kronecker/template/GB_kroner_template.c @@ -0,0 +1,176 @@ +//------------------------------------------------------------------------------ +// GB_kroner_template: Kronecker product, C = kron (A,B) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// C = kron(A,B) where op determines the binary multiplier to use. The type of +// C is the ztype of the operator. C is hypersparse if either A or B are +// hypersparse, full if both A and B are full, or sparse otherwise. C is never +// constructed as bitmap. This template does not need access to C->h if C +// is hypersparse, so it works the same if C is sparse or hypersparse. + +{ + + //-------------------------------------------------------------------------- + // get inputs + //-------------------------------------------------------------------------- + + #ifdef GB_JIT_KERNEL + const int64_t *restrict Ap = A->p ; + const int64_t *restrict Ah = A->h ; + const int64_t *restrict Ai = A->i ; + const int64_t avlen = A->vlen ; + const int64_t *restrict Bp = B->p ; + const int64_t *restrict Bh = B->h ; + const int64_t *restrict Bi = B->i ; + const int64_t bvlen = B->vlen ; + const int64_t bnvec = B->nvec ; + GB_C_NVALS (cnz) ; + const int64_t *restrict Cp = C->p ; + const int64_t cnvec = C->nvec ; + const int64_t cvlen = C->vlen ; + #endif + + int64_t *restrict Ci = C->i ; + const GB_A_TYPE *restrict Ax = (GB_A_TYPE *) A->x ; + const GB_B_TYPE *restrict Bx = (GB_A_TYPE *) B->x ; + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; + + //-------------------------------------------------------------------------- + // C = kron (A,B) + //-------------------------------------------------------------------------- + + int tid ; + #pragma omp parallel for num_threads(nthreads) schedule(static) + for (tid = 0 ; tid < nthreads ; tid++) + { + + //---------------------------------------------------------------------- + // get the iso values of A and B + //---------------------------------------------------------------------- + + GB_DECLAREA (a) ; + if (GB_A_ISO) + { + GB_GETA (a, Ax, 0, true) ; + } + GB_DECLAREB (b) ; + if (GB_B_ISO) + { + GB_GETB (b, Bx, 0, true) ; + } + + //---------------------------------------------------------------------- + // construct the task to compute Ci,Cx [pC:pC_end-1] + //---------------------------------------------------------------------- + + int64_t pC, pC_end ; + GB_PARTITION (pC, pC_end, cnz, tid, nthreads) ; + + // find where this task starts in C + int64_t kC_task = GB_search_for_vector (pC, Cp, 0, cnvec, cvlen) ; + int64_t pC_delta = pC - GBP_C (Cp, kC_task, cvlen) ; + + //---------------------------------------------------------------------- + // compute C(:,kC) for all vectors kC in this task + //---------------------------------------------------------------------- + + for (int64_t kC = kC_task ; kC < cnvec && pC < pC_end ; kC++) + { + + //------------------------------------------------------------------ + // get the vectors C(:,jC), A(:,jA), and B(:,jB) + //------------------------------------------------------------------ + + // C(:,jC) = kron (A(:,jA), B(:,jB), the (kC)th vector of C, + // where jC = GBH_C (Ch, kC) + int64_t kA = kC / bnvec ; + int64_t kB = kC % bnvec ; + + // get A(:,jA), the (kA)th vector of A + int64_t jA = GBH_A (Ah, kA) ; + int64_t pA_start = GBP_A (Ap, kA, avlen) ; + int64_t pA_end = GBP_A (Ap, kA+1, avlen) ; + + // get B(:,jB), the (kB)th vector of B + int64_t jB = GBH_B (Bh, kB) ; + int64_t pB_start = GBP_B (Bp, kB, bvlen) ; + int64_t pB_end = GBP_B (Bp, kB+1, bvlen) ; + int64_t bknz = pB_end - pB_start ; + + // shift into the middle of A(:,jA) and B(:,jB) for the first + // vector of C for this task. + int64_t pA_delta = 0 ; + int64_t pB_delta = 0 ; + if (kC == kC_task && bknz > 0) + { + pA_delta = pC_delta / bknz ; + pB_delta = pC_delta % bknz ; + } + + //------------------------------------------------------------------ + // for all entries in A(:,jA), skipping entries for first vector + //------------------------------------------------------------------ + + int64_t pA = pA_start + pA_delta ; + pA_delta = 0 ; + for ( ; pA < pA_end && pC < pC_end ; pA++) + { + + //-------------------------------------------------------------- + // a = A(iA,jA), typecasted to op->xtype + //-------------------------------------------------------------- + + int64_t iA = GBI_A (Ai, pA, avlen) ; + int64_t iAblock = iA * bvlen ; + if (!GB_A_ISO) + { + GB_GETA (a, Ax, pA, false) ; + } + + //-------------------------------------------------------------- + // for all entries in B(:,jB), skipping entries for 1st vector + //-------------------------------------------------------------- + + // scan B(:,jB), skipping to the first entry of C if this is + // the first time B is accessed in this task + int64_t pB = pB_start + pB_delta ; + pB_delta = 0 ; + for ( ; pB < pB_end && pC < pC_end ; pB++) + { + + //---------------------------------------------------------- + // b = B(iB,jB), typecasted to op->ytype + //---------------------------------------------------------- + + int64_t iB = GBI_B (Bi, pB, bvlen) ; + if (!GB_B_ISO) + { + GB_GETB (b, Bx, pB, false) ; + } + + //---------------------------------------------------------- + // C(iC,jC) = A(iA,jA) * B(iB,jB) + //---------------------------------------------------------- + + if (!GB_C_IS_FULL) + { + // save the row index iC + Ci [pC] = iAblock + iB ; + } + // Cx [pC] = op (a, b) + if (!GB_C_ISO) + { + GB_KRONECKER_OP (Cx, pC, a, iA, jA, b, iB, jB) ; + } + pC++ ; + } + } + } + } +} + diff --git a/Source/mask/GB_accum_mask.c b/Source/mask/GB_accum_mask.c index fa936b1271..0d2db4b83b 100644 --- a/Source/mask/GB_accum_mask.c +++ b/Source/mask/GB_accum_mask.c @@ -52,7 +52,7 @@ } #include "assign/GB_subassign.h" -#include "ewise/GB_add.h" +#include "add/GB_add.h" #include "mask/GB_mask.h" #include "transpose/GB_transpose.h" #include "mask/GB_accum_mask.h" @@ -400,7 +400,7 @@ GrB_Info GB_accum_mask // C = accum (C,T) bool ignore ; GB_OK (GB_add (Z, C->type, C->is_csc, (apply_mask) ? M : NULL, Mask_struct, Mask_comp, &ignore, C, T, false, NULL, NULL, - accum, false, Werk)) ; + accum, false, false, Werk)) ; GB_Matrix_free (Thandle) ; } diff --git a/Source/mask/GB_masker.c b/Source/mask/GB_masker.c index aa8a3b0342..6f67243aee 100644 --- a/Source/mask/GB_masker.c +++ b/Source/mask/GB_masker.c @@ -50,7 +50,7 @@ // GB_masker_phase2. #include "mask/GB_mask.h" -#include "ewise/GB_add.h" +#include "add/GB_add.h" #define GB_FREE_ALL ; GrB_Info GB_masker // R = masker (C, M, Z) @@ -97,7 +97,7 @@ GrB_Info GB_masker // R = masker (C, M, Z) ASSERT (GB_IMPLIES (M->iso, Mask_struct)) ; //-------------------------------------------------------------------------- - // determine the sparsity of R + // determine the sparsity of R (sparse or bitmap) //-------------------------------------------------------------------------- int R_sparsity = GB_masker_sparsity (C, M, Mask_comp, Z) ; @@ -121,7 +121,7 @@ GrB_Info GB_masker // R = masker (C, M, Z) //-------------------------------------------------------------------------- // This phase is identical to phase0 of GB_add, except that Ch is never a - // deep or shallow copy of Mh. + // deep or shallow copy of Mh. R_sparsity may change to hypersparse. info = GB_add_phase0 ( // computed by by phase0: diff --git a/Source/mask/GB_masker_phase1.c b/Source/mask/GB_masker_phase1.c index 33c89f3e94..570fef8e25 100644 --- a/Source/mask/GB_masker_phase1.c +++ b/Source/mask/GB_masker_phase1.c @@ -7,22 +7,24 @@ //------------------------------------------------------------------------------ -// JIT: needed. - // GB_masker_phase1 counts the number of entries in each vector of R, for R = // masker (C,M,Z), and then does a cumulative sum to find Cp. GB_masker_phase1 // is preceded by GB_add_phase0, which finds the non-empty vectors of R. This // phase is done entirely in parallel. -// R, M, C, and Z can be standard sparse or hypersparse, as determined by -// GB_add_phase0. All cases of the mask M are handled: present and not -// complemented, and present and complemented. The mask is always present for -// R=masker(C,M,Z). +// R can be sparse or hypersparse, as determined by GB_add_phase0. M, C, and Z +// can have any sparsity format. All cases of the mask M are handled: present +// and not complemented, and present and complemented. The mask is always +// present for R=masker(C,M,Z). // Rp is either freed by phase2, or transplanted into R. #include "mask/GB_mask.h" #include "include/GB_unused.h" +#include "jitifyer/GB_stringify.h" +#include "include/GB_masker_shared_definitions.h" + +#define GB_FREE_ALL GB_FREE (&Rp, Rp_size) ; GrB_Info GB_masker_phase1 // count nnz in each R(:,j) ( @@ -54,6 +56,8 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) // check inputs //-------------------------------------------------------------------------- + int64_t *restrict Rp = NULL ; size_t Rp_size = 0 ; + ASSERT (Rp_handle != NULL) ; ASSERT (Rp_size_handle != NULL) ; ASSERT (Rnvec_nonempty != NULL) ; @@ -78,7 +82,6 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) ASSERT (C->vdim == Z->vdim && C->vlen == Z->vlen) ; ASSERT (C->vdim == M->vdim && C->vlen == M->vlen) ; - int64_t *restrict Rp = NULL ; size_t Rp_size = 0 ; (*Rp_handle) = NULL ; //-------------------------------------------------------------------------- @@ -96,8 +99,39 @@ GrB_Info GB_masker_phase1 // count nnz in each R(:,j) // count the entries in each vector of R //-------------------------------------------------------------------------- - #define GB_PHASE_1_OF_2 - #include "mask/factory/GB_masker_template.c" + // via the JIT kernel + GrB_Info info = GB_masker_phase1_jit ( + // computed by phase1: + Rp, // output of size Rnvec+1 + Rnvec_nonempty, // # of non-empty vectors in R + // tasks from phase1a: + TaskList, // array of structs + R_ntasks, // # of tasks + R_nthreads, // # of threads to use + // analysis from phase0: + Rnvec, + Rh, + R_to_M, + R_to_C, + R_to_Z, + // original input: + M, // required mask + Mask_comp, // if true, then M is complemented + Mask_struct, // if true, use the only structure of M + C, + Z + ) ; + + if (info == GrB_NO_VALUE) + { + // via the generic kernel + GBURBLE ("(generic masker) ") ; + #define GB_PHASE_1_OF_2 + #include "mask/template/GB_masker_template.c" + info = GrB_SUCCESS ; + } + + GB_OK (info) ; //-------------------------------------------------------------------------- // cumulative sum of Rp and fine tasks in TaskList diff --git a/Source/mask/GB_masker_phase2.c b/Source/mask/GB_masker_phase2.c index 96db52d20b..31cee2e602 100644 --- a/Source/mask/GB_masker_phase2.c +++ b/Source/mask/GB_masker_phase2.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: needed. - // GB_masker_phase2 computes R = masker (C,M,Z). It is preceded first by // GB_add_phase0, which computes the list of vectors of R to compute (Rh) and // their location in C and Z (R_to_[CZ]). Next, GB_masker_phase1 counts the @@ -17,9 +15,10 @@ // GB_masker_phase2 computes the pattern and values of each vector of R(:,j), // entirely in parallel. -// R, M, C, and Z can be standard sparse or hypersparse, as determined by -// GB_add_phase0. All cases of the mask M are handled: present and not -// complemented, and present and complemented. The mask is always present. +// R, M, C, and Z can have any sparsity format (except R cannot be full), as +// determined by GB_add_phase0 and GB_masker_sparsity. All cases of the mask M +// are handled: present and not complemented, and present and complemented. +// The mask is always present. // This function either frees Rp and Rh, or transplants then into R, as R->p // and R->h. Either way, the caller must not free them. @@ -29,6 +28,8 @@ #include "mask/GB_mask.h" #include "slice/GB_ek_slice.h" #include "include/GB_unused.h" +#include "jitifyer/GB_stringify.h" +#include "include/GB_masker_shared_definitions.h" #undef GB_FREE_WORKSPACE #define GB_FREE_WORKSPACE \ @@ -78,6 +79,11 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) // check inputs //-------------------------------------------------------------------------- + GB_WERK_DECLARE (C_ek_slicing, int64_t) ; + GB_WERK_DECLARE (M_ek_slicing, int64_t) ; + int C_nthreads = 0, C_ntasks = 0 ; + int M_nthreads = 0, M_ntasks = 0 ; + ASSERT_MATRIX_OK (M, "M for mask phase2", GB0) ; ASSERT (!GB_ZOMBIES (M)) ; ASSERT (!GB_JUMBLED (M)) ; @@ -101,9 +107,6 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) ASSERT (R != NULL && (R->static_header || GBNSTATIC)) ; - GB_WERK_DECLARE (C_ek_slicing, int64_t) ; - GB_WERK_DECLARE (M_ek_slicing, int64_t) ; - ASSERT (Rp_handle != NULL) ; ASSERT (Rh_handle != NULL) ; int64_t *Rp = (*Rp_handle) ; @@ -177,12 +180,34 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) R->magic = GB_MAGIC ; //-------------------------------------------------------------------------- - // generic worker + // slice C and M, if needed + //-------------------------------------------------------------------------- + + if (R_sparsity == GxB_BITMAP) + { + int nthreads_max = GB_Context_nthreads_max ( ) ; + double chunk = GB_Context_chunk ( ) ; + int64_t C_nnz_held = GB_nnz_held (C) ; + GB_SLICE_MATRIX_WORK (C, 8, C_nnz_held + C->nvec, C_nnz_held) ; + if (GB_IS_SPARSE (M) || GB_IS_HYPERSPARSE (M)) + { + int64_t M_nnz_held = GB_nnz_held (M) ; + GB_SLICE_MATRIX_WORK (M, 8, M_nnz_held + M->nvec, M_nnz_held) ; + } + } + + //-------------------------------------------------------------------------- + // masker phase2 worker //-------------------------------------------------------------------------- #define GB_PHASE_2_OF_2 if (R_iso) { + + //---------------------------------------------------------------------- + // R iso case + //---------------------------------------------------------------------- + // R can be iso only if C and/or Z are iso GBURBLE ("(iso mask) ") ; #define GB_ISO_MASKER @@ -196,13 +221,35 @@ GrB_Info GB_masker_phase2 // phase2 for R = masker (C,M,Z) // C must be iso; copy its iso value into R memcpy (R->x, C->x, czsize) ; } - #include "mask/factory/GB_masker_template.c" + #include "mask/template/GB_masker_template.c" + info = GrB_SUCCESS ; } else { - #include "mask/factory/GB_masker_template.c" + + //---------------------------------------------------------------------- + // via the JIT kernel + //---------------------------------------------------------------------- + + info = GB_masker_phase2_jit (R, TaskList, R_ntasks, R_nthreads, + R_to_M, R_to_C, R_to_Z, M, Mask_comp, Mask_struct, C, Z, + C_ek_slicing, C_ntasks, C_nthreads, + M_ek_slicing, M_ntasks, M_nthreads) ; + + //---------------------------------------------------------------------- + // via the generic kernel + //---------------------------------------------------------------------- + + if (info == GrB_NO_VALUE) + { + GBURBLE ("(generic masker) ") ; + #include "mask/template/GB_masker_template.c" + info = GrB_SUCCESS ; + } } + GB_OK (info) ; + //-------------------------------------------------------------------------- // prune empty vectors from Rh //-------------------------------------------------------------------------- diff --git a/Source/mask/GB_masker_sparsity.c b/Source/mask/GB_masker_sparsity.c index cc67e7e109..b99c8a45de 100644 --- a/Source/mask/GB_masker_sparsity.c +++ b/Source/mask/GB_masker_sparsity.c @@ -12,9 +12,10 @@ // returns GxB_SPARSE. The final determination is made by GB_add_phase0, // as called by GB_masker. -// C is sparse or hypersparse on input. It is never bitmap or full; that -// case is handled by GB_subassign instead. R can be constructed as sparse, -// hypersparse, or bitmap (not full). M and Z can have any sparsity pattern. +// C is sparse or hypersparse on input. It is never bitmap or full; that case +// is handled by GB_subassign and GB_bitmap_assing instead. R can be +// constructed as sparse, hypersparse, or bitmap (not full). M and Z can have +// any sparsity pattern. #include "mask/GB_mask.h" diff --git a/Source/mask/include/GB_masker_shared_definitions.h b/Source/mask/include/GB_masker_shared_definitions.h new file mode 100644 index 0000000000..7630e182a1 --- /dev/null +++ b/Source/mask/include/GB_masker_shared_definitions.h @@ -0,0 +1,148 @@ +//------------------------------------------------------------------------------ +// GB_masker_shared_definitions.h: common macros for masker kernels +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// GB_masker_shared_definitions.h provides default definitions for all masker +// kernels, if the special cases have not been #define'd prior to #include'ing +// this file. This file is shared by generic and both CPU and CUDA JIT +// kernels. There are no factory masker kernels. + +#include "include/GB_kernel_shared_definitions.h" + +#ifndef GB_MASKER_SHARED_DEFINITIONS_H +#define GB_MASKER_SHARED_DEFINITIONS_H + +// the type of R, M, C, and Z +#ifndef GB_R_TYPE +#define GB_R_TYPE GB_void +#endif + +// copy C(i,j) to R(i,j) +#ifndef GB_COPY_C_TO_R +#define GB_COPY_C_TO_R(Rx,pR,Cx,pC,C_iso,rsize) \ + memcpy (Rx +(pR)*rsize, Cx +(C_iso ? 0:(pC)*rsize), rsize) ; +#endif + +// copy Z(i,j) to R(i,j) +#ifndef GB_COPY_Z_TO_R +#define GB_COPY_Z_TO_R(Rx,pR,Zx,pZ,Z_iso,rsize) \ + memcpy (Rx +(pR)*rsize, Zx +(Z_iso ? 0:(pZ)*rsize), rsize) ; +#endif + +// copy a range of values from C to R +#ifndef GB_COPY_C_TO_R_RANGE +#define GB_COPY_C_TO_R_RANGE(Rx,pR,Cx,pC,C_iso,rsize,cjnz) \ +{ \ + if (C_iso) \ + { \ + for (int64_t k = 0 ; k < cjnz ; k++) \ + { \ + /* Rx [pR+k] = Cx [0] */ \ + GB_COPY_C_TO_R (Rx, pR+k, Cx, 0, true, rsize) ; \ + } \ + } \ + else \ + { \ + /* Rx [pR:pR+cjnz-1] = Cx [pC:pC+cjnz-1] */ \ + memcpy (Rx +(pR)*rsize, Cx +(pC)*rsize, (cjnz)*rsize) ; \ + } \ +} +#endif + +// copy a range of values from Z to R +#ifndef GB_COPY_Z_TO_R_RANGE +#define GB_COPY_Z_TO_R_RANGE(Rx,pR,Zx,pZ,Z_iso,rsize,zjnz) \ +{ \ + if (Z_iso) \ + { \ + for (int64_t k = 0 ; k < zjnz ; k++) \ + { \ + /* Rx [pR+k] = Zx [0] */ \ + GB_COPY_Z_TO_R (Rx, pR+k, Zx, 0, true, rsize) ; \ + } \ + } \ + else \ + { \ + /* Rx [pR:pR+zjnz-1] = Zx [pZ:pZ+zjnz-1] */ \ + memcpy (Rx +(pR)*rsize, Zx +(pZ)*rsize, (zjnz)*rsize) ; \ + } \ +} +#endif + +#ifndef GB_MASK_COMP +#define GB_MASK_COMP Mask_comp +#endif + +#ifndef GB_MASK_STRUCT +#define GB_MASK_STRUCT Mask_struct +#endif + +#ifndef GB_NO_MASK +#define GB_NO_MASK 0 +#endif + +#ifndef GB_R_IS_BITMAP +#define GB_R_IS_BITMAP (R_sparsity == GxB_BITMAP) +#endif +#ifndef GB_R_IS_FULL +#define GB_R_IS_FULL false +#endif +#ifndef GB_R_IS_SPARSE +#define GB_R_IS_SPARSE (R_sparsity== GxB_SPARSE) +#endif +#ifndef GB_R_IS_HYPER +#define GB_R_IS_HYPER (R_sparsity == GxB_HYPERSPARSE) +#endif + +#ifndef GB_C_IS_BITMAP +#define GB_C_IS_BITMAP C_is_bitmap +#endif +#ifndef GB_C_IS_FULL +#define GB_C_IS_FULL C_is_full +#endif +#ifndef GB_C_IS_SPARSE +#define GB_C_IS_SPARSE C_is_sparse +#endif +#ifndef GB_C_IS_HYPER +#define GB_C_IS_HYPER C_is_hyper +#endif +#ifndef GB_C_ISO +#define GB_C_ISO C_iso +#endif + +#ifndef GB_M_IS_BITMAP +#define GB_M_IS_BITMAP M_is_bitmap +#endif +#ifndef GB_M_IS_FULL +#define GB_M_IS_FULL M_is_full +#endif +#ifndef GB_M_IS_SPARSE +#define GB_M_IS_SPARSE M_is_sparse +#endif +#ifndef GB_M_IS_HYPER +#define GB_M_IS_HYPER M_is_hyper +#endif + +#ifndef GB_Z_IS_BITMAP +#define GB_Z_IS_BITMAP Z_is_bitmap +#endif +#ifndef GB_Z_IS_FULL +#define GB_Z_IS_FULL Z_is_full +#endif +#ifndef GB_Z_IS_SPARSE +#define GB_Z_IS_SPARSE Z_is_sparse +#endif +#ifndef GB_Z_IS_HYPER +#define GB_Z_IS_HYPER Z_is_hyper +#endif +#ifndef GB_Z_ISO +#define GB_Z_ISO Z_iso +#endif + +#endif + diff --git a/Source/mask/factory/GB_bitmap_masker_template.c b/Source/mask/template/GB_bitmap_masker_template.c similarity index 86% rename from Source/mask/factory/GB_bitmap_masker_template.c rename to Source/mask/template/GB_bitmap_masker_template.c index 08c3be7b7f..eaac6fb5c0 100644 --- a/Source/mask/factory/GB_bitmap_masker_template.c +++ b/Source/mask/template/GB_bitmap_masker_template.c @@ -46,16 +46,17 @@ int64_t p, rnvals = 0 ; - ASSERT (R_sparsity == GxB_BITMAP) ; - ASSERT (C_is_sparse || C_is_hyper) ; - ASSERT (Z_is_bitmap || Z_is_full) ; + ASSERT (GB_R_IS_BITMAP) ; + ASSERT (GB_C_IS_SPARSE || GB_C_IS_HYPER) ; + ASSERT (GB_Z_IS_BITMAP || GB_Z_IS_FULL) ; //-------------------------------------------------------------------------- // scatter C into the R bitmap //-------------------------------------------------------------------------- - GB_C_NHELD (C_nnz_held) ; - GB_SLICE_MATRIX_WORK (C, 8, C_nnz_held + C->nvec, C_nnz_held) ; + const int64_t *kfirst_Cslice = C_ek_slicing ; + const int64_t *klast_Cslice = C_ek_slicing + C_ntasks ; + const int64_t *pstart_Cslice = C_ek_slicing + C_ntasks*2 ; #pragma omp parallel for num_threads(C_nthreads) schedule(dynamic,1) \ reduction(+:rnvals) @@ -67,9 +68,8 @@ { // find the part of C(:,k) for this task int64_t j = GBH_C (Ch, k) ; - int64_t pC_start, pC_end ; - GB_get_pA (&pC_start, &pC_end, taskid, k, kfirst, - klast, pstart_Cslice, Cp, vlen) ; + GB_GET_PA (pC_start, pC_end, taskid, k,kfirst,klast, pstart_Cslice, + Cp [k], Cp [k+1]) ; int64_t pR_start = j * vlen ; // traverse over C(:,j), the kth vector of C for (int64_t pC = pC_start ; pC < pC_end ; pC++) @@ -80,7 +80,8 @@ Rb [pR] = 1 ; rnvals++ ; #ifndef GB_ISO_MASKER - memcpy (Rx + (pR)*rsize, Cx + (C_iso? 0:(pC)*rsize), rsize) ; +// memcpy (Rx + (pR)*rsize, Cx + (C_iso? 0:(pC)*rsize), rsize) ; + GB_COPY_C_TO_R (Rx, pR, Cx, pC, C_iso, rsize) ; #endif } } @@ -92,7 +93,7 @@ // R=Z or R=Z //-------------------------------------------------------------------------- - if (M_is_sparse || M_is_hyper) + if (GB_M_IS_SPARSE || GB_M_IS_HYPER) { //---------------------------------------------------------------------- @@ -106,14 +107,15 @@ // sparse sparse bitmap bitmap // sparse sparse full bitmap - ASSERT (Mask_comp) ; + ASSERT (GB_MASK_COMP) ; //---------------------------------------------------------------------- // scatter M into the R bitmap //---------------------------------------------------------------------- - GB_M_NHELD (M_nnz_held) ; - GB_SLICE_MATRIX_WORK (M, 8, M_nnz_held + M->nvec, M_nnz_held) ; + const int64_t *kfirst_Mslice = M_ek_slicing ; + const int64_t *klast_Mslice = M_ek_slicing + M_ntasks ; + const int64_t *pstart_Mslice = M_ek_slicing + M_ntasks*2 ; #pragma omp parallel for num_threads(M_nthreads) schedule(dynamic,1) for (taskid = 0 ; taskid < M_ntasks ; taskid++) @@ -124,9 +126,8 @@ { // find the part of M(:,k) for this task int64_t j = GBH_M (Mh, k) ; - int64_t pM_start, pM_end ; - GB_get_pA (&pM_start, &pM_end, taskid, k, kfirst, - klast, pstart_Mslice, Mp, vlen) ; + GB_GET_PA (pM_start, pM_end, taskid, k, kfirst, klast, + pstart_Mslice, Mp [k], Mp [k+1]) ; int64_t pR_start = j * vlen ; // traverse over M(:,j), the kth vector of M for (int64_t pM = pM_start ; pM < pM_end ; pM++) @@ -171,7 +172,7 @@ for (p = 0 ; p < rnz ; p++) { int8_t r = Rb [p] ; - int8_t z = GBB (Zb, p) ; + int8_t z = GBB_Z (Zb, p) ; switch (r) { case 0 : // R(i,j) not present, M(i,j) false @@ -179,7 +180,8 @@ { // R(i,j) = Z(i,j), insert new value #ifndef GB_ISO_MASKER - memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); +// memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); + GB_COPY_Z_TO_R (Rx, p, Zx, p, Z_iso, rsize) ; #endif Rb [p] = 1 ; rnvals++ ; @@ -191,7 +193,8 @@ { // R(i,j) = Z(i,j), update prior value #ifndef GB_ISO_MASKER - memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); +// memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); + GB_COPY_Z_TO_R (Rx, p, Zx, p, Z_iso, rsize) ; #endif } else @@ -259,10 +262,10 @@ for (p = 0 ; p < rnz ; p++) { bool mij = GBB_M (Mb, p) && GB_MCAST (Mx, p, msize) ; - if (Mask_comp) mij = !mij ; + if (GB_MASK_COMP) mij = !mij ; if (mij) { - int8_t z = GBB (Zb, p) ; + int8_t z = GBB_Z (Zb, p) ; int8_t r = Rb [p] ; if (r) { @@ -270,7 +273,8 @@ { // R(i,j) = Z(i,j), update, no change to rnvals #ifndef GB_ISO_MASKER - memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); +// memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize); + GB_COPY_Z_TO_R (Rx, p, Zx, p, Z_iso, rsize) ; #endif } else @@ -284,7 +288,8 @@ { // R(i,j) = Z(i,j), new entry #ifndef GB_ISO_MASKER - memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize) ; +// memcpy (Rx +(p)*rsize, Zx +(Z_iso? 0:(p)*rsize), rsize) ; + GB_COPY_Z_TO_R (Rx, p, Zx, p, Z_iso, rsize) ; #endif Rb [p] = 1 ; rnvals++ ; diff --git a/Source/mask/factory/GB_masker_template.c b/Source/mask/template/GB_masker_template.c similarity index 79% rename from Source/mask/factory/GB_masker_template.c rename to Source/mask/template/GB_masker_template.c index 6dd31a4769..7a8b067d4d 100644 --- a/Source/mask/factory/GB_masker_template.c +++ b/Source/mask/template/GB_masker_template.c @@ -33,33 +33,35 @@ const int8_t *restrict Cb = C->b ; const int64_t *restrict Ci = C->i ; const int64_t vlen = C->vlen ; + #ifndef GB_JIT_KERNEL const bool C_is_hyper = GB_IS_HYPERSPARSE (C) ; const bool C_is_sparse = GB_IS_SPARSE (C) ; const bool C_is_bitmap = GB_IS_BITMAP (C) ; const bool C_is_full = GB_IS_FULL (C) ; - int C_nthreads, C_ntasks ; + #endif const int64_t *restrict Zp = Z->p ; const int64_t *restrict Zh = Z->h ; const int8_t *restrict Zb = Z->b ; const int64_t *restrict Zi = Z->i ; + #ifndef GB_JIT_KERNEL const bool Z_is_hyper = GB_IS_HYPERSPARSE (Z) ; const bool Z_is_sparse = GB_IS_SPARSE (Z) ; const bool Z_is_bitmap = GB_IS_BITMAP (Z) ; const bool Z_is_full = GB_IS_FULL (Z) ; - int Z_nthreads, Z_ntasks ; + #endif const int64_t *restrict Mp = NULL ; const int64_t *restrict Mh = NULL ; const int8_t *restrict Mb = NULL ; const int64_t *restrict Mi = NULL ; const GB_M_TYPE *restrict Mx = NULL ; + #ifndef GB_JIT_KERNEL const bool M_is_hyper = GB_IS_HYPERSPARSE (M) ; const bool M_is_sparse = GB_IS_SPARSE (M) ; const bool M_is_bitmap = GB_IS_BITMAP (M) ; const bool M_is_full = GB_IS_FULL (M) ; - const bool M_is_sparse_or_hyper = M_is_sparse || M_is_hyper ; - int M_nthreads, M_ntasks ; + #endif size_t msize = 0 ; if (M != NULL) { @@ -67,17 +69,19 @@ Mh = M->h ; Mb = M->b ; Mi = M->i ; - Mx = (GB_M_TYPE *) (Mask_struct ? NULL : (M->x)) ; + Mx = (GB_M_TYPE *) (GB_MASK_STRUCT ? NULL : (M->x)) ; msize = M->type->size ; } #if defined ( GB_PHASE_2_OF_2 ) + #ifndef GB_JIT_KERNEL const bool Z_iso = Z->iso ; const bool C_iso = C->iso ; + #endif #ifndef GB_ISO_MASKER - const GB_void *restrict Cx = (GB_void *) C->x ; - const GB_void *restrict Zx = (GB_void *) Z->x ; - GB_void *restrict Rx = (GB_void *) R->x ; + const GB_R_TYPE *restrict Cx = (GB_R_TYPE *) C->x ; + const GB_R_TYPE *restrict Zx = (GB_R_TYPE *) Z->x ; + GB_R_TYPE *restrict Rx = (GB_R_TYPE *) R->x ; #endif const int64_t *restrict Rp = R->p ; const int64_t *restrict Rh = R->h ; @@ -85,9 +89,8 @@ int64_t *restrict Ri = R->i ; size_t rsize = R->type->size ; // when R is bitmap or full: - const int64_t rnz = GB_nnz_held (R) ; - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; +// const int64_t rnz = GB_nnz_held (R) ; + GB_R_NHELD (rnz) ; #endif //-------------------------------------------------------------------------- @@ -96,22 +99,22 @@ #if defined ( GB_PHASE_1_OF_2 ) { - // phase1 - #include "mask/factory/GB_sparse_masker_template.c" + // phase1: R is always sparse or hypersparse + #include "template/GB_sparse_masker_template.c" } #else { // phase2 - if (R_sparsity == GxB_SPARSE || R_sparsity == GxB_HYPERSPARSE) + if (GB_R_IS_SPARSE || GB_R_IS_HYPER) { // R is sparse or hypersparse (phase1 and phase2) - #include "mask/factory/GB_sparse_masker_template.c" + #include "template/GB_sparse_masker_template.c" } - else // R_sparsity == GxB_BITMAP + else // R is bitmap { // R is bitmap (phase2 only) - ASSERT (R_sparsity == GxB_BITMAP) ; - #include "mask/factory/GB_bitmap_masker_template.c" + ASSERT (GB_R_IS_BITMAP) ; + #include "template/GB_bitmap_masker_template.c" } } #endif diff --git a/Source/mask/factory/GB_sparse_masker_template.c b/Source/mask/template/GB_sparse_masker_template.c similarity index 91% rename from Source/mask/factory/GB_sparse_masker_template.c rename to Source/mask/template/GB_sparse_masker_template.c index 915bbeae04..7bcf1e86db 100644 --- a/Source/mask/factory/GB_sparse_masker_template.c +++ b/Source/mask/template/GB_sparse_masker_template.c @@ -61,7 +61,8 @@ #define GB_COPY_Z \ { \ Ri [pR] = i ; \ - memcpy (Rx +(pR)*rsize, Zx +(Z_iso ? 0:(pZ)*rsize), rsize) ; \ + /* memcpy (Rx +(pR)*rsize, Zx +(Z_iso ? 0:(pZ)*rsize), rsize) ; */ \ + GB_COPY_Z_TO_R (Rx, pR, Zx, pZ, Z_iso, rsize) ; \ pR++ ; \ } #endif @@ -74,13 +75,13 @@ #if defined ( GB_PHASE_1_OF_2 ) #define GB_COPY_Z_BITMAP_OR_FULL \ { \ - rjnz += GBB (Zb, pZ_start + i - iZ_first) ; \ + rjnz += GBB_Z (Zb, pZ_start + i - iZ_first) ; \ } #elif defined ( GB_ISO_MASKER ) #define GB_COPY_Z_BITMAP_OR_FULL \ { \ int64_t pZ = pZ_start + i - iZ_first ; \ - if (GBB (Zb, pZ)) \ + if (GBB_Z (Zb, pZ)) \ { \ Ri [pR] = i ; \ pR++ ; \ @@ -90,10 +91,11 @@ #define GB_COPY_Z_BITMAP_OR_FULL \ { \ int64_t pZ = pZ_start + i - iZ_first ; \ - if (GBB (Zb, pZ)) \ + if (GBB_Z (Zb, pZ)) \ { \ Ri [pR] = i ; \ - memcpy (Rx +(pR)*rsize, Zx +(Z_iso ? 0:(pZ)*rsize), rsize) ; \ + /* memcpy (Rx +(pR)*rsize, Zx +(Z_iso ? 0:(pZ)*rsize), rsize) ; */ \ + GB_COPY_Z_TO_R (Rx, pR, Zx, pZ, Z_iso, rsize) ; \ pR++ ; \ } \ } @@ -119,7 +121,8 @@ #define GB_COPY_C \ { \ Ri [pR] = i ; \ - memcpy (Rx +(pR)*rsize, Cx +(C_iso ? 0:(pC)*rsize), rsize) ; \ + /* memcpy (Rx +(pR)*rsize, Cx +(C_iso ? 0:(pC)*rsize), rsize) ; */ \ + GB_COPY_C_TO_R (Rx, pR, Cx, pC, C_iso, rsize) ; \ pR++ ; \ } #endif @@ -135,7 +138,7 @@ // phase2: compute C //-------------------------------------------------------------------------- - ASSERT (C_is_sparse || C_is_hyper) ; + ASSERT (GB_C_IS_SPARSE || GB_C_IS_HYPER) ; #pragma omp parallel for num_threads(R_nthreads) schedule(dynamic,1) for (taskid = 0 ; taskid < R_ntasks ; taskid++) @@ -172,7 +175,7 @@ // get j, the kth vector of R //------------------------------------------------------------------ - int64_t j = GBH (Rh, k) ; + int64_t j = GBH_R (Rh, k) ; #if defined ( GB_PHASE_1_OF_2 ) int64_t rjnz = 0 ; @@ -253,8 +256,8 @@ int64_t kZ = (R_to_Z == NULL) ? j : R_to_Z [k] ; if (kZ >= 0) { - pZ = GBP (Zp, kZ, vlen) ; - pZ_end = GBP (Zp, kZ+1, vlen) ; + pZ = GBP_Z (Zp, kZ, vlen) ; + pZ_end = GBP_Z (Zp, kZ+1, vlen) ; } } @@ -265,8 +268,8 @@ int64_t iZ_first = -1, iZ_last = -1 ; if (zjnz > 0) { - iZ_first = GBI (Zi, pZ, vlen) ; - iZ_last = GBI (Zi, pZ_end-1, vlen) ; + iZ_first = GBI_Z (Zi, pZ, vlen) ; + iZ_last = GBI_Z (Zi, pZ_end-1, vlen) ; } //------------------------------------------------------------------ @@ -304,7 +307,7 @@ // R(:,j) = masker (C (:,j), M (:,j), Z (:,j)) //------------------------------------------------------------------ - if (Z_is_bitmap || Z_is_full) + if (GB_Z_IS_BITMAP || GB_Z_IS_FULL) { //-------------------------------------------------------------- @@ -322,8 +325,8 @@ // Otherwise, R is bitmap and not computed here, but in // GB_bitmap_masker_template instead. - ASSERT (M_is_sparse || M_is_hyper) ; - ASSERT (!Mask_comp) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; + ASSERT (!GB_MASK_COMP) ; // 2-way merge of C(:,j) and M(:,j) and direct lookup of Z @@ -419,9 +422,9 @@ // sparse sparse sparse sparse // Z must be sparse or hypersparse - ASSERT (Z_is_sparse || Z_is_hyper) ; + ASSERT (GB_Z_IS_SPARSE || GB_Z_IS_HYPER) ; - if (!Mask_comp) + if (!GB_MASK_COMP) { //---------------------------------------------------------- @@ -433,19 +436,20 @@ rjnz = cjnz ; #else ASSERT (rjnz == cjnz) ; - memcpy (Ri +(pR), Ci +(pC), cjnz * sizeof (int64_t)) ; + memcpy (Ri +(pR), Ci +(pC), cjnz * sizeof (int64_t)) ; #ifndef GB_ISO_MASKER - if (C_iso) - { - for (int64_t k = 0 ; k < cjnz ; k++) - { - memcpy (Rx +(pR+k)*rsize, Cx, rsize) ; - } - } - else - { - memcpy (Rx +(pR)*rsize, Cx +(pC)*rsize, cjnz*rsize) ; - } + GB_COPY_C_TO_R_RANGE (Rx, pR, Cx, pC, C_iso, rsize, cjnz) ; +// if (C_iso) +// { +// for (int64_t k = 0 ; k < cjnz ; k++) +// { +// memcpy (Rx +(pR+k)*rsize, Cx, rsize) ; +// } +// } +// else +// { +// memcpy (Rx +(pR)*rsize, Cx +(pC)*rsize, cjnz*rsize) ; +// } #endif #endif @@ -464,17 +468,19 @@ ASSERT (rjnz == zjnz) ; memcpy (Ri +(pR), Zi +(pZ), zjnz * sizeof (int64_t)) ; #ifndef GB_ISO_MASKER - if (Z_iso) - { - for (int64_t k = 0 ; k < zjnz ; k++) - { - memcpy (Rx +(pR+k)*rsize, Zx, rsize) ; - } - } - else - { - memcpy (Rx +(pR)*rsize, Zx +(pZ)*rsize, zjnz*rsize) ; - } + GB_COPY_Z_TO_R_RANGE (Rx, pR, Zx, pZ, Z_iso, rsize, zjnz) ; +// if (Z_iso) +// { +// for (int64_t k = 0 ; k < zjnz ; k++) +// { +// memcpy (Rx +(pR+k)*rsize, Zx, rsize) ; +// } +// } +// else +// { +// memcpy (Rx +(pR)*rsize, Zx +(pZ)*rsize, zjnz*rsize) ; +// } + #endif #endif } @@ -507,7 +513,7 @@ // present), but both C and Z are stored in a sparse or // hypersparse sparsity structure. M has any sparsity. - ASSERT (Z_is_sparse || Z_is_hyper) ; + ASSERT (GB_Z_IS_SPARSE || GB_Z_IS_HYPER) ; ASSERT (cjnz == zjnz) ; ASSERT (iC_first == iZ_first) ; @@ -527,19 +533,21 @@ mij = GBB_M (Mb, pM) && GB_MCAST (Mx, pM, msize) ; pM++ ; } - if (Mask_comp) mij = !mij ; + if (GB_MASK_COMP) mij = !mij ; #ifndef GB_ISO_MASKER if (mij) { // R(i,j) = Z (i,j) - memcpy (Rx +(pR+p)*rsize, Zx +(Z_iso? 0:(pZ+p)*rsize), - rsize) ; +// memcpy (Rx +(pR+p)*rsize, Zx +(Z_iso? 0:(pZ+p)*rsize), +// rsize) ; + GB_COPY_Z_TO_R (Rx, pR+p, Zx, pZ+p, Z_iso, rsize) ; } else { // R(i,j) = C (i,j) - memcpy (Rx +(pR+p)*rsize, Cx +(C_iso? 0:(pC+p)*rsize), - rsize) ; +// memcpy (Rx +(pR+p)*rsize, Cx +(C_iso? 0:(pC+p)*rsize), +// rsize) ; + GB_COPY_C_TO_R (Rx, pR+p, Cx, pC+p, C_iso, rsize) ; } #endif } @@ -554,7 +562,7 @@ //-------------------------------------------------------------- // Z is sparse or hypersparse; M has any sparsity structure - ASSERT (Z_is_sparse || Z_is_hyper) ; + ASSERT (GB_Z_IS_SPARSE || GB_Z_IS_HYPER) ; //-------------------------------------------------------------- // Z is sparse or hypersparse, M has any sparsity @@ -622,7 +630,7 @@ // Use GB_SPLIT_BINARY_SEARCH so that pM can be used in // the for loop with index pM in the wrapup phase. - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; int64_t pright = pM_end - 1 ; bool found ; GB_SPLIT_BINARY_SEARCH (i, Mi, pM, pright, found) ; @@ -635,7 +643,7 @@ } } - if (Mask_comp) mij = !mij ; + if (GB_MASK_COMP) mij = !mij ; //---------------------------------------------------------- // R(i,j) = C(i,j) or Z(i,j) @@ -685,7 +693,7 @@ // C(:,j) is empty //---------------------------------------------------------- - if (!Mask_comp) + if (!GB_MASK_COMP) { //------------------------------------------------------ @@ -721,7 +729,7 @@ // This loop requires pM to start at the first // entry in M(:,j) that has not yet been handled. - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; for ( ; pM < pM_end ; pM++) { if (GB_MCAST (Mx, pM, msize)) @@ -742,7 +750,7 @@ // Method04e: M(:,j) is much denser than Z(:,j) //-------------------------------------------------- - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; for ( ; pZ < pZ_end ; pZ++) { // wrapup, C now empty, M(:,j) much denser than @@ -764,7 +772,7 @@ // Method04f: M(:,j) and Z(:,j) about same # entries //-------------------------------------------------- - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; while (pM < pM_end && pZ < pZ_end) { int64_t iM = Mi [pM] ; @@ -822,7 +830,7 @@ // Method04h: M(:,j) is sparse //-------------------------------------------------- - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; for ( ; pZ < pZ_end ; pZ++) { int64_t i = Zi [pZ] ; @@ -844,7 +852,7 @@ // Z(:,j) is empty //---------------------------------------------------------- - if (Mask_comp) + if (GB_MASK_COMP) { //------------------------------------------------------ @@ -877,7 +885,7 @@ // Method04j: C(:,j) is much denser than M(:,j) //-------------------------------------------------- - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; for ( ; pM < pM_end ; pM++) { if (GB_MCAST (Mx, pM, msize)) @@ -898,7 +906,7 @@ // Method04k: M(:,j) is much denser than C(:,j) //-------------------------------------------------- - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; for ( ; pC < pC_end ; pC++) { int64_t i = Ci [pC] ; @@ -918,7 +926,7 @@ // Method04l: M(:,j) and C(:,j) about same # entries //-------------------------------------------------- - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; while (pM < pM_end && pC < pC_end) { int64_t iM = Mi [pM] ; @@ -976,7 +984,7 @@ // Method04n: M(:,j) is sparse //-------------------------------------------------- - ASSERT (M_is_sparse || M_is_hyper) ; + ASSERT (GB_M_IS_SPARSE || GB_M_IS_HYPER) ; for ( ; pC < pC_end ; pC++) { int64_t i = Ci [pC] ; diff --git a/Source/math/GB_bitwise.h b/Source/math/GB_bitwise.h index c404be0d98..b27cfb9dca 100644 --- a/Source/math/GB_bitwise.h +++ b/Source/math/GB_bitwise.h @@ -244,8 +244,8 @@ inline uint64_t GB_bitset_uint64 (uint64_t x, uint64_t k) // bitclr (x,k) returns x modified by setting a bit from x to 0, whose position // is given by k. If k is in the range 1 to bits, then k gives the position of -// the bit to clear. If k is outside the range 1 to GB_BITS, then z = x is -// returned, unmodified. +// the bit to clear. If k is outside the range 1 to the # of bits in x, then z +// = x is returned, unmodified. inline int8_t GB_bitclr_int8 (int8_t x, int8_t k) { diff --git a/Source/math/include/GB_binary_search.h b/Source/math/include/GB_binary_search.h index 4634363b99..93a76e4645 100644 --- a/Source/math/include/GB_binary_search.h +++ b/Source/math/include/GB_binary_search.h @@ -117,7 +117,7 @@ while (pleft < pright) \ { \ int64_t pmiddle = (pleft + pright) / 2 ; \ - if (i > GB_UNFLIP (X [pmiddle])) \ + if (i > GB_UNZOMBIE (X [pmiddle])) \ { \ /* if in the list, it appears in [pmiddle+1..pright] */ \ pleft = pmiddle + 1 ; \ @@ -150,7 +150,7 @@ is_zombie = GB_IS_ZOMBIE (i2) ; \ if (is_zombie) \ { \ - i2 = GB_FLIP (i2) ; \ + i2 = GB_DEZOMBIE (i2) ; \ } \ found = (i == i2) ; \ } \ @@ -179,7 +179,7 @@ is_zombie = GB_IS_ZOMBIE (i2) ; \ if (is_zombie) \ { \ - i2 = GB_FLIP (i2) ; \ + i2 = GB_DEZOMBIE (i2) ; \ } \ found = (i == i2) ; \ if (!found) \ diff --git a/Source/math/include/GB_zombie.h b/Source/math/include/GB_zombie.h index 8838b16d15..1cbc0316d8 100644 --- a/Source/math/include/GB_zombie.h +++ b/Source/math/include/GB_zombie.h @@ -10,12 +10,12 @@ #ifndef GB_ZOMBIE_H #define GB_ZOMBIE_H -// GB_FLIP is a kind of "negation" about (-1) of a zero-based index. -// If i >= 0 then it is not flipped. -// If i < 0 then it has been flipped. -// Like negation, GB_FLIP is its own inverse: GB_FLIP (GB_FLIP (i)) == i. -// The "nil" value, -1, doesn't change when flipped: GB_FLIP (-1) = -1. -// GB_UNFLIP(i) is like taking an absolute value, undoing any GB_FLIP(i). +// GB_ZOMBIE is a kind of "negation" about (-1) of a zero-based index. +// If i >= 0 then it is not a zombie. +// If i < 0 then it has been marked as a zombie. +// Like negation, GB_ZOMBIE is its own inverse: GB_ZOMBIE (GB_ZOMBIE (i)) == i. +// The "nil" value, -1, doesn't change: GB_ZOMBIE (-1) = -1. +// GB_UNZOMBIE(i) is like taking an absolute value, undoing any GB_ZOMBIE(i). // An entry A(i,j) in a matrix can be marked as a "zombie". A zombie is an // entry that has been marked for deletion, but hasn't been deleted yet because @@ -24,16 +24,17 @@ // not only new entries into C, but it also deletes entries already present in // C. If an entry appears in A but not C(I,J), it is a new entry; new entries // placed in the pending tuple lists to be added later. If an entry appear in -// C(I,J) but NOT in A, then it is marked for deletion by flipping its row -// index, marking it as a zombie. +// C(I,J) but NOT in A, then it is marked for deletion by marking its row index +// as a zombie. // Zombies can be restored as regular entries by GrB_*assign. If an assignment // C(I,J)=A finds an entry in A that is a zombie in C, the zombie becomes a -// regular entry, taking on the value from A. The row index is unflipped. +// regular entry, taking on the value from A. The row index is 'dezombied' // Zombies are deleted and pending tuples are added into the matrix all at // once, by GB_wait. +/* OLD: #define GB_FLIP(i) (-(i)-2) #define GB_IS_FLIPPED(i) ((i) < 0) #define GB_IS_ZOMBIE(i) ((i) < 0) @@ -41,6 +42,25 @@ #define GB_UNFLIP(i) (((i) < 0) ? GB_FLIP(i) : (i)) #define GBI_UNFLIP(Ai,p,avlen) \ ((Ai == NULL) ? ((p) % (avlen)) : GB_UNFLIP (Ai [p])) +*/ + +// NEW: +// replace GB_FLIP with GB_ZOMBIE. +// add GB_DEZOMBIE (same as GB_FLIP and GB_ZOMBIE). +// no change to GB_IS_ZOMBIE. +// delete GB_IS_FLIPPED and GB_IS_NOT_FLIPPED. +// replace GB_UNFLIP with GB_UNZOMBIE. +// replace GBI_UNFLIP with GBI_UNZOMBIE. + +#define GB_ZOMBIE(i) (-(i)-2) +#define GB_DEZOMBIE(i) (-(i)-2) + +#define GB_IS_ZOMBIE(i) ((i) < 0) + +#define GB_UNZOMBIE(i) (((i) < 0) ? GB_ZOMBIE(i) : (i)) + +#define GBI_UNZOMBIE(Ai,p,avlen) \ + ((Ai == NULL) ? ((p) % (avlen)) : GB_UNZOMBIE (Ai [p])) #endif diff --git a/Source/matrix/GB_new.h b/Source/matrix/GB_new.h index b2ea50b727..cfa9351efa 100644 --- a/Source/matrix/GB_new.h +++ b/Source/matrix/GB_new.h @@ -59,9 +59,6 @@ GrB_Info GB_new_bix // create a new matrix, incl. A->b, A->i, A->x const bool iso // if true, allocate A as iso ) ; -// See GB_callbacks.h: -// GB_CALLBACK_BIX_ALLOC_PROTO (GB_bix_alloc) ; - GrB_Info GB_ix_realloc // reallocate space in a matrix ( GrB_Matrix A, // matrix to allocate space for diff --git a/Source/matrix/GB_static_header.h b/Source/matrix/include/GB_static_header.h similarity index 91% rename from Source/matrix/GB_static_header.h rename to Source/matrix/include/GB_static_header.h index 04fd5384db..107edeba4d 100644 --- a/Source/matrix/GB_static_header.h +++ b/Source/matrix/include/GB_static_header.h @@ -2,7 +2,7 @@ // GB_static_header.h: macros for allocating static headers //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -12,8 +12,9 @@ // matrices on the CPU, but the static headers do not get automatically // transfered to the GPU. Only dynamically allocated headers, allocated by // rmm_wrap_malloc, get transfered. Set this to 1 to turn off static headers -// (required for CUDA; see GB_static_headers.h). Leave static headers -// enabled by default by leaving this commented out or setting GBNSTATIC to 0. +// (required for CUDA). Leave static headers enabled by default by leaving +// this commented out or setting GBNSTATIC to 0. + // #undef GBNSTATIC // #define GBNSTATIC 1 @@ -62,7 +63,6 @@ static inline GrB_Matrix GB_clear_static_header // clear a static header GrB_Matrix C // static header to clear ) { - ASSERT (C != NULL) ; memset (C, 0, sizeof (struct GB_Matrix_opaque)) ; C->static_header = true ; return (C) ; diff --git a/Source/memory/GB_memcpy.c b/Source/memory/GB_memcpy.c index 1710da380d..c1ff100e20 100644 --- a/Source/memory/GB_memcpy.c +++ b/Source/memory/GB_memcpy.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Note that this function uses its own hard-coded chunk size. #include "GB.h" @@ -24,7 +22,7 @@ void GB_memcpy // parallel memcpy ) { - // FIXME for CUDA: do: + // Fixme for CUDA: do: // cpu <- cpu (already done below) // cpu <- gpu (effectively done below but could be better) // gpu <- cpu (need this) diff --git a/Source/memory/GB_memory.h b/Source/memory/GB_memory.h index 6ea38781e8..5d37b46684 100644 --- a/Source/memory/GB_memory.h +++ b/Source/memory/GB_memory.h @@ -23,11 +23,6 @@ void GB_memoryUsage // count # allocated blocks and their sizes bool count_hyper_hash // if true, include A->Y ) ; -// See GB_callbacks.h: -// GB_CALLBACK_MALLOC_MEMORY_PROTO (GB_malloc_memory) ; -// GB_CALLBACK_FREE_MEMORY_PROTO (GB_free_memory) ; -// GB_CALLBACK_MEMSET_PROTO (GB_memset) ; - void *GB_calloc_memory // pointer to allocated block of memory ( size_t nitems, // number of items to allocate diff --git a/Source/memory/GB_memset.c b/Source/memory/GB_memset.c index 64e439b50e..a5d69909df 100644 --- a/Source/memory/GB_memset.c +++ b/Source/memory/GB_memset.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Note that this function uses its own hard-coded chunk size. #include "GB.h" diff --git a/Source/monoid/GxB_Monoid_identity.c b/Source/monoid/GxB_Monoid_identity.c index eb52282e6d..1c83be5bf3 100644 --- a/Source/monoid/GxB_Monoid_identity.c +++ b/Source/monoid/GxB_Monoid_identity.c @@ -14,7 +14,7 @@ GrB_Info GxB_Monoid_identity // return the monoid identity void *identity, // returns the identity of the monoid GrB_Monoid monoid // monoid to query ) -{ +{ //-------------------------------------------------------------------------- // check inputs diff --git a/Source/mxm/GB_AxB__any_pair_iso.c b/Source/mxm/GB_AxB__any_pair_iso.c index f478e154e4..fac978f59f 100644 --- a/Source/mxm/GB_AxB__any_pair_iso.c +++ b/Source/mxm/GB_AxB__any_pair_iso.c @@ -7,8 +7,10 @@ //------------------------------------------------------------------------------ -#include "GB.h" #include "GB_control.h" +#define GB_TYPE_ENABLED 1 +#if GB_TYPE_ENABLED +#include "GB.h" #include "mxm/GB_AxB_saxpy.h" #include "include/GB_unused.h" #include "assign/GB_bitmap_assign_methods.h" @@ -350,3 +352,5 @@ GrB_Info GB (_Asaxpy3B__any_pair_iso) #endif +#endif + diff --git a/Source/mxm/GB_AxB_dot.c b/Source/mxm/GB_AxB_dot.c index c53e7eda4f..10d4cbc8df 100644 --- a/Source/mxm/GB_AxB_dot.c +++ b/Source/mxm/GB_AxB_dot.c @@ -187,7 +187,7 @@ GrB_Info GB_AxB_dot // dot product (multiple methods) GB_sparsity_char_matrix (B)) ; #if defined ( GRAPHBLAS_HAS_CUDA ) - if (!C_iso && // FIXME for CUDA, remove and create C iso on output + if (!C_iso && // Fixme for CUDA, remove and create C iso on output GB_cuda_AxB_dot3_branch (M, Mask_struct, A, B, semiring, flipxy)) { info = (GB_cuda_AxB_dot3 (C, M, Mask_struct, A, B, semiring, diff --git a/Source/mxm/GB_AxB_dot2.c b/Source/mxm/GB_AxB_dot2.c index 6a819d2122..b60cd2d630 100644 --- a/Source/mxm/GB_AxB_dot2.c +++ b/Source/mxm/GB_AxB_dot2.c @@ -22,8 +22,6 @@ // performance is not as good as it could be. For large problems, C=(A')*B is // faster with the saxpy3 method, as compared to this method with C=A'*B. -// JIT: done. - #define GB_FREE_WORKSPACE \ { \ GB_Matrix_free (&Mwork) ; \ @@ -47,6 +45,7 @@ #include "jitifyer/GB_stringify.h" #include "mxm/GB_AxB__include1.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif @@ -384,12 +383,9 @@ GrB_Info GB_AxB_dot2 // C=A'*B or C<#M>=A'*B, dot product method ASSERT (C_sparsity == GxB_BITMAP) ; int M_ntasks, M_nthreads ; GB_SLICE_MATRIX (M, 8) ; - // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, - NULL, 0, GB_ALL, NULL, NULL, 0, GB_ALL, NULL, - M, Mask_struct, GB_ASSIGN, GB_BITMAP_M_SCATTER_PLUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + GB_bitmap_M_scatter_whole (C, M, Mask_struct, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero // Cb (i,j) = 1: cij present, mij zero (not used yet) diff --git a/Source/mxm/GB_AxB_dot3.c b/Source/mxm/GB_AxB_dot3.c index 9547c5a20a..f81bf7da11 100644 --- a/Source/mxm/GB_AxB_dot3.c +++ b/Source/mxm/GB_AxB_dot3.c @@ -12,13 +12,12 @@ // applied. C and M are both sparse or hypersparse, and have the same sparsity // structure. -// JIT: done. - #include "mxm/GB_mxm.h" #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" #include "mxm/GB_AxB__include1.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif #include "include/GB_unused.h" diff --git a/Source/mxm/GB_AxB_dot3_slice.c b/Source/mxm/GB_AxB_dot3_slice.c index ab04fe529f..2683e1c590 100644 --- a/Source/mxm/GB_AxB_dot3_slice.c +++ b/Source/mxm/GB_AxB_dot3_slice.c @@ -35,7 +35,7 @@ } #include "mxm/GB_mxm.h" -#include "slice/factory/GB_search_for_vector_template.c" +#include "slice/include/GB_search_for_vector.h" //------------------------------------------------------------------------------ // GB_AxB_dot3_slice diff --git a/Source/mxm/GB_AxB_dot4.c b/Source/mxm/GB_AxB_dot4.c index 7153c6a05e..97a2efaa9a 100644 --- a/Source/mxm/GB_AxB_dot4.c +++ b/Source/mxm/GB_AxB_dot4.c @@ -18,8 +18,6 @@ // The ANY monoid is a special case: C is not modified at all. -// JIT: done. - //------------------------------------------------------------------------------ #include "mxm/GB_mxm.h" @@ -27,6 +25,7 @@ #include "include/GB_unused.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif @@ -218,8 +217,8 @@ GrB_Info GB_AxB_dot4 // C+=A'*B, dot product method if (C_in_iso) { // allocate but do not initialize C->x unless A or B are hypersparse. - // The initialization must be done if dot4 doesn't do the work; - // see GB_expand_iso below. + // The initialization must be done if dot4 doesn't do the work; see + // below for the check for (info == GrB_NO_VALUE). GB_OK (GB_convert_any_to_non_iso (C, initialized)) ; } @@ -282,7 +281,8 @@ GrB_Info GB_AxB_dot4 // C+=A'*B, dot product method GB_void cscalar [GB_VLA(csize)] ; int64_t cnz = GB_nnz_held (C) ; memcpy (cscalar, C->x, csize) ; - GB_expand_iso (C->x, cnz, cscalar, csize) ; + GB_OK (GB_iso_expand (C->x, cnz, cscalar, C->type)) ; + info = GrB_NO_VALUE ; } GBURBLE ("(punt) ") ; } diff --git a/Source/mxm/GB_AxB_meta.c b/Source/mxm/GB_AxB_meta.c index bdbdbe8098..133effe227 100644 --- a/Source/mxm/GB_AxB_meta.c +++ b/Source/mxm/GB_AxB_meta.c @@ -107,17 +107,20 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm //-------------------------------------------------------------------------- GB_Opcode opcode = semiring_in->multiply->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_positional = GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; 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) ; bool allow_scale = true ; - if (semiring_in->multiply->binop_function == NULL && - (op_is_first || op_is_second)) + if ((semiring_in->multiply->binop_function == NULL && + (op_is_first || op_is_second)) || GB_IS_INDEXBINARYOP_CODE (opcode)) { // GB_rowscale and GB_colscale do not handle the implicit FIRST - // operator for GB_reduce_to_vector. They do handle any other - // positional operator (FIRSTI, FIRSTJ, SECONDI, SECONDJ, etc). + // operator for GB_reduce_to_vector (where all function pointers are + // NULL). They do handle builtin index binary operator (FIRSTI, + // FIRSTJ, SECONDI, SECONDJ, etc), by converting the operation into + // GB_apply_op with a built-in unary POSITION* op. They do not handle + // any user-defined index binary operators. allow_scale = false ; } @@ -225,14 +228,14 @@ GrB_Info GB_AxB_meta // C=A*B meta algorithm // CSR, treat it as A' in CSC, and if A' is in CSR, treat it as A in CSC. if (!A_in->is_csc) { - // Flip the sense of A_transpose + // Negate A_transpose A_transpose = !A_transpose ; } // B is treated just like A if (!B_in->is_csc) { - // Flip the sense of B_transpose + // Negate B_transpose B_transpose = !B_transpose ; } diff --git a/Source/mxm/GB_AxB_saxbit.c b/Source/mxm/GB_AxB_saxbit.c index 434767d2c4..14986c6894 100644 --- a/Source/mxm/GB_AxB_saxbit.c +++ b/Source/mxm/GB_AxB_saxbit.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #define GB_FREE_WORKSPACE \ { \ GB_FREE_WORK (&Wf, Wf_size) ; \ @@ -33,6 +31,7 @@ #include "mxm/GB_AxB_saxpy_generic.h" #include "mxm/GB_AxB__include1.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif diff --git a/Source/mxm/GB_AxB_saxbit_generic_first.c b/Source/mxm/GB_AxB_saxbit_generic_first.c index 5661f88e8d..8ae91b954b 100644 --- a/Source/mxm/GB_AxB_saxbit_generic_first.c +++ b/Source/mxm/GB_AxB_saxbit_generic_first.c @@ -12,11 +12,10 @@ #define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_first #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 0 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 1 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxbit_generic_firstj32.c b/Source/mxm/GB_AxB_saxbit_generic_firstj32.c deleted file mode 100644 index d3efa7148b..0000000000 --- a/Source/mxm/GB_AxB_saxbit_generic_firstj32.c +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_AxB_saxbit_generic_firstj32.c: C=A*B, C bitmap/full, FIRSTJ mult -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C is bitmap only. -// multiply op is GxB_FIRSTJ_INT32, GxB_FIRSTJ1_INT32, -// GxB_SECONDI_INT32, or GxB_SECONDI1_INT32 - -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_firstj32 -#define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 1 -#define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 1 -#define GB_GENERIC_OP_IS_FIRST 0 -#define GB_GENERIC_OP_IS_SECOND 0 - -#include "mxm/factory/GB_AxB_saxpy_generic_method.c" - diff --git a/Source/mxm/GB_AxB_saxbit_generic_firstj64.c b/Source/mxm/GB_AxB_saxbit_generic_firstj64.c deleted file mode 100644 index 4c47dd8858..0000000000 --- a/Source/mxm/GB_AxB_saxbit_generic_firstj64.c +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_AxB_saxbit_generic_firstj64.c: C=A*B, C bitmap/full, FIRSTJ mult -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C is bitmap only. -// multiply op is GxB_FIRSTJ_INT64, GxB_FIRSTJ1_INT64, -// GxB_SECONDI_INT64, or GxB_SECONDI1_INT64 - -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_firstj64 -#define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 1 -#define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 1 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 1 -#define GB_GENERIC_OP_IS_FIRST 0 -#define GB_GENERIC_OP_IS_SECOND 0 - -#include "mxm/factory/GB_AxB_saxpy_generic_method.c" - diff --git a/Source/mxm/GB_AxB_saxbit_generic_flipped.c b/Source/mxm/GB_AxB_saxbit_generic_flipped.c index 6773fe2fdb..002a60b693 100644 --- a/Source/mxm/GB_AxB_saxbit_generic_flipped.c +++ b/Source/mxm/GB_AxB_saxbit_generic_flipped.c @@ -12,11 +12,10 @@ #define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_flipped #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 0 #define GB_GENERIC_FLIPXY 1 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxbit_generic_firsti64.c b/Source/mxm/GB_AxB_saxbit_generic_idx_flipped.c similarity index 62% rename from Source/mxm/GB_AxB_saxbit_generic_firsti64.c rename to Source/mxm/GB_AxB_saxbit_generic_idx_flipped.c index e4a1274e19..0706ded70d 100644 --- a/Source/mxm/GB_AxB_saxbit_generic_firsti64.c +++ b/Source/mxm/GB_AxB_saxbit_generic_idx_flipped.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GB_AxB_saxbit_generic_firsti64.c: C=A*B, C bitmap/full, FIRSTI mult +// GB_AxB_saxbit_generic_idx_flipped.c: C=A*B, C bitmap/full, flipped idx mult //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. @@ -8,15 +8,14 @@ //------------------------------------------------------------------------------ // C is bitmap only. -// multiply op is GxB_FIRSTI_INT64 or GxB_FIRSTI1_INT64 +// multiply op is index flipped -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_firsti64 +#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_idx_flipped #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 1 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 1 -#define GB_GENERIC_OP_IS_FIRSTI 1 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 1 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxbit_generic_firsti32.c b/Source/mxm/GB_AxB_saxbit_generic_idx_unflipped.c similarity index 62% rename from Source/mxm/GB_AxB_saxbit_generic_firsti32.c rename to Source/mxm/GB_AxB_saxbit_generic_idx_unflipped.c index 1a7410ec7d..34c4c8a780 100644 --- a/Source/mxm/GB_AxB_saxbit_generic_firsti32.c +++ b/Source/mxm/GB_AxB_saxbit_generic_idx_unflipped.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GB_AxB_saxbit_generic_firsti32.c: C=A*B, C bitmap/full, FIRSTI mult +// GB_AxB_saxbit_generic_idx_unflipped.c: C=A*B, C bitmap/full, unflipped idx //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. @@ -8,15 +8,14 @@ //------------------------------------------------------------------------------ // C is bitmap only. -// multiply op is GxB_FIRSTI_INT32 or GxB_FIRSTI1_INT32 +// multiply op is index unflipped -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_firsti32 +#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_idx_unflipped #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 1 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 1 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 1 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxbit_generic_second.c b/Source/mxm/GB_AxB_saxbit_generic_second.c index 81ed5d620e..13579f2293 100644 --- a/Source/mxm/GB_AxB_saxbit_generic_second.c +++ b/Source/mxm/GB_AxB_saxbit_generic_second.c @@ -12,11 +12,10 @@ #define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_second #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 0 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 1 diff --git a/Source/mxm/GB_AxB_saxbit_generic_secondj32.c b/Source/mxm/GB_AxB_saxbit_generic_secondj32.c deleted file mode 100644 index 8d81942b40..0000000000 --- a/Source/mxm/GB_AxB_saxbit_generic_secondj32.c +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_AxB_saxbit_generic_secondj32.c: C=A*B, C bitmap/full, SECONDJ mult -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C is bitmap only. -// multiply op is GxB_SECONDJ_INT32 or GxB_SECONDJ1_INT32 - -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_secondj32 -#define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 1 -#define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 -#define GB_GENERIC_OP_IS_FIRST 0 -#define GB_GENERIC_OP_IS_SECOND 0 - -#include "mxm/factory/GB_AxB_saxpy_generic_method.c" - diff --git a/Source/mxm/GB_AxB_saxbit_generic_secondj64.c b/Source/mxm/GB_AxB_saxbit_generic_secondj64.c deleted file mode 100644 index 637644448b..0000000000 --- a/Source/mxm/GB_AxB_saxbit_generic_secondj64.c +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_AxB_saxbit_generic_secondj64.c: C=A*B, C bitmap/full, SECONDJ mult -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C is bitmap only. -// multiply op is GxB_SECONDJ_INT64 or GxB_SECONDJ1_INT64 - -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_secondj64 -#define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 1 -#define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 1 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 -#define GB_GENERIC_OP_IS_FIRST 0 -#define GB_GENERIC_OP_IS_SECOND 0 - -#include "mxm/factory/GB_AxB_saxpy_generic_method.c" - diff --git a/Source/mxm/GB_AxB_saxbit_generic_unflipped.c b/Source/mxm/GB_AxB_saxbit_generic_unflipped.c index 44f10206be..1212f19a28 100644 --- a/Source/mxm/GB_AxB_saxbit_generic_unflipped.c +++ b/Source/mxm/GB_AxB_saxbit_generic_unflipped.c @@ -12,11 +12,10 @@ #define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxbit_generic_unflipped #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 0 -#define GB_GENERIC_OP_IS_POSITIONAL 0 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 1 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxpy3.c b/Source/mxm/GB_AxB_saxpy3.c index 5820a5a720..0ef8434228 100644 --- a/Source/mxm/GB_AxB_saxpy3.c +++ b/Source/mxm/GB_AxB_saxpy3.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // GB_AxB_saxpy3 computes C=A*B, C=A*B, or C=A*B in parallel. If the // mask matrix M has too many entries compared to the work to compute A*B, then // it is not applied. Instead, M is ignored and C=A*B is computed. The mask @@ -94,6 +92,7 @@ #include "mxm/GB_AxB_saxpy_generic.h" #include "mxm/GB_AxB__include1.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif #include "include/GB_unused.h" diff --git a/Source/mxm/GB_AxB_saxpy3.h b/Source/mxm/GB_AxB_saxpy3.h index 7bfa79bec4..6ef721e278 100644 --- a/Source/mxm/GB_AxB_saxpy3.h +++ b/Source/mxm/GB_AxB_saxpy3.h @@ -77,12 +77,6 @@ GrB_Info GB_AxB_saxpy3_flopcount GB_Werk Werk ) ; -//------------------------------------------------------------------------------ -// GB_AxB_saxpy3_cumsum: cumulative sum of C->p for GB_AxB_saxpy3 -//------------------------------------------------------------------------------ - -// GB_CALLBACK_SAXPY3_CUMSUM_PROTO (GB_AxB_saxpy3_cumsum) ; - //------------------------------------------------------------------------------ // GB_AxB_saxpy3_slice_balanced: create balanced parallel tasks for saxpy3 //------------------------------------------------------------------------------ diff --git a/Source/mxm/GB_AxB_saxpy3_cumsum.c b/Source/mxm/GB_AxB_saxpy3_cumsum.c index b17c5e86a5..55dc3452c3 100644 --- a/Source/mxm/GB_AxB_saxpy3_cumsum.c +++ b/Source/mxm/GB_AxB_saxpy3_cumsum.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // phase3: fine tasks finalize their computation nnz(C(:,j)) // phase4: cumulative sum of C->p diff --git a/Source/mxm/GB_AxB_saxpy3_flopcount.c b/Source/mxm/GB_AxB_saxpy3_flopcount.c index af1bed3cb3..59cc31b282 100644 --- a/Source/mxm/GB_AxB_saxpy3_flopcount.c +++ b/Source/mxm/GB_AxB_saxpy3_flopcount.c @@ -7,7 +7,8 @@ //------------------------------------------------------------------------------ -// JIT: not needed, but many variants possible (matrix sparsity formats) +// JIT: possible: many variants possible (matrix sparsity formats) +// matrices: A, B, M; bool Mask_comp // On input, A, B, and M (optional) are matrices for C=A*B, C=A*B, or // C=A*B. The flop count for each B(:,j) is computed, and returned as a @@ -248,9 +249,8 @@ GrB_Info GB_AxB_saxpy3_flopcount // find the part of B(:,j) to be computed by this task //------------------------------------------------------------------ - int64_t pB, pB_end ; - GB_get_pA (&pB, &pB_end, taskid, kk, - kfirst, klast, pstart_Bslice, Bp, bvlen) ; + GB_GET_PA (pB, pB_end, taskid, kk, kfirst, klast, pstart_Bslice, + GBP (Bp, kk, bvlen), GBP (Bp, kk+1, bvlen)) ; int64_t my_bjnz = pB_end - pB ; int64_t j = GBH (Bh, kk) ; diff --git a/Source/mxm/GB_AxB_saxpy3_generic_first.c b/Source/mxm/GB_AxB_saxpy3_generic_first.c index f49767cab0..2a8b7699dd 100644 --- a/Source/mxm/GB_AxB_saxpy3_generic_first.c +++ b/Source/mxm/GB_AxB_saxpy3_generic_first.c @@ -12,11 +12,10 @@ #define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_first #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 0 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 1 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxpy3_generic_firstj32.c b/Source/mxm/GB_AxB_saxpy3_generic_firstj32.c deleted file mode 100644 index 10cf462986..0000000000 --- a/Source/mxm/GB_AxB_saxpy3_generic_firstj32.c +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_AxB_saxpy3_generic_firstj32.c: C=A*B, C sparse/hyper, FIRSTJ multiplier -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C is sparse/hyper -// multiply op is GxB_FIRSTJ_INT32, GxB_FIRSTJ1_INT32, -// GxB_SECONDI_INT32, or GxB_SECONDI1_INT32 - -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_firstj32 -#define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 1 -#define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 1 -#define GB_GENERIC_OP_IS_FIRST 0 -#define GB_GENERIC_OP_IS_SECOND 0 - -#include "mxm/factory/GB_AxB_saxpy_generic_method.c" - diff --git a/Source/mxm/GB_AxB_saxpy3_generic_firstj64.c b/Source/mxm/GB_AxB_saxpy3_generic_firstj64.c deleted file mode 100644 index f5bf02f050..0000000000 --- a/Source/mxm/GB_AxB_saxpy3_generic_firstj64.c +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_AxB_saxpy3_generic_firstj64.c: C=A*B, C sparse/hyper, FIRSTJ multiplier -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C is sparse/hyper -// multiply op is GxB_FIRSTJ_INT64, GxB_FIRSTJ1_INT64, -// GxB_SECONDI_INT64, or GxB_SECONDI1_INT64 - -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_firstj64 -#define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 1 -#define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 1 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 1 -#define GB_GENERIC_OP_IS_FIRST 0 -#define GB_GENERIC_OP_IS_SECOND 0 - -#include "mxm/factory/GB_AxB_saxpy_generic_method.c" - diff --git a/Source/mxm/GB_AxB_saxpy3_generic_flipped.c b/Source/mxm/GB_AxB_saxpy3_generic_flipped.c index 20e9eb435f..65c3157211 100644 --- a/Source/mxm/GB_AxB_saxpy3_generic_flipped.c +++ b/Source/mxm/GB_AxB_saxpy3_generic_flipped.c @@ -12,11 +12,10 @@ #define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_flipped #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 0 #define GB_GENERIC_FLIPXY 1 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxpy3_generic_firsti32.c b/Source/mxm/GB_AxB_saxpy3_generic_idx_flipped.c similarity index 61% rename from Source/mxm/GB_AxB_saxpy3_generic_firsti32.c rename to Source/mxm/GB_AxB_saxpy3_generic_idx_flipped.c index c857381131..d7f15b4a71 100644 --- a/Source/mxm/GB_AxB_saxpy3_generic_firsti32.c +++ b/Source/mxm/GB_AxB_saxpy3_generic_idx_flipped.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GB_AxB_saxpy3_generic_firsti32.c: C=A*B, C sparse/hyper, FIRSTI multiplier +// GB_AxB_saxpy3_generic_idx_flipped.c: C=A*B, C sparse/hyper, flipped idx //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. @@ -8,15 +8,14 @@ //------------------------------------------------------------------------------ // C is sparse/hyper -// multiply op is GxB_FIRSTI_INT32 or GxB_FIRSTI1_INT32 +// multiply op is index flipped -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_firsti32 +#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_idx_flipped #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 1 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 1 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 1 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxpy3_generic_firsti64.c b/Source/mxm/GB_AxB_saxpy3_generic_idx_unflipped.c similarity index 61% rename from Source/mxm/GB_AxB_saxpy3_generic_firsti64.c rename to Source/mxm/GB_AxB_saxpy3_generic_idx_unflipped.c index 36a39fdf74..d8bcdbdb72 100644 --- a/Source/mxm/GB_AxB_saxpy3_generic_firsti64.c +++ b/Source/mxm/GB_AxB_saxpy3_generic_idx_unflipped.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GB_AxB_saxpy3_generic_firsti64.c: C=A*B, C sparse/hyper, FIRSTI multiplier +// GB_AxB_saxpy3_generic_idx_unflipped.c: C=A*B, C sparse/hyper, unflipped idx //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. @@ -8,15 +8,14 @@ //------------------------------------------------------------------------------ // C is sparse/hyper -// multiply op is GxB_FIRSTI_INT64 or GxB_FIRSTI1_INT64 +// multiply op is index unflipped -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_firsti64 +#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_idx_unflipped #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 1 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 1 -#define GB_GENERIC_OP_IS_FIRSTI 1 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 1 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxpy3_generic_second.c b/Source/mxm/GB_AxB_saxpy3_generic_second.c index 9dba760189..90c3e90c1c 100644 --- a/Source/mxm/GB_AxB_saxpy3_generic_second.c +++ b/Source/mxm/GB_AxB_saxpy3_generic_second.c @@ -12,11 +12,10 @@ #define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_second #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 0 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 0 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 1 diff --git a/Source/mxm/GB_AxB_saxpy3_generic_secondj32.c b/Source/mxm/GB_AxB_saxpy3_generic_secondj32.c deleted file mode 100644 index 3bbbdfee16..0000000000 --- a/Source/mxm/GB_AxB_saxpy3_generic_secondj32.c +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_AxB_saxpy3_generic_secondj32.c: C=A*B, C sparse/hyper, SECONDJ multiplier -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C is sparse/hyper -// multiply op is GxB_SECONDJ_INT32 or GxB_SECONDJ1_INT32 - -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_secondj32 -#define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 1 -#define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 -#define GB_GENERIC_OP_IS_FIRST 0 -#define GB_GENERIC_OP_IS_SECOND 0 - -#include "mxm/factory/GB_AxB_saxpy_generic_method.c" - diff --git a/Source/mxm/GB_AxB_saxpy3_generic_secondj64.c b/Source/mxm/GB_AxB_saxpy3_generic_secondj64.c deleted file mode 100644 index aeaa189449..0000000000 --- a/Source/mxm/GB_AxB_saxpy3_generic_secondj64.c +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_AxB_saxpy3_generic_secondj64.c: C=A*B, C sparse/hyper, SECONDJ multiplier -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// C is sparse/hyper -// multiply op is GxB_SECONDJ_INT64 or GxB_SECONDJ1_INT64 - -#define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_secondj64 -#define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 1 -#define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 1 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 -#define GB_GENERIC_OP_IS_FIRST 0 -#define GB_GENERIC_OP_IS_SECOND 0 - -#include "mxm/factory/GB_AxB_saxpy_generic_method.c" - diff --git a/Source/mxm/GB_AxB_saxpy3_generic_unflipped.c b/Source/mxm/GB_AxB_saxpy3_generic_unflipped.c index 2fd9d2581c..a4e23aeda0 100644 --- a/Source/mxm/GB_AxB_saxpy3_generic_unflipped.c +++ b/Source/mxm/GB_AxB_saxpy3_generic_unflipped.c @@ -12,11 +12,10 @@ #define GB_AXB_SAXPY_GENERIC_METHOD GB_AxB_saxpy3_generic_unflipped #define GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE 1 -#define GB_GENERIC_OP_IS_POSITIONAL 0 #define GB_GENERIC_FLIPXY 0 -#define GB_GENERIC_OP_IS_INT64 0 -#define GB_GENERIC_OP_IS_FIRSTI 0 -#define GB_GENERIC_OP_IS_FIRSTJ 0 +#define GB_GENERIC_NOFLIPXY 1 +#define GB_GENERIC_IDX_FLIPXY 0 +#define GB_GENERIC_IDX_NOFLIPXY 0 #define GB_GENERIC_OP_IS_FIRST 0 #define GB_GENERIC_OP_IS_SECOND 0 diff --git a/Source/mxm/GB_AxB_saxpy3_slice_balanced.c b/Source/mxm/GB_AxB_saxpy3_slice_balanced.c index 668ee9b389..148856389c 100644 --- a/Source/mxm/GB_AxB_saxpy3_slice_balanced.c +++ b/Source/mxm/GB_AxB_saxpy3_slice_balanced.c @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------ -// JIT: not needed, but some varants possible (matrix sparsity formats) +// JIT: possible: some varants (matrix sparsity formats) // If the mask is present but must be discarded, this function returns // GrB_NO_VALUE, to indicate that the analysis was terminated early. diff --git a/Source/mxm/GB_AxB_saxpy4.c b/Source/mxm/GB_AxB_saxpy4.c index 30800d18ec..e5f7afafc8 100644 --- a/Source/mxm/GB_AxB_saxpy4.c +++ b/Source/mxm/GB_AxB_saxpy4.c @@ -16,13 +16,12 @@ // The monoid must have an atomic implementation, so the TIMES monoid for // complex types is not supported. -// JIT: done. - //------------------------------------------------------------------------------ #include "mxm/GB_mxm.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif diff --git a/Source/mxm/GB_AxB_saxpy5.c b/Source/mxm/GB_AxB_saxpy5.c index 5a1cee24d9..8f059eb40b 100644 --- a/Source/mxm/GB_AxB_saxpy5.c +++ b/Source/mxm/GB_AxB_saxpy5.c @@ -26,13 +26,14 @@ // TODO: if the monoid is ANY, quick return GrB_SUCCESS and done_in_place // true, also for saxpy4. No work is needed and C doesn't change. -// JIT: done, but expand use of AVX to more semirings. +// FUTURE: expand use of AVX to more semirings //------------------------------------------------------------------------------ #include "mxm/GB_mxm.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_AxB__include2.h" #endif diff --git a/Source/mxm/GB_AxB_saxpy_generic.c b/Source/mxm/GB_AxB_saxpy_generic.c index 28e9d5eadf..2ed2314ccf 100644 --- a/Source/mxm/GB_AxB_saxpy_generic.c +++ b/Source/mxm/GB_AxB_saxpy_generic.c @@ -82,283 +82,156 @@ GrB_Info GB_AxB_saxpy_generic // C = A*B via saxpy3 or bitmap method, function pointers, and typecasting //-------------------------------------------------------------------------- - if (GB_OPCODE_IS_POSITIONAL (opcode)) - { + if (opcode == GB_FIRST_binop_code) + { //---------------------------------------------------------------------- - // generic semirings with positional mulitiply operators + // generic semirings with FIRST multiply operators //---------------------------------------------------------------------- - GB_BURBLE_MATRIX (C, "(generic positional C=A*B) ") ; - + GB_BURBLE_MATRIX (C, "(generic first C=A*B) ") ; + // t = A(i,k) + // mult->binop_function is not used and can be NULL. This is required + // for GB_reduce_to_vector for user-defined types. ASSERT (!flipxy) ; + ASSERT (B_is_pattern) ; + if (saxpy_method == GB_SAXPY_METHOD_3) + { + // C is sparse or hypersparse + info = GB_AxB_saxpy3_generic_first (C, M, Mask_comp, Mask_struct, + M_in_place, A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, SaxpyTasks, nfine, do_sort, Werk) ; + } + else + { + // C is bitmap + info = GB_AxB_saxbit_generic_first (C, M, Mask_comp, Mask_struct, + M_in_place, A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, + use_atomics, M_ek_slicing, M_nthreads, M_ntasks, + A_slice, H_slice, Wcx, Wf) ; + } - // C always has type int64_t or int32_t. The monoid must be used via - // its function pointer. The positional multiply operator must be - // hard-coded since it has no function pointer. The numerical values - // and types of A and B are not accessed. + } + else if (opcode == GB_SECOND_binop_code) + { - if (mult->ztype == GrB_INT64) - { - switch (opcode) - { - case GB_FIRSTI_binop_code : // z = first_i(A(i,k),y) == i - case GB_FIRSTI1_binop_code : // z = first_i1(A(i,k),y) == i+1 - { - if (saxpy_method == GB_SAXPY_METHOD_3) - { - // C is sparse or hypersparse - info = GB_AxB_saxpy3_generic_firsti64 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; - } - else - { - // C is bitmap - info = GB_AxB_saxbit_generic_firsti64 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; - } - } - break ; - - case GB_FIRSTJ_binop_code : // z = first_j(A(i,k),y) == k - case GB_FIRSTJ1_binop_code : // z = first_j1(A(i,k),y) == k+1 - case GB_SECONDI_binop_code : // z = second_i(x,B(k,j)) == k - case GB_SECONDI1_binop_code : // z = second_i1(x,B(k,j))== k+1 - { - if (saxpy_method == GB_SAXPY_METHOD_3) - { - // C is sparse or hypersparse - info = GB_AxB_saxpy3_generic_firstj64 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; - } - else - { - // C is bitmap - info = GB_AxB_saxbit_generic_firstj64 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; - } - } - break ; - - case GB_SECONDJ_binop_code : // z = second_j(x,B(k,j)) == j - case GB_SECONDJ1_binop_code : // z = second_j1(x,B(k,j))== j+1 - { - if (saxpy_method == GB_SAXPY_METHOD_3) - { - // C is sparse or hypersparse - info = GB_AxB_saxpy3_generic_secondj64 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; - } - else - { - // C is bitmap - info = GB_AxB_saxbit_generic_secondj64 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; - } - } - break ; - default: ; - } + //---------------------------------------------------------------------- + // generic semirings with SECOND multiply operators + //---------------------------------------------------------------------- + + GB_BURBLE_MATRIX (C, "(generic second C=A*B) ") ; + // t = B(i,k) + // mult->binop_function is not used and can be NULL. This is required + // for GB_reduce_to_vector for user-defined types. + + ASSERT (!flipxy) ; + ASSERT (A_is_pattern) ; + if (saxpy_method == GB_SAXPY_METHOD_3) + { + // C is sparse or hypersparse + info = GB_AxB_saxpy3_generic_second (C, M, Mask_comp, Mask_struct, + M_in_place, A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, SaxpyTasks, nfine, do_sort, Werk) ; } else - { - switch (opcode) - { - case GB_FIRSTI_binop_code : // z = first_i(A(i,k),y) == i - case GB_FIRSTI1_binop_code : // z = first_i1(A(i,k),y) == i+1 - { - if (saxpy_method == GB_SAXPY_METHOD_3) - { - // C is sparse or hypersparse - info = GB_AxB_saxpy3_generic_firsti32 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; - } - else - { - // C is bitmap - info = GB_AxB_saxbit_generic_firsti32 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; - } - } - break ; - - case GB_FIRSTJ_binop_code : // z = first_j(A(i,k),y) == k - case GB_FIRSTJ1_binop_code : // z = first_j1(A(i,k),y) == k+1 - case GB_SECONDI_binop_code : // z = second_i(x,B(k,j)) == k - case GB_SECONDI1_binop_code : // z = second_i1(x,B(k,j))== k+1 - { - if (saxpy_method == GB_SAXPY_METHOD_3) - { - // C is sparse or hypersparse - info = GB_AxB_saxpy3_generic_firstj32 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; - } - else - { - // C is bitmap - info = GB_AxB_saxbit_generic_firstj32 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; - } - } - break ; - - case GB_SECONDJ_binop_code : // z = second_j(x,B(k,j)) == j - case GB_SECONDJ1_binop_code : // z = second_j1(x,B(k,j))== j+1 - { - if (saxpy_method == GB_SAXPY_METHOD_3) - { - // C is sparse or hypersparse - info = GB_AxB_saxpy3_generic_secondj32 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; - } - else - { - // C is bitmap - info = GB_AxB_saxbit_generic_secondj32 - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; - } - } - break ; - default: ; - } + { + // C is bitmap + info = GB_AxB_saxbit_generic_second (C, M, Mask_comp, Mask_struct, + M_in_place, A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, + use_atomics, M_ek_slicing, M_nthreads, M_ntasks, + A_slice, H_slice, Wcx, Wf) ; } } - else + else if (mult->binop_function != NULL) { //---------------------------------------------------------------------- // generic semirings with standard multiply operators //---------------------------------------------------------------------- + // standard binary op GB_BURBLE_MATRIX (C, "(generic C=A*B) ") ; - if (opcode == GB_FIRST_binop_code) + if (flipxy) { - // t = A(i,k) - // fmult is not used and can be NULL. This is required for - // GB_reduce_to_vector for user-defined types. - ASSERT (!flipxy) ; - ASSERT (B_is_pattern) ; + // t = B(k,j) * A(i,k) if (saxpy_method == GB_SAXPY_METHOD_3) { - // C is sparse or hypersparse - info = GB_AxB_saxpy3_generic_first - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; + // C is sparse or hypersparse, mult is flipped + info = GB_AxB_saxpy3_generic_flipped (C, M, + Mask_comp, Mask_struct, M_in_place, + A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, SaxpyTasks, nfine, do_sort, Werk) ; } else { - // C is bitmap - info = GB_AxB_saxbit_generic_first - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; + // C is bitmap, mult is flipped + info = GB_AxB_saxbit_generic_flipped (C, M, + Mask_comp, Mask_struct, M_in_place, + A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, + use_atomics, M_ek_slicing, M_nthreads, M_ntasks, + A_slice, H_slice, Wcx, Wf) ; + } } - else if (opcode == GB_SECOND_binop_code) + else { - // t = B(i,k) - // fmult is not used and can be NULL. This is required for - // GB_reduce_to_vector for user-defined types. - ASSERT (!flipxy) ; - ASSERT (A_is_pattern) ; + // t = A(i,k) * B(k,j) if (saxpy_method == GB_SAXPY_METHOD_3) { - // C is sparse or hypersparse - info = GB_AxB_saxpy3_generic_second - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; + // C is sparse or hypersparse, mult is unflipped + info = GB_AxB_saxpy3_generic_unflipped (C, M, + Mask_comp, Mask_struct, M_in_place, + A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, SaxpyTasks, nfine, do_sort, Werk) ; } else { - // C is bitmap - info = GB_AxB_saxbit_generic_second - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; + // C is bitmap, mult is unflipped + info = GB_AxB_saxbit_generic_unflipped (C, M, + Mask_comp, Mask_struct, M_in_place, + A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, + use_atomics, M_ek_slicing, M_nthreads, M_ntasks, + A_slice, H_slice, Wcx, Wf) ; } } - else if (flipxy) + + } + else + { + + //---------------------------------------------------------------------- + // generic semirings with index binary multiply operators + //---------------------------------------------------------------------- + + GB_BURBLE_MATRIX (C, "(generic index C=A*B) ") ; + ASSERT (mult->idxbinop_function != NULL) ; + + if (flipxy) { // t = B(k,j) * A(i,k) if (saxpy_method == GB_SAXPY_METHOD_3) { // C is sparse or hypersparse, mult is flipped - info = GB_AxB_saxpy3_generic_flipped - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; + info = GB_AxB_saxpy3_generic_idx_flipped (C, M, + Mask_comp, Mask_struct, M_in_place, + A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, SaxpyTasks, nfine, do_sort, Werk) ; } else { // C is bitmap, mult is flipped - info = GB_AxB_saxbit_generic_flipped - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; + info = GB_AxB_saxbit_generic_idx_flipped (C, M, + Mask_comp, Mask_struct, M_in_place, + A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, + use_atomics, M_ek_slicing, M_nthreads, M_ntasks, + A_slice, H_slice, Wcx, Wf) ; } } else @@ -367,24 +240,23 @@ GrB_Info GB_AxB_saxpy_generic if (saxpy_method == GB_SAXPY_METHOD_3) { // C is sparse or hypersparse, mult is unflipped - info = GB_AxB_saxpy3_generic_unflipped - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - SaxpyTasks, nfine, do_sort, Werk) ; + info = GB_AxB_saxpy3_generic_idx_unflipped (C, M, + Mask_comp, Mask_struct, M_in_place, + A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, SaxpyTasks, nfine, do_sort, Werk) ; } else { // C is bitmap, mult is unflipped - info = GB_AxB_saxbit_generic_unflipped - (C, M, Mask_comp, Mask_struct, M_in_place, - A, A_is_pattern, B, B_is_pattern, semiring, - ntasks, nthreads, - nfine_tasks_per_vector, use_coarse_tasks, - use_atomics, M_ek_slicing, M_nthreads, M_ntasks, - A_slice, H_slice, Wcx, Wf) ; + info = GB_AxB_saxbit_generic_idx_unflipped (C, M, + Mask_comp, Mask_struct, M_in_place, + A, A_is_pattern, B, B_is_pattern, semiring, + ntasks, nthreads, nfine_tasks_per_vector, use_coarse_tasks, + use_atomics, M_ek_slicing, M_nthreads, M_ntasks, + A_slice, H_slice, Wcx, Wf) ; } } + } return (info) ; diff --git a/Source/mxm/GB_AxB_saxpy_generic.h b/Source/mxm/GB_AxB_saxpy_generic.h index dc29e546b0..40e1c7f93a 100644 --- a/Source/mxm/GB_AxB_saxpy_generic.h +++ b/Source/mxm/GB_AxB_saxpy_generic.h @@ -48,49 +48,7 @@ GrB_Info GB_AxB_saxpy_generic // GB_AxB_saxpy3_generic_*: C is sparse or hypersparse //------------------------------------------------------------------------------ -GrB_Info GB_AxB_saxpy3_generic_firsti64 -( - GrB_Matrix C, // C is sparse or hypersparse - const GrB_Matrix M, - bool Mask_comp, - const bool Mask_struct, - const bool M_in_place, - const GrB_Matrix A, - bool A_is_pattern, - const GrB_Matrix B, - bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B - const int ntasks, - const int nthreads, - // for saxpy3 only: - GB_saxpy3task_struct *restrict SaxpyTasks, - const int nfine, - const int do_sort, // if true, sort in saxpy3 - GB_Werk Werk -) ; - -GrB_Info GB_AxB_saxpy3_generic_firstj64 -( - GrB_Matrix C, // C is sparse or hypersparse - const GrB_Matrix M, - bool Mask_comp, - const bool Mask_struct, - const bool M_in_place, - const GrB_Matrix A, - bool A_is_pattern, - const GrB_Matrix B, - bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B - const int ntasks, - const int nthreads, - // for saxpy3 only: - GB_saxpy3task_struct *restrict SaxpyTasks, - const int nfine, - const int do_sort, // if true, sort in saxpy3 - GB_Werk Werk -) ; - -GrB_Info GB_AxB_saxpy3_generic_secondj64 +GrB_Info GB_AxB_saxpy3_generic_first ( GrB_Matrix C, // C is sparse or hypersparse const GrB_Matrix M, @@ -111,28 +69,7 @@ GrB_Info GB_AxB_saxpy3_generic_secondj64 GB_Werk Werk ) ; -GrB_Info GB_AxB_saxpy3_generic_firsti32 -( - GrB_Matrix C, // C is sparse or hypersparse - const GrB_Matrix M, - bool Mask_comp, - const bool Mask_struct, - const bool M_in_place, - const GrB_Matrix A, - bool A_is_pattern, - const GrB_Matrix B, - bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B - const int ntasks, - const int nfine, - // for saxpy3 only: - GB_saxpy3task_struct *restrict SaxpyTasks, - const int nthreads, - const int do_sort, // if true, sort in saxpy3 - GB_Werk Werk -) ; - -GrB_Info GB_AxB_saxpy3_generic_firstj32 +GrB_Info GB_AxB_saxpy3_generic_second ( GrB_Matrix C, // C is sparse or hypersparse const GrB_Matrix M, @@ -153,7 +90,7 @@ GrB_Info GB_AxB_saxpy3_generic_firstj32 GB_Werk Werk ) ; -GrB_Info GB_AxB_saxpy3_generic_secondj32 +GrB_Info GB_AxB_saxpy3_generic_flipped ( GrB_Matrix C, // C is sparse or hypersparse const GrB_Matrix M, @@ -164,7 +101,7 @@ GrB_Info GB_AxB_saxpy3_generic_secondj32 bool A_is_pattern, const GrB_Matrix B, bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B + const GrB_Semiring semiring, // semiring that defines C=A*B (flipped) const int ntasks, const int nthreads, // for saxpy3 only: @@ -174,7 +111,7 @@ GrB_Info GB_AxB_saxpy3_generic_secondj32 GB_Werk Werk ) ; -GrB_Info GB_AxB_saxpy3_generic_first +GrB_Info GB_AxB_saxpy3_generic_idx_flipped ( GrB_Matrix C, // C is sparse or hypersparse const GrB_Matrix M, @@ -185,7 +122,7 @@ GrB_Info GB_AxB_saxpy3_generic_first bool A_is_pattern, const GrB_Matrix B, bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B + const GrB_Semiring semiring, // semiring that defines C=A*B (flipped) const int ntasks, const int nthreads, // for saxpy3 only: @@ -195,7 +132,7 @@ GrB_Info GB_AxB_saxpy3_generic_first GB_Werk Werk ) ; -GrB_Info GB_AxB_saxpy3_generic_second +GrB_Info GB_AxB_saxpy3_generic_unflipped ( GrB_Matrix C, // C is sparse or hypersparse const GrB_Matrix M, @@ -216,28 +153,7 @@ GrB_Info GB_AxB_saxpy3_generic_second GB_Werk Werk ) ; -GrB_Info GB_AxB_saxpy3_generic_flipped -( - GrB_Matrix C, // C is sparse or hypersparse - const GrB_Matrix M, - bool Mask_comp, - const bool Mask_struct, - const bool M_in_place, - const GrB_Matrix A, - bool A_is_pattern, - const GrB_Matrix B, - bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B (flipped) - const int ntasks, - const int nthreads, - // for saxpy3 only: - GB_saxpy3task_struct *restrict SaxpyTasks, - const int nfine, - const int do_sort, // if true, sort in saxpy3 - GB_Werk Werk -) ; - -GrB_Info GB_AxB_saxpy3_generic_unflipped +GrB_Info GB_AxB_saxpy3_generic_idx_unflipped ( GrB_Matrix C, // C is sparse or hypersparse const GrB_Matrix M, @@ -262,88 +178,7 @@ GrB_Info GB_AxB_saxpy3_generic_unflipped // GB_AxB_saxbit_generic_*: C is bitmap (never full) //------------------------------------------------------------------------------ -GrB_Info GB_AxB_saxbit_generic_firsti64 -( - GrB_Matrix C, // C is bitmap - const GrB_Matrix M, - bool Mask_comp, - const bool Mask_struct, - const bool M_in_place, - const GrB_Matrix A, - bool A_is_pattern, - const GrB_Matrix B, - bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B - const int ntasks, - const int nthreads, - // for saxbit only: - const int nfine_tasks_per_vector, - const bool use_coarse_tasks, - const bool use_atomics, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_slice, - const int64_t *restrict H_slice, - GB_void *restrict Wcx, - int8_t *restrict Wf -) ; - -GrB_Info GB_AxB_saxbit_generic_firstj64 -( - GrB_Matrix C, // C is bitmap - const GrB_Matrix M, - bool Mask_comp, - const bool Mask_struct, - const bool M_in_place, - const GrB_Matrix A, - bool A_is_pattern, - const GrB_Matrix B, - bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B - const int ntasks, - const int nthreads, - // for saxbit only: - const int nfine_tasks_per_vector, - const bool use_coarse_tasks, - const bool use_atomics, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_slice, - const int64_t *restrict H_slice, - GB_void *restrict Wcx, - int8_t *restrict Wf -) ; - -GrB_Info GB_AxB_saxbit_generic_secondj64 -( - GrB_Matrix C, // C is bitmap - const GrB_Matrix M, - bool Mask_comp, - const bool Mask_struct, - const bool M_in_place, - const GrB_Matrix A, - bool A_is_pattern, - const GrB_Matrix B, - bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B - const int ntasks, - const int nthreads, - // for saxbit only: - const int nfine_tasks_per_vector, - const bool use_coarse_tasks, - const bool use_atomics, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_slice, - const int64_t *restrict H_slice, - GB_void *restrict Wcx, - int8_t *restrict Wf -) ; - -GrB_Info GB_AxB_saxbit_generic_firsti32 +GrB_Info GB_AxB_saxbit_generic_first ( GrB_Matrix C, // C is bitmap const GrB_Matrix M, @@ -370,7 +205,7 @@ GrB_Info GB_AxB_saxbit_generic_firsti32 int8_t *restrict Wf ) ; -GrB_Info GB_AxB_saxbit_generic_firstj32 +GrB_Info GB_AxB_saxbit_generic_second ( GrB_Matrix C, // C is bitmap const GrB_Matrix M, @@ -397,7 +232,7 @@ GrB_Info GB_AxB_saxbit_generic_firstj32 int8_t *restrict Wf ) ; -GrB_Info GB_AxB_saxbit_generic_secondj32 +GrB_Info GB_AxB_saxbit_generic_flipped ( GrB_Matrix C, // C is bitmap const GrB_Matrix M, @@ -408,7 +243,7 @@ GrB_Info GB_AxB_saxbit_generic_secondj32 bool A_is_pattern, const GrB_Matrix B, bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B + const GrB_Semiring semiring, // semiring that defines C=A*B (flipped) const int ntasks, const int nthreads, // for saxbit only: @@ -424,7 +259,7 @@ GrB_Info GB_AxB_saxbit_generic_secondj32 int8_t *restrict Wf ) ; -GrB_Info GB_AxB_saxbit_generic_first +GrB_Info GB_AxB_saxbit_generic_idx_flipped ( GrB_Matrix C, // C is bitmap const GrB_Matrix M, @@ -435,7 +270,7 @@ GrB_Info GB_AxB_saxbit_generic_first bool A_is_pattern, const GrB_Matrix B, bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B + const GrB_Semiring semiring, // semiring that defines C=A*B (flipped) const int ntasks, const int nthreads, // for saxbit only: @@ -451,7 +286,7 @@ GrB_Info GB_AxB_saxbit_generic_first int8_t *restrict Wf ) ; -GrB_Info GB_AxB_saxbit_generic_second +GrB_Info GB_AxB_saxbit_generic_unflipped ( GrB_Matrix C, // C is bitmap const GrB_Matrix M, @@ -478,34 +313,7 @@ GrB_Info GB_AxB_saxbit_generic_second int8_t *restrict Wf ) ; -GrB_Info GB_AxB_saxbit_generic_flipped -( - GrB_Matrix C, // C is bitmap - const GrB_Matrix M, - bool Mask_comp, - const bool Mask_struct, - const bool M_in_place, - const GrB_Matrix A, - bool A_is_pattern, - const GrB_Matrix B, - bool B_is_pattern, - const GrB_Semiring semiring, // semiring that defines C=A*B (flipped) - const int ntasks, - const int nthreads, - // for saxbit only: - const int nfine_tasks_per_vector, - const bool use_coarse_tasks, - const bool use_atomics, - const int64_t *restrict M_ek_slicing, - const int M_nthreads, - const int M_ntasks, - const int64_t *restrict A_slice, - const int64_t *restrict H_slice, - GB_void *restrict Wcx, - int8_t *restrict Wf -) ; - -GrB_Info GB_AxB_saxbit_generic_unflipped +GrB_Info GB_AxB_saxbit_generic_idx_unflipped ( GrB_Matrix C, // C is bitmap const GrB_Matrix M, diff --git a/Source/mxm/GB_bitmap_expand_to_hyper.c b/Source/mxm/GB_bitmap_expand_to_hyper.c index 73f5f488bd..4ff18baf89 100644 --- a/Source/mxm/GB_bitmap_expand_to_hyper.c +++ b/Source/mxm/GB_bitmap_expand_to_hyper.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - #define GB_FREE_ALL \ { \ GB_phybix_free (C) ; \ @@ -122,7 +120,7 @@ GrB_Info GB_bitmap_expand_to_hyper for (pC = 0 ; pC < cnz ; pC++) { int64_t i = Ah [pC % cvlen] ; - Ci [pC] = (Cb [pC]) ? i : GB_FLIP (i) ; + Ci [pC] = (Cb [pC]) ? i : GB_ZOMBIE (i) ; } } else @@ -133,7 +131,7 @@ GrB_Info GB_bitmap_expand_to_hyper for (pC = 0 ; pC < cnz ; pC++) { int64_t i = pC % cvlen ; - Ci [pC] = (Cb [pC]) ? i : GB_FLIP (i) ; + Ci [pC] = (Cb [pC]) ? i : GB_ZOMBIE (i) ; } } } diff --git a/Source/mxm/GB_colscale.c b/Source/mxm/GB_colscale.c index e9d57fb7e6..f34e7298f8 100644 --- a/Source/mxm/GB_colscale.c +++ b/Source/mxm/GB_colscale.c @@ -7,14 +7,13 @@ //------------------------------------------------------------------------------ -// JIT: done. - #include "mxm/GB_mxm.h" #include "binaryop/GB_binop.h" #include "apply/GB_apply.h" #include "slice/GB_ek_slice.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif #include "include/GB_unused.h" @@ -78,10 +77,15 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D GrB_Type ztype = mult->ztype ; ASSERT (ztype == semiring->add->op->ztype) ; GB_Opcode opcode = mult->opcode ; + GxB_binary_function fmult = mult->binop_function ; + // GB_reduce_to_vector does not use GB_colscale: - ASSERT (!(mult->binop_function == NULL && + ASSERT (!(fmult == NULL && (opcode == GB_FIRST_binop_code || opcode == GB_SECOND_binop_code))) ; + // user-defined index binaryops do not use GB_colscale: + ASSERT (!GB_IS_INDEXBINARYOP_CODE (opcode)) ; + //-------------------------------------------------------------------------- // determine if C is iso (ignore the monoid since it isn't used) //-------------------------------------------------------------------------- @@ -104,7 +108,7 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D // C = A*D, column scale, compute numerical values //-------------------------------------------------------------------------- - if (GB_OPCODE_IS_POSITIONAL (opcode)) + if (GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode)) { //---------------------------------------------------------------------- @@ -178,6 +182,7 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D // determine if the values are accessed //---------------------------------------------------------------------- + ASSERT (fmult != NULL) ; 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) ; @@ -207,11 +212,12 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D } info = GrB_NO_VALUE ; - + #if defined ( GRAPHBLAS_HAS_CUDA ) - if (GB_cuda_colscale_branch (A, D, semiring, flipxy)) { + if (GB_cuda_colscale_branch (A, D, semiring, flipxy)) + { info = GB_cuda_colscale (C, A, D, semiring, flipxy) ; - } + } #endif //---------------------------------------------------------------------- @@ -291,8 +297,6 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D #include "generic/GB_generic.h" GB_BURBLE_MATRIX (C, "(generic C=A*D colscale) ") ; - GxB_binary_function fmult = mult->binop_function ; - size_t csize = C->type->size ; size_t asize = A_is_pattern ? 0 : A->type->size ; size_t dsize = D_is_pattern ? 0 : D->type->size ; @@ -351,10 +355,11 @@ GrB_Info GB_colscale // C = A*D, column scale with diagonal D #include "ewise/include/GB_ewise_shared_definitions.h" + // conventional binary op if (flipxy) { #undef GB_EWISEOP - #define GB_EWISEOP(Cx,p,x,y,i,j) fmult (Cx +((p)*csize),y,x) + #define GB_EWISEOP(Cx,p,y,x,j,i) fmult (Cx +((p)*csize),x,y) #include "mxm/template/GB_colscale_template.c" } else diff --git a/Source/mxm/GB_is_diagonal.c b/Source/mxm/GB_is_diagonal.c index a06fcd47a5..4f8ee0de99 100644 --- a/Source/mxm/GB_is_diagonal.c +++ b/Source/mxm/GB_is_diagonal.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Returns true if A is a square diagonal matrix, with all diagonal entries // present. All pending tuples are ignored. Zombies are treated as entries. diff --git a/Source/mxm/GB_rowscale.c b/Source/mxm/GB_rowscale.c index 394e7259f2..27880a8af6 100644 --- a/Source/mxm/GB_rowscale.c +++ b/Source/mxm/GB_rowscale.c @@ -7,13 +7,12 @@ //------------------------------------------------------------------------------ -// JIT: done. - #include "mxm/GB_mxm.h" #include "binaryop/GB_binop.h" #include "apply/GB_apply.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -66,10 +65,15 @@ GrB_Info GB_rowscale // C = D*B, row scale with diagonal D GrB_Type ztype = mult->ztype ; ASSERT (ztype == semiring->add->op->ztype) ; GB_Opcode opcode = mult->opcode ; + GxB_binary_function fmult = mult->binop_function ; + // GB_reduce_to_vector does not use GB_rowscale: - ASSERT (!(mult->binop_function == NULL && + ASSERT (!(fmult == NULL && (opcode == GB_FIRST_binop_code || opcode == GB_SECOND_binop_code))) ; + // user-defined index binaryops do not use GB_colscale: + ASSERT (!GB_IS_INDEXBINARYOP_CODE (opcode)) ; + //-------------------------------------------------------------------------- // determine if C is iso (ignore the monoid since it isn't used) //-------------------------------------------------------------------------- @@ -85,13 +89,14 @@ GrB_Info GB_rowscale // C = D*B, row scale with diagonal D // set C->iso = C_iso OK GB_OK (GB_dup_worker (&C, C_iso, B, false, ztype)) ; info = GrB_NO_VALUE ; + ASSERT (C->type == ztype) ; //-------------------------------------------------------------------------- // C = D*B, row scale, compute numerical values //-------------------------------------------------------------------------- - if (GB_OPCODE_IS_POSITIONAL (opcode)) - { + if (GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode)) + { //---------------------------------------------------------------------- // apply a positional operator: convert C=D*B to C=op(B) @@ -165,6 +170,7 @@ GrB_Info GB_rowscale // C = D*B, row scale with diagonal D // determine if the values are accessed //---------------------------------------------------------------------- + ASSERT (fmult != NULL) ; 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) ; @@ -196,7 +202,8 @@ GrB_Info GB_rowscale // C = D*B, row scale with diagonal D info = GrB_NO_VALUE ; #if defined ( GRAPHBLAS_HAS_CUDA ) - if (GB_cuda_rowscale_branch (D, B, semiring, flipxy)) { + if (GB_cuda_rowscale_branch (D, B, semiring, flipxy)) + { info = GB_cuda_rowscale (C, D, B, semiring, flipxy) ; } #endif @@ -275,8 +282,6 @@ GrB_Info GB_rowscale // C = D*B, row scale with diagonal D #include "generic/GB_generic.h" GB_BURBLE_MATRIX (C, "(generic C=D*B rowscale) ") ; - GxB_binary_function fmult = mult->binop_function ; - size_t csize = C->type->size ; size_t dsize = D_is_pattern ? 0 : D->type->size ; size_t bsize = B_is_pattern ? 0 : B->type->size ; @@ -335,14 +340,17 @@ GrB_Info GB_rowscale // C = D*B, row scale with diagonal D #include "ewise/include/GB_ewise_shared_definitions.h" + // conventional binary op if (flipxy) { + ASSERT (fmult != NULL) ; #undef GB_EWISEOP - #define GB_EWISEOP(Cx,p,x,y,i,j) fmult (Cx +((p)*csize),y,x) + #define GB_EWISEOP(Cx,p,y,x,j,i) fmult (Cx +((p)*csize),x,y) #include "mxm/template/GB_rowscale_template.c" } else { + ASSERT (fmult != NULL) ; #undef GB_EWISEOP #define GB_EWISEOP(Cx,p,x,y,i,j) fmult (Cx +((p)*csize),x,y) #include "mxm/template/GB_rowscale_template.c" diff --git a/Source/mxm/factory/GB_AxB_bitwise_factory.c b/Source/mxm/factory/GB_AxB_bitwise_factory.c index 5c2297a60e..9b01eba229 100644 --- a/Source/mxm/factory/GB_AxB_bitwise_factory.c +++ b/Source/mxm/factory/GB_AxB_bitwise_factory.c @@ -11,6 +11,34 @@ // bitwise semirings. The multiply operators are bor, band, bxor, or bxnor, // as defined by GB_MNAME. +#if defined (GxB_NO_UINT8) +#define GB_CASE_UINT8(op) +#else +#define GB_CASE_UINT8(op) \ + case GB_UINT8_code: GB_AxB_WORKER (op, GB_MNAME, _uint8 ) +#endif + +#if defined (GxB_NO_UINT16) +#define GB_CASE_UINT16(op) +#else +#define GB_CASE_UINT16(op) \ + case GB_UINT16_code: GB_AxB_WORKER (op, GB_MNAME, _uint16) +#endif + +#if defined (GxB_NO_UINT32) +#define GB_CASE_UINT32(op) +#else +#define GB_CASE_UINT32(op) \ + case GB_UINT32_code: GB_AxB_WORKER (op, GB_MNAME, _uint32) +#endif + +#if defined (GxB_NO_UINT64) +#define GB_CASE_UINT64(op) +#else +#define GB_CASE_UINT64(op) \ + case GB_UINT64_code: GB_AxB_WORKER (op, GB_MNAME, _uint64) +#endif + { switch (add_binop_code) { @@ -21,10 +49,10 @@ switch (zcode) { - case GB_UINT8_code : GB_AxB_WORKER (_bor, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_bor, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_bor, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_bor, GB_MNAME, _uint64) + GB_CASE_UINT8 (_bor) + GB_CASE_UINT16 (_bor) + GB_CASE_UINT32 (_bor) + GB_CASE_UINT64 (_bor) default: ; } break ; @@ -35,10 +63,10 @@ switch (zcode) { - case GB_UINT8_code : GB_AxB_WORKER (_band, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_band, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_band, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_band, GB_MNAME, _uint64) + GB_CASE_UINT8 (_band) + GB_CASE_UINT16 (_band) + GB_CASE_UINT32 (_band) + GB_CASE_UINT64 (_band) default: ; } break ; @@ -49,10 +77,10 @@ switch (zcode) { - case GB_UINT8_code : GB_AxB_WORKER (_bxor, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_bxor, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_bxor, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_bxor, GB_MNAME, _uint64) + GB_CASE_UINT8 (_bxor) + GB_CASE_UINT16 (_bxor) + GB_CASE_UINT32 (_bxor) + GB_CASE_UINT64 (_bxor) default: ; } break ; @@ -63,10 +91,10 @@ switch (zcode) { - case GB_UINT8_code : GB_AxB_WORKER (_bxnor, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_bxnor, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_bxnor, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_bxnor, GB_MNAME, _uint64) + GB_CASE_UINT8 (_bxnor) + GB_CASE_UINT16 (_bxnor) + GB_CASE_UINT32 (_bxnor) + GB_CASE_UINT64 (_bxnor) default: ; } break ; @@ -77,3 +105,8 @@ #undef GB_MNAME +#undef GB_CASE_UINT8 +#undef GB_CASE_UINT16 +#undef GB_CASE_UINT32 +#undef GB_CASE_UINT64 + diff --git a/Source/mxm/factory/GB_AxB_compare_factory.c b/Source/mxm/factory/GB_AxB_compare_factory.c index bbb45dbfb3..452addf35b 100644 --- a/Source/mxm/factory/GB_AxB_compare_factory.c +++ b/Source/mxm/factory/GB_AxB_compare_factory.c @@ -26,6 +26,83 @@ // #ifndef GB_NO_BOOLEAN, resulting in 50 semirings for the NE muliply // operator. +#if defined (GxB_NO_BOOL) +#define GB_CASE_BOOL(op) +#else +#define GB_CASE_BOOL(op) \ + case GB_BOOL_code: GB_AxB_WORKER (op, GB_MNAME, _bool ) +#endif + +#if defined (GxB_NO_INT8) +#define GB_CASE_INT8(op) +#else +#define GB_CASE_INT8(op) \ + case GB_INT8_code: GB_AxB_WORKER (op, GB_MNAME, _int8 ) +#endif + +#if defined (GxB_NO_INT16) +#define GB_CASE_INT16(op) +#else +#define GB_CASE_INT16(op) \ + case GB_INT16_code: GB_AxB_WORKER (op, GB_MNAME, _int16 ) +#endif + +#if defined (GxB_NO_INT32) +#define GB_CASE_INT32(op) +#else +#define GB_CASE_INT32(op) \ + case GB_INT32_code: GB_AxB_WORKER (op, GB_MNAME, _int32 ) +#endif + +#if defined (GxB_NO_INT64) +#define GB_CASE_INT64(op) +#else +#define GB_CASE_INT64(op) \ + case GB_INT64_code: GB_AxB_WORKER (op, GB_MNAME, _int64 ) +#endif + +#if defined (GxB_NO_UINT8) +#define GB_CASE_UINT8(op) +#else +#define GB_CASE_UINT8(op) \ + case GB_UINT8_code: GB_AxB_WORKER (op, GB_MNAME, _uint8 ) +#endif + +#if defined (GxB_NO_UINT16) +#define GB_CASE_UINT16(op) +#else +#define GB_CASE_UINT16(op) \ + case GB_UINT16_code: GB_AxB_WORKER (op, GB_MNAME, _uint16) +#endif + +#if defined (GxB_NO_UINT32) +#define GB_CASE_UINT32(op) +#else +#define GB_CASE_UINT32(op) \ + case GB_UINT32_code: GB_AxB_WORKER (op, GB_MNAME, _uint32) +#endif + +#if defined (GxB_NO_UINT64) +#define GB_CASE_UINT64(op) +#else +#define GB_CASE_UINT64(op) \ + case GB_UINT64_code: GB_AxB_WORKER (op, GB_MNAME, _uint64) +#endif + +#if defined (GxB_NO_FP32) +#define GB_CASE_FP32(op) +#else +#define GB_CASE_FP32(op) \ + case GB_FP32_code: GB_AxB_WORKER (op, GB_MNAME, _fp32 ) +#endif + +#if defined (GxB_NO_FP64) +#define GB_CASE_FP64(op) +#else +#define GB_CASE_FP64(op) \ + case GB_FP64_code: GB_AxB_WORKER (op, GB_MNAME, _fp64 ) +#endif + ASSERT (zcode == GB_BOOL_code) ; { @@ -36,109 +113,109 @@ ASSERT (zcode == GB_BOOL_code) ; switch (add_binop_code) { - case GB_LOR_binop_code : + case GB_LOR_binop_code : switch (xcode) { #ifndef GB_NO_BOOLEAN - case GB_BOOL_code : GB_AxB_WORKER (_lor, GB_MNAME, _bool ) + GB_CASE_BOOL (_lor) #endif - case GB_INT8_code : GB_AxB_WORKER (_lor, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_lor, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_lor, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_lor, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_lor, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_lor, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_lor, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_lor, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_lor, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_lor, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_lor) + GB_CASE_INT16 (_lor) + GB_CASE_INT32 (_lor) + GB_CASE_INT64 (_lor) + GB_CASE_UINT8 (_lor) + GB_CASE_UINT16 (_lor) + GB_CASE_UINT32 (_lor) + GB_CASE_UINT64 (_lor) + GB_CASE_FP32 (_lor) + GB_CASE_FP64 (_lor) default: ; } break ; - case GB_LAND_binop_code : + case GB_LAND_binop_code : switch (xcode) { // 10 real, non-boolean types, plus boolean #ifndef GB_NO_BOOLEAN - case GB_BOOL_code : GB_AxB_WORKER (_land, GB_MNAME, _bool ) + GB_CASE_BOOL (_land) #endif - case GB_INT8_code : GB_AxB_WORKER (_land, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_land, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_land, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_land, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_land, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_land, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_land, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_land, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_land, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_land, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_land) + GB_CASE_INT16 (_land) + GB_CASE_INT32 (_land) + GB_CASE_INT64 (_land) + GB_CASE_UINT8 (_land) + GB_CASE_UINT16 (_land) + GB_CASE_UINT32 (_land) + GB_CASE_UINT64 (_land) + GB_CASE_FP32 (_land) + GB_CASE_FP64 (_land) default: ; } break ; - case GB_LXOR_binop_code : + case GB_LXOR_binop_code : switch (xcode) { #ifndef GB_NO_BOOLEAN - case GB_BOOL_code : GB_AxB_WORKER (_lxor, GB_MNAME, _bool ) + GB_CASE_BOOL (_lxor) #endif - case GB_INT8_code : GB_AxB_WORKER (_lxor, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_lxor, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_lxor, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_lxor, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_lxor, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_lxor, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_lxor, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_lxor, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_lxor, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_lxor, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_lxor) + GB_CASE_INT16 (_lxor) + GB_CASE_INT32 (_lxor) + GB_CASE_INT64 (_lxor) + GB_CASE_UINT8 (_lxor) + GB_CASE_UINT16 (_lxor) + GB_CASE_UINT32 (_lxor) + GB_CASE_UINT64 (_lxor) + GB_CASE_FP32 (_lxor) + GB_CASE_FP64 (_lxor) default: ; } break ; - case GB_EQ_binop_code : + case GB_EQ_binop_code : switch (xcode) { #ifndef GB_NO_BOOLEAN - case GB_BOOL_code : GB_AxB_WORKER (_eq, GB_MNAME, _bool ) + GB_CASE_BOOL (_eq) #endif - case GB_INT8_code : GB_AxB_WORKER (_eq, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_eq, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_eq, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_eq, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_eq, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_eq, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_eq, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_eq, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_eq, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_eq, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_eq) + GB_CASE_INT16 (_eq) + GB_CASE_INT32 (_eq) + GB_CASE_INT64 (_eq) + GB_CASE_UINT8 (_eq) + GB_CASE_UINT16 (_eq) + GB_CASE_UINT32 (_eq) + GB_CASE_UINT64 (_eq) + GB_CASE_FP32 (_eq) + GB_CASE_FP64 (_eq) default: ; } break ; #ifndef GB_NO_ANY_MONOID - case GB_ANY_binop_code : + case GB_ANY_binop_code : switch (xcode) { #ifndef GB_NO_BOOLEAN - case GB_BOOL_code : GB_AxB_WORKER (_any, GB_MNAME, _bool ) + GB_CASE_BOOL (_any) #endif - case GB_INT8_code : GB_AxB_WORKER (_any, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_any, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_any, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_any, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_any, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_any, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_any, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_any, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_any, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_any, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_any) + GB_CASE_INT16 (_any) + GB_CASE_INT32 (_any) + GB_CASE_INT64 (_any) + GB_CASE_UINT8 (_any) + GB_CASE_UINT16 (_any) + GB_CASE_UINT32 (_any) + GB_CASE_UINT64 (_any) + GB_CASE_FP32 (_any) + GB_CASE_FP64 (_any) default: ; } break ; @@ -151,3 +228,15 @@ ASSERT (zcode == GB_BOOL_code) ; #undef GB_NO_BOOLEAN #undef GB_MNAME +#undef GB_CASE_BOOL +#undef GB_CASE_INT8 +#undef GB_CASE_INT16 +#undef GB_CASE_INT32 +#undef GB_CASE_INT64 +#undef GB_CASE_UINT8 +#undef GB_CASE_UINT16 +#undef GB_CASE_UINT32 +#undef GB_CASE_UINT64 +#undef GB_CASE_FP32 +#undef GB_CASE_FP64 + diff --git a/Source/mxm/factory/GB_AxB_dot_generic.c b/Source/mxm/factory/GB_AxB_dot_generic.c index 411b7e040a..8550e0fb7b 100644 --- a/Source/mxm/factory/GB_AxB_dot_generic.c +++ b/Source/mxm/factory/GB_AxB_dot_generic.c @@ -26,9 +26,11 @@ ASSERT (!C->iso) ; GxB_binary_function fmult = mult->binop_function ; // NULL if positional + GxB_index_binary_function fmult_idx = mult->idxbinop_function ; GxB_binary_function fadd = add->op->binop_function ; GB_Opcode opcode = mult->opcode ; - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_builtin_positional = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) ; size_t csize = C->type->size ; size_t asize = A_is_pattern ? 0 : A->type->size ; @@ -68,254 +70,127 @@ // C = A'*B via dot products, function pointers, and typecasting //-------------------------------------------------------------------------- - if (op_is_positional) - { - - //---------------------------------------------------------------------- - // generic semirings with positional multiply operators - //---------------------------------------------------------------------- - - // C and Z types become int32_t or int64_t - - ASSERT (!flipxy) ; - - // aki = A(i,k), located in Ax [A_iso?0:(pA)], but value not used - #undef GB_A_IS_PATTERN - #define GB_A_IS_PATTERN 1 - #define GB_DECLAREA(aki) - #define GB_GETA(aki,Ax,pA,A_iso) - - // bkj = B(k,j), located in Bx [B_iso?0:pB], but value not used - #undef GB_B_IS_PATTERN - #define GB_B_IS_PATTERN 1 - #define GB_DECLAREB(bkj) - #define GB_GETB(bkj,Bx,pB,B_iso) - - // define cij for each task - #undef GB_CIJ_DECLARE - #define GB_CIJ_DECLARE(cij) GB_C_TYPE cij - - // Cx [p] = cij - #define GB_PUTC(cij,Cx,p) Cx [p] = cij + // aki = A(i,k), located in Ax [A_iso?0:(pA)] + #undef GB_A_IS_PATTERN + #define GB_A_IS_PATTERN 0 + #undef GB_DECLAREA + #define GB_DECLAREA(aki) \ + GB_void aki [GB_VLA(aki_size)] ; + #undef GB_GETA + #define GB_GETA(aki,Ax,pA,A_iso) \ + if (!A_is_pattern) cast_A (aki, Ax +((A_iso) ? 0:(pA)*asize), asize) + + // bkj = B(k,j), located in Bx [B_iso?0:pB] + #undef GB_B_IS_PATTERN + #define GB_B_IS_PATTERN 0 + #undef GB_DECLAREB + #define GB_DECLAREB(bkj) \ + GB_void bkj [GB_VLA(bkj_size)] ; + #undef GB_GETB + #define GB_GETB(bkj,Bx,pB,B_iso) \ + if (!B_is_pattern) cast_B (bkj, Bx +((B_iso) ? 0:(pB)*bsize), bsize) + + // define cij for each task + #undef GB_CIJ_DECLARE + #define GB_CIJ_DECLARE(cij) GB_void cij [GB_VLA(csize)] + + // Cx [p] = cij + #undef GB_PUTC + #define GB_PUTC(cij,Cx,p) memcpy (Cx +((p)*csize), cij, csize) + + // instead of GB_DECLARE_TERMINAL_CONST (zterminal): + GB_void *restrict zterminal = (GB_void *) add->terminal ; + + // break if cij reaches the terminal value + #undef GB_IF_TERMINAL_BREAK + #define GB_IF_TERMINAL_BREAK(z,zterminal) \ + if (is_terminal && memcmp (z, zterminal, csize) == 0) \ + { \ + break ; \ + } + #undef GB_TERMINAL_CONDITION + #define GB_TERMINAL_CONDITION(z,zterminal) \ + (is_terminal && memcmp (z, zterminal, csize) == 0) - // break if cij reaches the terminal value. The terminal condition - // 'is_terminal' is checked even if the monoid is not terminal. - #undef GB_MONOID_IS_TERMINAL - #define GB_MONOID_IS_TERMINAL 1 - #undef GB_IF_TERMINAL_BREAK - #define GB_IF_TERMINAL_BREAK(z,zterminal) \ - if (is_terminal && z == zterminal) \ - { \ - break ; \ - } - #undef GB_TERMINAL_CONDITION - #define GB_TERMINAL_CONDITION(z,zterminal) \ - (is_terminal && z == zterminal) + // C(i,j) += (A')(i,k) * B(k,j) + #undef GB_MULTADD + #define GB_MULTADD(cij, aki, bkj, i, k, j) \ + GB_void zwork [GB_VLA(csize)] ; \ + GB_MULT (zwork, aki, bkj, i, k, j) ; \ + fadd (cij, cij, zwork) - // C(i,j) += (A')(i,k) * B(k,j) - #define GB_MULTADD(cij, aki, bkj, i, k, j) \ - GB_C_TYPE zwork ; \ - GB_MULT (zwork, aki, bkj, i, k, j) ; \ - fadd (&cij, &cij, &zwork) + // generic types for C and Z + #undef GB_C_TYPE + #define GB_C_TYPE GB_void - int64_t offset = GB_positional_offset (opcode, NULL, NULL) ; - - if (mult->ztype == GrB_INT64) - { - #undef GB_C_TYPE - #define GB_C_TYPE int64_t - #undef GB_Z_TYPE - #define GB_Z_TYPE int64_t - // instead of GB_DECLARE_TERMINAL_CONST (zterminal): - int64_t zterminal = 0 ; - if (is_terminal) - { - memcpy (&zterminal, add->terminal, sizeof (int64_t)) ; - } - switch (opcode) - { - case GB_FIRSTI_binop_code : // first_i(A'(i,k),y) == i - case GB_FIRSTI1_binop_code : // first_i1(A'(i,k),y) == i+1 - #undef GB_MULT - #define GB_MULT(t, aki, bkj, i, k, j) t = i + offset - #if defined ( GB_DOT2_GENERIC ) - #include "mxm/template/GB_AxB_dot2_meta.c" - #elif defined ( GB_DOT3_GENERIC ) - #include "mxm/template/GB_AxB_dot3_meta.c" - #endif - break ; - case GB_FIRSTJ_binop_code : // first_j(A'(i,k),y) == k - case GB_FIRSTJ1_binop_code : // first_j1(A'(i,k),y) == k+1 - case GB_SECONDI_binop_code : // second_i(x,B(k,j)) == k - case GB_SECONDI1_binop_code : // second_i1(x,B(k,j)) == k+1 - #undef GB_MULT - #define GB_MULT(t, aki, bkj, i, k, j) t = k + offset - #if defined ( GB_DOT2_GENERIC ) - #include "mxm/template/GB_AxB_dot2_meta.c" - #elif defined ( GB_DOT3_GENERIC ) - #include "mxm/template/GB_AxB_dot3_meta.c" - #endif - break ; - case GB_SECONDJ_binop_code : // second_j(x,B(k,j)) == j - case GB_SECONDJ1_binop_code : // second_j1(x,B(k,j)) == j+1 - #undef GB_MULT - #define GB_MULT(t, aki, bkj, i, k, j) t = j + offset - #if defined ( GB_DOT2_GENERIC ) - #include "mxm/template/GB_AxB_dot2_meta.c" - #elif defined ( GB_DOT3_GENERIC ) - #include "mxm/template/GB_AxB_dot3_meta.c" - #endif - break ; - default: ; - } - } - else - { - #undef GB_C_TYPE - #define GB_C_TYPE int32_t - #undef GB_Z_TYPE - #define GB_Z_TYPE int32_t - // instead of GB_DECLARE_TERMINAL_CONST (zterminal): - int32_t zterminal = 0 ; - if (is_terminal) - { - memcpy (&zterminal, add->terminal, sizeof (int32_t)) ; - } - switch (opcode) - { - case GB_FIRSTI_binop_code : // first_i(A'(i,k),y) == i - case GB_FIRSTI1_binop_code : // first_i1(A'(i,k),y) == i+1 - #undef GB_MULT - #define GB_MULT(t,aki,bkj,i,k,j) t = (int32_t) (i + offset) - #if defined ( GB_DOT2_GENERIC ) - #include "mxm/template/GB_AxB_dot2_meta.c" - #elif defined ( GB_DOT3_GENERIC ) - #include "mxm/template/GB_AxB_dot3_meta.c" - #endif - break ; - case GB_FIRSTJ_binop_code : // first_j(A'(i,k),y) == k - case GB_FIRSTJ1_binop_code : // first_j1(A'(i,k),y) == k+1 - case GB_SECONDI_binop_code : // second_i(x,B(k,j)) == k - case GB_SECONDI1_binop_code : // second_i1(x,B(k,j)) == k+1 - #undef GB_MULT - #define GB_MULT(t,aki,bkj,i,k,j) t = (int32_t) (k + offset) - #if defined ( GB_DOT2_GENERIC ) - #include "mxm/template/GB_AxB_dot2_meta.c" - #elif defined ( GB_DOT3_GENERIC ) - #include "mxm/template/GB_AxB_dot3_meta.c" - #endif - break ; - case GB_SECONDJ_binop_code : // second_j(x,B(k,j)) == j - case GB_SECONDJ1_binop_code : // second_j1(x,B(k,j)) == j+1 - #undef GB_MULT - #define GB_MULT(t,aki,bkj,i,k,j) t = (int32_t) (j + offset) - #if defined ( GB_DOT2_GENERIC ) - #include "mxm/template/GB_AxB_dot2_meta.c" - #elif defined ( GB_DOT3_GENERIC ) - #include "mxm/template/GB_AxB_dot3_meta.c" - #endif - break ; - default: ; - } - } + #undef GB_Z_TYPE + #define GB_Z_TYPE GB_void + if (opcode == GB_FIRST_binop_code) + { + // t = A(i,k) + // fmult is not used and can be NULL (for user-defined types) + ASSERT (!flipxy) ; + ASSERT (B_is_pattern) ; + #undef GB_MULT + #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, aik, csize) + #if defined ( GB_DOT2_GENERIC ) + #include "mxm/template/GB_AxB_dot2_meta.c" + #elif defined ( GB_DOT3_GENERIC ) + #include "mxm/template/GB_AxB_dot3_meta.c" + #endif } - else + else if (opcode == GB_SECOND_binop_code) + { + // t = B(i,k) + // fmult is not used and can be NULL (for user-defined types) + ASSERT (!flipxy) ; + ASSERT (A_is_pattern) ; + #undef GB_MULT + #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, bkj, csize) + #if defined ( GB_DOT2_GENERIC ) + #include "mxm/template/GB_AxB_dot2_meta.c" + #elif defined ( GB_DOT3_GENERIC ) + #include "mxm/template/GB_AxB_dot3_meta.c" + #endif + } + else if (fmult != NULL) { - - //---------------------------------------------------------------------- - // generic semirings with standard multiply operators - //---------------------------------------------------------------------- - - // aki = A(i,k), located in Ax [A_iso?0:(pA)] - #undef GB_A_IS_PATTERN - #define GB_A_IS_PATTERN 0 - #undef GB_DECLAREA - #define GB_DECLAREA(aki) \ - GB_void aki [GB_VLA(aki_size)] ; - #undef GB_GETA - #define GB_GETA(aki,Ax,pA,A_iso) \ - if (!A_is_pattern) cast_A (aki, Ax +((A_iso) ? 0:(pA)*asize), asize) - - // bkj = B(k,j), located in Bx [B_iso?0:pB] - #undef GB_B_IS_PATTERN - #define GB_B_IS_PATTERN 0 - #undef GB_DECLAREB - #define GB_DECLAREB(bkj) \ - GB_void bkj [GB_VLA(bkj_size)] ; - #undef GB_GETB - #define GB_GETB(bkj,Bx,pB,B_iso) \ - if (!B_is_pattern) cast_B (bkj, Bx +((B_iso) ? 0:(pB)*bsize), bsize) - - // define cij for each task - #undef GB_CIJ_DECLARE - #define GB_CIJ_DECLARE(cij) GB_void cij [GB_VLA(csize)] - - // Cx [p] = cij - #undef GB_PUTC - #define GB_PUTC(cij,Cx,p) memcpy (Cx +((p)*csize), cij, csize) - - // instead of GB_DECLARE_TERMINAL_CONST (zterminal): - GB_void *restrict zterminal = (GB_void *) add->terminal ; - - // break if cij reaches the terminal value - #undef GB_IF_TERMINAL_BREAK - #define GB_IF_TERMINAL_BREAK(z,zterminal) \ - if (is_terminal && memcmp (z, zterminal, csize) == 0) \ - { \ - break ; \ - } - #undef GB_TERMINAL_CONDITION - #define GB_TERMINAL_CONDITION(z,zterminal) \ - (is_terminal && memcmp (z, zterminal, csize) == 0) - - // C(i,j) += (A')(i,k) * B(k,j) - #undef GB_MULTADD - #define GB_MULTADD(cij, aki, bkj, i, k, j) \ - GB_void zwork [GB_VLA(csize)] ; \ - GB_MULT (zwork, aki, bkj, i, k, j) ; \ - fadd (cij, cij, zwork) - - // generic types for C and Z - #undef GB_C_TYPE - #define GB_C_TYPE GB_void - - #undef GB_Z_TYPE - #define GB_Z_TYPE GB_void - - if (opcode == GB_FIRST_binop_code) + // standard binary op + if (flipxy) { - // t = A(i,k) - // fmult is not used and can be NULL (for user-defined types) - ASSERT (!flipxy) ; - ASSERT (B_is_pattern) ; + // t = B(k,j) * (A')(i,k) #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, aik, csize) + #define GB_MULT(t, aki, bkj, i, k, j) fmult (t, bkj, aki) #if defined ( GB_DOT2_GENERIC ) #include "mxm/template/GB_AxB_dot2_meta.c" #elif defined ( GB_DOT3_GENERIC ) #include "mxm/template/GB_AxB_dot3_meta.c" #endif } - else if (opcode == GB_SECOND_binop_code) + else { - // t = B(i,k) - // fmult is not used and can be NULL (for user-defined types) - ASSERT (!flipxy) ; - ASSERT (A_is_pattern) ; + // t = (A')(i,k) * B(k,j) #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, bkj, csize) + #define GB_MULT(t, aki, bkj, i, k, j) fmult (t, aki, bkj) #if defined ( GB_DOT2_GENERIC ) #include "mxm/template/GB_AxB_dot2_meta.c" #elif defined ( GB_DOT3_GENERIC ) #include "mxm/template/GB_AxB_dot3_meta.c" #endif } - else if (flipxy) + } + else + { + // index binary op + ASSERT (fmult_idx != NULL) ; + const void *theta = mult->theta ; + if (flipxy) { // t = B(k,j) * (A')(i,k) #undef GB_MULT - #define GB_MULT(t, aki, bkj, i, k, j) fmult (t, bkj, aki) + #define GB_MULT(t, aki, bkj, i, k, j) \ + fmult_idx (t, bkj, j, k, aki, k, i, theta) #if defined ( GB_DOT2_GENERIC ) #include "mxm/template/GB_AxB_dot2_meta.c" #elif defined ( GB_DOT3_GENERIC ) @@ -326,7 +201,8 @@ { // t = (A')(i,k) * B(k,j) #undef GB_MULT - #define GB_MULT(t, aki, bkj, i, k, j) fmult (t, aki, bkj) + #define GB_MULT(t, aki, bkj, i, k, j) \ + fmult_idx (t, aki, i, k, bkj, k, j, theta) #if defined ( GB_DOT2_GENERIC ) #include "mxm/template/GB_AxB_dot2_meta.c" #elif defined ( GB_DOT3_GENERIC ) diff --git a/Source/mxm/factory/GB_AxB_positional_factory.c b/Source/mxm/factory/GB_AxB_positional_factory.c index bfedf915be..83c138f4e9 100644 --- a/Source/mxm/factory/GB_AxB_positional_factory.c +++ b/Source/mxm/factory/GB_AxB_positional_factory.c @@ -12,7 +12,7 @@ ASSERT (xcode == zcode) ; ASSERT (ycode == zcode) ; -ASSERT (GB_OPCODE_IS_POSITIONAL (mult_binop_code)) ; +ASSERT (GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (mult_binop_code)) ; { if (zcode == GB_INT32_code) diff --git a/Source/mxm/factory/GB_AxB_saxpy_generic_method.c b/Source/mxm/factory/GB_AxB_saxpy_generic_method.c index bc5df7b305..97542855dc 100644 --- a/Source/mxm/factory/GB_AxB_saxpy_generic_method.c +++ b/Source/mxm/factory/GB_AxB_saxpy_generic_method.c @@ -32,23 +32,11 @@ // This template is used to construct the following methods, all of which // are called by GB_AxB_saxpy_generic: -// GB_AxB_saxpy3_generic_firsti64 -// GB_AxB_saxpy3_generic_firstj64 -// GB_AxB_saxpy3_generic_secondj64 -// GB_AxB_saxpy3_generic_firsti32 -// GB_AxB_saxpy3_generic_firstj32 -// GB_AxB_saxpy3_generic_secondj32 // GB_AxB_saxpy3_generic_first // GB_AxB_saxpy3_generic_second // GB_AxB_saxpy3_generic_flipped // GB_AxB_saxpy3_generic_unflipped -// GB_AxB_saxbit_generic_firsti64 -// GB_AxB_saxbit_generic_firstj64 -// GB_AxB_saxbit_generic_secondj64 -// GB_AxB_saxbit_generic_firsti32 -// GB_AxB_saxbit_generic_firstj32 -// GB_AxB_saxbit_generic_secondj32 // GB_AxB_saxbit_generic_first // GB_AxB_saxbit_generic_second // GB_AxB_saxbit_generic_flipped @@ -59,7 +47,6 @@ #include "mxm/GB_AxB_saxpy.h" #include "slice/GB_ek_slice.h" #include "binaryop/GB_binop.h" -#include "slice/factory/GB_ek_slice_search.c" #include "assign/GB_bitmap_assign_methods.h" #include "mxm/include/GB_mxm_shared_definitions.h" #include "mxm/GB_AxB_saxpy_generic.h" @@ -112,6 +99,7 @@ GrB_Info GB_AXB_SAXPY_GENERIC_METHOD ASSERT (mult->ztype == C->type) ; GxB_binary_function fmult = mult->binop_function ; // NULL if positional + GxB_index_binary_function fmult_idx = mult->idxbinop_function ; GxB_binary_function fadd = add->op->binop_function ; GB_Opcode opcode = mult->opcode ; @@ -162,275 +150,134 @@ GrB_Info GB_AXB_SAXPY_GENERIC_METHOD // definitions for GB_AxB_saxpy_generic_template.c #include "mxm/include/GB_AxB_saxpy3_template.h" - #if GB_GENERIC_OP_IS_POSITIONAL - { + // aik = A(i,k), located in Ax [A_iso ? 0:pA] + #undef GB_A_IS_PATTERN + #define GB_A_IS_PATTERN 0 + #undef GB_DECLAREA + #define GB_DECLAREA(aik) \ + GB_void aik [GB_VLA(aik_size)] ; + #undef GB_GETA + #define GB_GETA(aik,Ax,pA,A_iso) \ + if (!A_is_pattern) \ + { \ + cast_A (aik, Ax +((A_iso) ? 0:((pA)*asize)), asize) ; \ + } - //---------------------------------------------------------------------- - // generic semirings with positional mulitiply operators - //---------------------------------------------------------------------- + // bkj = B(k,j), located in Bx [B_iso ? 0:pB] + #undef GB_B_IS_PATTERN + #define GB_B_IS_PATTERN 0 + #undef GB_DECLAREB + #define GB_DECLAREB(bkj) \ + GB_void bkj [GB_VLA(bkj_size)] ; + #undef GB_GETB + #define GB_GETB(bkj,Bx,pB,B_iso) \ + if (!B_is_pattern) \ + { \ + cast_B (bkj, Bx +((B_iso) ? 0:((pB)*bsize)), bsize) ; \ + } - // C and Z type become int32_t or int64_t + // define t for each task + #undef GB_CIJ_DECLARE + #define GB_CIJ_DECLARE(t) GB_void t [GB_VLA(csize)] - // C always has type int64_t or int32_t. The monoid must be used via - // its function pointer. The positional multiply operator must be - // hard-coded since it has no function pointer. The numerical values - // and types of A and B are not accessed. + // address of Cx [p] + #undef GB_CX + #define GB_CX(p) (Cx +((p)*csize)) - ASSERT (A_is_pattern) ; - ASSERT (B_is_pattern) ; + // Cx [p] = t + #undef GB_CIJ_WRITE + #define GB_CIJ_WRITE(p,t) memcpy (GB_CX (p), t, csize) - // aik = A(i,k), located in Ax [A_iso ? 0:pA], value not used - #undef GB_A_IS_PATTERN - #define GB_A_IS_PATTERN 1 - #define GB_DECLAREA(aik) - #define GB_GETA(aik,Ax,pA,A_iso) - - // bkj = B(k,j), located in Bx [B_iso ? 0:pB], value not used - #undef GB_B_IS_PATTERN - #define GB_B_IS_PATTERN 1 - #define GB_DECLAREB(bkj) - #define GB_GETB(bkj,Bx,pB,B_iso) - - // define t for each task - #undef GB_CIJ_DECLARE - #define GB_CIJ_DECLARE(t) GB_C_TYPE t - - // address of Cx [p] - #define GB_CX(p) (&Cx [p]) - - // Cx [p] = t - #undef GB_CIJ_WRITE - #define GB_CIJ_WRITE(p,t) Cx [p] = t - - // address of Hx [i] - #define GB_HX(i) (&Hx [i]) - - // Hx [i] = t - #undef GB_HX_WRITE - #define GB_HX_WRITE(i,t) Hx [i] = t - - // Cx [p] = Hx [i] - #undef GB_CIJ_GATHER - #define GB_CIJ_GATHER(p,i) Cx [p] = Hx [i] - - // Cx [p:p+len=-1] = Hx [i:i+len-1] - // via memcpy (&(Cx [p]), &(Hx [i]), len*csize) - #undef GB_CIJ_MEMCPY - #define GB_CIJ_MEMCPY(p,i,len) memcpy (GB_CX (p), GB_HX (i), (len)*csize) - - // Cx [p] += Hx [i] - #undef GB_CIJ_GATHER_UPDATE - #define GB_CIJ_GATHER_UPDATE(p,i) fadd (GB_CX (p), GB_CX (p), GB_HX (i)) - - // Cx [p] += t - #undef GB_CIJ_UPDATE - #define GB_CIJ_UPDATE(p,t) fadd (GB_CX (p), GB_CX (p), &t) - - // Hx [i] += t - #undef GB_HX_UPDATE - #define GB_HX_UPDATE(i,t) fadd (GB_HX (i), GB_HX (i), &t) - - // the original multiplier op may have been flipped, but the offset - // is unchanged - int64_t offset = GB_positional_offset (mult->opcode, NULL, NULL) ; - - #if GB_GENERIC_OP_IS_INT64 - { - #undef GB_C_TYPE - #define GB_C_TYPE int64_t - #undef GB_Z_TYPE - #define GB_Z_TYPE int64_t - // future:: rename GB_C_SIZE to GB_Z_SIZE - #undef GB_C_SIZE - #define GB_C_SIZE (sizeof (int64_t)) - ASSERT (C->type == GrB_INT64) ; - ASSERT (csize == sizeof (int64_t)) ; - #if GB_GENERIC_OP_IS_FIRSTI - { - // GB_FIRSTI_binop_code : // z = first_i(A(i,k),y) == i - // GB_FIRSTI1_binop_code : // z = first_i1(A(i,k),y) == i+1 - #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) t = i + offset - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #elif GB_GENERIC_OP_IS_FIRSTJ - { - // GB_FIRSTJ_binop_code : // z = first_j(A(i,k),y) == k - // GB_FIRSTJ1_binop_code : // z = first_j1(A(i,k),y) == k+1 - // GB_SECONDI_binop_code : // z = second_i(x,B(k,j)) == k - // GB_SECONDI1_binop_code : // z = second_i1(x,B(k,j))== k+1 - #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) t = k + offset - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #else - { - // GB_SECONDJ_binop_code : // z = second_j(x,B(k,j)) == j - // GB_SECONDJ1_binop_code : // z = second_j1(x,B(k,j))== j+1 - #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) t = j + offset - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #endif - } - #else - { - #undef GB_C_TYPE - #define GB_C_TYPE int32_t - #undef GB_Z_TYPE - #define GB_Z_TYPE int32_t - #undef GB_C_SIZE - #define GB_C_SIZE (sizeof (int32_t)) - ASSERT (C->type == GrB_INT32) ; - ASSERT (csize == sizeof (int32_t)) ; - #if GB_GENERIC_OP_IS_FIRSTI - { - // GB_FIRSTI_binop_code : // z = first_i(A(i,k),y) == i - // GB_FIRSTI1_binop_code : // z = first_i1(A(i,k),y) == i+1 - #undef GB_MULT - #define GB_MULT(t,aik,bkj,i,k,j) t = (int32_t) (i + offset) - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #elif GB_GENERIC_OP_IS_FIRSTJ - { - // GB_FIRSTJ_binop_code : // z = first_j(A(i,k),y) == k - // GB_FIRSTJ1_binop_code : // z = first_j1(A(i,k),y) == k+1 - // GB_SECONDI_binop_code : // z = second_i(x,B(k,j)) == k - // GB_SECONDI1_binop_code : // z = second_i1(x,B(k,j))== k+1 - #undef GB_MULT - #define GB_MULT(t,aik,bkj,i,k,j) t = (int32_t) (k + offset) - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #else - { - // GB_SECONDJ_binop_code : // z = second_j(x,B(k,j)) == j - // GB_SECONDJ1_binop_code : // z = second_j1(x,B(k,j))== j+1 - #undef GB_MULT - #define GB_MULT(t,aik,bkj,i,k,j) t = (int32_t) (j + offset) - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #endif - } - #endif + // address of Hx [i] + #undef GB_HX + #define GB_HX(i) (Hx +((i)*csize)) + + // Hx [i] = t + #undef GB_HX_WRITE + #define GB_HX_WRITE(i,t) memcpy (GB_HX (i), t, csize) + + // Cx [p] = Hx [i] + #undef GB_CIJ_GATHER + #define GB_CIJ_GATHER(p,i) memcpy (GB_CX (p), GB_HX(i), csize) + // Cx [p:p+len=-1] = Hx [i:i+len-1] + // via memcpy (&(Cx [p]), &(Hx [i]), len*csize) + #undef GB_CIJ_MEMCPY + #define GB_CIJ_MEMCPY(p,i,len) memcpy (GB_CX (p), GB_HX (i), (len)*csize) + + // Cx [p] += Hx [i] + #undef GB_CIJ_GATHER_UPDATE + #define GB_CIJ_GATHER_UPDATE(p,i) fadd (GB_CX (p), GB_CX (p), GB_HX (i)) + + // Cx [p] += t + #undef GB_CIJ_UPDATE + #define GB_CIJ_UPDATE(p,t) fadd (GB_CX (p), GB_CX (p), t) + + // Hx [i] += t + #undef GB_HX_UPDATE + #define GB_HX_UPDATE(i,t) fadd (GB_HX (i), GB_HX (i), t) + + // generic types for C and Z + #undef GB_C_TYPE + #define GB_C_TYPE GB_void + + #undef GB_Z_TYPE + #define GB_Z_TYPE GB_void + + #undef GB_C_SIZE + #define GB_C_SIZE csize + + #if GB_GENERIC_OP_IS_FIRST + { + // t = A(i,k) + ASSERT (B_is_pattern) ; + #undef GB_MULT + #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, aik, csize) + #include "mxm/factory/GB_AxB_saxpy_generic_template.c" } - #else - { - - //---------------------------------------------------------------------- - // generic semirings with standard multiply operators - //---------------------------------------------------------------------- - - // aik = A(i,k), located in Ax [A_iso ? 0:pA] - #undef GB_A_IS_PATTERN - #define GB_A_IS_PATTERN 0 - #undef GB_DECLAREA - #define GB_DECLAREA(aik) \ - GB_void aik [GB_VLA(aik_size)] ; - #undef GB_GETA - #define GB_GETA(aik,Ax,pA,A_iso) \ - if (!A_is_pattern) \ - { \ - cast_A (aik, Ax +((A_iso) ? 0:((pA)*asize)), asize) ; \ - } - - // bkj = B(k,j), located in Bx [B_iso ? 0:pB] - #undef GB_B_IS_PATTERN - #define GB_B_IS_PATTERN 0 - #undef GB_DECLAREB - #define GB_DECLAREB(bkj) \ - GB_void bkj [GB_VLA(bkj_size)] ; - #undef GB_GETB - #define GB_GETB(bkj,Bx,pB,B_iso) \ - if (!B_is_pattern) \ - { \ - cast_B (bkj, Bx +((B_iso) ? 0:((pB)*bsize)), bsize) ; \ - } - - // define t for each task - #undef GB_CIJ_DECLARE - #define GB_CIJ_DECLARE(t) GB_void t [GB_VLA(csize)] - - // address of Cx [p] - #undef GB_CX - #define GB_CX(p) (Cx +((p)*csize)) - - // Cx [p] = t - #undef GB_CIJ_WRITE - #define GB_CIJ_WRITE(p,t) memcpy (GB_CX (p), t, csize) - - // address of Hx [i] - #undef GB_HX - #define GB_HX(i) (Hx +((i)*csize)) - - // Hx [i] = t - #undef GB_HX_WRITE - #define GB_HX_WRITE(i,t) memcpy (GB_HX (i), t, csize) - - // Cx [p] = Hx [i] - #undef GB_CIJ_GATHER - #define GB_CIJ_GATHER(p,i) memcpy (GB_CX (p), GB_HX(i), csize) - - // Cx [p:p+len=-1] = Hx [i:i+len-1] - // via memcpy (&(Cx [p]), &(Hx [i]), len*csize) - #undef GB_CIJ_MEMCPY - #define GB_CIJ_MEMCPY(p,i,len) memcpy (GB_CX (p), GB_HX (i), (len)*csize) - - // Cx [p] += Hx [i] - #undef GB_CIJ_GATHER_UPDATE - #define GB_CIJ_GATHER_UPDATE(p,i) fadd (GB_CX (p), GB_CX (p), GB_HX (i)) - - // Cx [p] += t - #undef GB_CIJ_UPDATE - #define GB_CIJ_UPDATE(p,t) fadd (GB_CX (p), GB_CX (p), t) - - // Hx [i] += t - #undef GB_HX_UPDATE - #define GB_HX_UPDATE(i,t) fadd (GB_HX (i), GB_HX (i), t) - - // generic types for C and Z - #undef GB_C_TYPE - #define GB_C_TYPE GB_void - - #undef GB_Z_TYPE - #define GB_Z_TYPE GB_void - - #undef GB_C_SIZE - #define GB_C_SIZE csize - - #if GB_GENERIC_OP_IS_FIRST - { - // t = A(i,k) - ASSERT (B_is_pattern) ; - #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, aik, csize) - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #elif GB_GENERIC_OP_IS_SECOND - { - // t = B(i,k) - ASSERT (A_is_pattern) ; - #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, bkj, csize) - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #elif GB_GENERIC_FLIPXY - { - // t = B(k,j) * A(i,k) - ASSERT (fmult != NULL) ; - #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) fmult (t, bkj, aik) - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #else - { - // t = A(i,k) * B(k,j) - ASSERT (fmult != NULL) ; - #undef GB_MULT - #define GB_MULT(t, aik, bkj, i, k, j) fmult (t, aik, bkj) - #include "mxm/factory/GB_AxB_saxpy_generic_template.c" - } - #endif + #elif GB_GENERIC_OP_IS_SECOND + { + // t = B(i,k) + ASSERT (A_is_pattern) ; + #undef GB_MULT + #define GB_MULT(t, aik, bkj, i, k, j) memcpy (t, bkj, csize) + #include "mxm/factory/GB_AxB_saxpy_generic_template.c" + } + #elif GB_GENERIC_FLIPXY + { + // t = B(k,j) * A(i,k) + ASSERT (fmult != NULL) ; + #undef GB_MULT + #define GB_MULT(t, aik, bkj, i, k, j) fmult (t, bkj, aik) + #include "mxm/factory/GB_AxB_saxpy_generic_template.c" + } + #elif GB_GENERIC_NOFLIPXY + { + // t = A(i,k) * B(k,j) + ASSERT (fmult != NULL) ; + #undef GB_MULT + #define GB_MULT(t, aik, bkj, i, k, j) fmult (t, aik, bkj) + #include "mxm/factory/GB_AxB_saxpy_generic_template.c" + } + #elif GB_GENERIC_IDX_FLIPXY + { + // t = B(k,j) * A(i,k) + ASSERT (fmult_idx != NULL) ; + const void *theta = mult->theta ; + #undef GB_MULT + #define GB_MULT(t, aik, bkj, i, k, j) \ + fmult_idx (t, bkj, j, k, aik, k, i, theta) + #include "mxm/factory/GB_AxB_saxpy_generic_template.c" + } + #elif GB_GENERIC_IDX_NOFLIPXY + { + // t = A(i,k) * B(k,j) + ASSERT (fmult_idx != NULL) ; + const void *theta = mult->theta ; + #undef GB_MULT + #define GB_MULT(t, aik, bkj, i, k, j) \ + fmult_idx (t, aik, i, k, bkj, k, j, theta) + #include "mxm/factory/GB_AxB_saxpy_generic_template.c" } #endif diff --git a/Source/mxm/factory/GB_AxB_type_factory.c b/Source/mxm/factory/GB_AxB_type_factory.c index 05ceca5221..68e988eaa4 100644 --- a/Source/mxm/factory/GB_AxB_type_factory.c +++ b/Source/mxm/factory/GB_AxB_type_factory.c @@ -36,95 +36,179 @@ ASSERT (zcode == xcode) ; ASSERT (zcode == ycode) ; ASSERT (mult_binop_code != GB_ANY_binop_code) ; +#if defined (GxB_NO_INT8) +#define GB_CASE_INT8(op) +#else +#define GB_CASE_INT8(op) \ + case GB_INT8_code: GB_AxB_WORKER (op, GB_MNAME, _int8 ) +#endif + +#if defined (GxB_NO_INT16) +#define GB_CASE_INT16(op) +#else +#define GB_CASE_INT16(op) \ + case GB_INT16_code: GB_AxB_WORKER (op, GB_MNAME, _int16 ) +#endif + +#if defined (GxB_NO_INT32) +#define GB_CASE_INT32(op) +#else +#define GB_CASE_INT32(op) \ + case GB_INT32_code: GB_AxB_WORKER (op, GB_MNAME, _int32 ) +#endif + +#if defined (GxB_NO_INT64) +#define GB_CASE_INT64(op) +#else +#define GB_CASE_INT64(op) \ + case GB_INT64_code: GB_AxB_WORKER (op, GB_MNAME, _int64 ) +#endif + +#if defined (GxB_NO_UINT8) +#define GB_CASE_UINT8(op) +#else +#define GB_CASE_UINT8(op) \ + case GB_UINT8_code: GB_AxB_WORKER (op, GB_MNAME, _uint8 ) +#endif + +#if defined (GxB_NO_UINT16) +#define GB_CASE_UINT16(op) +#else +#define GB_CASE_UINT16(op) \ + case GB_UINT16_code: GB_AxB_WORKER (op, GB_MNAME, _uint16) +#endif + +#if defined (GxB_NO_UINT32) +#define GB_CASE_UINT32(op) +#else +#define GB_CASE_UINT32(op) \ + case GB_UINT32_code: GB_AxB_WORKER (op, GB_MNAME, _uint32) +#endif + +#if defined (GxB_NO_UINT64) +#define GB_CASE_UINT64(op) +#else +#define GB_CASE_UINT64(op) \ + case GB_UINT64_code: GB_AxB_WORKER (op, GB_MNAME, _uint64) +#endif + +#if defined (GxB_NO_FP32) +#define GB_CASE_FP32(op) +#else +#define GB_CASE_FP32(op) \ + case GB_FP32_code: GB_AxB_WORKER (op, GB_MNAME, _fp32 ) +#endif + +#if defined (GxB_NO_FP64) +#define GB_CASE_FP64(op) +#else +#define GB_CASE_FP64(op) \ + case GB_FP64_code: GB_AxB_WORKER (op, GB_MNAME, _fp64 ) +#endif + +#if defined (GxB_NO_FC32) +#define GB_CASE_FC32(op) +#else +#define GB_CASE_FC32(op) \ + case GB_FC32_code: GB_AxB_WORKER (op, GB_MNAME, _fc32 ) +#endif + +#if defined (GxB_NO_FC64) +#define GB_CASE_FC64(op) +#else +#define GB_CASE_FC64(op) \ + case GB_FC64_code: GB_AxB_WORKER (op, GB_MNAME, _fc64 ) +#endif + if (xcode != GB_BOOL_code) -{ +{ switch (add_binop_code) { // disable the MIN, MAX, ANY, and TIMES monoids for some multops #ifndef GB_NO_MIN_MAX_ANY_TIMES_MONOIDS - case GB_MIN_binop_code: + case GB_MIN_binop_code : switch (xcode) { // 10 real, non-boolean types - case GB_INT8_code : GB_AxB_WORKER (_min, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_min, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_min, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_min, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_min, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_min, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_min, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_min, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_min, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_min, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_min) + GB_CASE_INT16 (_min) + GB_CASE_INT32 (_min) + GB_CASE_INT64 (_min) + GB_CASE_UINT8 (_min) + GB_CASE_UINT16 (_min) + GB_CASE_UINT32 (_min) + GB_CASE_UINT64 (_min) + GB_CASE_FP32 (_min) + GB_CASE_FP64 (_min) default: ; } break ; - case GB_MAX_binop_code: + case GB_MAX_binop_code : switch (xcode) { // 10 real, non-boolean types - case GB_INT8_code : GB_AxB_WORKER (_max, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_max, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_max, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_max, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_max, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_max, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_max, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_max, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_max, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_max, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_max) + GB_CASE_INT16 (_max) + GB_CASE_INT32 (_max) + GB_CASE_INT64 (_max) + GB_CASE_UINT8 (_max) + GB_CASE_UINT16 (_max) + GB_CASE_UINT32 (_max) + GB_CASE_UINT64 (_max) + GB_CASE_FP32 (_max) + GB_CASE_FP64 (_max) default: ; } break ; - case GB_TIMES_binop_code: + case GB_TIMES_binop_code : switch (xcode) { // 10 real, non-boolean types, plus 2 complex - case GB_INT8_code : GB_AxB_WORKER (_times, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_times, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_times, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_times, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_times, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_times, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_times, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_times, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_times, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_times, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_times) + GB_CASE_INT16 (_times) + GB_CASE_INT32 (_times) + GB_CASE_INT64 (_times) + GB_CASE_UINT8 (_times) + GB_CASE_UINT16 (_times) + GB_CASE_UINT32 (_times) + GB_CASE_UINT64 (_times) + GB_CASE_FP32 (_times) + GB_CASE_FP64 (_times) #if defined ( GB_COMPLEX ) - case GB_FC32_code : GB_AxB_WORKER (_times, GB_MNAME, _fc32 ) - case GB_FC64_code : GB_AxB_WORKER (_times, GB_MNAME, _fc64 ) + GB_CASE_FC32 (_times) + GB_CASE_FC64 (_times) #endif default: ; } break ; #ifndef GB_NO_ANY_MONOID - case GB_ANY_binop_code: + case GB_ANY_binop_code : switch (xcode) { // 10 real, non-boolean types, plus 2 complex - case GB_INT8_code : GB_AxB_WORKER (_any, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_any, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_any, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_any, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_any, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_any, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_any, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_any, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_any, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_any, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_any) + GB_CASE_INT16 (_any) + GB_CASE_INT32 (_any) + GB_CASE_INT64 (_any) + GB_CASE_UINT8 (_any) + GB_CASE_UINT16 (_any) + GB_CASE_UINT32 (_any) + GB_CASE_UINT64 (_any) + GB_CASE_FP32 (_any) + GB_CASE_FP64 (_any) #if defined ( GB_COMPLEX ) // the ANY monoid is non-atomic for complex types - case GB_FC32_code : GB_AxB_WORKER (_any, GB_MNAME, _fc32 ) - case GB_FC64_code : GB_AxB_WORKER (_any, GB_MNAME, _fc64 ) + GB_CASE_FC32 (_any) + GB_CASE_FC64 (_any) #endif default: ; } @@ -132,25 +216,25 @@ if (xcode != GB_BOOL_code) #endif #endif - case GB_PLUS_binop_code: + case GB_PLUS_binop_code : switch (xcode) { // 10 real, non-boolean types, plus 2 complex - case GB_INT8_code : GB_AxB_WORKER (_plus, GB_MNAME, _int8 ) - case GB_INT16_code : GB_AxB_WORKER (_plus, GB_MNAME, _int16 ) - case GB_INT32_code : GB_AxB_WORKER (_plus, GB_MNAME, _int32 ) - case GB_INT64_code : GB_AxB_WORKER (_plus, GB_MNAME, _int64 ) - case GB_UINT8_code : GB_AxB_WORKER (_plus, GB_MNAME, _uint8 ) - case GB_UINT16_code : GB_AxB_WORKER (_plus, GB_MNAME, _uint16) - case GB_UINT32_code : GB_AxB_WORKER (_plus, GB_MNAME, _uint32) - case GB_UINT64_code : GB_AxB_WORKER (_plus, GB_MNAME, _uint64) - case GB_FP32_code : GB_AxB_WORKER (_plus, GB_MNAME, _fp32 ) - case GB_FP64_code : GB_AxB_WORKER (_plus, GB_MNAME, _fp64 ) + GB_CASE_INT8 (_plus) + GB_CASE_INT16 (_plus) + GB_CASE_INT32 (_plus) + GB_CASE_INT64 (_plus) + GB_CASE_UINT8 (_plus) + GB_CASE_UINT16 (_plus) + GB_CASE_UINT32 (_plus) + GB_CASE_UINT64 (_plus) + GB_CASE_FP32 (_plus) + GB_CASE_FP64 (_plus) #if defined ( GB_COMPLEX ) // only the PLUS monoid is atomic for complex types - case GB_FC32_code : GB_AxB_WORKER (_plus, GB_MNAME, _fc32 ) - case GB_FC64_code : GB_AxB_WORKER (_plus, GB_MNAME, _fc64 ) + GB_CASE_FC32 (_plus) + GB_CASE_FC64 (_plus) #endif default: ; } @@ -162,9 +246,10 @@ if (xcode != GB_BOOL_code) #ifndef GB_NO_BOOLEAN else -{ +{ switch (add_binop_code) { + #if !defined (GxB_NO_BOOL) // 5 boolean monoids #ifndef GB_MULT_IS_PAIR_OPERATOR // all these semirings are replaced with the ANY_PAIR iso semiring @@ -176,6 +261,7 @@ else #endif #endif case GB_LXOR_binop_code : GB_AxB_WORKER (_lxor, GB_MNAME, _bool) + #endif default: ; } } @@ -187,3 +273,16 @@ else #undef GB_NO_MIN_MAX_ANY_TIMES_MONOIDS #undef GB_MULT_IS_PAIR_OPERATOR +#undef GB_CASE_INT8 +#undef GB_CASE_INT16 +#undef GB_CASE_INT32 +#undef GB_CASE_INT64 +#undef GB_CASE_UINT8 +#undef GB_CASE_UINT16 +#undef GB_CASE_UINT32 +#undef GB_CASE_UINT64 +#undef GB_CASE_FP32 +#undef GB_CASE_FP64 +#undef GB_CASE_FC32 +#undef GB_CASE_FC64 + diff --git a/Source/mxm/template/GB_AxB_dot3_phase1_template.c b/Source/mxm/template/GB_AxB_dot3_phase1_template.c index 2cd571526d..ad764d8413 100644 --- a/Source/mxm/template/GB_AxB_dot3_phase1_template.c +++ b/Source/mxm/template/GB_AxB_dot3_phase1_template.c @@ -48,7 +48,7 @@ const int64_t j = GBH_C (Ch, k) ; #endif - GB_GET_VECTOR (pM, pM_end, pM, pM_end, Mp, k, mvlen) ; + GB_GET_VECTOR_M (pM, pM_end, pM, pM_end, Mp, k, mvlen) ; //------------------------------------------------------------------ // get B(:,j) diff --git a/Source/mxm/template/GB_AxB_dot3_template.c b/Source/mxm/template/GB_AxB_dot3_template.c index d60d2f2cfd..bb6d7a82dc 100644 --- a/Source/mxm/template/GB_AxB_dot3_template.c +++ b/Source/mxm/template/GB_AxB_dot3_template.c @@ -93,7 +93,7 @@ { // C(i,j) is a zombie int64_t i = Mi [pC] ; - Ci [pC] = GB_FLIP (i) ; + Ci [pC] = GB_ZOMBIE (i) ; } continue ; } @@ -160,7 +160,7 @@ { // C(i,j) is a zombie task_nzombies++ ; - Ci [pC] = GB_FLIP (i) ; + Ci [pC] = GB_ZOMBIE (i) ; } } } diff --git a/Source/mxm/template/GB_AxB_dot4_cij.c b/Source/mxm/template/GB_AxB_dot4_cij.c index 89acd2b073..bf1f717e1e 100644 --- a/Source/mxm/template/GB_AxB_dot4_cij.c +++ b/Source/mxm/template/GB_AxB_dot4_cij.c @@ -39,15 +39,16 @@ cij = (GB_C_TYPE) (t & 0x1L) ; } #elif GB_IS_PLUS_PAIR_8_SEMIRING - { + { // (PLUS int8, uint8 monoids)_PAIR semirings + // only used by the JIT if int8 and uint8 FactoryKernels disabled uint64_t t = ((uint64_t) cij) + ainz ; cij = (GB_C_TYPE) (t & 0xFFL) ; } #elif GB_IS_PLUS_PAIR_16_SEMIRING { // (PLUS int16, uint16 monoids)_PAIR semirings - // this is only used by the JIT + // only used by the JIT if int16 and uint16 FactoryKernels disabled uint64_t t = ((uint64_t) cij) + ainz ; cij = (GB_C_TYPE) (t & 0xFFFFL) ; } diff --git a/Source/mxm/template/GB_AxB_dot4_template.c b/Source/mxm/template/GB_AxB_dot4_template.c index a8fa7b4547..9eef0f0a6a 100644 --- a/Source/mxm/template/GB_AxB_dot4_template.c +++ b/Source/mxm/template/GB_AxB_dot4_template.c @@ -106,15 +106,18 @@ cij = (GB_C_TYPE) (t & 0x1L) ; } #elif GB_IS_PLUS_PAIR_8_SEMIRING - { + { // (PLUS int8, uint8 monoids)_PAIR semirings + // only used by the JIT if int8 and uint8 + // FactoryKernels disabled uint64_t t = ((uint64_t) cij) + vlen ; cij = (GB_C_TYPE) (t & 0xFFL) ; } #elif GB_IS_PLUS_PAIR_16_SEMIRING { // (PLUS int16, uint16 monoids)_PAIR semirings - // this is only used by the JIT + // only used by the JIT if int16 and uint16 + // FactoryKernels disabled uint64_t t = ((uint64_t) cij) + vlen ; cij = (GB_C_TYPE) (t & 0xFFFFL) ; } @@ -779,15 +782,18 @@ cij = (GB_C_TYPE) (t & 0x1L) ; } #elif GB_IS_PLUS_PAIR_8_SEMIRING - { + { // (PLUS int8, uint8 monoids)_PAIR semirings + // only used by the JIT if int8 and uint8 + // FactoryKernels disabled uint64_t t = ((uint64_t) cij) + bjnz ; cij = (GB_C_TYPE) (t & 0xFFL) ; } #elif GB_IS_PLUS_PAIR_16_SEMIRING { // (PLUS int16, uint16 monoids)_PAIR semirings - // this is only used by the JIT + // only used by the JIT if int16 and uint16 + // FactoryKernels disabled uint64_t t = ((uint64_t) cij) + bjnz ; cij = (GB_C_TYPE) (t & 0xFFFFL) ; } diff --git a/Source/mxm/template/GB_AxB_dot_cij.c b/Source/mxm/template/GB_AxB_dot_cij.c index 5c586b32af..078635f8b2 100644 --- a/Source/mxm/template/GB_AxB_dot_cij.c +++ b/Source/mxm/template/GB_AxB_dot_cij.c @@ -75,14 +75,15 @@ cij = (GB_C_TYPE) (((uint64_t) vlen) & 0x1L) ; } #elif GB_IS_PLUS_PAIR_8_SEMIRING - { + { // (PLUS int8, uint8 monoids)_PAIR semirings + // only used by the JIT if int8 and uint8 FactoryKernels disabled cij = (GB_C_TYPE) (((uint64_t) vlen) & 0xFFL) ; } #elif GB_IS_PLUS_PAIR_16_SEMIRING { // (PLUS int16, uint16 monoids)_PAIR semirings - // this is only used by the JIT + // only used by the JIT if int16 and uint16 FactoryKernels disabled cij = (GB_C_TYPE) (((uint64_t) vlen) & 0xFFFFL) ; } #elif GB_IS_PLUS_PAIR_32_SEMIRING @@ -192,14 +193,15 @@ cij = (GB_C_TYPE) (((uint64_t) bjnz) & 0x1L) ; } #elif GB_IS_PLUS_PAIR_8_SEMIRING - { + { // (PLUS int8, uint8 monoids)_PAIR semirings + // only used by the JIT if int8 and uint8 FactoryKernels disabled cij = (GB_C_TYPE) (((uint64_t) bjnz) & 0xFFL) ; } #elif GB_IS_PLUS_PAIR_16_SEMIRING { // (PLUS int16, uint16 monoids)_PAIR semirings - // this is only used by the JIT + // only used by the JIT if int16 and uint16 FactoryKernels disabled cij = (GB_C_TYPE) (((uint64_t) bjnz) & 0xFFFFL) ; } #elif GB_IS_PLUS_PAIR_32_SEMIRING @@ -408,14 +410,15 @@ cij = (GB_C_TYPE) (((uint64_t) ainz) & 0x1L) ; } #elif GB_IS_PLUS_PAIR_8_SEMIRING - { + { // (PLUS int8, uint8 monoids)_PAIR semirings + // only used by the JIT if int8 and uint8 FactoryKernels disabled cij = (GB_C_TYPE) (((uint64_t) ainz) & 0xFFL) ; } #elif GB_IS_PLUS_PAIR_16_SEMIRING { // (PLUS int16, uint16 monoids)_PAIR semirings - // this is only used by the JIT + // only used by the JIT if int16 and uint16 FactoryKernels disabled cij = (GB_C_TYPE) (((uint64_t) ainz) & 0xFFFFL) ; } #elif GB_IS_PLUS_PAIR_32_SEMIRING diff --git a/Source/mxm/template/GB_AxB_saxbit_template.c b/Source/mxm/template/GB_AxB_saxbit_template.c index e71257ee73..ecb3b8ac1d 100644 --- a/Source/mxm/template/GB_AxB_saxbit_template.c +++ b/Source/mxm/template/GB_AxB_saxbit_template.c @@ -133,9 +133,8 @@ if (M_is_sparse_or_hyper) { // Cb [pC] += 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, - NULL, 0, GB_ALL, NULL, NULL, 0, GB_ALL, NULL, - M, Mask_struct, GB_ASSIGN, GB_BITMAP_M_SCATTER_PLUS_2, + GB_bitmap_M_scatter_whole (C, M, Mask_struct, + GB_BITMAP_M_SCATTER_PLUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; // the bitmap of C now contains: // Cb (i,j) = 0: cij not present, mij zero @@ -404,10 +403,8 @@ if (M_is_sparse_or_hyper) { // Cb [pC] -= 2 for each entry M(i,j) in the mask - GB_bitmap_M_scatter (C, - NULL, 0, GB_ALL, NULL, NULL, 0, GB_ALL, NULL, - M, Mask_struct, GB_ASSIGN, GB_BITMAP_M_SCATTER_MINUS_2, - M_ek_slicing, M_ntasks, M_nthreads) ; + GB_bitmap_M_scatter_whole (C, M, Mask_struct, + GB_BITMAP_M_SCATTER_MINUS_2, M_ek_slicing, M_ntasks, M_nthreads) ; } } diff --git a/Source/ok/GB_assert.h b/Source/ok/GB_assert.h index 011fefd8dd..123ca1dc44 100644 --- a/Source/ok/GB_assert.h +++ b/Source/ok/GB_assert.h @@ -1,12 +1,15 @@ //------------------------------------------------------------------------------ -// GB_assert.h: assertions +// GB_assert.h: assertions for all of GraphBLAS except JIT 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 //------------------------------------------------------------------------------ +// These methods are used in all of GraphBLAS except for JIT kernels. +// For JIT kernels, see ok/GB_assert_kernels.h. + //------------------------------------------------------------------------------ // debugging definitions //------------------------------------------------------------------------------ @@ -83,6 +86,7 @@ #undef ASSERT_TYPE_OK_OR_NULL #undef ASSERT_BINARYOP_OK #undef ASSERT_INDEXUNARYOP_OK +#undef ASSERT_INDEXBINARYOP_OK #undef ASSERT_BINARYOP_OK_OR_NULL #undef ASSERT_UNARYOP_OK #undef ASSERT_UNARYOP_OK_OR_NULL @@ -113,6 +117,9 @@ #define ASSERT_INDEXUNARYOP_OK(op,name,pr) \ ASSERT_OK (GB_IndexUnaryOp_check (op, name, pr, NULL)) +#define ASSERT_INDEXBINARYOP_OK(op,name,pr) \ + ASSERT_OK (GB_IndexBinaryOp_check (op, name, pr, NULL)) + #define ASSERT_BINARYOP_OK_OR_NULL(op,name,pr) \ ASSERT_OK_OR_NULL (GB_BinaryOp_check (op, name, pr, NULL)) @@ -135,7 +142,7 @@ ASSERT_OK_OR_NULL (GB_Operator_check (op, name, pr, NULL)) #define ASSERT_MONOID_OK(mon,name,pr) \ - ASSERT_OK (GB_Monoid_check (mon, name, pr, NULL)) + ASSERT_OK (GB_Monoid_check (mon, name, pr, NULL, false)) #define ASSERT_SEMIRING_OK(s,name,pr) \ ASSERT_OK (GB_Semiring_check (s, name, pr, NULL)) @@ -165,8 +172,8 @@ ASSERT_OK_OR_NULL (GB_Descriptor_check (d, name, pr, NULL)) #define ASSERT_CONTEXT_OK(c,name,pr) \ - ASSERT_OK (GB_context_check (c, name, pr, NULL)) + ASSERT_OK (GB_Context_check (c, name, pr, NULL)) #define ASSERT_CONTEXT_OK_OR_NULL(c,name,pr) \ - ASSERT_OK_OR_NULL (GB_context_check (c, name, pr, NULL)) + ASSERT_OK_OR_NULL (GB_Context_check (c, name, pr, NULL)) diff --git a/Source/ok/GB_ok.h b/Source/ok/GB_check_inputs.h similarity index 90% rename from Source/ok/GB_ok.h rename to Source/ok/GB_check_inputs.h index d5d58f3ee2..8fae0e5c50 100644 --- a/Source/ok/GB_ok.h +++ b/Source/ok/GB_check_inputs.h @@ -1,28 +1,14 @@ //------------------------------------------------------------------------------ -// GB_ok.h: macros for checking inputs and returning if an error occurs +// GB_check_inputs.h: macros for checking inputs; return if error occurs //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ -#ifndef GB_OK_H -#define GB_OK_H - -//------------------------------------------------------------------------------ -// GB_OK: call a method and take corrective active if it fails -//------------------------------------------------------------------------------ - -#define GB_OK(method) \ -{ \ - info = method ; \ - if (info != GrB_SUCCESS) \ - { \ - GB_FREE_ALL ; \ - return (info) ; \ - } \ -} +#ifndef GB_CHECK_INPUTS_H +#define GB_CHECK_INPUTS_H //------------------------------------------------------------------------------ // GB_RETURN_*: input guards for user-callable GrB* and GxB* methods diff --git a/Source/ok/include/GB_assert_kernels.h b/Source/ok/include/GB_assert_kernels.h index f16d07ffff..05e64148af 100644 --- a/Source/ok/include/GB_assert_kernels.h +++ b/Source/ok/include/GB_assert_kernels.h @@ -1,12 +1,15 @@ //------------------------------------------------------------------------------ -// GB_assert_kernels.h: assertions +// GB_assert_kernels.h: assertions for JIT 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 //------------------------------------------------------------------------------ +// These methods are for JIT kernels. +// For outside of JIT kernels, see ok/GB_assert.h. + //------------------------------------------------------------------------------ // debugging definitions //------------------------------------------------------------------------------ @@ -71,6 +74,7 @@ #undef ASSERT_TYPE_OK_OR_NULL #undef ASSERT_BINARYOP_OK #undef ASSERT_INDEXUNARYOP_OK +#undef ASSERT_INDEXBINARYOP_OK #undef ASSERT_BINARYOP_OK_OR_NULL #undef ASSERT_UNARYOP_OK #undef ASSERT_UNARYOP_OK_OR_NULL @@ -93,6 +97,7 @@ #define ASSERT_TYPE_OK_OR_NULL(t,name,pr) #define ASSERT_BINARYOP_OK(op,name,pr) #define ASSERT_INDEXUNARYOP_OK(op,name,pr) +#define ASSERT_INDEXBINARYOP_OK(op,name,pr) #define ASSERT_BINARYOP_OK_OR_NULL(op,name,pr) #define ASSERT_UNARYOP_OK(op,name,pr) #define ASSERT_UNARYOP_OK_OR_NULL(op,name,pr) diff --git a/Source/ok/include/GB_ok.h b/Source/ok/include/GB_ok.h new file mode 100644 index 0000000000..524bbdd047 --- /dev/null +++ b/Source/ok/include/GB_ok.h @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// GB_ok.h: call a GraphBLAS method and return if an error occurs +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_OK_H +#define GB_OK_H + +#define GB_OK(method) \ +{ \ + info = method ; \ + if (info != GrB_SUCCESS) \ + { \ + GB_FREE_ALL ; \ + return (info) ; \ + } \ +} + +#endif diff --git a/Source/op/GB_Op_free.c b/Source/op/GB_Op_free.c index ce62904639..1f2db44002 100644 --- a/Source/op/GB_Op_free.c +++ b/Source/op/GB_Op_free.c @@ -27,6 +27,11 @@ GrB_Info GB_Op_free // free a user-created op { GB_FREE (&(op->defn), defn_size) ; } + size_t theta_size = op->theta_size ; + if (theta_size > 0) + { + GB_FREE (&(op->theta), theta_size) ; + } size_t header_size = op->header_size ; if (header_size > 0) { diff --git a/Source/op/GB_op_name_and_defn.c b/Source/op/GB_op_name_and_defn.c index f2601928f7..ff3da2ef50 100644 --- a/Source/op/GB_op_name_and_defn.c +++ b/Source/op/GB_op_name_and_defn.c @@ -36,6 +36,8 @@ GrB_Info GB_op_name_and_defn //-------------------------------------------------------------------------- ASSERT (op_name != NULL) ; + ASSERT (op_name_len != NULL) ; + ASSERT (op_hash != NULL) ; ASSERT (op_defn != NULL) ; ASSERT (op_defn_size != NULL) ; (*op_defn) = NULL ; @@ -60,21 +62,18 @@ GrB_Info GB_op_name_and_defn // 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 || (*op_name_len) > 0)) ; - //-------------------------------------------------------------------------- // get the definition of the operator, if present //-------------------------------------------------------------------------- char *defn = NULL ; size_t defn_size = 0 ; + size_t defn_len = 0 ; + if (input_defn != NULL) { // determine the string length of the definition - size_t defn_len = strlen (input_defn) ; + defn_len = strlen (input_defn) ; // allocate space for the definition defn = GB_MALLOC (defn_len+1, char, &defn_size) ; @@ -88,6 +87,15 @@ GrB_Info GB_op_name_and_defn memcpy (defn, input_defn, defn_len+1) ; } + //-------------------------------------------------------------------------- + // compute the operator hash + //-------------------------------------------------------------------------- + + // 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 || ((*op_name_len) > 0 && defn_len > 0))) ; + //-------------------------------------------------------------------------- // return result //-------------------------------------------------------------------------- diff --git a/Source/pack_unpack/GxB_Matrix_pack_HyperCSC.c b/Source/pack_unpack/GxB_Matrix_pack_HyperCSC.c index f71bbf81f7..d68b72506f 100644 --- a/Source/pack_unpack/GxB_Matrix_pack_HyperCSC.c +++ b/Source/pack_unpack/GxB_Matrix_pack_HyperCSC.c @@ -27,7 +27,7 @@ GrB_Info GxB_Matrix_pack_HyperCSC // pack a hypersparse CSC matrix bool jumbled, // if true, indices in each column may be unsorted const GrB_Descriptor desc ) -{ +{ //-------------------------------------------------------------------------- // check inputs and get the descriptor diff --git a/Source/pending/GB_Pending.h b/Source/pending/GB_Pending.h index 3a8f6b354e..041f25c55c 100644 --- a/Source/pending/GB_Pending.h +++ b/Source/pending/GB_Pending.h @@ -11,10 +11,6 @@ #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 //------------------------------------------------------------------------------ @@ -41,44 +37,6 @@ void GB_Pending_free // free a list of pending tuples GB_Pending *PHandle ) ; -//------------------------------------------------------------------------------ -// GB_Pending_ensure: make sure the list of pending tuples is large enough -//------------------------------------------------------------------------------ - -// create or reallocate a list of pending tuples - -static inline bool GB_Pending_ensure -( - GB_Pending *PHandle, // input/output - bool iso, // if true, do not allocate Pending->x - GrB_Type type, // type of pending tuples - GrB_BinaryOp op, // operator for assembling pending tuples - bool is_matrix, // true if Pending->j must be allocated - int64_t nnew, // # of pending tuples to add - GB_Werk Werk -) -{ - - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- - - ASSERT (PHandle != NULL) ; - - //-------------------------------------------------------------------------- - // ensure the list of pending tuples is large enough - //-------------------------------------------------------------------------- - - if ((*PHandle) == NULL) - { - return (GB_Pending_alloc (PHandle, iso, type, op, is_matrix, nnew)) ; - } - else - { - return (GB_Pending_realloc (PHandle, nnew, Werk)) ; - } -} - //------------------------------------------------------------------------------ // GB_Pending_add: add an entry A(i,j) to the list of pending tuples //------------------------------------------------------------------------------ diff --git a/Source/pending/GB_Pending_ensure.c b/Source/pending/GB_Pending_ensure.c new file mode 100644 index 0000000000..37c54ab9a6 --- /dev/null +++ b/Source/pending/GB_Pending_ensure.c @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// GB_Pending_ensure: ensure a list of pending tuples is large enough +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "pending/GB_Pending.h" + +// create or reallocate a list of pending tuples + +GB_CALLBACK_PENDING_ENSURE_PROTO (GB_Pending_ensure) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + ASSERT (PHandle != NULL) ; + + //-------------------------------------------------------------------------- + // ensure the list of pending tuples is large enough + //-------------------------------------------------------------------------- + + if ((*PHandle) == NULL) + { + return (GB_Pending_alloc (PHandle, iso, type, op, is_matrix, nnew)) ; + } + else + { + return (GB_Pending_realloc (PHandle, nnew, Werk)) ; + } +} + diff --git a/Source/positional/GB_positional_idxunop_ijflip.c b/Source/positional/GB_positional_idxunop_ijflip.c index 4c723b5d1e..696a53b700 100644 --- a/Source/positional/GB_positional_idxunop_ijflip.c +++ b/Source/positional/GB_positional_idxunop_ijflip.c @@ -8,8 +8,8 @@ //------------------------------------------------------------------------------ // Flip i and j to handle the CSR/CSC variations, for index-unary positional -// ops. The two operators GB_FLIPDIAG_INT[32,64] are only used internally -// and are not available to the user application. +// ops. The two operators GxB_FLIPDIAGINDEX_INT32 and GxB_FLIPDIAGINDEX_INT64 +// are only used internally and are not available to the user application. #include "GB.h" diff --git a/Source/print/GB_BinaryOp_check.c b/Source/print/GB_BinaryOp_check.c index 2e70527802..47b780a34c 100644 --- a/Source/print/GB_BinaryOp_check.c +++ b/Source/print/GB_BinaryOp_check.c @@ -8,6 +8,7 @@ //------------------------------------------------------------------------------ #include "GB.h" +#include "get_set/GB_get_set.h" GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator ( @@ -43,7 +44,7 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator GB_CHECK_MAGIC (op) ; GB_Opcode opcode = op->opcode ; - if (!GB_IS_BINARYOP_CODE (opcode)) + if (!(GB_IS_BINARYOP_CODE (opcode) || GB_IS_INDEXBINARYOP_CODE (opcode))) { GBPR0 (" BinaryOp has an invalid opcode\n") ; return (GrB_INVALID_OBJECT) ; @@ -56,7 +57,9 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator return (GrB_INVALID_OBJECT) ; } - bool op_is_positional = GB_OPCODE_IS_POSITIONAL (opcode) ; + bool op_is_from_idxbinop = + GB_IS_BUILTIN_BINOP_CODE_POSITIONAL (opcode) || + GB_IS_INDEXBINARYOP_CODE (opcode) ; 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) ; @@ -69,15 +72,20 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator // user-defined binary operator GBPR0 ("(user-defined): z=%s(x,y)\n", op_name) ; } + else if (opcode == GB_USER_idxbinop_code) + { + GBPR0 ("(user-defined index):\n z=%s(x,ix,iy,y,iy,yj,theta)\n", + op_name) ; + } else if (opcode == GB_FIRST_binop_code && op->ztype->code == GB_UDT_code) { // FIRST_UDT binary operator created by GB_reduce_to_vector GBPR0 ("(generated): z=%s(x,y)\n", op_name) ; } - else if (op_is_positional) + else if (op_is_from_idxbinop) { - // built-in positional binary operator - GBPR0 ("(built-in positional): z=%s(x,y,i,k,j)\n", op_name) ; + // built-in index binary operator + GBPR0 ("(built-in index):\n z=%s(x,ix,iy,y,iy,yj,theta)\n", op_name) ; } else { @@ -85,8 +93,9 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator GBPR0 ("(built-in): z=%s(x,y)\n", op_name) ; } - if (!(op_is_positional || op_is_first || op_is_second) - && op->binop_function == NULL) + if ((!(op_is_from_idxbinop || op_is_first || op_is_second) + && op->binop_function == NULL) + || (op_is_from_idxbinop && op->idxbinop_function == NULL)) { GBPR0 (" BinaryOp has a NULL function pointer\n") ; return (GrB_INVALID_OBJECT) ; @@ -98,9 +107,16 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator return (GrB_INVALID_OBJECT) ; } + // name given by GrB_set, or 'GrB_*' name for built-in operators + const char *given_name = GB_op_name_get ((GB_Operator) op) ; + if (given_name != NULL) + { + GBPR0 (" BinaryOp given name: [%s]\n", given_name) ; + } + info = GB_Type_check (op->ztype, "ztype", pr, f) ; ASSERT (info == GrB_SUCCESS) ; - if (!op_is_positional && !op_is_pair) + if (!op_is_pair) { if (!op_is_second) { @@ -123,6 +139,24 @@ GrB_Info GB_BinaryOp_check // check a GraphBLAS binary operator } } + if (op_is_from_idxbinop) + { + info = GB_Type_check (op->theta_type, "theta_type", pr, f) ; + if (info != GrB_SUCCESS) + { + GBPR0 (" BinaryOp has an invalid theta_type\n") ; + return (GrB_INVALID_OBJECT) ; + } + if (pr != GxB_SILENT) + { + GBPR (" theta: [ ") ; + info = GB_entry_check (op->theta_type, op->theta, pr, f) ; + if (info != GrB_SUCCESS) return (info) ; + GBPR ("]") ; + } + GBPR0 ("\n") ; + } + if (op->defn != NULL) { GBPR0 ("%s\n", op->defn) ; diff --git a/Source/print/GB_Context_check.c b/Source/print/GB_Context_check.c index 9f37499e3e..8afcb3d70d 100644 --- a/Source/print/GB_Context_check.c +++ b/Source/print/GB_Context_check.c @@ -38,6 +38,13 @@ GrB_Info GB_Context_check // check a GraphBLAS Context GBPR0 ("\n") ; + // name given by GrB_set, or 'GrB_*' name for built-in objects + char *given_name = Context->user_name ; + if (Context->user_name_size > 0 && given_name != NULL) + { + GBPR0 (" Context given name: [%s]\n", given_name) ; + } + int nthreads_max = GB_Context_nthreads_max_get (Context) ; GBPR0 (" Context.nthreads: %d\n", nthreads_max) ; diff --git a/Source/print/GB_Descriptor_check.c b/Source/print/GB_Descriptor_check.c index 19bdf3daa8..61c9f4063e 100644 --- a/Source/print/GB_Descriptor_check.c +++ b/Source/print/GB_Descriptor_check.c @@ -8,6 +8,7 @@ //------------------------------------------------------------------------------ #include "GB.h" +#include "get_set/GB_get_set.h" //------------------------------------------------------------------------------ // GB_dc: check a single descriptor field @@ -121,6 +122,13 @@ GrB_Info GB_Descriptor_check // check a GraphBLAS descriptor GBPR0 ("\n") ; + // name given by GrB_set, or 'GrB_*' name for built-in operators + const char *given_name = GB_desc_name_get (D) ; + if (given_name != NULL) + { + GBPR0 (" Descriptor given name: [%s]\n", given_name) ; + } + GrB_Info info [5] ; info [0] = GB_dc (0, "out ", D->out, GrB_REPLACE, pr, f) ; info [1] = GB_dc (1, "mask ", D->mask, GxB_DEFAULT, pr, f) ; diff --git a/Source/print/GB_IndexBinaryOp_check.c b/Source/print/GB_IndexBinaryOp_check.c new file mode 100644 index 0000000000..3d4616a407 --- /dev/null +++ b/Source/print/GB_IndexBinaryOp_check.c @@ -0,0 +1,111 @@ +//------------------------------------------------------------------------------ +// GB_IndexBinaryOp_check: check and print a index_binary operator +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" +#include "get_set/GB_get_set.h" + +GrB_Info GB_IndexBinaryOp_check // check a GraphBLAS index_binary operator +( + const GxB_IndexBinaryOp op, // GraphBLAS operator to print and check + const char *name, // name of the operator + int pr, // print level + FILE *f // file for output +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GBPR0 ("\n GraphBLAS IndexBinaryOp: %s ", ((name != NULL) ? name : "")) ; + + if (op == NULL) + { + GBPR0 ("NULL\n") ; + return (GrB_NULL_POINTER) ; + } + + //-------------------------------------------------------------------------- + // check object + //-------------------------------------------------------------------------- + + GB_CHECK_MAGIC (op) ; + GB_Opcode opcode = op->opcode ; + if (!GB_IS_INDEXBINARYOP_CODE (opcode)) + { + GBPR0 (" IndexBinaryOp has an invalid opcode\n") ; + return (GrB_INVALID_OBJECT) ; + } + + // only user-defined IndexBinaryOps exist + ASSERT (opcode == GB_USER_idxbinop_code) ; + GBPR0 ("(user-defined):\n ") ; + + 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,ix,jx,y,iy,jy,theta)\n", op_name) ; + + // name given by GrB_set, or 'GrB_*' name for built-in operators + const char *given_name = GB_op_name_get ((GB_Operator) op) ; + if (given_name != NULL) + { + GBPR0 (" IndexBinaryOp given name: [%s]\n", given_name) ; + } + + if (op->idxbinop_function == NULL) + { + GBPR0 (" IndexBinaryOp has a NULL function pointer\n") ; + return (GrB_INVALID_OBJECT) ; + } + + if (opcode == GB_USER_idxbinop_code && name_len != actual_len) + { + GBPR0 (" IndexBinaryOp has an invalid name_len\n") ; + return (GrB_INVALID_OBJECT) ; + } + + GrB_Info info ; + + info = GB_Type_check (op->ztype, "ztype", pr, f) ; + if (info != GrB_SUCCESS) + { + GBPR0 (" IndexBinaryOp has an invalid ztype\n") ; + return (GrB_INVALID_OBJECT) ; + } + + info = GB_Type_check (op->xtype, "xtype", pr, f) ; + if (info != GrB_SUCCESS) + { + GBPR0 (" IndexBinaryOp has an invalid xtype\n") ; + return (GrB_INVALID_OBJECT) ; + } + + info = GB_Type_check (op->ytype, "ytype", pr, f) ; + if (info != GrB_SUCCESS) + { + GBPR0 (" IndexBinaryOp has an invalid ytype\n") ; + return (GrB_INVALID_OBJECT) ; + } + + info = GB_Type_check (op->theta_type, "theta_type", pr, f) ; + if (info != GrB_SUCCESS) + { + GBPR0 (" IndexBinaryOp has an invalid theta_type\n") ; + return (GrB_INVALID_OBJECT) ; + } + + if (op->defn != NULL) + { + GBPR0 ("%s\n", op->defn) ; + } + + return (GrB_SUCCESS) ; +} + diff --git a/Source/print/GB_IndexUnaryOp_check.c b/Source/print/GB_IndexUnaryOp_check.c index 99a07b49dc..cc06b3d092 100644 --- a/Source/print/GB_IndexUnaryOp_check.c +++ b/Source/print/GB_IndexUnaryOp_check.c @@ -8,6 +8,7 @@ //------------------------------------------------------------------------------ #include "GB.h" +#include "get_set/GB_get_set.h" GrB_Info GB_IndexUnaryOp_check // check a GraphBLAS index_unary operator ( @@ -67,6 +68,13 @@ GrB_Info GB_IndexUnaryOp_check // check a GraphBLAS index_unary operator return (GrB_INVALID_OBJECT) ; } + // name given by GrB_set, or 'GrB_*' name for built-in operators + const char *given_name = GB_op_name_get ((GB_Operator) op) ; + if (given_name != NULL) + { + GBPR0 (" IndexUnaryOp given name: [%s]\n", given_name) ; + } + GrB_Info info ; info = GB_Type_check (op->ztype, "ztype", pr, f) ; diff --git a/Source/print/GB_Monoid_check.c b/Source/print/GB_Monoid_check.c index 453ea714a3..2adea3490b 100644 --- a/Source/print/GB_Monoid_check.c +++ b/Source/print/GB_Monoid_check.c @@ -8,13 +8,15 @@ //------------------------------------------------------------------------------ #include "GB.h" +#include "get_set/GB_get_set.h" GrB_Info GB_Monoid_check // check a GraphBLAS monoid ( const GrB_Monoid monoid, // GraphBLAS monoid to print and check const char *name, // name of the monoid, optional int pr, // print level - FILE *f // file for output + FILE *f, // file for output + bool in_semiring // if true, then called by GB_Semiring_check ) { @@ -55,6 +57,13 @@ GrB_Info GB_Monoid_check // check a GraphBLAS monoid return (GrB_INVALID_OBJECT) ; } + // name given by GrB_set, or 'GrB_*' name for built-in objects + const char *given_name = GB_monoid_name_get (monoid) ; + if (given_name != NULL) + { + GBPR0 (" Monoid given name: [%s]\n", given_name) ; + } + if (monoid->op->xtype != monoid->op->ztype || monoid->op->ytype != monoid->op->ztype) { @@ -85,7 +94,7 @@ GrB_Info GB_Monoid_check // check a GraphBLAS monoid if (info != GrB_SUCCESS) return (info) ; GBPR (" ]") ; } - GBPR ("\n") ; + if (!in_semiring) GBPR ("\n") ; } return (GrB_SUCCESS) ; diff --git a/Source/print/GB_Operator_check.c b/Source/print/GB_Operator_check.c index 74b585e39e..c3890882ff 100644 --- a/Source/print/GB_Operator_check.c +++ b/Source/print/GB_Operator_check.c @@ -47,6 +47,10 @@ GrB_Info GB_Operator_check // check a GraphBLAS operator { return (GB_IndexUnaryOp_check ((GrB_IndexUnaryOp) op, name, pr, f)) ; } + else if (GB_IS_INDEXBINARYOP_CODE (opcode)) + { + return (GB_IndexBinaryOp_check ((GxB_IndexBinaryOp) op, name, pr, f)) ; + } else if (GB_IS_SELECTOP_CODE (opcode)) { return (GB_SelectOp_check ((GxB_SelectOp) op, name, pr, f)) ; diff --git a/Source/print/GB_Semiring_check.c b/Source/print/GB_Semiring_check.c index f2603c1461..b41343e1cf 100644 --- a/Source/print/GB_Semiring_check.c +++ b/Source/print/GB_Semiring_check.c @@ -8,6 +8,7 @@ //------------------------------------------------------------------------------ #include "GB.h" +#include "get_set/GB_get_set.h" GrB_Info GB_Semiring_check // check a GraphBLAS semiring ( @@ -59,7 +60,7 @@ GrB_Info GB_Semiring_check // check a GraphBLAS semiring } GrB_Info info ; - info = GB_Monoid_check (add, "semiring->add", pr, f) ; + info = GB_Monoid_check (add, "semiring->add", pr, f, true) ; if (info != GrB_SUCCESS) { GBPR0 (" Semiring->add invalid\n") ; @@ -73,6 +74,13 @@ GrB_Info GB_Semiring_check // check a GraphBLAS semiring return (GrB_INVALID_OBJECT) ; } + // name given by GrB_set, or 'GrB_*' name for built-in objects + const char *given_name = GB_semiring_name_get (semiring) ; + if (given_name != NULL) + { + GBPR0 (" Semiring given name: [%s]\n", given_name) ; + } + // z = multiply(x,y); type of z must match monoid type if (mult->ztype != add->op->ztype) { diff --git a/Source/print/GB_Type_check.c b/Source/print/GB_Type_check.c index 139c53ca43..3b588c21eb 100644 --- a/Source/print/GB_Type_check.c +++ b/Source/print/GB_Type_check.c @@ -13,6 +13,7 @@ // GraphBLAS GrB_Type was created. #include "GB.h" +#include "get_set/GB_get_set.h" GrB_Info GB_Type_check // check a GraphBLAS Type ( @@ -27,7 +28,7 @@ GrB_Info GB_Type_check // check a GraphBLAS Type // check inputs //-------------------------------------------------------------------------- - GBPR0 (" GraphBLAS type: ") ; + GBPR0 (" GraphBLAS Type: ") ; if (name != NULL) GBPR0 ("%s ", name) ; if (type == NULL) @@ -78,6 +79,13 @@ GrB_Info GB_Type_check // check a GraphBLAS Type return (GrB_INVALID_OBJECT) ; } + // name given by GrB_set + char *given_name = type->user_name ; + if (type->user_name_size > 0 && given_name != NULL) + { + GBPR0 (" Type given name: [%s]\n", given_name) ; + } + if (type->defn != NULL) { GBPR0 (" %s\n", type->defn) ; diff --git a/Source/print/GB_UnaryOp_check.c b/Source/print/GB_UnaryOp_check.c index f5e1daaa29..bcba3274b6 100644 --- a/Source/print/GB_UnaryOp_check.c +++ b/Source/print/GB_UnaryOp_check.c @@ -8,6 +8,7 @@ //------------------------------------------------------------------------------ #include "GB.h" +#include "get_set/GB_get_set.h" GrB_Info GB_UnaryOp_check // check a GraphBLAS unary operator ( @@ -54,7 +55,7 @@ GrB_Info GB_UnaryOp_check // check a GraphBLAS unary operator 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_positional = GB_IS_BUILTIN_UNOP_CODE_POSITIONAL (opcode) ; bool op_is_one = (opcode == GB_ONE_unop_code) ; bool op_is_identity = (opcode == GB_IDENTITY_unop_code) ; @@ -70,6 +71,13 @@ GrB_Info GB_UnaryOp_check // check a GraphBLAS unary operator return (GrB_INVALID_OBJECT) ; } + // name given by GrB_set, or 'GrB_*' name for built-in objects + const char *given_name = GB_op_name_get ((GB_Operator) op) ; + if (given_name != NULL) + { + GBPR0 (" UnaryOp given name: [%s]\n", given_name) ; + } + GrB_Info info ; info = GB_Type_check (op->ztype, "ztype", pr, f) ; diff --git a/Source/print/GB_check.h b/Source/print/GB_check.h index 2e0e3b59b5..d17139dc1a 100644 --- a/Source/print/GB_check.h +++ b/Source/print/GB_check.h @@ -66,6 +66,15 @@ GrB_Info GB_IndexUnaryOp_check // check a GraphBLAS index_unary operator FILE *f // file for output ) ; +GrB_Info GB_IndexBinaryOp_check // check a GraphBLAS index_binary operator +( + const GxB_IndexBinaryOp op, // GraphBLAS operator to print and check + const char *name, // name of the operator + int pr, // print level + FILE *f // file for output +) ; + +#ifndef GB_CUDA_FOLDER GrB_Info GB_SelectOp_check // check a GraphBLAS select operator ( const GxB_SelectOp op, // GraphBLAS operator to print and check @@ -73,6 +82,7 @@ GrB_Info GB_SelectOp_check // check a GraphBLAS select operator int pr, // print level FILE *f // file for output ) ; +#endif GrB_Info GB_Operator_check // check a GraphBLAS operator ( @@ -87,7 +97,8 @@ GrB_Info GB_Monoid_check // check a GraphBLAS monoid const GrB_Monoid monoid, // GraphBLAS monoid to print and check const char *name, // name of the monoid, optional int pr, // print level - FILE *f // file for output + FILE *f, // file for output + bool in_semiring // if true, then called by GB_Semiring_check ) ; GrB_Info GB_Semiring_check // check a GraphBLAS semiring @@ -119,7 +130,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector const GrB_Matrix A, // GraphBLAS matrix to print and check const char *name, // name of the matrix, optional int pr, // print level; if negative, ignore nzombie - // conditions and use GB_FLIP(pr) for diagnostics + // conditions and use GB_ZOMBIE(pr) for diagnostics FILE *f, // file for output const char *kind // "matrix" or "vector" ) ; diff --git a/Source/print/GB_matvec_check.c b/Source/print/GB_matvec_check.c index fae9178929..3800758b52 100644 --- a/Source/print/GB_matvec_check.c +++ b/Source/print/GB_matvec_check.c @@ -18,13 +18,14 @@ #include "pending/GB_Pending.h" #include "GB.h" +#include "get_set/GB_get_set.h" GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector ( const GrB_Matrix A, // GraphBLAS matrix to print and check const char *name, // name of the matrix, optional int pr, // print level; if negative, ignore nzombie - // conditions and use GB_FLIP(pr) for diagnostics + // conditions and use GB_ZOMBIE(pr) for diagnostics FILE *f, // file for output (or stdout if f is NULL) const char *kind // "matrix" or "vector" (only for printing diag.) ) @@ -43,7 +44,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector bool ignore_zombies = false ; if (pr < 0) { - pr = GB_FLIP (pr) ; + pr = GB_DEZOMBIE (pr) ; ignore_zombies = true ; } pr = GB_IMIN (pr, GxB_COMPLETE_VERBOSE) ; @@ -83,7 +84,14 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector } else { - GBPR0 ("%s", A->type->name) ; + if (A->type->name [0] == '\0') + { + GBPR0 ("user-defined (type size %zu bytes)", A->type->size) ; + } + else + { + GBPR0 ("%s", A->type->name) ; + } } } @@ -460,7 +468,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector GBPR0 (", memory: %.1f KB\n", s) ; } else if (memsize < K*K*K) - { + { double s = ((double) memsize) / ((double) K*K) ; GBPR0 (", memory: %.1f MB\n", s) ; } @@ -490,6 +498,17 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector GBPR0 ("\n") ; } + //-------------------------------------------------------------------------- + // report the GrB_set name + //-------------------------------------------------------------------------- + + // name given by GrB_set + char *given_name = A->user_name ; + if (A->user_name_size > 0 && given_name != NULL) + { + GBPR0 (" %s given name: [%s]\n", kind, given_name) ; + } + //-------------------------------------------------------------------------- // report the number of pending tuples and zombies //-------------------------------------------------------------------------- @@ -596,7 +615,7 @@ GrB_Info GB_matvec_check // check a GraphBLAS matrix or vector int64_t i = GBI (A->i, p, A->vlen) ; bool is_zombie = GB_IS_ZOMBIE (i) ; - i = GB_UNFLIP (i) ; + i = GB_UNZOMBIE (i) ; if (is_zombie) nzombies++ ; bool print_value = false ; if (prcol) diff --git a/Source/print/GB_printf.h b/Source/print/GB_printf.h index 8a00784a43..1a7a674be0 100644 --- a/Source/print/GB_printf.h +++ b/Source/print/GB_printf.h @@ -132,6 +132,7 @@ void GB_assign_burble ( + const char *method, // method const bool C_replace, // descriptor for C const int Ikind, const int Jkind, diff --git a/Source/print/GxB_IndexBinaryOp_fprint.c b/Source/print/GxB_IndexBinaryOp_fprint.c new file mode 100644 index 0000000000..41c3aad1f1 --- /dev/null +++ b/Source/print/GxB_IndexBinaryOp_fprint.c @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_fprint: print and check a GxB_IndexBinaryOp object +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB.h" + +GrB_Info GxB_IndexBinaryOp_fprint // print and check a GxB_IndexBinaryOp +( + GxB_IndexBinaryOp op, // object to print and check + const char *name, // name of the object + GxB_Print_Level pr, // print level + FILE *f // file for output +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_IndexBinaryOp_fprint (op, name, pr, f)") ; + + //-------------------------------------------------------------------------- + // print and check the object + //-------------------------------------------------------------------------- + + return (GB_IndexBinaryOp_check (op, name, pr, f)) ; +} + diff --git a/Source/print/GxB_Monoid_fprint.c b/Source/print/GxB_Monoid_fprint.c index c01061d80a..67a01ac8fd 100644 --- a/Source/print/GxB_Monoid_fprint.c +++ b/Source/print/GxB_Monoid_fprint.c @@ -28,6 +28,6 @@ GrB_Info GxB_Monoid_fprint // print and check a GrB_Monoid // print and check the object //-------------------------------------------------------------------------- - return (GB_Monoid_check (monoid, name, pr, f)) ; + return (GB_Monoid_check (monoid, name, pr, f, false)) ; } diff --git a/Source/reduce/GB_reduce_to_scalar.c b/Source/reduce/GB_reduce_to_scalar.c index 2d7b0b43ba..da5f61942e 100644 --- a/Source/reduce/GB_reduce_to_scalar.c +++ b/Source/reduce/GB_reduce_to_scalar.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // c = accum (c, reduce_to_scalar(A)), reduce entries in a matrix to a scalar. // Does the work for GrB_*_reduce_TYPE, both matrix and vector. @@ -28,6 +26,7 @@ #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_red__include.h" #endif #include "monoid/include/GB_monoid_shared_definitions.h" @@ -269,6 +268,7 @@ GrB_Info GB_reduce_to_scalar // z = reduce_to_scalar (A) #include "generic/GB_generic.h" GxB_binary_function freduce = monoid->op->binop_function ; + ASSERT (freduce != NULL) ; // ztype z = identity #define GB_DECLARE_IDENTITY(z) \ @@ -413,6 +413,7 @@ GrB_Info GB_reduce_to_scalar // z = reduce_to_scalar (A) else { GxB_binary_function faccum = accum->binop_function ; + ASSERT (faccum != NULL) ; GB_cast_function cast_C_to_xaccum, cast_Z_to_yaccum, cast_zaccum_to_C ; cast_C_to_xaccum = GB_cast_factory (accum->xtype->code, ctype->code) ; diff --git a/Source/reduce/GB_reduce_to_scalar_iso.c b/Source/reduce/GB_reduce_to_scalar_iso.c index bceab7089d..92186b6e5f 100644 --- a/Source/reduce/GB_reduce_to_scalar_iso.c +++ b/Source/reduce/GB_reduce_to_scalar_iso.c @@ -39,6 +39,7 @@ void GB_reduce_to_scalar_iso // s = reduce (A) where A is iso // get the monoid GxB_binary_function freduce = monoid->op->binop_function ; + ASSERT (freduce != NULL) ; GrB_Type ztype = monoid->op->ztype ; size_t zsize = ztype->size ; GB_Type_code zcode = ztype->code ; @@ -57,7 +58,7 @@ void GB_reduce_to_scalar_iso // s = reduce (A) where A is iso // this can occur is if A is a huge full iso-valued matrix, where vlen // * vdim caused uint64_t overflow in GB_nnz_full and returned // INT64_MAX. Reduce the matrix in two steps: first reducing each - // vector of size vlen to a scalar t, obtainting an implicit iso full + // vector of size vlen to a scalar t, obtaining an implicit iso full // vector T of size vdim. Each entry in this vector T has the value t, // and then this vector T is reduced to the result s. GBURBLE ("(reduce huge iso full matrix to scalar) ") ; diff --git a/Source/reduce/factory/GB_red_factory.c b/Source/reduce/factory/GB_red_factory.c index 853b159735..ec8afdd674 100644 --- a/Source/reduce/factory/GB_red_factory.c +++ b/Source/reduce/factory/GB_red_factory.c @@ -15,11 +15,92 @@ // 4: lor, land, eq (same as lxnor), lxor for boolean // 13: any: for all 13 types -// FUTURE: band, bor, bxor, bxnor for uint [8,16,32,64] could be added. -// Or, just use the JIT. +#if defined (GxB_NO_INT8) +#define GB_CASE_INT8(op) +#else +#define GB_CASE_INT8(op) \ + case GB_INT8_code: GB_RED_WORKER (op, _int8 , int8_t ) +#endif + +#if defined (GxB_NO_INT16) +#define GB_CASE_INT16(op) +#else +#define GB_CASE_INT16(op) \ + case GB_INT16_code: GB_RED_WORKER (op, _int16 , int16_t ) +#endif + +#if defined (GxB_NO_INT32) +#define GB_CASE_INT32(op) +#else +#define GB_CASE_INT32(op) \ + case GB_INT32_code: GB_RED_WORKER (op, _int32 , int32_t ) +#endif + +#if defined (GxB_NO_INT64) +#define GB_CASE_INT64(op) +#else +#define GB_CASE_INT64(op) \ + case GB_INT64_code: GB_RED_WORKER (op, _int64 , int64_t ) +#endif + +#if defined (GxB_NO_UINT8) +#define GB_CASE_UINT8(op) +#else +#define GB_CASE_UINT8(op) \ + case GB_UINT8_code: GB_RED_WORKER (op, _uint8 , uint8_t ) +#endif + +#if defined (GxB_NO_UINT16) +#define GB_CASE_UINT16(op) +#else +#define GB_CASE_UINT16(op) \ + case GB_UINT16_code: GB_RED_WORKER (op, _uint16, uint16_t) +#endif + +#if defined (GxB_NO_UINT32) +#define GB_CASE_UINT32(op) +#else +#define GB_CASE_UINT32(op) \ + case GB_UINT32_code: GB_RED_WORKER (op, _uint32, uint32_t) +#endif + +#if defined (GxB_NO_UINT64) +#define GB_CASE_UINT64(op) +#else +#define GB_CASE_UINT64(op) \ + case GB_UINT64_code: GB_RED_WORKER (op, _uint64, uint64_t) +#endif + +#if defined (GxB_NO_FP32) +#define GB_CASE_FP32(op) +#else +#define GB_CASE_FP32(op) \ + case GB_FP32_code: GB_RED_WORKER (op, _fp32 , float ) +#endif + +#if defined (GxB_NO_FP64) +#define GB_CASE_FP64(op) +#else +#define GB_CASE_FP64(op) \ + case GB_FP64_code: GB_RED_WORKER (op, _fp64 , double ) +#endif + +#if defined (GxB_NO_FC32) +#define GB_CASE_FC32(op) +#else +#define GB_CASE_FC32(op) \ + case GB_FC32_code: GB_RED_WORKER (op, _fc32 , GxB_FC32_t) +#endif + +#if defined (GxB_NO_FC64) +#define GB_CASE_FC64(op) +#else +#define GB_CASE_FC64(op) \ + case GB_FC64_code: GB_RED_WORKER (op, _fc64 , GxB_FC64_t) +#endif if (typecode != GB_BOOL_code) -{ +{ //-------------------------------------------------------------------------- // non-boolean case @@ -28,98 +109,98 @@ if (typecode != GB_BOOL_code) switch (opcode) { - case GB_MIN_binop_code : + case GB_MIN_binop_code : switch (typecode) { - case GB_INT8_code : GB_RED_WORKER (_min, _int8, int8_t ) - case GB_INT16_code : GB_RED_WORKER (_min, _int16, int16_t ) - case GB_INT32_code : GB_RED_WORKER (_min, _int32, int32_t ) - case GB_INT64_code : GB_RED_WORKER (_min, _int64, int64_t ) - case GB_UINT8_code : GB_RED_WORKER (_min, _uint8, uint8_t ) - case GB_UINT16_code : GB_RED_WORKER (_min, _uint16, uint16_t) - case GB_UINT32_code : GB_RED_WORKER (_min, _uint32, uint32_t) - case GB_UINT64_code : GB_RED_WORKER (_min, _uint64, uint64_t) - case GB_FP32_code : GB_RED_WORKER (_min, _fp32, float ) - case GB_FP64_code : GB_RED_WORKER (_min, _fp64, double ) + GB_CASE_INT8 (_min) + GB_CASE_INT16 (_min) + GB_CASE_INT32 (_min) + GB_CASE_INT64 (_min) + GB_CASE_UINT8 (_min) + GB_CASE_UINT16 (_min) + GB_CASE_UINT32 (_min) + GB_CASE_UINT64 (_min) + GB_CASE_FP32 (_min) + GB_CASE_FP64 (_min) default: ; } break ; - case GB_MAX_binop_code : + case GB_MAX_binop_code : switch (typecode) { - case GB_INT8_code : GB_RED_WORKER (_max, _int8, int8_t ) - case GB_INT16_code : GB_RED_WORKER (_max, _int16, int16_t ) - case GB_INT32_code : GB_RED_WORKER (_max, _int32, int32_t ) - case GB_INT64_code : GB_RED_WORKER (_max, _int64, int64_t ) - case GB_UINT8_code : GB_RED_WORKER (_max, _uint8, uint8_t ) - case GB_UINT16_code : GB_RED_WORKER (_max, _uint16, uint16_t) - case GB_UINT32_code : GB_RED_WORKER (_max, _uint32, uint32_t) - case GB_UINT64_code : GB_RED_WORKER (_max, _uint64, uint64_t) - case GB_FP32_code : GB_RED_WORKER (_max, _fp32, float ) - case GB_FP64_code : GB_RED_WORKER (_max, _fp64, double ) + GB_CASE_INT8 (_max) + GB_CASE_INT16 (_max) + GB_CASE_INT32 (_max) + GB_CASE_INT64 (_max) + GB_CASE_UINT8 (_max) + GB_CASE_UINT16 (_max) + GB_CASE_UINT32 (_max) + GB_CASE_UINT64 (_max) + GB_CASE_FP32 (_max) + GB_CASE_FP64 (_max) default: ; } break ; - case GB_PLUS_binop_code : + case GB_PLUS_binop_code : switch (typecode) { - case GB_INT8_code : GB_RED_WORKER (_plus, _int8, int8_t ) - case GB_INT16_code : GB_RED_WORKER (_plus, _int16, int16_t ) - case GB_INT32_code : GB_RED_WORKER (_plus, _int32, int32_t ) - case GB_INT64_code : GB_RED_WORKER (_plus, _int64, int64_t ) - case GB_UINT8_code : GB_RED_WORKER (_plus, _uint8, uint8_t ) - case GB_UINT16_code : GB_RED_WORKER (_plus, _uint16, uint16_t) - case GB_UINT32_code : GB_RED_WORKER (_plus, _uint32, uint32_t) - case GB_UINT64_code : GB_RED_WORKER (_plus, _uint64, uint64_t) - case GB_FP32_code : GB_RED_WORKER (_plus, _fp32, float ) - case GB_FP64_code : GB_RED_WORKER (_plus, _fp64, double ) - case GB_FC32_code : GB_RED_WORKER (_plus, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_RED_WORKER (_plus, _fc64, GxB_FC64_t) + GB_CASE_INT8 (_plus) + GB_CASE_INT16 (_plus) + GB_CASE_INT32 (_plus) + GB_CASE_INT64 (_plus) + GB_CASE_UINT8 (_plus) + GB_CASE_UINT16 (_plus) + GB_CASE_UINT32 (_plus) + GB_CASE_UINT64 (_plus) + GB_CASE_FP32 (_plus) + GB_CASE_FP64 (_plus) + GB_CASE_FC32 (_plus) + GB_CASE_FC64 (_plus) default: ; } break ; - case GB_TIMES_binop_code : + case GB_TIMES_binop_code : switch (typecode) { - case GB_INT8_code : GB_RED_WORKER (_times, _int8, int8_t ) - case GB_INT16_code : GB_RED_WORKER (_times, _int16, int16_t ) - case GB_INT32_code : GB_RED_WORKER (_times, _int32, int32_t ) - case GB_INT64_code : GB_RED_WORKER (_times, _int64, int64_t ) - case GB_UINT8_code : GB_RED_WORKER (_times, _uint8, uint8_t ) - case GB_UINT16_code : GB_RED_WORKER (_times, _uint16, uint16_t) - case GB_UINT32_code : GB_RED_WORKER (_times, _uint32, uint32_t) - case GB_UINT64_code : GB_RED_WORKER (_times, _uint64, uint64_t) - case GB_FP32_code : GB_RED_WORKER (_times, _fp32, float ) - case GB_FP64_code : GB_RED_WORKER (_times, _fp64, double ) - case GB_FC32_code : GB_RED_WORKER (_times, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_RED_WORKER (_times, _fc64, GxB_FC64_t) + GB_CASE_INT8 (_times) + GB_CASE_INT16 (_times) + GB_CASE_INT32 (_times) + GB_CASE_INT64 (_times) + GB_CASE_UINT8 (_times) + GB_CASE_UINT16 (_times) + GB_CASE_UINT32 (_times) + GB_CASE_UINT64 (_times) + GB_CASE_FP32 (_times) + GB_CASE_FP64 (_times) + GB_CASE_FC32 (_times) + GB_CASE_FC64 (_times) default: ; } break ; - case GB_ANY_binop_code : + case GB_ANY_binop_code : switch (typecode) { - case GB_INT8_code : GB_RED_WORKER (_any, _int8, int8_t ) - case GB_INT16_code : GB_RED_WORKER (_any, _int16, int16_t ) - case GB_INT32_code : GB_RED_WORKER (_any, _int32, int32_t ) - case GB_INT64_code : GB_RED_WORKER (_any, _int64, int64_t ) - case GB_UINT8_code : GB_RED_WORKER (_any, _uint8, uint8_t ) - case GB_UINT16_code : GB_RED_WORKER (_any, _uint16, uint16_t) - case GB_UINT32_code : GB_RED_WORKER (_any, _uint32, uint32_t) - case GB_UINT64_code : GB_RED_WORKER (_any, _uint64, uint64_t) - case GB_FP32_code : GB_RED_WORKER (_any, _fp32, float ) - case GB_FP64_code : GB_RED_WORKER (_any, _fp64, double ) - case GB_FC32_code : GB_RED_WORKER (_any, _fc32, GxB_FC32_t) - case GB_FC64_code : GB_RED_WORKER (_any, _fc64, GxB_FC64_t) + GB_CASE_INT8 (_any) + GB_CASE_INT16 (_any) + GB_CASE_INT32 (_any) + GB_CASE_INT64 (_any) + GB_CASE_UINT8 (_any) + GB_CASE_UINT16 (_any) + GB_CASE_UINT32 (_any) + GB_CASE_UINT64 (_any) + GB_CASE_FP32 (_any) + GB_CASE_FP64 (_any) + GB_CASE_FC32 (_any) + GB_CASE_FC64 (_any) default: ; } break ; @@ -129,15 +210,13 @@ if (typecode != GB_BOOL_code) } else -{ +{ //-------------------------------------------------------------------------- // boolean case: rename the opcode as needed //-------------------------------------------------------------------------- - // The FIRST and SECOND operators are not associative, but are added for - // GB_builder. - + #ifndef GxB_NO_BOOL switch (GB_boolean_rename (opcode)) { case GB_LOR_binop_code : GB_RED_WORKER (_lor, _bool, bool) @@ -147,5 +226,19 @@ else case GB_ANY_binop_code : GB_RED_WORKER (_any, _bool, bool) default: ; } + #endif } +#undef GB_CASE_INT8 +#undef GB_CASE_INT16 +#undef GB_CASE_INT32 +#undef GB_CASE_INT64 +#undef GB_CASE_UINT8 +#undef GB_CASE_UINT16 +#undef GB_CASE_UINT32 +#undef GB_CASE_UINT64 +#undef GB_CASE_FP32 +#undef GB_CASE_FP64 +#undef GB_CASE_FC32 +#undef GB_CASE_FC64 + diff --git a/Source/reshape/GB_reshape.c b/Source/reshape/GB_reshape.c index 80640ed3b3..33cba4a1a9 100644 --- a/Source/reshape/GB_reshape.c +++ b/Source/reshape/GB_reshape.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed, but variants possible. - // If the input matrix is nrows-by-ncols, and the size of the newly-created // matrix C is nrows_new-by-ncols_new, then nrows*ncols must equal // nrows_new*ncols_new. @@ -278,9 +276,8 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix for (int64_t k = kfirst ; k <= klast ; k++) { int64_t jold = GBH (Th, k) ; - int64_t pT_start, pT_end ; - GB_get_pA (&pT_start, &pT_end, tid, k, - kfirst, klast, pstart_Tslice, Tp, tvlen) ; + GB_GET_PA (pT_start, pT_end, tid, k, kfirst, klast, + pstart_Tslice, Tp [k], Tp [k+1]) ; for (int64_t p = pT_start ; p < pT_end ; p++) { int64_t iold = Ti [p] ; @@ -308,9 +305,8 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix for (int64_t k = kfirst ; k <= klast ; k++) { int64_t jold = GBH (Th, k) ; - int64_t pT_start, pT_end ; - GB_get_pA (&pT_start, &pT_end, tid, k, - kfirst, klast, pstart_Tslice, Tp, tvlen) ; + GB_GET_PA (pT_start, pT_end, tid, k, kfirst, klast, + pstart_Tslice, Tp [k], Tp [k+1]) ; for (int64_t p = pT_start ; p < pT_end ; p++) { int64_t iold = Ti [p] ; @@ -354,13 +350,13 @@ GrB_Info GB_reshape // reshape a GrB_Matrix into another GrB_Matrix &S_work_size, !T_jumbled, // indices may be jumbled on input true, // no duplicates exist - nvals, // number of entries in T and C + nvals, // number of entries in T and C true, // C is a matrix NULL, // I_input is not used NULL, // J_input is not used S_input, // S_input is used if not in-place; NULL if in-place T_iso, // true if T and C are iso-valued - nvals, // number of entries in T and C + nvals, // number of entries in T and C NULL, // no dup operator type, // type of S_work and S_input true, // burble is allowed diff --git a/Source/resize/GB_resize.c b/Source/resize/GB_resize.c index 86ef000ecc..1092bd9809 100644 --- a/Source/resize/GB_resize.c +++ b/Source/resize/GB_resize.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - #include "select/GB_select.h" #include "scalar/GB_Scalar_wrap.h" #include "resize/GB_resize.h" diff --git a/Source/select/GB_select_bitmap.c b/Source/select/GB_select_bitmap.c index 1590e08953..ab6ead7e77 100644 --- a/Source/select/GB_select_bitmap.c +++ b/Source/select/GB_select_bitmap.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #include "select/GB_select.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT @@ -87,7 +85,7 @@ GrB_Info GB_select_bitmap else { // Cx [0:anz-1] = Ax [0:anz-1] - // FIXME: do this on the GPU if appropriate + // Fixme for CUDA: do this on the GPU if appropriate GB_memcpy (C->x, A->x, anz * asize, nthreads) ; } @@ -100,7 +98,8 @@ GrB_Info GB_select_bitmap #if defined ( GRAPHBLAS_HAS_CUDA ) if (GB_cuda_select_branch (A, op)) { - info = GB_cuda_select_bitmap (C->b, &cnvals, C_iso, A, flipij, ythunk, op) ; + info = GB_cuda_select_bitmap (C->b, &cnvals, C_iso, A, flipij, ythunk, + op) ; } #endif @@ -109,9 +108,9 @@ GrB_Info GB_select_bitmap if (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) { - //---------------------------------------------------------------------- + //------------------------------------------------------------------ // bitmap selector for positional ops - //---------------------------------------------------------------------- + //------------------------------------------------------------------ info = GB_select_positional_bitmap (C->b, &cnvals, A, ithunk, op, nthreads) ; @@ -119,19 +118,20 @@ GrB_Info GB_select_bitmap else { - //---------------------------------------------------------------------- + //------------------------------------------------------------------ // bitmap selector for VALUE* and user-defined ops - //---------------------------------------------------------------------- + //------------------------------------------------------------------ #ifndef GBCOMPACT GB_IF_FACTORY_KERNELS_ENABLED { - //------------------------------------------------------------------ + //-------------------------------------------------------------- // via the factory kernel - //------------------------------------------------------------------ + //-------------------------------------------------------------- - #define GB_selbit(opname,aname) GB (_sel_bitmap_ ## opname ## aname) + #define GB_selbit(opname,aname) \ + GB (_sel_bitmap_ ## opname ## aname) #define GB_SEL_WORKER(opname,aname) \ { \ info = GB_selbit (opname, aname) (C->b, &cnvals, A, \ @@ -143,9 +143,9 @@ GrB_Info GB_select_bitmap } #endif - //---------------------------------------------------------------------- + //------------------------------------------------------------------ // via the JIT or PreJIT kernel - //---------------------------------------------------------------------- + //------------------------------------------------------------------ if (info == GrB_NO_VALUE) { @@ -153,14 +153,15 @@ GrB_Info GB_select_bitmap A, flipij, ythunk, op, nthreads) ; } - //---------------------------------------------------------------------- + //------------------------------------------------------------------ // via the generic kernel - //---------------------------------------------------------------------- + //------------------------------------------------------------------ if (info == GrB_NO_VALUE) { - info = GB_select_generic_bitmap (C->b, &cnvals, A, flipij, ythunk, - op, nthreads) ; + GBURBLE ("(generic select) ") ; + info = GB_select_generic_bitmap (C->b, &cnvals, A, flipij, + ythunk, op, nthreads) ; } } } diff --git a/Source/select/GB_select_column.c b/Source/select/GB_select_column.c index 2551c20aae..18a8d608b7 100644 --- a/Source/select/GB_select_column.c +++ b/Source/select/GB_select_column.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // The column selectors can be done in a single pass. #include "select/GB_select.h" @@ -37,7 +35,7 @@ GrB_Info GB_select_column GrB_Info info ; ASSERT_INDEXUNARYOP_OK (op, "idxunop for GB_select_column", GB0) ; - ASSERT_MATRIX_OK (A, "A for select column", GB_FLIP (GB0)) ; + ASSERT_MATRIX_OK (A, "A for select column", GB_ZOMBIE (GB0)) ; GB_Opcode opcode = op->opcode ; ASSERT (opcode == GB_COLINDEX_idxunop_code || opcode == GB_COLLE_idxunop_code || diff --git a/Source/select/GB_select_generic_bitmap.c b/Source/select/GB_select_generic_bitmap.c index c7608c0e1d..a0844c8fa2 100644 --- a/Source/select/GB_select_generic_bitmap.c +++ b/Source/select/GB_select_generic_bitmap.c @@ -30,7 +30,8 @@ GrB_Info GB_select_generic_bitmap GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_BITMAP (A) || GB_IS_FULL (A)) ; - ASSERT (!GB_OPCODE_IS_POSITIONAL (opcode)) ; + ASSERT (GB_IS_INDEXUNARYOP_CODE (opcode)) ; + ASSERT (!GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ; ASSERT (!(A->iso) || (opcode == GB_USER_idxunop_code)) ; ASSERT ((opcode >= GB_VALUENE_idxunop_code && opcode <= GB_VALUELE_idxunop_code) || diff --git a/Source/select/GB_select_generic_phase1.c b/Source/select/GB_select_generic_phase1.c index 7ddbf88ee5..285553fe76 100644 --- a/Source/select/GB_select_generic_phase1.c +++ b/Source/select/GB_select_generic_phase1.c @@ -34,7 +34,8 @@ GrB_Info GB_select_generic_phase1 GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; - ASSERT (!GB_OPCODE_IS_POSITIONAL (opcode)) ; + ASSERT (GB_IS_INDEXUNARYOP_CODE (opcode)) ; + ASSERT (!GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ; ASSERT (opcode != GB_NONZOMBIE_idxunop_code) ; //-------------------------------------------------------------------------- diff --git a/Source/select/GB_select_generic_phase2.c b/Source/select/GB_select_generic_phase2.c index 0c4961da6e..ada068c3b0 100644 --- a/Source/select/GB_select_generic_phase2.c +++ b/Source/select/GB_select_generic_phase2.c @@ -40,7 +40,8 @@ GrB_Info GB_select_generic_phase2 GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; - ASSERT (!GB_OPCODE_IS_POSITIONAL (opcode)) ; + ASSERT (GB_IS_INDEXUNARYOP_CODE (opcode)) ; + ASSERT (!GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ; ASSERT (!(A->iso) || opcode == GB_USER_idxunop_code) ; ASSERT ((opcode >= GB_VALUENE_idxunop_code && opcode <= GB_VALUELE_idxunop_code) @@ -95,7 +96,7 @@ GrB_Info GB_select_generic_phase2 #define GB_TEST_VALUE_OF_ENTRY(keep,p) \ bool keep ; \ fkeep (&keep, x, flipij ? j : i, flipij ? i : j, ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" } else @@ -113,7 +114,7 @@ GrB_Info GB_select_generic_phase2 GB_void z [GB_VLA(zsize)] ; \ fkeep (z, x, flipij ? j : i, flipij ? i : j, ythunk) ; \ cast_Z_to_bool (&keep, z, zsize) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" } @@ -143,7 +144,7 @@ GrB_Info GB_select_generic_phase2 #undef GB_TEST_VALUE_OF_ENTRY #define GB_TEST_VALUE_OF_ENTRY(keep,p) bool keep = (i >= 0) - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" } else if (op->ztype == GrB_BOOL && op->xtype == A->type) @@ -158,7 +159,7 @@ GrB_Info GB_select_generic_phase2 bool keep ; \ fkeep (&keep, Ax +(p)*asize, \ flipij ? j : i, flipij ? i : j, ythunk) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" } else @@ -179,7 +180,7 @@ GrB_Info GB_select_generic_phase2 cast_A_to_X (x, Ax +(p)*asize, asize) ; \ fkeep (z, x, flipij ? j : i, flipij ? i : j, ythunk) ; \ cast_Z_to_bool (&keep, z, zsize) ; - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" } } diff --git a/Source/select/GB_select_positional_bitmap.c b/Source/select/GB_select_positional_bitmap.c index 066a7ba8a2..2038e77a63 100644 --- a/Source/select/GB_select_positional_bitmap.c +++ b/Source/select/GB_select_positional_bitmap.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // A is bitmap or as-if-full. C is bitmap #include "select/GB_select.h" @@ -31,7 +29,7 @@ GrB_Info GB_select_positional_bitmap GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_BITMAP (A) || GB_IS_FULL (A)) ; - ASSERT (GB_OPCODE_IS_POSITIONAL (opcode)) ; + ASSERT (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode)) ; //-------------------------------------------------------------------------- // positional operators when C is bitmap diff --git a/Source/select/GB_select_positional_phase1.c b/Source/select/GB_select_positional_phase1.c index 97ce29a44d..f53797b23b 100644 --- a/Source/select/GB_select_positional_phase1.c +++ b/Source/select/GB_select_positional_phase1.c @@ -9,7 +9,7 @@ // A is sparse or hypersparse -// JIT: not needed, but 3 variants possible (A sparse, hyper, or full for DIAG) +// JIT: not need: use factory; 3 variants (A sparse, hyper, or full for DIAG) #include "select/GB_select.h" #include "slice/GB_ek_slice.h" @@ -36,7 +36,7 @@ GrB_Info GB_select_positional_phase1 GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A) || (opcode == GB_DIAG_idxunop_code)) ; - ASSERT (GB_OPCODE_IS_POSITIONAL (opcode) + ASSERT (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode) || opcode == GB_NONZOMBIE_idxunop_code) ; ASSERT (!GB_IS_BITMAP (A)) ; @@ -51,38 +51,38 @@ GrB_Info GB_select_positional_phase1 case GB_TRIL_idxunop_code : #define GB_TRIL_SELECTOR - #include "select/template/GB_select_positional_phase1_template.c" + #include "select/factory/GB_select_positional_phase1_template.c" break ; case GB_TRIU_idxunop_code : #define GB_TRIU_SELECTOR - #include "select/template/GB_select_positional_phase1_template.c" + #include "select/factory/GB_select_positional_phase1_template.c" break ; case GB_DIAG_idxunop_code : #define GB_DIAG_SELECTOR - #include "select/template/GB_select_positional_phase1_template.c" + #include "select/factory/GB_select_positional_phase1_template.c" break ; case GB_OFFDIAG_idxunop_code : case GB_DIAGINDEX_idxunop_code : #define GB_OFFDIAG_SELECTOR - #include "select/template/GB_select_positional_phase1_template.c" + #include "select/factory/GB_select_positional_phase1_template.c" break ; case GB_ROWINDEX_idxunop_code : #define GB_ROWINDEX_SELECTOR - #include "select/template/GB_select_positional_phase1_template.c" + #include "select/factory/GB_select_positional_phase1_template.c" break ; case GB_ROWLE_idxunop_code : #define GB_ROWLE_SELECTOR - #include "select/template/GB_select_positional_phase1_template.c" + #include "select/factory/GB_select_positional_phase1_template.c" break ; case GB_ROWGT_idxunop_code : #define GB_ROWGT_SELECTOR - #include "select/template/GB_select_positional_phase1_template.c" + #include "select/factory/GB_select_positional_phase1_template.c" break ; case GB_NONZOMBIE_idxunop_code : diff --git a/Source/select/GB_select_positional_phase2.c b/Source/select/GB_select_positional_phase2.c index 3623620a1c..f686c1f441 100644 --- a/Source/select/GB_select_positional_phase2.c +++ b/Source/select/GB_select_positional_phase2.c @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// GB_select_positional_phase1.c: count entries for C=select(A,thunk) +// GB_select_positional_phase2.c: count entries for C=select(A,thunk) //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. @@ -9,7 +9,7 @@ // A is sparse or hypersparse -// JIT: not needed, but 3 variants possible (A sparse, hyper, or full for DIAG) +// JIT: not need: use factory; 3 variants (A sparse, hyper, or full for DIAG) #include "select/GB_select.h" #include "slice/GB_ek_slice.h" @@ -38,7 +38,7 @@ GrB_Info GB_select_positional_phase2 GB_Opcode opcode = op->opcode ; ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A) || (opcode == GB_DIAG_idxunop_code)) ; - ASSERT (GB_OPCODE_IS_POSITIONAL (opcode) + ASSERT (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode) || (opcode == GB_NONZOMBIE_idxunop_code && A->iso)) ; //-------------------------------------------------------------------------- @@ -63,38 +63,38 @@ GrB_Info GB_select_positional_phase2 case GB_TRIL_idxunop_code : #define GB_TRIL_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_TRIU_idxunop_code : #define GB_TRIU_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_DIAG_idxunop_code : #define GB_DIAG_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_OFFDIAG_idxunop_code : case GB_DIAGINDEX_idxunop_code : #define GB_OFFDIAG_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_ROWINDEX_idxunop_code : #define GB_ROWINDEX_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_ROWLE_idxunop_code : #define GB_ROWLE_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_ROWGT_idxunop_code : #define GB_ROWGT_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_NONZOMBIE_idxunop_code : @@ -103,7 +103,7 @@ GrB_Info GB_select_positional_phase2 #define GB_TEST_VALUE_OF_ENTRY(keep,p) bool keep = (i >= 0) // A is iso and thus so is C, so do not select the value #define GB_SELECT_ENTRY(Cx,pC,Ax,pA) - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" #undef GB_ENTRY_SELECTOR break ; @@ -126,38 +126,38 @@ GrB_Info GB_select_positional_phase2 case GB_TRIL_idxunop_code : #define GB_TRIL_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_TRIU_idxunop_code : #define GB_TRIU_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_DIAG_idxunop_code : #define GB_DIAG_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_OFFDIAG_idxunop_code : case GB_DIAGINDEX_idxunop_code : #define GB_OFFDIAG_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_ROWINDEX_idxunop_code : #define GB_ROWINDEX_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_ROWLE_idxunop_code : #define GB_ROWLE_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; case GB_ROWGT_idxunop_code : #define GB_ROWGT_SELECTOR - #include "select/template/GB_select_phase2.c" + #include "select/template/GB_select_phase2_template.c" break ; default: ; diff --git a/Source/select/GB_select_sparse.c b/Source/select/GB_select_sparse.c index f23dbd4e39..56a1ab77ce 100644 --- a/Source/select/GB_select_sparse.c +++ b/Source/select/GB_select_sparse.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #include "select/GB_select.h" #include "slice/GB_ek_slice.h" #ifndef GBCOMPACT @@ -224,11 +222,19 @@ GrB_Info GB_select_sparse if (info == GrB_NO_VALUE) { // generic entry selector, phase1 + GBURBLE ("(generic select) ") ; info = GB_select_generic_phase1 (Cp, Wfirst, Wlast, A, flipij, ythunk, op, A_ek_slicing, A_ntasks, A_nthreads) ; } } + if (info != GrB_SUCCESS) + { + // out of memory, or other error + GB_FREE_ALL ; + return (info) ; + } + //========================================================================== // phase1b: cumulative sum and allocate C //========================================================================== @@ -345,8 +351,9 @@ GrB_Info GB_select_sparse } if (info != GrB_SUCCESS) - { - // out of memory, or other error + { + // sparse select phase 2 cannot fail but this is here in case it does + // in the future; this block of code thus cannot be tested. GB_FREE_ALL ; return (info) ; } @@ -404,7 +411,7 @@ GrB_Info GB_select_sparse // the NONZOMBIE opcode may have removed all zombies, but A->nzombie // is still nonzero. It is set to zero in GB_wait. - ASSERT_MATRIX_OK (A, "A output for GB_selector", GB_FLIP (GB0)) ; + ASSERT_MATRIX_OK (A, "A output for GB_selector", GB_ZOMBIE (GB0)) ; } else diff --git a/Source/select/GB_selector.c b/Source/select/GB_selector.c index 2536301ebe..cfe1470b38 100644 --- a/Source/select/GB_selector.c +++ b/Source/select/GB_selector.c @@ -41,11 +41,12 @@ GrB_Info GB_selector GrB_Info info ; ASSERT_INDEXUNARYOP_OK (op, "idxunop for GB_selector", GB0) ; ASSERT_SCALAR_OK (Thunk, "Thunk for GB_selector", GB0) ; - ASSERT_MATRIX_OK (A, "A input for GB_selector", GB_FLIP (GB0)) ; + ASSERT_MATRIX_OK (A, "A input for GB_selector", GB_ZOMBIE (GB0)) ; // positional op (tril, triu, diag, offdiag, resize, rowindex, ...): // can't be jumbled. nonzombie, entry-valued op, user op: jumbled OK GB_Opcode opcode = op->opcode ; - ASSERT (GB_IMPLIES (GB_OPCODE_IS_POSITIONAL (opcode), !GB_JUMBLED (A))) ; + ASSERT (GB_IMPLIES (GB_IS_INDEXUNARYOP_CODE_POSITIONAL (opcode), + !GB_JUMBLED (A))) ; ASSERT (C == NULL || (C != NULL && (C->static_header || GBNSTATIC))) ; bool in_place_A = (C == NULL) ; // GrB_wait and GB_resize only @@ -159,18 +160,27 @@ GrB_Info GB_selector info = GrB_NO_VALUE ; + // FIXME: pass in a T matrix, below, not C: + +#if 0 #if defined ( GRAPHBLAS_HAS_CUDA ) - if (GB_cuda_select_branch (A, op)) + if (!in_place_A /* Fixme for CUDA: remove this condition, and let the CUDA + kernel handle the in-place-A condition for GB_wait and GB_resize. */ + && GB_cuda_select_branch (A, op)) { info = GB_cuda_select_sparse (C, C_iso, op, flipij, A, ythunk) ; } #endif +#endif if (info == GrB_NO_VALUE) { info = GB_select_sparse (C, C_iso, op, flipij, A, ithunk, athunk, ythunk, Werk) ; } + + // FIXME: handle in_place_A case here, not in select_sparse: + // transplant from T to either C (not in place) or A (in place) return (info) ; } diff --git a/Source/select/template/GB_select_positional_phase1_template.c b/Source/select/factory/GB_select_positional_phase1_template.c similarity index 99% rename from Source/select/template/GB_select_positional_phase1_template.c rename to Source/select/factory/GB_select_positional_phase1_template.c index 4c55c5d65f..15521cc87e 100644 --- a/Source/select/template/GB_select_positional_phase1_template.c +++ b/Source/select/factory/GB_select_positional_phase1_template.c @@ -7,6 +7,8 @@ //------------------------------------------------------------------------------ +// A is sparse, hypersparse, or full (just for DIAG case) + { //-------------------------------------------------------------------------- diff --git a/Source/select/template/GB_select_phase2.c b/Source/select/template/GB_select_phase2_template.c similarity index 100% rename from Source/select/template/GB_select_phase2.c rename to Source/select/template/GB_select_phase2_template.c diff --git a/Source/semiring/GB_Semiring_new.c b/Source/semiring/GB_Semiring_new.c index 00f9d5c0fc..e31a60387e 100644 --- a/Source/semiring/GB_Semiring_new.c +++ b/Source/semiring/GB_Semiring_new.c @@ -2,13 +2,16 @@ // GB_Semiring_new: create a new semiring //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ // The semiring struct is already allocated on input. +// The multiply operator can be any GrB_BinaryOp, including ones created from a +// GxB_IndexBinaryOp. + #include "GB.h" #include "semiring/GB_Semiring_new.h" #include "jitifyer/GB_jitifyer.h" diff --git a/Source/semiring/GrB_Semiring_new.c b/Source/semiring/GrB_Semiring_new.c index 712889865d..149bca1447 100644 --- a/Source/semiring/GrB_Semiring_new.c +++ b/Source/semiring/GrB_Semiring_new.c @@ -27,6 +27,9 @@ // two input operands always appear in that order. That is, the multiply // operator is not assumed to be commutative. +// The multiply operator can be any GrB_BinaryOp, including ones created from a +// GxB_IndexBinaryOp. + #include "GB.h" #include "semiring/GB_Semiring_new.h" diff --git a/Source/serialize/GB_deserialize.c b/Source/serialize/GB_deserialize.c index 14f012b169..d1f8dc65a6 100644 --- a/Source/serialize/GB_deserialize.c +++ b/Source/serialize/GB_deserialize.c @@ -245,11 +245,10 @@ GrB_Info GB_deserialize // deserialize a matrix from a blob if (nfound == 2) { - // extract the GrB_NAME and GrB_EL_TYPE_STRING from the blob + // extract the GrB_NAME from the blob; + // GrB_EL_TYPE_STRING not needed 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)) ; } } diff --git a/Source/serialize/GB_deserialize_from_blob.c b/Source/serialize/GB_deserialize_from_blob.c index 6845a324fc..6d4f684922 100644 --- a/Source/serialize/GB_deserialize_from_blob.c +++ b/Source/serialize/GB_deserialize_from_blob.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Decompress a single array from a set of compressed blocks in the blob. If // the input data is mangled, this method is still safe, since it performs the // bare minimum sanity checks to ensure no out-of-bounds indexing of arrays. diff --git a/Source/serialize/GB_serialize.c b/Source/serialize/GB_serialize.c index 3d12478ddf..918bc18e73 100644 --- a/Source/serialize/GB_serialize.c +++ b/Source/serialize/GB_serialize.c @@ -378,7 +378,6 @@ GrB_Info GB_serialize // serialize a matrix into a 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 ; } @@ -387,7 +386,6 @@ GrB_Info GB_serialize // serialize a matrix into a blob 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 ; } diff --git a/Source/serialize/GB_serialize_array.c b/Source/serialize/GB_serialize_array.c index 4da9f67a02..a1fba17d52 100644 --- a/Source/serialize/GB_serialize_array.c +++ b/Source/serialize/GB_serialize_array.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // Parallel compression method for an array. The array is compressed into // a sequence of independently allocated blocks, or returned as-is if not // compressed. Currently, only LZ4, LZ4HC, and ZSTD are supported. @@ -273,7 +271,7 @@ GrB_Info GB_serialize_array // compute cumulative sum of the compressed blocks //-------------------------------------------------------------------------- - GB_cumsum (Sblocks, nblocks, NULL, 1, Werk) ; + GB_cumsum1 (Sblocks, nblocks) ; //-------------------------------------------------------------------------- // free workspace return result diff --git a/Source/serialize/GB_serialize_to_blob.c b/Source/serialize/GB_serialize_to_blob.c index 80d7ca2418..2b3329d0dd 100644 --- a/Source/serialize/GB_serialize_to_blob.c +++ b/Source/serialize/GB_serialize_to_blob.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - #include "GB.h" #include "serialize/GB_serialize.h" diff --git a/Source/slice/GB_e_slice.c b/Source/slice/GB_e_slice.c deleted file mode 100644 index 1f8798acc1..0000000000 --- a/Source/slice/GB_e_slice.c +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_e_slice: equal partition of e items to each task -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -// There are e items to split between ntasks. Task tid will own items -// Slice [tid] to Slice [tid+1]-1. - -#include "GB.h" - -void GB_e_slice -( - int64_t *Slice, // array of size ntasks+1 - int64_t e, // number items to partition amongst the tasks - const int ntasks // # of tasks -) -{ - Slice [0] = 0 ; - for (int tid = 1 ; tid < ntasks ; tid++) - { - Slice [tid] = (int64_t) GB_PART (tid, e, ntasks) ; - } - Slice [ntasks] = e ; -} - diff --git a/Source/slice/GB_ek_slice.c b/Source/slice/GB_ek_slice.c index 296b18b317..97cbd7858a 100644 --- a/Source/slice/GB_ek_slice.c +++ b/Source/slice/GB_ek_slice.c @@ -2,7 +2,7 @@ // GB_ek_slice: slice the entries and vectors of a matrix //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -23,19 +23,64 @@ // A may be jumbled. #include "slice/GB_ek_slice.h" -#include "slice/factory/GB_ek_slice_search.c" - -#if 0 -#define GB_CALLBACK_EK_SLICE_PROTO(GX_ek_slice) \ -void GX_ek_slice /* slice a matrix */ \ -( \ - /* output: */ \ - int64_t *restrict A_ek_slicing, /* size 3*ntasks+1 */ \ - /* input: */ \ - GrB_Matrix A, /* matrix to slice */ \ - int ntasks /* # of tasks */ \ +#include "slice/include/GB_search_for_vector.h" + +//------------------------------------------------------------------------------ +// GB_ek_slice_search: find the first and last vectors in a slice +//------------------------------------------------------------------------------ + +static inline void GB_ek_slice_search +( + // input: + int taskid, + int ntasks, + const int64_t *restrict pstart_slice, // size ntasks+1 + const int64_t *restrict Ap, // size anvec + int64_t anvec, // # of vectors in A + int64_t avlen, // vector length of A + // output: + int64_t *restrict kfirst_slice, // size ntasks + int64_t *restrict klast_slice // size ntasks ) -#endif +{ + int64_t pfirst = pstart_slice [taskid] ; + int64_t plast = pstart_slice [taskid+1] - 1 ; + + // find the first vector of the slice for task taskid: the + // vector that owns the entry Ai [pfirst] and Ax [pfirst]. + int64_t kfirst ; + if (taskid == 0) + { + kfirst = 0 ; + } + else + { + kfirst = GB_search_for_vector (pfirst, Ap, 0, anvec, avlen) ; + } + + // find the last vector of the slice for task taskid: the + // vector that owns the entry Ai [plast] and Ax [plast]. + int64_t klast ; + if (taskid == ntasks-1) + { + klast = anvec - 1 ; + } + else if (pfirst > plast) + { + // this task does no work + klast = kfirst ; + } + else + { + klast = GB_search_for_vector (plast, Ap, kfirst, anvec, avlen) ; + } + kfirst_slice [taskid] = kfirst ; + klast_slice [taskid] = klast ; +} + +//------------------------------------------------------------------------------ +// GB_ek_slice: slice the entries and vectors of a matrix +//------------------------------------------------------------------------------ GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) { diff --git a/Source/slice/GB_ek_slice.h b/Source/slice/GB_ek_slice.h index 42d8072039..28d8f9ec64 100644 --- a/Source/slice/GB_ek_slice.h +++ b/Source/slice/GB_ek_slice.h @@ -25,10 +25,6 @@ // On input, ntasks must be <= nnz (A), unless nnz (A) is zero. In that // case, ntasks must be 1. -// See GB_callbacks.h: -// GB_CALLBACK_EK_SLICE_PROTO (GB_ek_slice) ; -// GB_CALLBACK_EK_SLICE_MERGE1_PROTO (GB_ek_slice_merge1) ; - void GB_ek_slice_merge2 // merge final results for matrix C ( // output @@ -46,122 +42,4 @@ void GB_ek_slice_merge2 // merge final results for matrix C GB_Werk Werk ) ; -//------------------------------------------------------------------------------ -// GB_get_pA_and_pC: find the part of A(:,k) and C(:,k) for this task -//------------------------------------------------------------------------------ - -// The tasks were generated by GB_ek_slice. - -// GB_get_pA_and_pC is no longer used. JIT kernels and templates use -// use the GB_GET_PA_AND_PC macro instead, #define'd in -// Source/slice/include/GB_ek_slice_kernels.h. - -// FIXME: replace GB_GET_PA_AND_PC with this static inline function and use -// this instead (but without the assignment of p0 and p1). - -#if 0 -static inline void GB_get_pA_and_pC -( - // output - int64_t *pA_start, - int64_t *pA_end, - int64_t *pC, - // input - int tid, // task id - int64_t k, // current vector - int64_t kfirst, // first vector for this slice - int64_t klast, // last vector for this slice - const int64_t *restrict pstart_slice, // start of each slice in A - const int64_t *restrict Cp_kfirst, // start of each slice in C - const int64_t *restrict Cp, // vector pointers for C - int64_t cvlen, // C->vlen - const int64_t *restrict Ap, // vector pointers for A - int64_t avlen // A->vlen -) -{ - - // get the start of vector k and k+1 (does not appear in GB_GET_PA_AND_PC) - int64_t p0 = GBP (Ap, k, avlen) ; - int64_t p1 = GBP (Ap, k+1, avlen) ; - - if (k == kfirst) - { - // First vector for task tid; may only be partially owned. - (*pA_start) = pstart_slice [tid] ; - (*pA_end ) = GB_IMIN (p1, pstart_slice [tid+1]) ; - (*pC) = Cp_kfirst [tid] ; - } - else if (k == klast) - { - // Last vector for task tid; may only be partially owned. - (*pA_start) = p0 ; - (*pA_end ) = pstart_slice [tid+1] ; - (*pC) = GBP (Cp, k, cvlen) ; - } - else - { - // task tid entirely owns this vector A(:,k). - (*pA_start) = p0 ; - (*pA_end ) = p1 ; - (*pC) = GBP (Cp, k, cvlen) ; - } -} -#endif - -//------------------------------------------------------------------------------ -// GB_get_pA: find the part of A(:,k) to be operated on by this task -//------------------------------------------------------------------------------ - -// The tasks were generated by GB_ek_slice. - -// GB_get_pA is only used for non-templatized factory methods, not in any JIT -// kernels or templates. JIT kernels and templates use the GB_GET_PA macro -// instead, #define'd in Source/slice/include/GB_ek_slice_kernels.h. - -// GB_get_pA and GB_GET_PA are very similar, except that GB_get_pA computes -// p0 and p1. - -// FIXME: unify GB_get_pA and GB_GET_PA into a single method. - -static inline void GB_get_pA -( - // output - int64_t *pA_start, - int64_t *pA_end, - // input - int tid, // task id - int64_t k, // current vector - int64_t kfirst, // first vector for this slice - int64_t klast, // last vector for this slice - const int64_t *restrict pstart_slice, // start of each slice in A - const int64_t *restrict Ap, // vector pointers for A - int64_t avlen // A->vlen -) -{ - - // get the start of vector k and k+1 (does not appear in GB_GET_PA) - int64_t p0 = GBP (Ap, k, avlen) ; - int64_t p1 = GBP (Ap, k+1, avlen) ; - - if (k == kfirst) - { - // First vector for task tid; may only be partially owned. - (*pA_start) = pstart_slice [tid] ; - (*pA_end ) = GB_IMIN (p1, pstart_slice [tid+1]) ; - } - else if (k == klast) - { - // Last vector for task tid; may only be partially owned. - (*pA_start) = p0 ; - (*pA_end ) = pstart_slice [tid+1] ; - } - else - { - // task tid entirely owns this vector A(:,k). - (*pA_start) = p0 ; - (*pA_end ) = p1 ; - } -} - #endif - diff --git a/Source/slice/GB_ek_slice_merge1.c b/Source/slice/GB_ek_slice_merge1.c index b5df69c0f6..ca8a2e8a30 100644 --- a/Source/slice/GB_ek_slice_merge1.c +++ b/Source/slice/GB_ek_slice_merge1.c @@ -24,20 +24,6 @@ #include "slice/GB_ek_slice.h" -#if 0 -#define GB_CALLBACK_EK_SLICE_MERGE1_PROTO(GX_ek_slice_merge1) \ -void GX_ek_slice_merge1 /* merge column counts for the matrix C */ \ -( \ - /* input/output: */ \ - int64_t *restrict Cp, /* column counts */ \ - /* input: */ \ - const int64_t *restrict Wfirst, /* size A_ntasks */ \ - const int64_t *restrict Wlast, /* size A_ntasks */ \ - const int64_t *A_ek_slicing, /* size 3*A_ntasks+1 */ \ - const int A_ntasks /* # of tasks */ \ -) -#endif - GB_CALLBACK_EK_SLICE_MERGE1_PROTO (GB_ek_slice_merge1) { const int64_t *restrict kfirst_Aslice = A_ek_slicing ; diff --git a/Source/slice/GB_ewise_slice.c b/Source/slice/GB_ewise_slice.c index 4868b1e261..802c700105 100644 --- a/Source/slice/GB_ewise_slice.c +++ b/Source/slice/GB_ewise_slice.c @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------ -// JIT: not needed, but could use variants for sparsity formats. +// JIT: possible: could use variants for sparsity formats. // Constructs a set of tasks to compute C, for an element-wise operation that // operates on two input matrices, C=op(A,B). These include: @@ -38,25 +38,7 @@ // GB_ewise_slice //------------------------------------------------------------------------------ -GrB_Info GB_ewise_slice -( - // output: - GB_task_struct **p_TaskList, // array of structs - size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads for eWise operation - // input: - const int64_t Cnvec, // # of vectors of C - const int64_t *restrict Ch, // vectors of C, if hypersparse - const int64_t *restrict C_to_M, // mapping of C to M - const int64_t *restrict C_to_A, // mapping of C to A - const int64_t *restrict C_to_B, // mapping of C to B - bool Ch_is_Mh, // if true, then Ch == Mh; GB_add only - const GrB_Matrix M, // mask matrix to slice (optional) - const GrB_Matrix A, // matrix to slice - const GrB_Matrix B, // matrix to slice - GB_Werk Werk -) +GB_CALLBACK_EWISE_SLICE_PROTO (GB_ewise_slice) { //-------------------------------------------------------------------------- diff --git a/Source/slice/GB_p_slice.c b/Source/slice/GB_p_slice.c index 09706fd94d..939e548bc6 100644 --- a/Source/slice/GB_p_slice.c +++ b/Source/slice/GB_p_slice.c @@ -113,16 +113,7 @@ static void GB_p_slice_worker // GB_p_slice: partition Ap for a set of tasks //------------------------------------------------------------------------------ -void GB_p_slice // slice Ap -( - // output: - int64_t *restrict Slice, // size ntasks+1 - // input: - const int64_t *restrict Ap, // array size n+1 (NULL if full or bitmap) - const int64_t n, - const int ntasks, // # of tasks - const bool perfectly_balanced -) +GB_CALLBACK_P_SLICE_PROTO (GB_p_slice) { //-------------------------------------------------------------------------- diff --git a/Source/slice/GB_slice.h b/Source/slice/GB_slice.h deleted file mode 100644 index 6115df54c4..0000000000 --- a/Source/slice/GB_slice.h +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_slice.h: definitions for GB_e_slice and GB_p_slice -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#ifndef GB_SLICE_H -#define GB_SLICE_H - -void GB_p_slice // slice Ap -( - // output: - int64_t *restrict Slice, // size ntasks+1 - // input: - const int64_t *restrict Ap, // array size n+1 (NULL if full or bitmap) - const int64_t n, - const int ntasks, // # of tasks - const bool perfectly_balanced -) ; - -void GB_e_slice -( - // output: - int64_t *Slice, // array of size ntasks+1 - // input: - int64_t e, // number items to partition amongst the tasks - const int ntasks // # of tasks -) ; - -#endif - diff --git a/Source/slice/GB_task_methods.h b/Source/slice/GB_task_methods.h index b4bb248829..b3abbe0459 100644 --- a/Source/slice/GB_task_methods.h +++ b/Source/slice/GB_task_methods.h @@ -67,26 +67,6 @@ ASSERT ((ntasks) < max_ntasks) ; \ } -GrB_Info GB_ewise_slice -( - // output: - GB_task_struct **p_TaskList, // array of structs - size_t *p_TaskList_size, // size of TaskList - int *p_ntasks, // # of tasks constructed - int *p_nthreads, // # of threads for eWise operation - // input: - const int64_t Cnvec, // # of vectors of C - const int64_t *restrict Ch, // vectors of C, if hypersparse - const int64_t *restrict C_to_M, // mapping of C to M - const int64_t *restrict C_to_A, // mapping of C to A - const int64_t *restrict C_to_B, // mapping of C to B - bool Ch_is_Mh, // if true, then Ch == Mh; GB_add only - const GrB_Matrix M, // mask matrix to slice (optional) - const GrB_Matrix A, // matrix to slice - const GrB_Matrix B, // matrix to slice - GB_Werk Werk -) ; - void GB_slice_vector ( // output: return i, pA, and pB diff --git a/Source/slice/factory/GB_ek_slice_search.c b/Source/slice/factory/GB_ek_slice_search.c deleted file mode 100644 index 968e4d4742..0000000000 --- a/Source/slice/factory/GB_ek_slice_search.c +++ /dev/null @@ -1,64 +0,0 @@ -//------------------------------------------------------------------------------ -// GB_ek_slice_search.c: find the first and last vectors in a slice -//------------------------------------------------------------------------------ - -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -//------------------------------------------------------------------------------ - -#ifndef GB_EK_SLICE_SEARCH_H -#define GB_EK_SLICE_SEARCH_H -#include "slice/factory/GB_search_for_vector_template.c" - -static inline void GB_ek_slice_search -( - // input: - int taskid, - int ntasks, - const int64_t *restrict pstart_slice, // size ntasks+1 - const int64_t *restrict Ap, // size anvec - int64_t anvec, // # of vectors in A - int64_t avlen, // vector length of A - // output: - int64_t *restrict kfirst_slice, // size ntasks - int64_t *restrict klast_slice // size ntasks -) -{ - int64_t pfirst = pstart_slice [taskid] ; - int64_t plast = pstart_slice [taskid+1] - 1 ; - - // find the first vector of the slice for task taskid: the - // vector that owns the entry Ai [pfirst] and Ax [pfirst]. - int64_t kfirst ; - if (taskid == 0) - { - kfirst = 0 ; - } - else - { - kfirst = GB_search_for_vector (pfirst, Ap, 0, anvec, avlen) ; - } - - // find the last vector of the slice for task taskid: the - // vector that owns the entry Ai [plast] and Ax [plast]. - int64_t klast ; - if (taskid == ntasks-1) - { - klast = anvec - 1 ; - } - else if (pfirst > plast) - { - // this task does no work - klast = kfirst ; - } - else - { - klast = GB_search_for_vector (plast, Ap, kfirst, anvec, avlen) ; - } - kfirst_slice [taskid] = kfirst ; - klast_slice [taskid] = klast ; -} - -#endif - diff --git a/Source/slice/include/GB_ek_slice_kernels.h b/Source/slice/include/GB_ek_slice_kernels.h index cae30aa2a8..bbbc6ebc4f 100644 --- a/Source/slice/include/GB_ek_slice_kernels.h +++ b/Source/slice/include/GB_ek_slice_kernels.h @@ -2,7 +2,7 @@ // GB_ek_slice_kernels.h: slice the entries and vectors of a matrix //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //------------------------------------------------------------------------------ @@ -10,6 +10,21 @@ #ifndef GB_EK_SLICE_KERNELS_H #define GB_EK_SLICE_KERNELS_H +static inline void GB_e_slice +( + int64_t *Slice, // array of size ntasks+1 + int64_t e, // number items to partition amongst the tasks + const int ntasks // # of tasks +) +{ + Slice [0] = 0 ; + for (int tid = 1 ; tid < ntasks ; tid++) + { + Slice [tid] = (int64_t) GB_PART (tid, e, ntasks) ; + } + Slice [ntasks] = e ; +} + //------------------------------------------------------------------------------ // GB_ek_slice_ntasks: determine # of threads and tasks to use for GB_ek_slice //------------------------------------------------------------------------------ @@ -74,8 +89,8 @@ static inline void GB_ek_slice_ntasks // The tasks were generated by GB_ek_slice. // as a macro, where p0, p1, and p2 are first obtained as above: -// p0 = GBP_A (Ap, k, avlen) ; -// p1 = GBP_A (Ap, k+1, avlen) ; +// p0 = GBP (Ap, k, avlen) ; +// p1 = GBP (Ap, k+1, avlen) ; // p2 = GBP (Cp, k, cvlen) ; #define GB_GET_PA_AND_PC(pA_start,pA_end,pC,tid,k,kfirst,klast,pstart_slice,Cp_kfirst,p0,p1,p2) \ int64_t pA_start, pA_end, pC ; \ @@ -108,8 +123,8 @@ static inline void GB_ek_slice_ntasks // The tasks were generated by GB_ek_slice. // as a macro, where p0 and p1 are first obtained as above: -// p0 = GBP_A (Ap, k, avlen) ; -// p1 = GBP_A (Ap, k+1, avlen) ; +// p0 = GBP (Ap, k, avlen) ; +// p1 = GBP (Ap, k+1, avlen) ; #define GB_GET_PA(pA_start,pA_end,tid,k,kfirst,klast,pstart_slice,p0,p1) \ int64_t pA_start, pA_end ; \ if (k == kfirst) \ diff --git a/Source/slice/factory/GB_search_for_vector_template.c b/Source/slice/include/GB_search_for_vector.h similarity index 95% rename from Source/slice/factory/GB_search_for_vector_template.c rename to Source/slice/include/GB_search_for_vector.h index fd7d8588ba..2818360311 100644 --- a/Source/slice/factory/GB_search_for_vector_template.c +++ b/Source/slice/include/GB_search_for_vector.h @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ -// GB_search_for_vector_template: find the vector k that contains p +// GB_search_for_vector: find the vector k that contains p //------------------------------------------------------------------------------ -// 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/Source/slice/include/GB_task_struct.h b/Source/slice/include/GB_task_struct.h index 2d3eee42d3..31653fa7a5 100644 --- a/Source/slice/include/GB_task_struct.h +++ b/Source/slice/include/GB_task_struct.h @@ -48,6 +48,8 @@ GB_task_struct ; // GB_GET_VECTOR: get the content of a vector for a coarse/fine task //------------------------------------------------------------------------------ +#if 0 +// General case, but is not optimized for the JIT, and no longer used: #define GB_GET_VECTOR(pX_start, pX_fini, pX, pX_end, Xp, kX, Xvlen) \ int64_t pX_start, pX_fini ; \ if (fine_task) \ @@ -62,6 +64,23 @@ GB_task_struct ; pX_start = GBP (Xp, kX, Xvlen) ; \ pX_fini = GBP (Xp, kX+1, Xvlen) ; \ } +#endif + +// GB_GET_VECTOR_M: optimized for the M matrix +#define GB_GET_VECTOR_M(pM_start, pM_fini, pX, pX_end, Mp, k, Mvlen) \ + int64_t pM_start, pM_fini ; \ + if (fine_task) \ + { \ + /* A fine task operates on a slice of X(:,k) */ \ + pM_start = TaskList [taskid].pX ; \ + pM_fini = TaskList [taskid].pX_end ; \ + } \ + else \ + { \ + /* vectors are never sliced for a coarse task */ \ + pM_start = GBP_M (Mp, k, Mvlen) ; \ + pM_fini = GBP_M (Mp, k+1, Mvlen) ; \ + } #endif diff --git a/Source/sort/GB_msort_1.c b/Source/sort/GB_msort_1.c index c11ba60a3f..b2d668322b 100644 --- a/Source/sort/GB_msort_1.c +++ b/Source/sort/GB_msort_1.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // A parallel mergesort of an array of 1-by-n integers. #include "sort/GB_msort_1.h" diff --git a/Source/sort/GB_msort_2.c b/Source/sort/GB_msort_2.c index 50172242f0..c0e5d72515 100644 --- a/Source/sort/GB_msort_2.c +++ b/Source/sort/GB_msort_2.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // A parallel mergesort of an array of 2-by-n integers. Each key // consists of two integers. diff --git a/Source/sort/GB_msort_3.c b/Source/sort/GB_msort_3.c index 2de5194ae2..acdf602a7f 100644 --- a/Source/sort/GB_msort_3.c +++ b/Source/sort/GB_msort_3.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // A parallel mergesort of an array of 3-by-n integers. Each key // consists of three integers. diff --git a/Source/sort/GB_qsort_1.c b/Source/sort/GB_qsort_1.c index 89c0eb5f3c..e8d42b08ce 100644 --- a/Source/sort/GB_qsort_1.c +++ b/Source/sort/GB_qsort_1.c @@ -37,7 +37,7 @@ #define GB_partition GB_partition_1 #define GB_quicksort GB_quicksort_1 -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" GB_CALLBACK_QSORT_1_PROTO (GB_qsort_1) { diff --git a/Source/sort/GB_qsort_1b.c b/Source/sort/GB_qsort_1b.c index 76dae1b833..811fc44af7 100644 --- a/Source/sort/GB_qsort_1b.c +++ b/Source/sort/GB_qsort_1b.c @@ -46,7 +46,7 @@ #define GB_partition GB_partition_1b #define GB_quicksort GB_quicksort_1b -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" void GB_qsort_1b // sort array A of size 2-by-n, using 1 key (A [0][]) ( @@ -97,7 +97,7 @@ void GB_qsort_1b // sort array A of size 2-by-n, using 1 key (A [0][]) #undef GB_quicksort #define GB_quicksort GB_quicksort_1b_size1 -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" void GB_qsort_1b_size1 // GB_qsort_1b with A_1 with sizeof = 1 ( @@ -123,7 +123,7 @@ void GB_qsort_1b_size1 // GB_qsort_1b with A_1 with sizeof = 1 #undef GB_quicksort #define GB_quicksort GB_quicksort_1b_size2 -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" void GB_qsort_1b_size2 // GB_qsort_1b with A_1 with sizeof = 2 ( @@ -150,7 +150,7 @@ void GB_qsort_1b_size2 // GB_qsort_1b with A_1 with sizeof = 2 #undef GB_quicksort #define GB_quicksort GB_quicksort_1b_size4 -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" void GB_qsort_1b_size4 // GB_qsort_1b with A_1 with sizeof = 4 ( @@ -177,7 +177,7 @@ void GB_qsort_1b_size4 // GB_qsort_1b with A_1 with sizeof = 4 #undef GB_quicksort #define GB_quicksort GB_quicksort_1b_size8 -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" void GB_qsort_1b_size8 // GB_qsort_1b with A_1 with sizeof = 8 ( @@ -203,7 +203,7 @@ void GB_qsort_1b_size8 // GB_qsort_1b with A_1 with sizeof = 8 #undef GB_quicksort #define GB_quicksort GB_quicksort_1b_size16 -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" void GB_qsort_1b_size16 // GB_qsort_1b with A_1 with sizeof = 16 ( diff --git a/Source/sort/GB_qsort_2.c b/Source/sort/GB_qsort_2.c index 8023684251..b2418951f1 100644 --- a/Source/sort/GB_qsort_2.c +++ b/Source/sort/GB_qsort_2.c @@ -39,7 +39,7 @@ #define GB_partition GB_partition_2 #define GB_quicksort GB_quicksort_2 -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" void GB_qsort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) ( diff --git a/Source/sort/GB_qsort_3.c b/Source/sort/GB_qsort_3.c index cd978017f3..9baf9fd362 100644 --- a/Source/sort/GB_qsort_3.c +++ b/Source/sort/GB_qsort_3.c @@ -41,7 +41,7 @@ #define GB_partition GB_partition_3 #define GB_quicksort GB_quicksort_3 -#include "sort/factory/GB_qsort_template.c" +#include "sort/template/GB_qsort_template.c" void GB_qsort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) ( diff --git a/Source/sort/GB_sort.c b/Source/sort/GB_sort.c index 45954c17a1..3f06b19302 100644 --- a/Source/sort/GB_sort.c +++ b/Source/sort/GB_sort.c @@ -7,21 +7,20 @@ //------------------------------------------------------------------------------ -// JIT: needed. - #include "sort/GB_sort.h" #include "transpose/GB_transpose.h" #include "slice/GB_ek_slice.h" +#include "jitifyer/GB_stringify.h" // macros: // GB_SORT (func) defined as GB_sort_func_TYPE_ascend or _descend, // GB_msort_ISO_ascend or _descend, // or GB_msort_func_UDT -// GB_TYPE bool, int8_, ... or GB_void for UDT +// GB_C_TYPE bool, int8_, ... or GB_void for UDT // GB_ADDR(A,p) A+p for builtin, A + p * GB_SIZE otherwise -// GB_SIZE size of each entry: sizeof (GB_TYPE) for built-in +// GB_SIZE size of each entry: sizeof (GB_C_TYPE) for built-in // GB_GET(x,X,i) x = (op->xtype) X [i] // GB_COPY(A,i,C,k) A [i] = C [k] // GB_SWAP(A,i,k) swap A [i] and A [k] @@ -33,10 +32,15 @@ #define GB_SORT_UDT 0 #define GB_ADDR(A,i) ((A) + (i)) -#define GB_GET(x,A,i) GB_TYPE x = A [i] +#define GB_GET(x,A,i) GB_C_TYPE x = A [i] #define GB_COPY(A,i,B,j) A [i] = B [j] -#define GB_SIZE sizeof (GB_TYPE) -#define GB_SWAP(A,i,j) { GB_TYPE t = A [i] ; A [i] = A [j] ; A [j] = t ; } +#define GB_SIZE sizeof (GB_C_TYPE) +#define GB_SWAP(A,i,j) \ +{ \ + GB_C_TYPE t = A [i] ; \ + A [i] = A [j] ; \ + A [j] = t ; \ +} //------------------------------------------------------------------------------ // ascending sort for built-in types @@ -45,49 +49,49 @@ #define GB_LT(less,a,i,b,j) \ less = (((a) < (b)) ? true : (((a) == (b)) ? ((i) < (j)) : false)) -#define GB_TYPE bool +#define GB_C_TYPE bool #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_BOOL) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE int8_t +#define GB_C_TYPE int8_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_INT8) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE int16_t +#define GB_C_TYPE int16_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_INT16) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE int32_t +#define GB_C_TYPE int32_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_INT32) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE int64_t +#define GB_C_TYPE int64_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_INT64) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE uint8_t +#define GB_C_TYPE uint8_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_UINT8) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE uint16_t +#define GB_C_TYPE uint16_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_UINT16) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE uint32_t +#define GB_C_TYPE uint32_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_UINT32) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE uint64_t +#define GB_C_TYPE uint64_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_UINT64) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE float +#define GB_C_TYPE float #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_FP32) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE double +#define GB_C_TYPE double #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _ascend_FP64) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" //------------------------------------------------------------------------------ // descending sort for built-in types @@ -97,52 +101,52 @@ #define GB_LT(less,a,i,b,j) \ less = (((a) > (b)) ? true : (((a) == (b)) ? ((i) < (j)) : false)) -#define GB_TYPE bool +#define GB_C_TYPE bool #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_BOOL) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE int8_t +#define GB_C_TYPE int8_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_INT8) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE int16_t +#define GB_C_TYPE int16_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_INT16) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE int32_t +#define GB_C_TYPE int32_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_INT32) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE int64_t +#define GB_C_TYPE int64_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_INT64) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE uint8_t +#define GB_C_TYPE uint8_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_UINT8) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE uint16_t +#define GB_C_TYPE uint16_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_UINT16) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE uint32_t +#define GB_C_TYPE uint32_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_UINT32) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE uint64_t +#define GB_C_TYPE uint64_t #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_UINT64) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE float +#define GB_C_TYPE float #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_FP32) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" -#define GB_TYPE double +#define GB_C_TYPE double #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _descend_FP64) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" //------------------------------------------------------------------------------ -// macros for user-defined types and when typecasting is performed +// macros for the generic kernel //------------------------------------------------------------------------------ #undef GB_ADDR @@ -157,7 +161,7 @@ fcast (x, GB_ADDR (A, i), csize) #define GB_COPY(A,i,B,j) memcpy (GB_ADDR (A, i), GB_ADDR (B, j), csize) #define GB_SIZE csize -#define GB_TYPE GB_void +#define GB_C_TYPE GB_void #define GB_SWAP(A,i,j) \ { \ @@ -182,7 +186,7 @@ #undef GB_SORT_UDT #define GB_SORT_UDT 1 #define GB_SORT(func) GB_EVAL3 (GB(sort_), func, _UDT) -#include "sort/factory/GB_sort_template.c" +#include "sort/template/GB_sort_template.c" //------------------------------------------------------------------------------ // GB_sort @@ -203,9 +207,6 @@ GB_phybix_free (P) ; \ } -// redefine to use the revised GB_FREE_ALL above: -#include "matrix/GB_static_header.h" - GrB_Info GB_sort ( // output: @@ -247,11 +248,13 @@ GrB_Info GB_sort if (op->ztype != GrB_BOOL || op->xtype != op->ytype || atype != ctype || !(ptype == GrB_INT64 || ptype == GrB_UINT64) - || !GB_Type_compatible (atype, op->xtype)) + || !GB_Type_compatible (atype, op->xtype) + || GB_IS_INDEXBINARYOP_CODE (op->opcode)) { // op must return bool, and its inputs x and y must have the same type; // the types of A and C must match exactly; P must be INT64 or UINT64; // A and C must be typecasted to the input type of the op. + // Positional ops are not allowed. return (GrB_DOMAIN_MISMATCH) ; } @@ -350,10 +353,23 @@ GrB_Info GB_sort // sort C in place //-------------------------------------------------------------------------- + int64_t cnz = GB_nnz (C) ; + int nthreads = GB_nthreads (cnz, chunk, nthreads_max) ; + GB_Opcode opcode = op->opcode ; GB_Type_code acode = atype->code ; - if ((op->xtype == atype) && (op->ytype == atype) && + if (C->iso || cnz <= 1) + { + + //---------------------------------------------------------------------- + // C is iso: nothing to do + //---------------------------------------------------------------------- + + ; + + } + else if ((op->xtype == atype) && (op->ytype == atype) && (opcode == GB_LT_binop_code || opcode == GB_GT_binop_code) && (acode < GB_UDT_code)) { @@ -368,27 +384,38 @@ GrB_Info GB_sort switch (acode) { case GB_BOOL_code : - GB_OK (GB(sort_matrix_ascend_BOOL )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_BOOL )(C, nthreads, Werk)) ; + break ; case GB_INT8_code : - GB_OK (GB(sort_matrix_ascend_INT8 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_INT8 )(C, nthreads, Werk)) ; + break ; case GB_INT16_code : - GB_OK (GB(sort_matrix_ascend_INT16 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_INT16 )(C, nthreads, Werk)) ; + break ; case GB_INT32_code : - GB_OK (GB(sort_matrix_ascend_INT32 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_INT32 )(C, nthreads, Werk)) ; + break ; case GB_INT64_code : - GB_OK (GB(sort_matrix_ascend_INT64 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_INT64 )(C, nthreads, Werk)) ; + break ; case GB_UINT8_code : - GB_OK (GB(sort_matrix_ascend_UINT8 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_UINT8 )(C, nthreads, Werk)) ; + break ; case GB_UINT16_code : - GB_OK (GB(sort_matrix_ascend_UINT16 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_UINT16 )(C, nthreads, Werk)) ; + break ; case GB_UINT32_code : - GB_OK (GB(sort_matrix_ascend_UINT32 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_UINT32 )(C, nthreads, Werk)) ; + break ; case GB_UINT64_code : - GB_OK (GB(sort_matrix_ascend_UINT64 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_UINT64 )(C, nthreads, Werk)) ; + break ; case GB_FP32_code : - GB_OK (GB(sort_matrix_ascend_FP32 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_FP32 )(C, nthreads, Werk)) ; + break ; case GB_FP64_code : - GB_OK (GB(sort_matrix_ascend_FP64 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_ascend_FP64 )(C, nthreads, Werk)) ; + break ; default:; } } @@ -398,27 +425,38 @@ GrB_Info GB_sort switch (acode) { case GB_BOOL_code : - GB_OK (GB(sort_matrix_descend_BOOL )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_BOOL )(C, nthreads, Werk)) ; + break ; case GB_INT8_code : - GB_OK (GB(sort_matrix_descend_INT8 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_INT8 )(C, nthreads, Werk)) ; + break ; case GB_INT16_code : - GB_OK (GB(sort_matrix_descend_INT16 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_INT16 )(C, nthreads, Werk)) ; + break ; case GB_INT32_code : - GB_OK (GB(sort_matrix_descend_INT32 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_INT32 )(C, nthreads, Werk)) ; + break ; case GB_INT64_code : - GB_OK (GB(sort_matrix_descend_INT64 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_INT64 )(C, nthreads, Werk)) ; + break ; case GB_UINT8_code : - GB_OK (GB(sort_matrix_descend_UINT8 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_UINT8 )(C, nthreads, Werk)) ; + break ; case GB_UINT16_code : - GB_OK (GB(sort_matrix_descend_UINT16)(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_UINT16)(C, nthreads, Werk)) ; + break ; case GB_UINT32_code : - GB_OK (GB(sort_matrix_descend_UINT32)(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_UINT32)(C, nthreads, Werk)) ; + break ; case GB_UINT64_code : - GB_OK (GB(sort_matrix_descend_UINT64)(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_UINT64)(C, nthreads, Werk)) ; + break ; case GB_FP32_code : - GB_OK (GB(sort_matrix_descend_FP32 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_FP32 )(C, nthreads, Werk)) ; + break ; case GB_FP64_code : - GB_OK (GB(sort_matrix_descend_FP64 )(C, Werk)) ; break ; + GB_OK (GB(sort_matrix_descend_FP64 )(C, nthreads, Werk)) ; + break ; default:; } } @@ -431,14 +469,22 @@ GrB_Info GB_sort // typecasting, user-defined types, or unconventional operators //---------------------------------------------------------------------- - GB_OK (GB (sort_matrix_UDT) (C, op, Werk)) ; + // via the JIT kernel + info = GB_sort_jit (C, op, nthreads, Werk) ; + + // via the generic kernel + if (info == GrB_NO_VALUE) + { + info = GB (sort_matrix_UDT) (C, op, nthreads, Werk) ; + } + + GB_OK (info) ; } //-------------------------------------------------------------------------- // constuct the final indices //-------------------------------------------------------------------------- - int64_t cnz = GB_nnz (C) ; int64_t cnvec = C->nvec ; int64_t *restrict Ti = NULL ; @@ -463,7 +509,6 @@ GrB_Info GB_sort int C_nthreads, C_ntasks ; GB_SLICE_MATRIX (C, 1) ; int64_t *restrict Cp = C->p ; - const int64_t cvlen = C->vlen ; int tid ; #pragma omp parallel for num_threads(C_nthreads) schedule(static,1) for (tid = 0 ; tid < C_ntasks ; tid++) @@ -473,9 +518,8 @@ GrB_Info GB_sort for (int64_t k = kfirst ; k <= klast ; k++) { const int64_t pC0 = Cp [k] ; - int64_t pC_start, pC_end ; - GB_get_pA (&pC_start, &pC_end, tid, k, - kfirst, klast, pstart_Cslice, Cp, cvlen) ; + GB_GET_PA (pC_start, pC_end, tid, k, kfirst, klast, pstart_Cslice, + pC0, Cp [k+1]) ; for (int64_t pC = pC_start ; pC < pC_end ; pC++) { Ti [pC] = pC - pC0 ; diff --git a/Source/sort/GB_sort.h b/Source/sort/GB_sort.h index 81a6749ad9..50c6ef4364 100644 --- a/Source/sort/GB_sort.h +++ b/Source/sort/GB_sort.h @@ -2,7 +2,7 @@ // GB_sort.h: definitions for sorting functions //------------------------------------------------------------------------------ -// 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 //------------------------------------------------------------------------------ @@ -16,8 +16,7 @@ #define GB_SORT_H #include "GB.h" - -#define GB_BASECASE (64 * 1024) +#include "sort/include/GB_sort_kernels.h" void GB_qsort_1b // sort array A of size 2-by-n, using 1 key (A [0][]) ( @@ -62,9 +61,6 @@ void GB_qsort_1b_size16 // GB_qsort_1b with A_1 with sizeof = 16 const int64_t n ) ; -// See GB_callbacks.h: -// GB_CALLBACK_QSORT_1_PROTO (GB_qsort_1) ; - void GB_qsort_2 // sort array A of size 2-by-n, using 2 keys (A [0:1][]) ( int64_t *restrict A_0, // size n array @@ -104,121 +100,6 @@ GrB_Info GB_msort_3 // sort array A of size 3-by-n, using 3 keys (A [0:2][]) int nthreads // # of threads to use ) ; -//------------------------------------------------------------------------------ -// GB_lt_1: sorting comparator function, one key -//------------------------------------------------------------------------------ - -// A [a] and B [b] are keys of one integer. - -// GB_lt_1 returns true if A [a] < B [b], for GB_qsort_1b - -#define GB_lt_1(A_0, a, B_0, b) (A_0 [a] < B_0 [b]) - -//------------------------------------------------------------------------------ -// GB_lt_2: sorting comparator function, two keys -//------------------------------------------------------------------------------ - -// A [a] and B [b] are keys of two integers. - -// GB_lt_2 returns true if A [a] < B [b], for GB_qsort_2 and GB_msort_2 - -#define GB_lt_2(A_0, A_1, a, B_0, B_1, b) \ -( \ - (A_0 [a] < B_0 [b]) ? \ - ( \ - true \ - ) \ - : \ - ( \ - (A_0 [a] == B_0 [b]) ? \ - ( \ - /* primary key is the same; tie-break on the 2nd key */ \ - (A_1 [a] < B_1 [b]) \ - ) \ - : \ - ( \ - false \ - ) \ - ) \ -) - -//------------------------------------------------------------------------------ -// GB_lt_3: sorting comparator function, three keys -//------------------------------------------------------------------------------ - -// A [a] and B [b] are keys of three integers. - -// GB_lt_3 returns true if A [a] < B [b], for GB_qsort_3 and GB_msort_3 - -#define GB_lt_3(A_0, A_1, A_2, a, B_0, B_1, B_2, b) \ -( \ - (A_0 [a] < B_0 [b]) ? \ - ( \ - true \ - ) \ - : \ - ( \ - (A_0 [a] == B_0 [b]) ? \ - ( \ - /* primary key is the same; tie-break on the 2nd and 3rd key */ \ - GB_lt_2 (A_1, A_2, a, B_1, B_2, b) \ - ) \ - : \ - ( \ - false \ - ) \ - ) \ -) - -//------------------------------------------------------------------------------ -// GB_eq_*: sorting comparator function, one to three keys -//------------------------------------------------------------------------------ - -// A [a] and B [b] are keys of two or three integers. -// GB_eq_* returns true if A [a] == B [b] - -#define GB_eq_3(A_0, A_1, A_2, a, B_0, B_1, B_2, b) \ -( \ - (A_0 [a] == B_0 [b]) && \ - (A_1 [a] == B_1 [b]) && \ - (A_2 [a] == B_2 [b]) \ -) - -#define GB_eq_2(A_0, A_1, a, B_0, B_1, b) \ -( \ - (A_0 [a] == B_0 [b]) && \ - (A_1 [a] == B_1 [b]) \ -) - -#define GB_eq_1(A_0, a, B_0, b) \ -( \ - (A_0 [a] == B_0 [b]) \ -) - -//------------------------------------------------------------------------------ -// random number generator for quicksort -//------------------------------------------------------------------------------ - -// return a random GrB_Index, in range 0 to 2^60 -#define GB_RAND_MAX 32767 - -// return a random number between 0 and GB_RAND_MAX -static inline GrB_Index GB_rand15 (uint64_t *seed) -{ - (*seed) = (*seed) * 1103515245 + 12345 ; - return (((*seed) / 65536) % (GB_RAND_MAX + 1)) ; -} - -// return a random GrB_Index, in range 0 to 2^60 -static inline GrB_Index GB_rand (uint64_t *seed) -{ - GrB_Index i = GB_rand15 (seed) ; - i = GB_RAND_MAX * i + GB_rand15 (seed) ; - i = GB_RAND_MAX * i + GB_rand15 (seed) ; - i = GB_RAND_MAX * i + GB_rand15 (seed) ; - return (i) ; -} - //------------------------------------------------------------------------------ // matrix sorting (for GxB_Matrix_sort and GxB_Vector_sort) //------------------------------------------------------------------------------ @@ -237,3 +118,4 @@ GrB_Info GB_sort #endif + diff --git a/Source/sort/include/GB_qsort_1b_kernel.h b/Source/sort/include/GB_qsort_1b_kernel.h new file mode 100644 index 0000000000..4994075ef8 --- /dev/null +++ b/Source/sort/include/GB_qsort_1b_kernel.h @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// GB_qsort_1b_kernel: sort a 2-by-n list, using A [0][ ] as the sort key +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This inline function can be used in a JIT kernel, where GB_A_TYPE is +// templatized to the given data type. + +//------------------------------------------------------------------------------ + +#ifndef GB_QSORT_1B_KERNEL_H +#define GB_QSORT_1B_KERNEL_H + +#include "include/GB_sort_kernels.h" + +// returns true if A [a] < B [b] +#define GB_lt(A,a,B,b) GB_lt_1 (A ## _0, a, B ## _0, b) + +// each entry has a single key +#define GB_K 1 + +// argument list for calling a function +#undef GB_arg +#define GB_arg(A) \ + A ## _0, A ## _1 + +// argument list for calling a function, with offset +#undef GB_arg_offset +#define GB_arg_offset(A,x) \ + A ## _0 + (x), A ## _1 + (x) + +// argument list for defining a function +#undef GB_args +#define GB_args(A) \ + int64_t *restrict A ## _0, \ + GB_A_TYPE *restrict A ## _1 \ + +// swap A [a] and A [b] +#undef GB_swap +#define GB_swap(A,a,b) \ +{ \ + int64_t t0 = A ## _0 [a] ; A ## _0 [a] = A ## _0 [b] ; A ## _0 [b] = t0 ;\ + GB_A_TYPE t1 = A ## _1 [a] ; A ## _1 [a] = A ## _1 [b] ; A ## _1 [b] = t1 ;\ +} + +#undef GB_partition +#define GB_partition GB_partition_1b_kernel +#undef GB_quicksort +#define GB_quicksort GB_quicksort_1b_kernel + +#include "template/GB_qsort_template.c" + +// GB_qsort_1b_kernel: with A_1 having a templatized type of GB_A_TYPE +static inline void GB_qsort_1b_kernel +( + int64_t *restrict A_0, // size n array + GB_A_TYPE *restrict A_1, // size n array + const int64_t n +) +{ + uint64_t seed = n ; + GB_quicksort (GB_arg (A), n, &seed) ; +} + +#endif + diff --git a/Source/sort/include/GB_sort_kernels.h b/Source/sort/include/GB_sort_kernels.h new file mode 100644 index 0000000000..5982f78293 --- /dev/null +++ b/Source/sort/include/GB_sort_kernels.h @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// GB_sort_kernels.h: definitions for sorting functions +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#ifndef GB_SORT_KERNELS_H +#define GB_SORT_KERNELS_H + +//------------------------------------------------------------------------------ +// GB_lt_1: sorting comparator function, one key +//------------------------------------------------------------------------------ + +// A [a] and B [b] are keys of one integer. + +// GB_lt_1 returns true if A [a] < B [b], for GB_qsort_1b + +#define GB_lt_1(A_0, a, B_0, b) (A_0 [a] < B_0 [b]) + +//------------------------------------------------------------------------------ +// GB_lt_2: sorting comparator function, two keys +//------------------------------------------------------------------------------ + +// A [a] and B [b] are keys of two integers. + +// GB_lt_2 returns true if A [a] < B [b], for GB_qsort_2 and GB_msort_2 + +#define GB_lt_2(A_0, A_1, a, B_0, B_1, b) \ +( \ + (A_0 [a] < B_0 [b]) ? \ + ( \ + true \ + ) \ + : \ + ( \ + (A_0 [a] == B_0 [b]) ? \ + ( \ + /* primary key is the same; tie-break on the 2nd key */ \ + (A_1 [a] < B_1 [b]) \ + ) \ + : \ + ( \ + false \ + ) \ + ) \ +) + +//------------------------------------------------------------------------------ +// GB_lt_3: sorting comparator function, three keys +//------------------------------------------------------------------------------ + +// A [a] and B [b] are keys of three integers. + +// GB_lt_3 returns true if A [a] < B [b], for GB_qsort_3 and GB_msort_3 + +#define GB_lt_3(A_0, A_1, A_2, a, B_0, B_1, B_2, b) \ +( \ + (A_0 [a] < B_0 [b]) ? \ + ( \ + true \ + ) \ + : \ + ( \ + (A_0 [a] == B_0 [b]) ? \ + ( \ + /* primary key is the same; tie-break on the 2nd and 3rd key */ \ + GB_lt_2 (A_1, A_2, a, B_1, B_2, b) \ + ) \ + : \ + ( \ + false \ + ) \ + ) \ +) + +//------------------------------------------------------------------------------ +// GB_eq_*: sorting comparator function, one to three keys +//------------------------------------------------------------------------------ + +// A [a] and B [b] are keys of two or three integers. +// GB_eq_* returns true if A [a] == B [b] + +#define GB_eq_3(A_0, A_1, A_2, a, B_0, B_1, B_2, b) \ +( \ + (A_0 [a] == B_0 [b]) && \ + (A_1 [a] == B_1 [b]) && \ + (A_2 [a] == B_2 [b]) \ +) + +#define GB_eq_2(A_0, A_1, a, B_0, B_1, b) \ +( \ + (A_0 [a] == B_0 [b]) && \ + (A_1 [a] == B_1 [b]) \ +) + +#define GB_eq_1(A_0, a, B_0, b) \ +( \ + (A_0 [a] == B_0 [b]) \ +) + +#endif + diff --git a/Source/sort/factory/GB_qsort_template.c b/Source/sort/template/GB_qsort_template.c similarity index 98% rename from Source/sort/factory/GB_qsort_template.c rename to Source/sort/template/GB_qsort_template.c index c44a573eb3..f3b6cb0788 100644 --- a/Source/sort/factory/GB_qsort_template.c +++ b/Source/sort/template/GB_qsort_template.c @@ -33,7 +33,7 @@ static inline int64_t GB_partition { // select a pivot at random - int64_t pivot = ((n < GB_RAND_MAX) ? GB_rand15 (seed) : GB_rand (seed)) % n; + uint64_t pivot = GB_rand (seed) % ((uint64_t) n) ; // get the Pivot int64_t Pivot_0 [1] ; Pivot_0 [0] = A_0 [pivot] ; diff --git a/Source/sort/factory/GB_sort_template.c b/Source/sort/template/GB_sort_template.c similarity index 91% rename from Source/sort/factory/GB_sort_template.c rename to Source/sort/template/GB_sort_template.c index 11a49fb365..3573330733 100644 --- a/Source/sort/factory/GB_sort_template.c +++ b/Source/sort/template/GB_sort_template.c @@ -11,9 +11,9 @@ // GB_SORT (func) defined as GB_sort_func_TYPE_ascend or _descend, // GB_msort_ISO_ascend or _descend, // or GB_msort_func_UDT -// GB_TYPE bool, int8_, ... or GB_void for UDT or ISO +// GB_C_TYPE bool, int8_, ... or GB_void for UDT or ISO // GB_ADDR(A,p) A+p for builtin, A + p * GB_SIZE otherwise -// GB_SIZE size of each entry: sizeof (GB_TYPE) for built-in +// GB_SIZE size of each entry: sizeof (GB_C_TYPE) for built-in // GB_GET(x,X,i) x = X [i] for built-in, memcpy for UDT // GB_COPY(A,i,C,k) A[i] = C [k] // GB_SWAP(A,i,k) swap A[i] and A[k] @@ -29,12 +29,12 @@ static inline int64_t GB_SORT (partition) ( - GB_TYPE *restrict A_0, // size n arrays to partition - int64_t *restrict A_1, // size n array - const int64_t n, // size of the array(s) to partition - uint64_t *seed // random number seed, modified on output + GB_C_TYPE *restrict A_0, // size n arrays to partition + int64_t *restrict A_1, // size n array + const int64_t n, // size of the array(s) to partition + uint64_t *seed // random number seed, modified on output #if GB_SORT_UDT - , size_t csize // size of GB_TYPE + , size_t csize // size of GB_C_TYPE , size_t xsize // size of op->xtype , GxB_binary_function flt // function to test for < (ascend), > (descend) , GB_cast_function fcast // cast entry to inputs of flt @@ -43,7 +43,7 @@ static inline int64_t GB_SORT (partition) { // select a pivot at random - int64_t pivot = ((n < GB_RAND_MAX) ? GB_rand15 (seed) : GB_rand (seed)) % n; + uint64_t pivot = GB_rand (seed) % ((uint64_t) n) ; // Pivot = A [pivot] GB_GET (Pivot0, A_0, pivot) ; // Pivot0 = A_0 [pivot] @@ -112,12 +112,12 @@ static inline int64_t GB_SORT (partition) static void GB_SORT (quicksort) // sort A [0:n-1] ( - GB_TYPE *restrict A_0, // size n arrays to sort - int64_t *restrict A_1, // size n array - const int64_t n, // size of the array(s) to sort - uint64_t *seed // random number seed + GB_C_TYPE *restrict A_0, // size n arrays to sort + int64_t *restrict A_1, // size n array + const int64_t n, // size of the array(s) to sort + uint64_t *seed // random number seed #if GB_SORT_UDT - , size_t csize // size of GB_TYPE + , size_t csize // size of GB_C_TYPE , size_t xsize // size of op->xtype , GxB_binary_function flt // function to test for < (ascend), > (descend) , GB_cast_function fcast // cast entry to inputs of flt @@ -193,15 +193,15 @@ static void GB_SORT (quicksort) // sort A [0:n-1] static int64_t GB_SORT (binary_search) // return pleft ( - const GB_TYPE *restrict Z_0, // Pivot is Z [pivot] - const int64_t *restrict Z_1, + const GB_C_TYPE *restrict Z_0, // Pivot is Z [pivot] + const int64_t *restrict Z_1, const int64_t pivot, - const GB_TYPE *restrict X_0, // search in X [p_start..p_end_-1] - const int64_t *restrict X_1, + const GB_C_TYPE *restrict X_0, // search in X [p_start..p_end_-1] + const int64_t *restrict X_1, const int64_t p_start, const int64_t p_end #if GB_SORT_UDT - , size_t csize // size of GB_TYPE + , size_t csize // size of GB_C_TYPE , size_t xsize // size of op->xtype , GxB_binary_function flt // function to test for < (ascend), > (descend) , GB_cast_function fcast // cast entry to inputs of flt @@ -305,16 +305,16 @@ static void GB_SORT (create_merge_tasks) const int t0, // first task tid to create const int ntasks, // # of tasks to create const int64_t pS_start, // merge into S [pS_start...] - const GB_TYPE *restrict L_0, // Left = L [pL_start...pL_end-1] - const int64_t *restrict L_1, + const GB_C_TYPE *restrict L_0, // Left = L [pL_start...pL_end-1] + const int64_t *restrict L_1, const int64_t pL_start, const int64_t pL_end, - const GB_TYPE *restrict R_0, // Right = R [pR_start...pR_end-1] - const int64_t *restrict R_1, + const GB_C_TYPE *restrict R_0, // Right = R [pR_start...pR_end-1] + const int64_t *restrict R_1, const int64_t pR_start, const int64_t pR_end #if GB_SORT_UDT - , size_t csize // size of GB_TYPE + , size_t csize // size of GB_C_TYPE , size_t xsize // size of op->xtype , GxB_binary_function flt // function to test for < (ascend), > (descend) , GB_cast_function fcast // cast entry to inputs of flt @@ -439,16 +439,16 @@ static void GB_SORT (create_merge_tasks) static void GB_SORT (merge) ( - GB_TYPE *restrict S_0, // output of length nleft + nright + GB_C_TYPE *restrict S_0, // output of length nleft + nright int64_t *restrict S_1, - const GB_TYPE *restrict Left_0, // left input of length nleft - const int64_t *restrict Left_1, + const GB_C_TYPE *restrict Left_0, // left input of length nleft + const int64_t *restrict Left_1, const int64_t nleft, - const GB_TYPE *restrict Right_0, // right input of length nright - const int64_t *restrict Right_1, + const GB_C_TYPE *restrict Right_0, // right input of length nright + const int64_t *restrict Right_1, const int64_t nright #if GB_SORT_UDT - , size_t csize // size of GB_TYPE + , size_t csize // size of GB_C_TYPE , size_t xsize // size of op->xtype , GxB_binary_function flt // function to test for < (ascend), > (descend) , GB_cast_function fcast // cast entry to inputs of flt @@ -506,16 +506,16 @@ static void GB_SORT (merge) static void GB_SORT (vector) // sort the pair of arrays A_0, A_1 ( - GB_TYPE *restrict A_0, // size n array - int64_t *restrict A_1, // size n array - GB_TYPE *restrict W_0, // workspace of size n * GB_SIZE bytes - int64_t *restrict W, // int64_t workspace of size n+6*ntasks+1 + GB_C_TYPE *restrict A_0, // size n array + int64_t *restrict A_1, // size n array + GB_C_TYPE *restrict W_0, // workspace of size n * GB_SIZE bytes + int64_t *restrict W, // int64_t workspace of size n+6*ntasks+1 const int64_t n, const int kk, const int ntasks, const int nthreads // # of threads to use #if GB_SORT_UDT - , size_t csize // size of GB_TYPE + , size_t csize // size of GB_C_TYPE , size_t xsize // size of op->xtype , GxB_binary_function flt // function to test for < (ascend), > (descend) , GB_cast_function fcast // cast entry to inputs of flt @@ -655,14 +655,20 @@ static void GB_SORT (vector) // sort the pair of arrays A_0, A_1 GB_FREE_WORK (&W, W_size) ; \ } +#ifdef GB_JIT_KERNEL +GB_JIT_GLOBAL GB_JIT_KERNEL_SORT_PROTO (GB_jit_kernel) ; +GB_JIT_GLOBAL GB_JIT_KERNEL_SORT_PROTO (GB_jit_kernel) +#else static GrB_Info GB_SORT (matrix) ( GrB_Matrix C, // matrix sorted in-place #if GB_SORT_UDT GrB_BinaryOp op, // comparator for user-defined types only #endif + int nthreads, // # of threads to use GB_Werk Werk ) +#endif { //-------------------------------------------------------------------------- @@ -676,25 +682,31 @@ static GrB_Info GB_SORT (matrix) ASSERT (op->xtype == op->ytype) ; #endif - GB_C_NVALS (cnz) ; // int64_t cnz = GB_nnz (C) ; - if (C->iso || cnz <= 1) - { - // nothing to do - return (GrB_SUCCESS) ; - } + //-------------------------------------------------------------------------- + // get callback functions + //-------------------------------------------------------------------------- + + #ifdef GB_JIT_KERNEL + GB_GET_CALLBACK (GB_malloc_memory) ; + GB_GET_CALLBACK (GB_free_memory) ; + GB_GET_CALLBACK (GB_werk_pop) ; + GB_GET_CALLBACK (GB_werk_push) ; + GB_GET_CALLBACK (GB_p_slice) ; + #endif //-------------------------------------------------------------------------- // get input //-------------------------------------------------------------------------- + GB_C_NVALS (cnz) ; // int64_t cnz = GB_nnz (C) ; int64_t cnvec = C->nvec ; int64_t *restrict Cp = C->p ; int64_t *restrict Ci = C->i ; - GB_TYPE *restrict Cx = (GB_TYPE *) C->x ; + GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; // workspace - GB_TYPE *restrict W_0 = NULL ; size_t W_0_size = 0 ; - int64_t *restrict W = NULL ; size_t W_size = 0 ; + GB_C_TYPE *restrict W_0 = NULL ; size_t W_0_size = 0 ; + int64_t *restrict W = NULL ; size_t W_size = 0 ; int64_t *restrict C_skipped = NULL ; size_t C_skipped_size = 0 ; GB_WERK_DECLARE (SortTasks, int64_t) ; @@ -705,6 +717,7 @@ static GrB_Info GB_SORT (matrix) size_t csize = ctype->size ; size_t xsize = op->xtype->size ; GxB_binary_function flt = op->binop_function ; + ASSERT (flt != NULL) ; GB_cast_function fcast = GB_cast_factory (op->xtype->code, ctype->code) ; #endif @@ -714,9 +727,6 @@ static GrB_Info GB_SORT (matrix) // slice the C matrix into tasks for phase 1 - int nthreads_max = GB_Context_nthreads_max ( ) ; - double chunk = GB_Context_chunk ( ) ; - int nthreads = GB_nthreads (cnz, chunk, nthreads_max) ; int ntasks = (nthreads == 1) ? 1 : (32 * nthreads) ; ntasks = GB_IMIN (ntasks, cnvec) ; ntasks = GB_IMAX (ntasks, 1) ; @@ -790,7 +800,7 @@ static GrB_Info GB_SORT (matrix) // construct a list of vectors that must still be sorted //-------------------------------------------------------------------------- - GB_cumsum (C_skip, ntasks, NULL, 1, Werk) ; + GB_cumsum1 (C_skip, ntasks) ; int64_t total_skipped = C_skip [ntasks] ; C_skipped = GB_MALLOC_WORK (total_skipped, int64_t, &C_skipped_size) ; @@ -843,7 +853,7 @@ static GrB_Info GB_SORT (matrix) //-------------------------------------------------------------------------- W = GB_MALLOC_WORK (max_length + 6*ntasks2 + 1, int64_t, &W_size) ; - W_0 = (GB_TYPE *) GB_MALLOC_WORK (max_length * GB_SIZE, GB_void, + W_0 = (GB_C_TYPE *) GB_MALLOC_WORK (max_length * GB_SIZE, GB_void, &W_0_size) ; if (W == NULL || W_0 == NULL) { @@ -881,5 +891,5 @@ static GrB_Info GB_SORT (matrix) } #undef GB_SORT -#undef GB_TYPE +#undef GB_C_TYPE diff --git a/Source/split/GB_split_bitmap.c b/Source/split/GB_split_bitmap.c index 5f3c2c1741..0cfd6a165d 100644 --- a/Source/split/GB_split_bitmap.c +++ b/Source/split/GB_split_bitmap.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #define GB_FREE_ALL \ GB_Matrix_free (&C) ; @@ -190,7 +188,7 @@ GrB_Info GB_split_bitmap // split a bitmap matrix if (info == GrB_NO_VALUE) { - // user-defined types + GBURBLE ("(generic split) ") ; #define GB_C_TYPE GB_void #define GB_A_TYPE GB_void #undef GB_COPY diff --git a/Source/split/GB_split_full.c b/Source/split/GB_split_full.c index f0cc974599..a1827124d3 100644 --- a/Source/split/GB_split_full.c +++ b/Source/split/GB_split_full.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #define GB_FREE_ALL \ GB_Matrix_free (&C) ; @@ -182,7 +180,7 @@ GrB_Info GB_split_full // split a full matrix if (info == GrB_NO_VALUE) { - // user-defined types + GBURBLE ("(generic split) ") ; #define GB_C_TYPE GB_void #define GB_A_TYPE GB_void #undef GB_COPY diff --git a/Source/split/GB_split_sparse.c b/Source/split/GB_split_sparse.c index d8906d49c5..7a52d2e57c 100644 --- a/Source/split/GB_split_sparse.c +++ b/Source/split/GB_split_sparse.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - #define GB_FREE_WORKSPACE \ GB_WERK_POP (C_ek_slicing, int64_t) ; \ GB_FREE_WORK (&Wp, Wp_size) ; @@ -319,7 +317,7 @@ GrB_Info GB_split_sparse // split a sparse matrix if (info == GrB_NO_VALUE) { - // user-defined types + GBURBLE ("(generic split) ") ; #define GB_C_TYPE GB_void #define GB_A_TYPE GB_void #undef GB_COPY diff --git a/Source/transpose/GB_transpose.c b/Source/transpose/GB_transpose.c index 1829d0779a..582c975010 100644 --- a/Source/transpose/GB_transpose.c +++ b/Source/transpose/GB_transpose.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // CALLS: GB_builder // Transpose a matrix, C=A', and optionally apply a unary operator and/or @@ -630,7 +628,7 @@ GrB_Info GB_transpose // C=A', C=(ctype)A' or C=op(A') Count [tid] = k ; } - GB_cumsum (Count, ntasks, NULL, 1, NULL) ; + GB_cumsum1 (Count, ntasks) ; ASSERT (Count [ntasks] == anz) ; #pragma omp parallel for num_threads(nth) schedule(dynamic,1) diff --git a/Source/transpose/GB_transpose_bucket.c b/Source/transpose/GB_transpose_bucket.c index f6344bb858..08fb686ff2 100644 --- a/Source/transpose/GB_transpose_bucket.c +++ b/Source/transpose/GB_transpose_bucket.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // C = A' or op(A'). Optionally typecasts from A->type to the new type ctype, // and/or optionally applies a unary operator. diff --git a/Source/transpose/GB_transpose_ix.c b/Source/transpose/GB_transpose_ix.c index 0c2005eacc..85d5c535ca 100644 --- a/Source/transpose/GB_transpose_ix.c +++ b/Source/transpose/GB_transpose_ix.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // The values of A are typecasted to C->type, the type of the C matrix. // If A is sparse or hypersparse diff --git a/Source/transpose/GB_transpose_op.c b/Source/transpose/GB_transpose_op.c index 03625b9b0e..ec5000cdf2 100644 --- a/Source/transpose/GB_transpose_op.c +++ b/Source/transpose/GB_transpose_op.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: done. - // C = op (A') // The values of A are typecasted to op->xtype and then passed to the unary @@ -39,6 +37,7 @@ #include "binaryop/GB_binop.h" #include "jitifyer/GB_stringify.h" #ifndef GBCOMPACT +#include "GB_control.h" #include "FactoryKernels/GB_uop__include.h" #include "FactoryKernels/GB_ew__include.h" #endif @@ -217,35 +216,37 @@ GrB_Info GB_transpose_op // transpose, typecast, and apply operator to a matrix size_t xsize = op->xtype->size ; size_t ysize = op->ytype->size ; - GB_Type_code scode = scalar->type->code ; + GB_Type_code scalar_code = scalar->type->code ; xcode = op->xtype->code ; ycode = op->ytype->code ; // typecast the scalar to the operator input size_t ssize_cast ; - GB_Type_code scode_cast ; + GB_Type_code scalar_code_cast ; if (binop_bind1st) { ssize_cast = xsize ; - scode_cast = xcode ; + scalar_code_cast = xcode ; } else { ssize_cast = ysize ; - scode_cast = ycode ; + scalar_code_cast = ycode ; } GB_void swork [GB_VLA(ssize_cast)] ; GB_void *scalarx = (GB_void *) scalar->x ; - if (scode_cast != scode) + if (scalar_code_cast != scalar_code) { // typecast the scalar to the operator input, in swork - GB_cast_function cast_s = GB_cast_factory (scode_cast, scode) ; + GB_cast_function cast_s = + GB_cast_factory (scalar_code_cast, scalar_code) ; cast_s (swork, scalar->x, ssize) ; scalarx = swork ; } GB_Type_code acode = Atype->code ; GxB_binary_function fop = op->binop_function ; + ASSERT (fop != NULL) ; GB_cast_function cast_A_to_Y = GB_cast_factory (ycode, acode) ; GB_cast_function cast_A_to_X = GB_cast_factory (xcode, acode) ; diff --git a/Source/transpose/GrB_transpose.c b/Source/transpose/GrB_transpose.c index aa7c0aaac8..ad1a68ae54 100644 --- a/Source/transpose/GrB_transpose.c +++ b/Source/transpose/GrB_transpose.c @@ -80,7 +80,7 @@ GrB_Info GrB_transpose // C = accum(C,A') or accum(C,A) bool C_is_csc = C->is_csc ; if (C_is_csc != A->is_csc) { - // Flip the sense of A_transpose + // Negate A_transpose A_transpose = !A_transpose ; } diff --git a/Source/transpose/template/GB_transpose_sparse.c b/Source/transpose/template/GB_transpose_sparse.c index 56da1e8c35..7c16cb48dd 100644 --- a/Source/transpose/template/GB_transpose_sparse.c +++ b/Source/transpose/template/GB_transpose_sparse.c @@ -33,7 +33,7 @@ for (int64_t k = 0 ; k < anvec ; k++) { // iterate over the entries in A(:,j) - int64_t j = GBH_S (Ah, k) ; + int64_t j = GBH_AB (Ah, k) ; int64_t pA_start = Ap [k] ; int64_t pA_end = Ap [k+1] ; for (int64_t pA = pA_start ; pA < pA_end ; pA++) @@ -65,7 +65,7 @@ for (int64_t k = A_slice [tid] ; k < A_slice [tid+1] ; k++) { // iterate over the entries in A(:,j) - int64_t j = GBH_S (Ah, k) ; + int64_t j = GBH_AB (Ah, k) ; int64_t pA_start = Ap [k] ; int64_t pA_end = Ap [k+1] ; for (int64_t pA = pA_start ; pA < pA_end ; pA++) @@ -100,7 +100,7 @@ for (int64_t k = A_slice [tid] ; k < A_slice [tid+1] ; k++) { // iterate over the entries in A(:,j) - int64_t j = GBH_S (Ah, k) ; + int64_t j = GBH_AB (Ah, k) ; int64_t pA_start = Ap [k] ; int64_t pA_end = Ap [k+1] ; for (int64_t pA = pA_start ; pA < pA_end ; pA++) diff --git a/Source/transpose/template/GB_transpose_template.c b/Source/transpose/template/GB_transpose_template.c index 7fd76a1a6d..1a1a2f8578 100644 --- a/Source/transpose/template/GB_transpose_template.c +++ b/Source/transpose/template/GB_transpose_template.c @@ -16,24 +16,24 @@ // get A and C //-------------------------------------------------------------------------- - #undef GBH_S - #undef GB_S_TYPE + #undef GBH_AB + #undef GB_AB_TYPE #ifdef GB_BIND_1ST // A is the name of the matrix passed in to this kernel, but it takes // the place of the B matrix for C=op(x,A'). As a result, the B macros // must be used to access its contents. - #define GBH_S(Ah,k) GBH_B(Ah,k) - #define GB_S_TYPE GB_B_TYPE + #define GBH_AB(Ah,k) GBH_B(Ah,k) + #define GB_AB_TYPE GB_B_TYPE #else // for bind2nd, unary ops, and mere typecasting, use the A macros to // access the A matrix. - #define GBH_S(Ah,k) GBH_A(Ah,k) - #define GB_S_TYPE GB_A_TYPE + #define GBH_AB(Ah,k) GBH_A(Ah,k) + #define GB_AB_TYPE GB_A_TYPE #endif #ifndef GB_ISO_TRANSPOSE - const GB_S_TYPE *restrict Ax = (GB_S_TYPE *) A->x ; + const GB_AB_TYPE *restrict Ax = (GB_AB_TYPE *) A->x ; GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ; #endif @@ -86,6 +86,6 @@ } #undef GB_ISO_TRANSPOSE -#undef GBH_S -#undef GB_S_TYPE +#undef GBH_AB +#undef GB_AB_TYPE diff --git a/Source/type/GxB_Type_new.c b/Source/type/GxB_Type_new.c index b4bfe342cf..e2209e8c86 100644 --- a/Source/type/GxB_Type_new.c +++ b/Source/type/GxB_Type_new.c @@ -139,7 +139,10 @@ GrB_Info GxB_Type_new { // unable to determine the type size GrB_Type_free (&t) ; - return (GrB_INVALID_VALUE) ; + // If the JIT fails, it returns GrB_NO_VALUE or GxB_JIT_ERROR, + // Convert GrB_NO_VALUE to GrB_INVALID_VALUE (the size of the type + // is 0 and cannot be determined by the JIT). + return (info == GrB_NO_VALUE ? GrB_INVALID_VALUE : info) ; } t->size = sizeof_type ; } diff --git a/Source/unaryop/GB_unop_identity.c b/Source/unaryop/GB_unop_identity.c index 525fc24831..0d476cf6c4 100644 --- a/Source/unaryop/GB_unop_identity.c +++ b/Source/unaryop/GB_unop_identity.c @@ -7,13 +7,15 @@ //------------------------------------------------------------------------------ +// The op does not do any typecasting: ztype == xtype + #include "GB.h" #include "unaryop/GB_unop.h" #include "include/GB_unused.h" GB_Operator GB_unop_identity // return IDENTITY operator, or NULL on error ( - GrB_Type type, // operator type + GrB_Type type, // operator type (both z and x) GrB_UnaryOp op // header for IDENTITY_UDT operator ) { @@ -37,7 +39,7 @@ GB_Operator GB_unop_identity // return IDENTITY operator, or NULL on error { // construct the IDENTITY_UDT operator. It will have a NULL // function pointer so it cannot be used in a generic kernel. It - // will have a nonzero hash, and will thus not be treated as a a + // will have a nonzero hash, and will thus not be treated as a // built-in operator in the JIT kernels. The name of the operator // is the name of its type. if (op == NULL) return (NULL) ; diff --git a/Source/unaryop/GxB_UnaryOp_new.c b/Source/unaryop/GxB_UnaryOp_new.c index 0a0a71d533..d9a0bfd5a3 100644 --- a/Source/unaryop/GxB_UnaryOp_new.c +++ b/Source/unaryop/GxB_UnaryOp_new.c @@ -42,7 +42,7 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator // allocate the unary operator size_t header_size ; - GrB_UnaryOp op = GB_MALLOC (1, struct GB_UnaryOp_opaque, &header_size) ; + GrB_UnaryOp op = GB_CALLOC (1, struct GB_UnaryOp_opaque, &header_size) ; if (op == NULL) { // out of memory @@ -74,7 +74,10 @@ GrB_Info GxB_UnaryOp_new // create a new user-defined unary operator { // unable to construct the function pointer GB_Op_free ((GB_Operator *) &op) ; - return (GrB_NULL_POINTER) ; + // If the JIT fails, it returns GrB_NO_VALUE or GxB_JIT_ERROR, + // Convert GrB_NO_VALUE to GrB_NULL_POINTER (the function is NULL + // and cannot be compiled by the JIT). + return (info == GrB_NO_VALUE ? GrB_NULL_POINTER : info) ; } op->unop_function = (GxB_unary_function) user_function ; GB_BURBLE_END ; diff --git a/Source/wait/GB_unjumble.c b/Source/wait/GB_unjumble.c index 0eb471ddc8..d4f4f46e25 100644 --- a/Source/wait/GB_unjumble.c +++ b/Source/wait/GB_unjumble.c @@ -8,6 +8,10 @@ //------------------------------------------------------------------------------ #include "sort/GB_sort.h" +#include "unaryop/GB_unop.h" +#include "jitifyer/GB_stringify.h" + +#define GB_FREE_ALL GB_WERK_POP (A_slice, int64_t) ; GrB_Info GB_unjumble // unjumble a matrix ( @@ -35,7 +39,7 @@ GrB_Info GB_unjumble // unjumble a matrix return (GrB_SUCCESS) ; } - // full and bitmap matrices are never jumbled + // full and bitmap matrices are never jumbled ASSERT (!GB_IS_FULL (A)) ; ASSERT (!GB_IS_BITMAP (A)) ; ASSERT (GB_IS_SPARSE (A) || GB_IS_HYPERSPARSE (A)) ; @@ -78,77 +82,126 @@ GrB_Info GB_unjumble // unjumble a matrix // sort the vectors //-------------------------------------------------------------------------- - switch (asize) - { - case 0 : // iso matrices of any type; only sort the pattern - #define GB_QSORT \ - GB_qsort_1 (Ai+pA_start, aknz) ; - #include "wait/factory/GB_unjumbled_template.c" - break ; + GrB_Info info = GrB_NO_VALUE ; - case GB_1BYTE : // bool, uint8, int8, and user defined types of size 1 - { - uint8_t *Ax = (uint8_t *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size1 (Ai+pA_start, Ax+pA_start, aknz) ; - #include "wait/factory/GB_unjumbled_template.c" - } - break ; + if (asize == 0) + { - case GB_2BYTE : // uint16, int16, and user-defined types of size 2 - { - uint16_t *Ax = (uint16_t *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size2 (Ai+pA_start, Ax+pA_start, aknz) ; - #include "wait/factory/GB_unjumbled_template.c" - } - break ; + //---------------------------------------------------------------------- + // iso matrices of any type; only sort the pattern + //---------------------------------------------------------------------- - case GB_4BYTE : // uint32, int32, float, and 4-byte user - { - uint32_t *Ax = (uint32_t *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size4 (Ai+pA_start, Ax+pA_start, aknz) ; - #include "wait/factory/GB_unjumbled_template.c" - } - break ; + #define GB_QSORT GB_qsort_1 (Ai+pA_start, aknz) ; + #include "wait/template/GB_unjumbled_template.c" + info = GrB_SUCCESS ; + } + else + { - case GB_8BYTE : // uint64, int64, double, float complex, and 8-byte user - { - uint64_t *Ax = (uint64_t *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size8 (Ai+pA_start, Ax+pA_start, aknz) ; - #include "wait/factory/GB_unjumbled_template.c" - } - break ; + //---------------------------------------------------------------------- + // factory kernels for non-iso matrices + //---------------------------------------------------------------------- - case GB_16BYTE : // double complex, and user-defined types of size 16 + #ifndef GBCOMPACT + GB_IF_FACTORY_KERNELS_ENABLED { - GB_blob16 *Ax = (GB_blob16 *) A->x ; - #define GB_QSORT \ - GB_qsort_1b_size16 (Ai+pA_start, Ax+pA_start, aknz) ; - #include "wait/factory/GB_unjumbled_template.c" + switch (asize) + { + + case GB_1BYTE : // bool, uint8, int8, and user types of size 1 + { + uint8_t *Ax = (uint8_t *) A->x ; + #define GB_QSORT \ + GB_qsort_1b_size1 (Ai+pA_start, Ax+pA_start, aknz) ; + #include "wait/template/GB_unjumbled_template.c" + info = GrB_SUCCESS ; + } + break ; + + case GB_2BYTE : // uint16, int16, and user types of size 2 + { + uint16_t *Ax = (uint16_t *) A->x ; + #define GB_QSORT \ + GB_qsort_1b_size2 (Ai+pA_start, Ax+pA_start, aknz) ; + #include "wait/template/GB_unjumbled_template.c" + info = GrB_SUCCESS ; + } + break ; + + case GB_4BYTE : // uint32, int32, float, and 4-byte user + { + uint32_t *Ax = (uint32_t *) A->x ; + #define GB_QSORT \ + GB_qsort_1b_size4 (Ai+pA_start, Ax+pA_start, aknz) ; + #include "wait/template/GB_unjumbled_template.c" + info = GrB_SUCCESS ; + } + break ; + + case GB_8BYTE : // uint64, int64, double, float complex, + // and 8-byte user-defined types + { + uint64_t *Ax = (uint64_t *) A->x ; + #define GB_QSORT \ + GB_qsort_1b_size8 (Ai+pA_start, Ax+pA_start, aknz) ; + #include "wait/template/GB_unjumbled_template.c" + info = GrB_SUCCESS ; + } + break ; + + case GB_16BYTE : // double complex, and user types of size 16 + { + GB_blob16 *Ax = (GB_blob16 *) A->x ; + #define GB_QSORT \ + GB_qsort_1b_size16 (Ai+pA_start, Ax+pA_start, aknz) ; + #include "wait/template/GB_unjumbled_template.c" + info = GrB_SUCCESS ; + } + break ; + + default:; + } } - break ; + #endif + } - default : // user-defined types of arbitrary size - { - GB_void *Ax = (GB_void *) A->x ; - #define GB_QSORT \ - GB_qsort_1b (Ai+pA_start, Ax+pA_start*asize, asize, aknz) ; - #include "wait/factory/GB_unjumbled_template.c" - } - break ; + //-------------------------------------------------------------------------- + // via the JIT kernel + //-------------------------------------------------------------------------- + + if (info == GrB_NO_VALUE) + { + GBURBLE ("(unjumble: jit kernel) ") ; + struct GB_UnaryOp_opaque op_header ; + GB_Operator op = GB_unop_identity (A->type, &op_header) ; + info = GB_unjumble_jit (A, op, A_slice, ntasks, nthreads) ; + } + + //-------------------------------------------------------------------------- + // via the generic kernel + //-------------------------------------------------------------------------- + + if (info == GrB_NO_VALUE) + { + GBURBLE ("(unjumble: generic kernel) ") ; + GB_void *Ax = (GB_void *) A->x ; + #define GB_QSORT \ + GB_qsort_1b (Ai+pA_start, Ax+pA_start*asize, asize, aknz) ; + #include "wait/template/GB_unjumbled_template.c" + info = GrB_SUCCESS ; } //-------------------------------------------------------------------------- // free workspace and return result //-------------------------------------------------------------------------- - GB_WERK_POP (A_slice, int64_t) ; - A->jumbled = false ; // A has been unjumbled - ASSERT_MATRIX_OK (A, "A unjumbled", GB0) ; - ASSERT (A->nvec_nonempty >= 0) - return (GrB_SUCCESS) ; + GB_FREE_ALL ; + if (info == GrB_SUCCESS) + { + A->jumbled = false ; // A has been unjumbled + ASSERT_MATRIX_OK (A, "A unjumbled", GB0) ; + ASSERT (A->nvec_nonempty >= 0) + } + return (info) ; } diff --git a/Source/wait/GB_wait.c b/Source/wait/GB_wait.c index 309153360e..e9258cb5b6 100644 --- a/Source/wait/GB_wait.c +++ b/Source/wait/GB_wait.c @@ -7,8 +7,6 @@ //------------------------------------------------------------------------------ -// JIT: not needed. Only one variant possible. - // CALLS: GB_builder // The matrix A has zombies and/or pending tuples placed there by @@ -52,7 +50,7 @@ } #include "select/GB_select.h" -#include "ewise/GB_add.h" +#include "add/GB_add.h" #include "binaryop/GB_binop.h" #include "pending/GB_Pending.h" #include "builder/GB_build.h" @@ -75,7 +73,7 @@ GrB_Info GB_wait // finish all pending computations struct GB_Matrix_opaque T_header, A1_header, S_header ; GrB_Matrix T = NULL, A1 = NULL, S = NULL, Y = NULL ; - ASSERT_MATRIX_OK (A, "A to wait", GB_FLIP (GB0)) ; + ASSERT_MATRIX_OK (A, "A to wait", GB_ZOMBIE (GB0)) ; if (GB_IS_FULL (A) || GB_IS_BITMAP (A)) { @@ -249,7 +247,7 @@ GrB_Info GB_wait // finish all pending computations // A zombie is an entry A(i,j) in the matrix that as been marked for // deletion, but hasn't been deleted yet. It is marked by "negating" - // replacing its index i with GB_FLIP(i). + // replacing its index i with GB_ZOMBIE(i). // TODO: pass tnz to GB_selector, to pad the reallocated A matrix ASSERT_MATRIX_OK (A, "A before zombies removed", GB0) ; @@ -429,7 +427,8 @@ GrB_Info GB_wait // finish all pending computations int64_t *restrict A1p = A1->p ; int64_t *restrict A1h = A1->h ; int64_t a1nvec = 0 ; - for (int64_t k = kA ; k < anvec ; k++) + + for (int64_t k = kA ; k < anvec ; k++) // TODO:parallel { // get A (:,k) int64_t pA_start = Ap [k] ; @@ -459,7 +458,7 @@ GrB_Info GB_wait // finish all pending computations GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_add (S, A->type, A->is_csc, NULL, 0, 0, &ignore, A1, T, - false, NULL, NULL, op_2nd, true, Werk)) ; + false, NULL, NULL, op_2nd, false, true, Werk)) ; ASSERT_MATRIX_OK (S, "S = A1+T", GB0) ; @@ -508,7 +507,7 @@ GrB_Info GB_wait // finish all pending computations } // append the vectors of T to the end of A - for (int64_t k = 0 ; k < tnvec ; k++) + for (int64_t k = 0 ; k < tnvec ; k++) // TODO:parallel { int64_t j = Th [k] ; ASSERT (j >= tjfirst) ; @@ -556,7 +555,7 @@ GrB_Info GB_wait // finish all pending computations GB_CLEAR_STATIC_HEADER (S, &S_header) ; GB_OK (GB_add (S, A->type, A->is_csc, NULL, 0, 0, &ignore, A, T, - false, NULL, NULL, op_2nd, true, Werk)) ; + false, NULL, NULL, op_2nd, false, true, Werk)) ; GB_Matrix_free (&T) ; ASSERT_MATRIX_OK (S, "S after GB_wait:add", GB0) ; diff --git a/Source/wait/GB_wait.h b/Source/wait/GB_wait.h index 4ebfd35538..1a8f10d478 100644 --- a/Source/wait/GB_wait.h +++ b/Source/wait/GB_wait.h @@ -49,8 +49,32 @@ GrB_Info GB_unjumble // unjumble a matrix #define GB_MATRIX_WAIT_IF_PENDING_OR_ZOMBIES(A) \ GB_WAIT_IF (GB_PENDING_OR_ZOMBIES (A), A, GB_STR (A)) -// ensure A is not jumbled +// ensure A is not jumbled (if so, do all pending work) #define GB_MATRIX_WAIT_IF_JUMBLED(A) GB_WAIT_IF (GB_JUMBLED (A), A, GB_STR (A)) +// just ensure A is not jumbled; leaving pending tuples alone if possible +#define GB_UNJUMBLE(A) \ +{ \ + if (GB_JUMBLED (A)) \ + { \ + GrB_Info info ; \ + if (GB_ZOMBIES (A)) \ + { \ + /* zombies cannot be unjumbled, so do all pending work */ \ + GB_OK (GB_wait ((GrB_Matrix) A, GB_STR (A), Werk)) ; \ + ASSERT (!GB_PENDING (A)) ; \ + } \ + else \ + { \ + /* just unjumble the matrix; do no other pending work */ \ + GB_BURBLE_MATRIX (A, "(unjumble: %s) ", GB_STR (A)) ; \ + GB_OK (GB_unjumble ((GrB_Matrix) A, Werk)) ; \ + ASSERT (GB_PENDING_OK (A)) ; \ + } \ + ASSERT (!GB_ZOMBIES (A)) ; \ + } \ + ASSERT (!GB_JUMBLED (A)) ; \ +} + #endif diff --git a/Source/wait/GxB_IndexBinaryOp_wait.c b/Source/wait/GxB_IndexBinaryOp_wait.c new file mode 100644 index 0000000000..4bfbdbe5f6 --- /dev/null +++ b/Source/wait/GxB_IndexBinaryOp_wait.c @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// GxB_IndexBinaryOp_wait: wait for a user-defined GxB_IndexBinaryOp to complete +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// In SuiteSparse:GraphBLAS, a user-defined GxB_IndexBinaryOp has no pending +// operations to wait for. All this method does is verify that the op is +// properly initialized, and then it does an OpenMP flush. + +#include "GB.h" + +GrB_Info GxB_IndexBinaryOp_wait // no work, just check if valid +( + GxB_IndexBinaryOp op, + GrB_WaitMode waitmode +) +{ + + //-------------------------------------------------------------------------- + // check inputs + //-------------------------------------------------------------------------- + + GB_WHERE1 ("GxB_IndexBinaryOp_wait (op, waitmode)") ; + GB_RETURN_IF_NULL_OR_FAULTY (op) ; + + //-------------------------------------------------------------------------- + // return result + //-------------------------------------------------------------------------- + + #pragma omp flush + return (GrB_SUCCESS) ; +} + diff --git a/Source/wait/factory/GB_unjumbled_template.c b/Source/wait/template/GB_unjumbled_template.c similarity index 100% rename from Source/wait/factory/GB_unjumbled_template.c rename to Source/wait/template/GB_unjumbled_template.c diff --git a/Tcov/Contents.m b/Tcov/Contents.m index 73804b189f..23ba0d5366 100644 --- a/Tcov/Contents.m +++ b/Tcov/Contents.m @@ -2,11 +2,11 @@ % % grbcov - compile, run, and evaluate test coverage % -% grbcover - compile ../Test/* for statement coverage testing -% grbcover_edit - create a version of GraphBLAS for statement coverage tests -% testcov - run all GraphBLAS tests, with statement coverage -% grbshow - create a test coverage report in tmp_cover/ -% grbmake - compile the GraphBLAS library for statement coverage testing +% grbcov_testmake - compile ../Test/* for statement coverage testing +% grbcover_edit - create a version of GraphBLAS for statement coverage tests +% testcov - run all GraphBLAS tests, with statement coverage +% grbshow - create a test coverage report in tmp_cover/ +% grbmake - compile the GraphBLAS library for statement coverage testing -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/Tcov/GB_coverage.c b/Tcov/GB_coverage.c index d5451d5f1e..a91aafef51 100644 --- a/Tcov/GB_coverage.c +++ b/Tcov/GB_coverage.c @@ -2,7 +2,7 @@ // GB_coverage.c: global array for Tcov test coverage //------------------------------------------------------------------------------ -// 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/Tcov/Makefile b/Tcov/Makefile index a80836c7e1..dd232069fa 100644 --- a/Tcov/Makefile +++ b/Tcov/Makefile @@ -2,7 +2,7 @@ # GraphBLAS/Tcov/Makefile #------------------------------------------------------------------------------- -# 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 #------------------------------------------------------------------------------- @@ -59,7 +59,7 @@ clean: distclean: clean $(RM) *.mex* tmp*/* errlog*.txt grbstat.mat fprint.txt - $(RM) libgraphblas_tcov.* + $(RM) libgraphblas_tcov.* log_GB_mex_test21.txt purge: distclean $(RM) log.txt diff --git a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c b/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c similarity index 90% rename from Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c rename to Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c index e4dfe1eaea..f78abcb6e4 100644 --- a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c +++ b/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c +// GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -118,15 +118,15 @@ void my_rdiv2 (double *z, const double *x, const float *y) #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0xa7db05133c25c170 ; - v [0] = 9 ; v [1] = 2 ; v [2] = 9 ; // intentionally stale version + (*hash) = 0xd4163d6cf4f3dd37 ; + v [0] = 9 ; v [1] = 2 ; v [2] = 9 ; // intentionally stale version defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c b/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2.c similarity index 92% rename from Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c rename to Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2.c index 9c9c16c29e..698011a4c6 100644 --- a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c +++ b/Tcov/PreJIT/GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c +// GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -118,14 +118,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0x31aff911c5850713 ; + (*hash) = 0x424842cce4da274b ; v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version v [1] = GxB_IMPLEMENTATION_MINOR ; v [2] = GxB_IMPLEMENTATION_SUB ; diff --git a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c b/Tcov/PreJIT/GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c similarity index 91% rename from Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c rename to Tcov/PreJIT/GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c index c00db893eb..098071f92e 100644 --- a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c +++ b/Tcov/PreJIT/GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c +// GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -41,6 +41,7 @@ void my_rdiv (double *z, const double *x, const double *y) { // escape this quote: " /* escape this backslash \ */ + /* modified for GrB 9.4.1 */ (*z) = (*y) / (*x) ; } #define GB_my_rdiv_USER_DEFN \ @@ -48,6 +49,7 @@ void my_rdiv (double *z, const double *x, const double *y) "{\n" \ " // escape this quote: \"\n" \ " /* escape this backslash \\ */\n" \ +" /* modified for GrB 9.4.1 */\n" \ " (*z) = (*y) / (*x) ;\n" \ "}" #endif @@ -122,14 +124,14 @@ void my_rdiv (double *z, const double *x, const double *y) #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv -#define GB_jit_query GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv_query +#define GB_jit_kernel GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv +#define GB_jit_query GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0x227f98d0b09e286f ; + (*hash) = 0x4b2ea6f2b6a7b0ce ; v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version v [1] = GxB_IMPLEMENTATION_MINOR ; v [2] = GxB_IMPLEMENTATION_SUB ; diff --git a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c b/Tcov/PreJIT/GB_jit__AxB_dot2__4015bbb0bbbcd.c similarity index 92% rename from Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c rename to Tcov/PreJIT/GB_jit__AxB_dot2__4015bbb0bbbcd.c index f03547ff17..9ae1da1a09 100644 --- a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c +++ b/Tcov/PreJIT/GB_jit__AxB_dot2__4015bbb0bbbcd.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c +// GB_jit__AxB_dot2__4015bbb0bbbcd.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -100,14 +100,14 @@ #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__2c1f046bbb0bbbcd -#define GB_jit_query GB_jit__AxB_dot2__2c1f046bbb0bbbcd_query +#define GB_jit_kernel GB_jit__AxB_dot2__4015bbb0bbbcd +#define GB_jit_query GB_jit__AxB_dot2__4015bbb0bbbcd_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0xdf8cbb0c0ac7ce22 ; + (*hash) = 0x6e48218858a85299 ; v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version v [1] = GxB_IMPLEMENTATION_MINOR ; v [2] = GxB_IMPLEMENTATION_SUB ; diff --git a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c b/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2.c similarity index 92% rename from Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c rename to Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2.c index becabba60b..8ecd316568 100644 --- a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c +++ b/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c +// GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -118,14 +118,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0x422f36dae3aeca51 ; + (*hash) = 0x011d3f3c31fe171a ; v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version v [1] = GxB_IMPLEMENTATION_MINOR ; v [2] = GxB_IMPLEMENTATION_SUB ; diff --git a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c b/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2.c similarity index 92% rename from Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c rename to Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2.c index 6d42a27a85..d786915a3c 100644 --- a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c +++ b/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c +// GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -118,14 +118,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0x654ba0e0a34027e9 ; + (*hash) = 0x85ddee0b2f10ccd1 ; v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version v [1] = GxB_IMPLEMENTATION_MINOR ; v [2] = GxB_IMPLEMENTATION_SUB ; diff --git a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c b/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2.c similarity index 92% rename from Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c rename to Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2.c index 47348a9860..1ba88e7fad 100644 --- a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c +++ b/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c +// GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -118,14 +118,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0x98afaa59c37fb8bb ; + (*hash) = 0x9662b6723f64f3f4 ; v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version v [1] = GxB_IMPLEMENTATION_MINOR ; v [2] = GxB_IMPLEMENTATION_SUB ; diff --git a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c b/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2.c similarity index 92% rename from Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c rename to Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2.c index dbb1898b2e..e44ad71dff 100644 --- a/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c +++ b/Tcov/PreJIT/GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c +// GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -118,14 +118,14 @@ void my_rdiv2 (double *z, const double *x, const float *y) #include "include/GB_mxm_shared_definitions.h" #ifndef GB_JIT_RUNTIME -#define GB_jit_kernel GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2 -#define GB_jit_query GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2_query +#define GB_jit_kernel GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2 +#define GB_jit_query GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2_query #endif #include "template/GB_jit_kernel_AxB_dot2.c" GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { - (*hash) = 0xfaa3c6cd7f90ec16 ; + (*hash) = 0x2a7fa85b1f837ed2 ; v [0] = GxB_IMPLEMENTATION_MAJOR ; // keep at current version v [1] = GxB_IMPLEMENTATION_MINOR ; v [2] = GxB_IMPLEMENTATION_SUB ; diff --git a/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c b/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c index 62358b2c49..6fd5ebb17a 100644 --- a/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c +++ b/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__user_op__0__my_rdiv.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v9.3.0, Timothy A. Davis, (c) 2017-2024, +// SuiteSparse:GraphBLAS v9.4.1, Timothy A. Davis, (c) 2017-2024, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -18,7 +18,7 @@ void my_rdiv (double *z, const double *x, const double *y) { // escape this quote: " /* escape this backslash \ */ - /* modified for GrB 9.3.0 */ + /* modified for GrB 9.4.1 */ (*z) = (*y) / (*x) ; } #define GB_my_rdiv_USER_DEFN \ @@ -26,7 +26,7 @@ void my_rdiv (double *z, const double *x, const double *y) "{\n" \ " // escape this quote: \"\n" \ " /* escape this backslash \\ */\n" \ -" /* modified for GrB 9.3.0 */\n" \ +" /* modified for GrB 9.4.1 */\n" \ " (*z) = (*y) / (*x) ;\n" \ "}" #define GB_USER_OP_DEFN GB_my_rdiv_USER_DEFN diff --git a/Tcov/PreJIT/GB_prejit.c b/Tcov/PreJIT/GB_prejit.c index 6fedc28188..0b848630b2 100644 --- a/Tcov/PreJIT/GB_prejit.c +++ b/Tcov/PreJIT/GB_prejit.c @@ -18,14 +18,14 @@ // prototypes for all PreJIT kernels //------------------------------------------------------------------------------ -JIT_DOT2 (GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv) -JIT_DOT2 (GB_jit__AxB_dot2__2c1f046bbb0bbbcd) -JIT_DOT2 (GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2) -JIT_DOT2 (GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv) +JIT_DOT2 (GB_jit__AxB_dot2__4015bbb0bbbcd) +JIT_DOT2 (GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2) +JIT_DOT2 (GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2) JIT_UOP (GB_jit__user_op__0__my_rdiv) @@ -33,14 +33,14 @@ JIT_UOP (GB_jit__user_op__0__my_rdiv) // prototypes for all PreJIT query kernels //------------------------------------------------------------------------------ -JIT_Q (GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv_query) -JIT_Q (GB_jit__AxB_dot2__2c1f046bbb0bbbcd_query) -JIT_Q (GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2_query) -JIT_Q (GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv_query) +JIT_Q (GB_jit__AxB_dot2__4015bbb0bbbcd_query) +JIT_Q (GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2_query) +JIT_Q (GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2_query) JIT_Q (GB_jit__user_op__0__my_rdiv_query) @@ -51,14 +51,14 @@ JIT_Q (GB_jit__user_op__0__my_rdiv_query) #if ( 9 > 0 ) static void *GB_prejit_kernels [9] = { -GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2, -GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2, -GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv, -GB_jit__AxB_dot2__2c1f046bbb0bbbcd, -GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2, -GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2, -GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2, -GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2, +GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2, +GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2, +GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv, +GB_jit__AxB_dot2__4015bbb0bbbcd, +GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2, +GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2, +GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2, +GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2, GB_jit__user_op__0__my_rdiv } ; #endif @@ -70,14 +70,14 @@ GB_jit__user_op__0__my_rdiv #if ( 9 > 0 ) static void *GB_prejit_queries [9] = { -GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2_query, -GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2_query, -GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv_query, -GB_jit__AxB_dot2__2c1f046bbb0bbbcd_query, -GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2_query, -GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2_query, -GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2_query, -GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2_query, +GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2_query, +GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2_query, +GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv_query, +GB_jit__AxB_dot2__4015bbb0bbbcd_query, +GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2_query, +GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2_query, +GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2_query, +GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2_query, GB_jit__user_op__0__my_rdiv_query } ; #endif @@ -89,14 +89,14 @@ GB_jit__user_op__0__my_rdiv_query #if ( 9 > 0 ) static char *GB_prejit_names [9] = { -"GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2", -"GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2", -"GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv", -"GB_jit__AxB_dot2__2c1f046bbb0bbbcd", -"GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2", -"GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2", -"GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2", -"GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2", +"GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2", +"GB_jit__AxB_dot2__4000bba0bbacf__plus_my_rdiv2", +"GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv", +"GB_jit__AxB_dot2__4015bbb0bbbcd", +"GB_jit__AxB_dot2__4100bba0baacf__plus_my_rdiv2", +"GB_jit__AxB_dot2__4100bba0babcd__plus_my_rdiv2", +"GB_jit__AxB_dot2__4100bba0babcf__plus_my_rdiv2", +"GB_jit__AxB_dot2__4100bba0bbac7__plus_my_rdiv2", "GB_jit__user_op__0__my_rdiv" } ; #endif diff --git a/Tcov/PreJIT/README.txt b/Tcov/PreJIT/README.txt index 16adf1fadb..7ff0980f18 100644 --- a/Tcov/PreJIT/README.txt +++ b/Tcov/PreJIT/README.txt @@ -3,32 +3,41 @@ They are placed here to use a PreJIT kernels for the Tcov tests. This file has an intentionally stale function definition: - GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c + GB_jit__AxB_dot2__4000bbb0bbbcd__plus_my_rdiv.c This file has an intentionally stale GraphBLAS version: - GB_jit__AxB_dot2__2c1f000bba0bbac7__plus_my_rdiv2.c + GB_jit__AxB_dot2__4000bba0bbac7__plus_my_rdiv2.c These files should be valid PreJIT kernels: - GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c - GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c - GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c - GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c - GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c - GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c + GB_jit__AxB_dot2__0b000bba0bbacf__plus_my_rdiv2.c + GB_jit__AxB_dot2__0b100bba0baacf__plus_my_rdiv2.c + GB_jit__AxB_dot2__0b100bba0babcd__plus_my_rdiv2.c + GB_jit__AxB_dot2__0b100bba0babcf__plus_my_rdiv2.c + GB_jit__AxB_dot2__0b100bba0bbac7__plus_my_rdiv2.c + GB_jit__AxB_dot2__0b046bbb0bbbcd.c GB_jit__user_op__0__my_rdiv.c This file will contain an index of the kernels listed above: GB_prejit.c +These kernels are generated by test145 but are not copied here: + + GB_jit__AxB_dot4__4014bbb0bbbc5.c + GB_jit__AxB_dot4__4014bbb0bbbcd.c + GB_jit__AxB_dot4__4014bbb0bbbcf.c + GB_jit__AxB_dot4__4900bba0baacf__plus_my_rdiv2.c + GB_jit__AxB_dot4__4900bba0babcf__plus_my_rdiv2.c + GB_jit__AxB_dot4__4900bba0bbac7__plus_my_rdiv2.c + If GraphBLAS is modified, test145 should be run again to create these JIT kernels, using the Test/test145.m script. Next, copy the above files into -GraphBLAS/Tcov/GB_prejit.c. Also copy them into GraphBLAS/PreJIT and rerun +GraphBLAS/Tcov/PreJIT. Copy them into GraphBLAS/PreJIT and rerun 'make' for the main GraphBLAS library, and then copy Config/GB_prejit.c here. -Finally, modify GB_mex_rdiv.c to trigger the stale PreJIT kernel case, by +Finally, modify Test/GB_mex_rdiv.c to trigger the stale PreJIT kernel case, by changing the string MY_RDIV. After modifying it, rerun test145 and copy the final GB_jit__user_op__0__my_rdiv.c here. diff --git a/Tcov/README.txt b/Tcov/README.txt index 0521baf13d..86bd323e2a 100644 --- a/Tcov/README.txt +++ b/Tcov/README.txt @@ -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. SPDX-License-Identifier: Apache-2.0 GraphBLAS/Tcov: statement coverage tests @@ -41,7 +41,9 @@ Files in GraphBLAS/Tcov: Contents.m for 'help Tcov'; list of files grbcov.m makes the tests, runs them, and lists the test coverage - grbcover.m compile GraphBLAS for statement coverage testing + + grbmake.m compile GraphBLAS for test coverage + grbcov_testmake.m compile ../Tests/*.c for statement coverage testing grbcover_edit.m create a version of GraphBLAS for statement coverage tests testcov.m run all GraphBLAS tests, with statement coverage grbshow.m create a test coverage report in tmp_cover/ diff --git a/Tcov/grbcov.m b/Tcov/grbcov.m index ebedec75ff..5f11578459 100644 --- a/Tcov/grbcov.m +++ b/Tcov/grbcov.m @@ -1,18 +1,28 @@ function grbcov %GRBCOV compile, run, and evaluate test coverage -% 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 -!rmtmph clear all -clear mex tstart = tic ; + system ('make purge') ; + +fp = fopen ('log.txt', 'a') ; +fprintf (fp, '%s grbcov starting\n', datestr (now)) ; +fclose (fp) ; + +!rmtmph +clear mex grbmake ; testcov ; grbshow ; ttotal = toc (tstart) ; +fp = fopen ('log.txt', 'a') ; +fprintf (fp, '%s grbcov ending\n', datestr (now)) ; +fclose (fp) ; + fprintf ('\nTotal time, incl compilation: %8.2f minutes\n', ttotal / 60) ; diff --git a/Tcov/grbcover.m b/Tcov/grbcov_testmake.m similarity index 97% rename from Tcov/grbcover.m rename to Tcov/grbcov_testmake.m index 04c5019623..eb69a8aad2 100644 --- a/Tcov/grbcover.m +++ b/Tcov/grbcov_testmake.m @@ -1,12 +1,12 @@ -function grbcover (what) -%GBCOVER compile ../Test/* for statement coverage testing +function grbcov_testmake (what) +%GRBCOV_TESTMAKE compile ../Test/* for statement coverage testing % % This function compiles just the mexFunctions in ../Test. % It does not compile the GraphBLAS library itself. % % See also: grbcover_edit, grbmake -% 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 if (ispc) @@ -196,3 +196,4 @@ function grbcover (what) fprintf (']\n') ; + diff --git a/Tcov/grbcover_edit.m b/Tcov/grbcover_edit.m index 621a89515d..de88506af3 100644 --- a/Tcov/grbcover_edit.m +++ b/Tcov/grbcover_edit.m @@ -1,5 +1,5 @@ function count = grbcover_edit (infiles, count, outdir) -%GBCOVER_EDIT create a version of GraphBLAS for statement coverage tests +%GRBCOVER_EDIT create a version of GraphBLAS for statement coverage tests % % Usage: % count = grbcover_edit (infiles, count) @@ -25,7 +25,7 @@ % default : GB_cov[count]++ ; statement % -% 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 if (ispc) @@ -37,19 +37,64 @@ infiles = dir (infiles) ; end nfiles = length (infiles) ; -enabled = true ; + +% determine which types are disabled: +types = { 'bool', 'int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', ... + 'uint32', 'uint64', 'fp32', 'fp64', 'fc32', 'fc64' } ; +disabled = zeros (length (types), 1) ; +for k = 1:length(types) + t = upper (types {k}) ; + [status, result] = system (sprintf ( ... + 'grep "^ #define GxB_NO_%s" ../Source/GB_control.h', t)) ; + disabled (k) = ~isempty (result) ; + if (disabled (k)) + fprintf ('type disabled: %s\n', t) ; + end +end for k = 1:nfiles + if (mod (k, 70) == 0) + fprintf ('\n') ; + end + if (infiles (k).bytes == 0) continue ; end infile = [infiles(k).folder '/' infiles(k).name] ; outfile = [outdir '/' infiles(k).name] ; - fprintf ('.') ; - if (mod (k, 40) == 0) - fprintf ('\n') ; + + enabled = true ; + coverage = true ; + + if (contains (infile, 'FactoryKernel')) + % this is a FactoryKernel; check if its type is disabled + if (contains (infile, 'GB_sel__')) + % select FactoryKernels are never disabled + coverage = true ; + elseif (contains (infile, 'GB_uop__identity')) + % identity FactoryKernels are never disabled by type + coverage = true ; + else + % all other FactoryKernels may be disabled + found = zeros (length (types), 1) ; + for kk = 1:length (types) + t = types {kk} ; + t = ['_' t] ; + found (kk) = length (strfind (infile, t)) ; + end + if (sum (found .* disabled) > 0) + % no coverage for this file + coverage = false ; + end + end + end + + if (coverage) + fprintf ('.') ; + else + fprintf ('o') ; end f_input = fopen (infile, 'r') ; @@ -67,6 +112,11 @@ % empty line: as-is fprintf (f_output, '\n') ; + elseif (len >= 2 && isequal (cline (1:2), '//')) + + % comment line: as-is + fprintf (f_output, '%s\n', cline) ; + elseif (contains (cline, '#include "')) if (contains (cline, '/GB_')) @@ -89,7 +139,7 @@ % left curly brackect and space at the end of the line % "{ " changes to "{ GB_cov[n]++ ; " - if (enabled) + if (coverage && enabled) fprintf (f_output, '%s GB_cov[%d]++ ;\n', cline, count) ; count = count + 1 ; else @@ -103,7 +153,7 @@ % a switch case statement, or "default : " % "case stuff : statement" => "case stuff : GB_cov[n]++ ; statement" - if (enabled) + if (coverage && enabled) colon = find (cline == ':', 1) ; fprintf (f_output, '%s : GB_cov[%d]++ ; %s\n', ... cline (1:colon-1), count, cline (colon+1:end)) ; @@ -118,7 +168,9 @@ fprintf (f_output, '%s\n', cline) ; % determine if the code is commented out - if (isequal (cline, '#if 0') && enabled) + if (~coverage) + % do nothing + elseif (isequal (cline, '#if 0') && enabled) % code coverage disabled until reaching "#endif" indent = false ; enabled = false ; diff --git a/Tcov/grbmake.m b/Tcov/grbmake.m index 937687c8ce..aaa707414f 100644 --- a/Tcov/grbmake.m +++ b/Tcov/grbmake.m @@ -1,13 +1,13 @@ function grbmake -%GBMAKE compile the GraphBLAS library for statement coverage testing +%GRBMAKE compile the GraphBLAS library for statement coverage testing % % This function compiles ../Source to create the % libgraphblas_tcov.so (or *.dylib) library, inserting code code for statement % coverage testing. It does not compile the mexFunctions. % -% See also: grbcover, grbcover_edit +% See also: grbcov_testmake, grbcover_edit -% 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 if (ispc) @@ -73,3 +73,4 @@ system (sprintf ('make -j%d', feature ('numcores'))) ; end + diff --git a/Tcov/grbshow.m b/Tcov/grbshow.m index 44e28f1ecf..dd7d1ec139 100644 --- a/Tcov/grbshow.m +++ b/Tcov/grbshow.m @@ -1,7 +1,7 @@ function grbshow -%GBSHOW create a test coverage report in tmp_cover/ +%GRBSHOW create a test coverage report in tmp_cover/ -% 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 if (ispc) @@ -13,7 +13,14 @@ nfiles = length (infiles) ; -load grbstat.mat +% load grbstat.mat +global GraphBLAS_grbcov +n = grblines ; +c = sum (GraphBLAS_grbcov > 0) ; +if (c == n) + fprintf ('all %d lines covered\n', n) ; + return +end for k = 1:nfiles @@ -60,3 +67,4 @@ end + diff --git a/Tcov/log_Aug2.txt b/Tcov/log_Aug2.txt deleted file mode 100644 index be9dddc6c2..0000000000 --- a/Tcov/log_Aug2.txt +++ /dev/null @@ -1,207 +0,0 @@ - ----------------------------------------------- [malloc] [cover] -02-Aug 05:35:52 test281 0.1 sec 88: 24859 of 25110 1.0% 672.39/s -02-Aug 05:35:52 test201 0.3 sec 113: 24746 of 25110 1.4% 451.33/s -02-Aug 05:36:01 test169 8.7 sec 483: 24261 of 25110 3.4% 55.80/s -02-Aug 05:36:02 test250 1.4 sec 289: 23972 of 25110 4.5% 204.72/s -02-Aug 05:36:05 test250 2.1 sec 56: 23916 of 25110 4.8% 26.91/s -02-Aug 05:36:05 test279 0.1 sec 118: 23798 of 25110 5.2% 1685.06/s -02-Aug 05:36:05 test278 0.1 sec 48: 23750 of 25110 5.4% 834.23/s -02-Aug 05:36:05 test277 0.1 sec 38: 23712 of 25110 5.6% 601.28/s -02-Aug 05:36:05 test276 0.1 sec 1626: 22086 of 25110 12.0% 27547.18/s -02-Aug 05:36:05 test275 0.1 sec 117: 21969 of 25110 12.5% 2108.53/s -02-Aug 05:36:05 test274 0.1 sec 129: 21840 of 25110 13.0% 2355.13/s -02-Aug 05:36:05 test273 0.2 sec 113: 21727 of 25110 13.5% 728.81/s -02-Aug 05:36:05 test272 0.1 sec 8: 21719 of 25110 13.5% 146.19/s -02-Aug 05:36:06 test271 0.1 sec 497: 21222 of 25110 15.5% 8926.81/s -02-Aug 05:36:06 test270 0.1 sec 286: 20936 of 25110 16.6% 5252.04/s -02-Aug 05:36:06 test269 0.1 sec 83: 20853 of 25110 17.0% 1487.08/s -02-Aug 05:36:06 test268 0.0 sec 3: 20850 of 25110 17.0% 108.37/s -02-Aug 05:36:08 test145 2.1 sec 197: 20653 of 25110 17.7% 94.46/s -02-Aug 05:36:08 test145 0.0 sec 1: 20652 of 25110 17.8% 25.51/s -02-Aug 05:36:08 test145 0.0 sec 18: 20634 of 25110 17.8% 963.13/s -02-Aug 05:36:08 test145 0.0 sec 4: 20630 of 25110 17.8% 245.90/s -02-Aug 05:36:10 test145 1.6 sec 34: 20596 of 25110 18.0% 21.91/s -02-Aug 05:36:10 test145 0.0 sec 3: 20593 of 25110 18.0% 168.62/s -02-Aug 05:36:11 test240 1.1 sec 70: 20520 of 25110 18.3% 62.95/s -02-Aug 05:36:12 test240 0.3 sec 1: 20519 of 25110 18.3% 3.54/s -02-Aug 05:36:13 test237 1.0 sec 38: 20481 of 25110 18.4% 38.53/s -02-Aug 05:36:15 test237 2.5 sec 2: 20479 of 25110 18.4% 0.81/s -02-Aug 05:36:15 test237 0.1 sec 17: 20462 of 25110 18.5% 333.12/s -02-Aug 05:36:15 test237 0.0 sec 6: 20456 of 25110 18.5% 173.39/s -02-Aug 05:36:15 test237 0.0 sec 4: 20452 of 25110 18.6% 111.27/s -02-Aug 05:36:16 test267 0.7 sec 8: 20444 of 25110 18.6% 11.97/s -02-Aug 05:36:16 test267 0.0 sec 1: 20443 of 25110 18.6% 2044.99/s -02-Aug 05:36:17 test265 0.5 sec 34: 20409 of 25110 18.7% 68.44/s -02-Aug 05:36:17 test264 0.1 sec 173: 20236 of 25110 19.4% 2994.48/s -02-Aug 05:36:18 test263 0.8 sec 13: 20223 of 25110 19.5% 16.26/s -02-Aug 05:36:18 test262 0.1 sec 22: 20201 of 25110 19.5% 382.61/s -02-Aug 05:36:18 test261 0.1 sec 22: 20179 of 25110 19.6% 405.69/s -02-Aug 05:36:18 test260 0.1 sec 3: 20176 of 25110 19.6% 55.93/s -02-Aug 05:36:21 test259 2.4 sec 4: 20172 of 25110 19.7% 1.67/s -02-Aug 05:36:21 test258 0.3 sec 14: 20158 of 25110 19.7% 43.70/s -02-Aug 05:36:22 test257 0.3 sec 41: 20117 of 25110 19.9% 157.70/s -02-Aug 05:36:22 test255 0.1 sec 8: 20109 of 25110 19.9% 145.90/s -02-Aug 05:36:23 test254 0.8 sec 14: 20095 of 25110 20.0% 17.10/s -02-Aug 05:36:27 test254 4.1 sec 20: 20075 of 25110 20.1% 4.82/s -02-Aug 05:36:27 test254 0.1 sec 1: 20074 of 25110 20.1% 18.37/s -02-Aug 05:36:28 test253 0.1 sec 9: 20065 of 25110 20.1% 62.67/s -02-Aug 05:36:28 test252 0.1 sec 7: 20058 of 25110 20.1% 131.26/s -02-Aug 05:37:37 test280 69.0 sec 139: 19919 of 25110 20.7% 2.01/s -02-Aug 05:39:26 test251 109.4 sec 437: 19482 of 25110 22.4% 3.99/s -02-Aug 05:42:29 test251 182.0 sec 60: 19422 of 25110 22.7% 0.33/s -02-Aug 05:42:30 test249 1.3 sec 24: 19398 of 25110 22.7% 18.96/s -02-Aug 05:42:30 test247 0.0 sec 22: 19376 of 25110 22.8% 1444.90/s -02-Aug 05:42:41 test246 10.7 sec 66: 19310 of 25110 23.1% 6.16/s -02-Aug 05:43:00 test01 19.0 sec 1292: 18018 of 25110 28.2% 67.90/s -02-Aug 05:43:01 test245 1.0 sec 34: 17984 of 25110 28.4% 33.68/s -02-Aug 05:43:02 test245 0.0 sec 8: 17976 of 25110 28.4% 437.59/s -02-Aug 05:43:02 test199 0.0 sec 1: 17975 of 25110 28.4% 238.21/s -02-Aug 05:43:02 test83 0.1 sec 10: 17965 of 25110 28.5% 172.36/s -02-Aug 05:43:02 test210 0.0 sec 7: 17958 of 25110 28.5% 2886.60/s -02-Aug 05:43:02 test165 0.0 sec 1: 17957 of 25110 28.5% 241.14/s -02-Aug 05:43:02 test219 0.0 sec 7: 17950 of 25110 28.5% 2594.51/s -02-Aug 05:43:03 test219 0.3 sec 3: 17947 of 25110 28.5% 10.50/s -02-Aug 05:43:03 test241 0.1 sec 8: 17939 of 25110 28.6% 78.49/s -02-Aug 05:43:03 test220 0.1 sec 10: 17929 of 25110 28.6% 108.18/s -02-Aug 05:43:04 test211 0.0 sec 15: 17914 of 25110 28.7% 492.92/s -02-Aug 05:43:04 test202 0.1 sec 45: 17869 of 25110 28.8% 449.23/s -02-Aug 05:43:04 test202 0.0 sec 1: 17868 of 25110 28.8% 32.13/s -02-Aug 05:43:08 test152 3.4 sec 825: 17043 of 25110 32.1% 241.16/s -02-Aug 05:43:09 test152 1.5 sec 13: 17030 of 25110 32.2% 8.83/s -02-Aug 05:44:26 test152 76.9 sec 245: 16785 of 25110 33.2% 3.19/s -02-Aug 05:44:27 test222 0.1 sec 18: 16767 of 25110 33.2% 146.44/s -02-Aug 05:44:28 test256 0.6 sec 58: 16709 of 25110 33.5% 90.89/s -02-Aug 05:44:31 test186 2.9 sec 43: 16666 of 25110 33.6% 14.80/s -02-Aug 05:44:31 test186 0.5 sec 3: 16663 of 25110 33.6% 6.60/s -02-Aug 05:44:32 test186(0) 0.4 sec 5: 16658 of 25110 33.7% 12.44/s -02-Aug 05:44:32 test150 0.1 sec 35: 16623 of 25110 33.8% 263.78/s -02-Aug 05:44:33 test239 0.1 sec 15: 16608 of 25110 33.9% 162.13/s -02-Aug 05:44:34 test239 0.9 sec 2: 16606 of 25110 33.9% 2.23/s -02-Aug 05:44:34 test235 0.0 sec 4: 16602 of 25110 33.9% 98.91/s -02-Aug 05:44:34 test226 0.0 sec 8: 16594 of 25110 33.9% 640.26/s -02-Aug 05:44:35 test223 0.0 sec 2: 16592 of 25110 33.9% 66.80/s -02-Aug 05:44:35 test204 0.1 sec 14: 16578 of 25110 34.0% 127.61/s -02-Aug 05:44:35 test203 0.1 sec 9: 16569 of 25110 34.0% 162.04/s -02-Aug 05:44:35 test183 0.0 sec 10: 16559 of 25110 34.1% 368.30/s -02-Aug 05:44:36 test179 0.1 sec 15: 16544 of 25110 34.1% 151.87/s -02-Aug 05:44:38 test179 1.9 sec 4: 16540 of 25110 34.1% 2.06/s -02-Aug 05:44:38 test174 0.0 sec 10: 16530 of 25110 34.2% 200.16/s -02-Aug 05:44:39 test155 0.1 sec 41: 16489 of 25110 34.3% 353.31/s -02-Aug 05:44:39 test136 0.2 sec 55: 16434 of 25110 34.6% 346.19/s -02-Aug 05:45:06 test02 26.5 sec 257: 16177 of 25110 35.6% 9.69/s -02-Aug 05:45:07 test109 0.4 sec 8: 16169 of 25110 35.6% 18.09/s -02-Aug 05:45:07 test109 0.0 sec 4: 16165 of 25110 35.6% 1545.60/s -02-Aug 05:45:07 test109 0.4 sec 8: 16157 of 25110 35.7% 22.43/s -02-Aug 05:45:08 test04 0.1 sec 15: 16142 of 25110 35.7% 170.20/s -02-Aug 05:45:08 test207 0.0 sec 2: 16140 of 25110 35.7% 577.03/s -02-Aug 05:45:08 test221 0.0 sec 2: 16138 of 25110 35.7% 289.90/s -02-Aug 05:45:09 test162 0.1 sec 3: 16135 of 25110 35.7% 59.40/s -02-Aug 05:45:10 test159 1.2 sec 72: 16063 of 25110 36.0% 59.93/s -02-Aug 05:45:10 test09 0.0 sec 5: 16058 of 25110 36.0% 652.66/s -02-Aug 05:45:11 test132 0.1 sec 8: 16050 of 25110 36.1% 102.31/s -02-Aug 05:45:16 test141 4.6 sec 549: 15501 of 25110 38.3% 118.23/s -02-Aug 05:45:17 testc2(1,1) 1.3 sec 19: 15482 of 25110 38.3% 15.09/s -02-Aug 05:45:24 testc2(1,1) 6.7 sec 4: 15478 of 25110 38.4% 0.60/s -02-Aug 05:45:25 test214 0.0 sec 3: 15475 of 25110 38.4% 338.64/s -02-Aug 05:45:25 test213 0.0 sec 2: 15473 of 25110 38.4% 197.53/s -02-Aug 05:45:28 test206 3.2 sec 221: 15252 of 25110 39.3% 70.12/s -02-Aug 05:45:45 test206 16.5 sec 20: 15232 of 25110 39.3% 1.21/s -02-Aug 05:45:46 test212 0.0 sec 8: 15224 of 25110 39.4% 410.51/s -02-Aug 05:45:46 test212 0.2 sec 2: 15222 of 25110 39.4% 10.19/s -02-Aug 05:45:47 test128 0.4 sec 36: 15186 of 25110 39.5% 102.43/s -02-Aug 05:45:47 test82 0.1 sec 13: 15173 of 25110 39.6% 145.93/s -02-Aug 05:45:52 test229 4.4 sec 9: 15164 of 25110 39.6% 2.05/s -02-Aug 05:45:53 test229 0.9 sec 1: 15163 of 25110 39.6% 1.15/s -02-Aug 05:45:54 test144 0.6 sec 2: 15161 of 25110 39.6% 3.47/s -02-Aug 05:47:59 test14 124.5 sec 715: 14446 of 25110 42.5% 5.74/s -02-Aug 05:51:43 test14 223.9 sec 62: 14384 of 25110 42.7% 0.28/s -02-Aug 05:51:53 test180 9.0 sec 130: 14254 of 25110 43.2% 14.38/s -02-Aug 05:51:58 test236 4.1 sec 74: 14180 of 25110 43.5% 18.13/s -02-Aug 05:52:01 test232 2.6 sec 22: 14158 of 25110 43.6% 8.56/s -02-Aug 05:52:21 test228 20.3 sec 27: 14131 of 25110 43.7% 1.33/s -02-Aug 05:56:09 test154 227.2 sec 1500: 12631 of 25110 49.7% 6.60/s -02-Aug 05:58:22 test154 132.2 sec 2: 12629 of 25110 49.7% 0.02/s -02-Aug 05:58:37 test238 14.6 sec 54: 12575 of 25110 49.9% 3.71/s -02-Aug 05:59:47 test238 69.9 sec 9: 12566 of 25110 50.0% 0.13/s -02-Aug 06:03:15 test151b 207.9 sec 127: 12439 of 25110 50.5% 0.61/s -02-Aug 06:03:19 test184 3.1 sec 20: 12419 of 25110 50.5% 6.38/s -02-Aug 06:03:33 test191 13.4 sec 21: 12398 of 25110 50.6% 1.56/s -02-Aug 06:03:47 test191 14.1 sec 3: 12395 of 25110 50.6% 0.21/s -02-Aug 06:12:02 test188 494.3 sec 206: 12189 of 25110 51.5% 0.42/s -02-Aug 06:13:06 test188 62.6 sec 3: 12186 of 25110 51.5% 0.05/s -02-Aug 06:13:12 test224 5.2 sec 24: 12162 of 25110 51.6% 4.62/s -02-Aug 06:13:15 test196 2.5 sec 11: 12151 of 25110 51.6% 4.46/s -02-Aug 06:13:21 test209 5.5 sec 20: 12131 of 25110 51.7% 3.62/s -02-Aug 06:13:40 test104 19.0 sec 40: 12091 of 25110 51.8% 2.11/s -02-Aug 06:13:48 test189 7.9 sec 1: 12090 of 25110 51.9% 0.13/s -02-Aug 06:15:01 test194 71.9 sec 5: 12085 of 25110 51.9% 0.07/s -02-Aug 06:15:18 test76 16.3 sec 15: 12070 of 25110 51.9% 0.92/s -02-Aug 06:16:01 test244 42.8 sec 17: 12053 of 25110 52.0% 0.40/s -[malloc debugging turned off] -02-Aug 06:16:01 test225 0.2 sec 1: 12052 of 25110 52.0% 6.59/s -02-Aug 06:16:02 test176 0.1 sec 5: 12047 of 25110 52.0% 64.20/s -02-Aug 06:16:02 test208 0.0 sec 5: 12042 of 25110 52.0% 275.89/s -02-Aug 06:16:03 test216 0.1 sec 3: 12039 of 25110 52.1% 37.68/s -02-Aug 06:16:12 test142 8.3 sec 633: 11406 of 25110 54.6% 76.34/s -02-Aug 06:20:52 test142 279.8 sec 9: 11397 of 25110 54.6% 0.03/s -02-Aug 06:21:01 test142 8.1 sec : 11397 of 25110 54.6% -02-Aug 06:21:02 test137 0.3 sec 3: 11394 of 25110 54.6% 8.84/s -02-Aug 06:21:03 test137 0.0 sec 2: 11392 of 25110 54.6% 296.43/s -02-Aug 06:21:03 test139 0.4 sec 1: 11391 of 25110 54.6% 2.60/s -02-Aug 06:21:04 test172 0.1 sec 3: 11388 of 25110 54.6% 37.30/s -02-Aug 06:21:05 test148 0.7 sec 4: 11384 of 25110 54.7% 5.60/s -02-Aug 06:21:06 test157 0.6 sec 12: 11372 of 25110 54.7% 18.56/s -02-Aug 06:21:08 test182 0.9 sec 5: 11367 of 25110 54.7% 5.30/s -02-Aug 06:21:09 test108 0.6 sec 2: 11365 of 25110 54.7% 3.29/s -02-Aug 06:21:10 test108 0.2 sec 2: 11363 of 25110 54.7% 11.58/s -02-Aug 06:21:11 test130 0.8 sec 22: 11341 of 25110 54.8% 26.03/s -02-Aug 06:21:12 test124 0.2 sec 3: 11338 of 25110 54.8% 14.22/s -02-Aug 06:21:12 test138 0.0 sec 1: 11337 of 25110 54.9% 20.42/s -02-Aug 06:21:18 test227 4.8 sec 27: 11310 of 25110 55.0% 5.64/s -02-Aug 06:22:09 test125 50.5 sec 618: 10692 of 25110 57.4% 12.24/s -02-Aug 06:30:37 test234 507.4 sec 384: 10308 of 25110 58.9% 0.76/s -02-Aug 06:31:50 test234 72.2 sec 3: 10305 of 25110 59.0% 0.04/s -02-Aug 06:32:39 test242 48.1 sec 77: 10228 of 25110 59.3% 1.60/s -02-Aug 06:32:41 test173 1.6 sec 12: 10216 of 25110 59.3% 7.53/s -02-Aug 06:32:45 test200 3.1 sec 10: 10206 of 25110 59.4% 3.22/s -02-Aug 06:32:45 test197 0.2 sec 1: 10205 of 25110 59.4% 6.53/s -02-Aug 06:32:47 test84 1.4 sec 17: 10188 of 25110 59.4% 12.29/s -02-Aug 06:32:54 test19b 5.9 sec 59: 10129 of 25110 59.7% 9.93/s -02-Aug 06:32:55 test133 0.4 sec 2: 10127 of 25110 59.7% 4.73/s -02-Aug 06:33:00 test80 4.1 sec 12: 10115 of 25110 59.7% 2.91/s -02-Aug 06:33:19 test23 19.2 sec 148: 9967 of 25110 60.3% 7.70/s -02-Aug 06:33:22 test135 2.0 sec 3: 9964 of 25110 60.3% 1.52/s -02-Aug 06:34:39 test160 76.7 sec 24: 9940 of 25110 60.4% 0.31/s -02-Aug 06:34:45 test54 5.3 sec 20: 9920 of 25110 60.5% 3.76/s -02-Aug 06:34:47 test129 1.2 sec 4: 9916 of 25110 60.5% 3.29/s -02-Aug 06:34:50 test69 2.0 sec 6: 9910 of 25110 60.5% 2.97/s -02-Aug 06:36:26 test230 95.4 sec 114: 9796 of 25110 61.0% 1.20/s -02-Aug 06:48:56 test74 749.1 sec 6637: 3159 of 25110 87.4% 8.86/s -02-Aug 06:52:51 test127 234.5 sec 1701: 1458 of 25110 94.2% 7.25/s -02-Aug 06:52:55 test19 3.3 sec 12: 1446 of 25110 94.2% 3.59/s -02-Aug 06:52:59 test11 3.9 sec 3: 1443 of 25110 94.3% 0.77/s -02-Aug 06:53:03 test215 3.1 sec 1: 1442 of 25110 94.3% 0.33/s -02-Aug 06:53:21 test193 17.8 sec 5: 1437 of 25110 94.3% 0.28/s -02-Aug 06:56:08 test195 166.1 sec 39: 1398 of 25110 94.4% 0.23/s -02-Aug 06:56:34 test243 25.4 sec 7: 1391 of 25110 94.5% 0.28/s -02-Aug 06:56:42 test29 6.6 sec 3: 1388 of 25110 94.5% 0.45/s -02-Aug 06:56:43 testc2(0,0) 1.0 sec 7: 1381 of 25110 94.5% 7.28/s -02-Aug 06:57:04 testc2(0,0) 19.8 sec 1: 1380 of 25110 94.5% 0.05/s -02-Aug 06:57:05 testc4(0) 0.6 sec 4: 1376 of 25110 94.5% 7.07/s -02-Aug 06:57:20 testc7(0) 14.4 sec 2: 1374 of 25110 94.5% 0.14/s -02-Aug 06:57:26 testcc(1) 5.1 sec 1: 1373 of 25110 94.5% 0.20/s -02-Aug 06:57:36 test187 8.9 sec 4: 1369 of 25110 94.5% 0.45/s -02-Aug 06:57:42 test192 5.9 sec 1: 1368 of 25110 94.6% 0.17/s -02-Aug 06:58:02 test181 18.7 sec 4: 1364 of 25110 94.6% 0.21/s -02-Aug 06:59:57 test185 115.1 sec 6: 1358 of 25110 94.6% 0.05/s -02-Aug 07:00:42 test53 43.8 sec 2: 1356 of 25110 94.6% 0.05/s -02-Aug 07:01:34 test17 51.3 sec 27: 1329 of 25110 94.7% 0.53/s -02-Aug 07:09:10 test231 455.1 sec 162: 1167 of 25110 95.4% 0.36/s -02-Aug 07:58:59 test10 2988.0 sec 968: 199 of 25110 99.2% 0.32/s -02-Aug 08:17:24 test75b 1104.8 sec 155: 44 of 25110 99.8% 0.14/s -02-Aug 08:18:57 test21b 92.1 sec 26: 18 of 25110 99.9% 0.28/s -02-Aug 08:19:50 testca(1) 52.7 sec 5: 13 of 25110 99.9% 0.09/s -02-Aug 08:21:49 test81 117.9 sec 1: 12 of 25110 100.0% 0.01/s -02-Aug 08:28:06 test18 375.8 sec 12: all 25110 full 100% 0.03/s -[malloc debugging turned back on] diff --git a/Tcov/log_Nov18.txt b/Tcov/log_Nov18.txt new file mode 100644 index 0000000000..7ce4f6d019 --- /dev/null +++ b/Tcov/log_Nov18.txt @@ -0,0 +1,275 @@ +18-Nov-2024 15:01:50 grbcov starting + +---------------------------------------------- [cover] +[malloc debugging turned off] +18-Nov 15:03:25 test286 0.4 sec 203: 18913 of 19280 1.9% 460.56/s +18-Nov 15:03:25 test286 0.0 sec 24: 18887 of 19280 2.0% 7731.96/s +18-Nov 15:03:25 test78 0.5 sec 92: 18795 of 19280 2.5% 187.80/s +18-Nov 15:03:25 test78 0.0 sec 10: 18785 of 19280 2.6% 523.78/s +18-Nov 15:03:26 test285 0.7 sec 102: 18683 of 19280 3.1% 143.93/s +18-Nov 15:03:26 test285 0.0 sec 13: 18670 of 19280 3.2% 880.46/s +18-Nov 15:03:26 test247 0.1 sec 67: 18603 of 19280 3.5% 501.95/s +18-Nov 15:03:26 test247 0.1 sec 9: 18594 of 19280 3.6% 90.29/s +18-Nov 15:03:27 test109 0.2 sec 56: 18538 of 19280 3.8% 327.51/s +18-Nov 15:03:27 test109 0.0 sec 4: 18534 of 19280 3.9% 3034.90/s +18-Nov 15:03:27 test109 0.1 sec 23: 18511 of 19280 4.0% 179.49/s +18-Nov 15:03:27 test109 0.0 sec 1: 18510 of 19280 4.0% 1031.99/s +18-Nov 15:03:27 test138 0.1 sec 62: 18448 of 19280 4.3% 424.24/s +18-Nov 15:03:27 test138 0.0 sec 1: 18447 of 19280 4.3% 38.92/s +18-Nov 15:03:27 test139 0.1 sec 28: 18419 of 19280 4.5% 209.53/s +18-Nov 15:03:27 test172 0.1 sec 53: 18366 of 19280 4.7% 921.90/s +18-Nov 15:03:27 test172 0.0 sec 4: 18362 of 19280 4.8% 115.19/s +18-Nov 15:03:27 test155 0.0 sec 247: 18115 of 19280 6.0% 5307.38/s +18-Nov 15:03:27 test155 0.0 sec 13: 18102 of 19280 6.1% 587.62/s +18-Nov 15:03:27 test174 0.2 sec 19: 18083 of 19280 6.2% 96.37/s +18-Nov 15:03:27 test174 0.0 sec 6: 18077 of 19280 6.2% 1252.35/s +18-Nov 15:03:28 test203 0.0 sec 24: 18053 of 19280 6.4% 650.07/s +18-Nov 15:03:28 test213 0.1 sec 21: 18032 of 19280 6.5% 196.08/s +18-Nov 15:03:28 test213 0.0 sec 1: 18031 of 19280 6.5% 603.50/s +18-Nov 15:03:28 test216 0.0 sec 14: 18017 of 19280 6.6% 548.31/s +18-Nov 15:03:28 test225 0.3 sec 26: 17991 of 19280 6.7% 98.10/s +18-Nov 15:03:28 test225 0.1 sec 28: 17963 of 19280 6.8% 555.80/s +18-Nov 15:03:28 test226 0.2 sec 11: 17952 of 19280 6.9% 62.23/s +18-Nov 15:03:28 test226 0.0 sec 2: 17950 of 19280 6.9% 388.95/s +18-Nov 15:03:28 test235 0.1 sec 26: 17924 of 19280 7.0% 459.92/s +18-Nov 15:03:28 test235 0.0 sec 3: 17921 of 19280 7.0% 224.62/s +18-Nov 15:03:28 test252 0.0 sec 18: 17903 of 19280 7.1% 941.87/s +18-Nov 15:03:28 test253 0.1 sec 33: 17870 of 19280 7.3% 556.78/s +18-Nov 15:03:28 test255 0.0 sec 8: 17862 of 19280 7.4% 354.31/s +18-Nov 15:03:29 test257 0.5 sec 69: 17793 of 19280 7.7% 135.09/s +18-Nov 15:03:29 test257 0.0 sec 4: 17789 of 19280 7.7% 8048.29/s +18-Nov 15:03:29 test260 0.0 sec 3: 17786 of 19280 7.7% 166.31/s +18-Nov 15:03:29 test261 0.0 sec 37: 17749 of 19280 7.9% 2224.23/s +18-Nov 15:03:29 test262 0.0 sec 38: 17711 of 19280 8.1% 2245.60/s +18-Nov 15:03:29 test263 0.3 sec 14: 17697 of 19280 8.2% 53.11/s +18-Nov 15:03:29 test263 0.0 sec 4: 17693 of 19280 8.2% 2365.46/s +18-Nov 15:03:29 test264 0.0 sec 159: 17534 of 19280 9.1% 8529.13/s +18-Nov 15:03:30 test265 0.3 sec 22: 17512 of 19280 9.2% 80.24/s +18-Nov 15:03:30 test265 0.0 sec 1: 17511 of 19280 9.2% 1669.45/s +18-Nov 15:03:30 test267 0.2 sec 20: 17491 of 19280 9.3% 100.83/s +18-Nov 15:03:30 test269 0.0 sec 140: 17351 of 19280 10.0% 6900.63/s +18-Nov 15:03:30 test271 0.0 sec 544: 16807 of 19280 12.8% 23549.78/s +18-Nov 15:03:30 test272 0.0 sec 10: 16797 of 19280 12.9% 616.64/s +18-Nov 15:03:30 test273 0.1 sec 131: 16666 of 19280 13.6% 2209.37/s +18-Nov 15:03:30 test274 0.0 sec 119: 16547 of 19280 14.2% 6146.06/s +18-Nov 15:03:30 test276 0.1 sec 1696: 14851 of 19280 23.0% 13277.18/s +18-Nov 15:03:30 test277 0.0 sec 38: 14813 of 19280 23.2% 1996.43/s +18-Nov 15:03:30 test279 0.0 sec 47: 14766 of 19280 23.4% 2665.31/s +18-Nov 15:03:30 test281 0.0 sec 16: 14750 of 19280 23.5% 895.56/s +18-Nov 15:03:30 test268 0.2 sec 4: 14746 of 19280 23.5% 21.61/s +18-Nov 15:03:30 test268 0.0 sec 4: 14742 of 19280 23.5% 924.00/s +18-Nov 15:03:30 test207 0.0 sec 10: 14732 of 19280 23.6% 5109.86/s +18-Nov 15:03:31 test211 0.5 sec 25: 14707 of 19280 23.7% 54.73/s +18-Nov 15:03:31 test211 0.0 sec 6: 14701 of 19280 23.8% 831.72/s +18-Nov 15:03:31 test183 0.2 sec 21: 14680 of 19280 23.9% 135.29/s +18-Nov 15:03:31 test212 0.2 sec 8: 14672 of 19280 23.9% 41.59/s +18-Nov 15:03:31 test212 0.0 sec 6: 14666 of 19280 23.9% 2237.14/s +18-Nov 15:03:31 test219 0.0 sec 8: 14658 of 19280 24.0% 399.10/s +18-Nov 15:03:31 test219 0.0 sec 5: 14653 of 19280 24.0% 8250.83/s +[malloc debugging turned on] +18-Nov 15:03:31 test244 0.1 sec 40: 14613 of 19280 24.2% 628.41/s +18-Nov 15:03:31 test194 0.1 sec 28: 14585 of 19280 24.4% 279.99/s +18-Nov 15:03:32 test09 0.2 sec 16: 14569 of 19280 24.4% 66.37/s +18-Nov 15:03:32 test09 0.0 sec 2: 14567 of 19280 24.4% 1202.65/s +18-Nov 15:03:32 test108 0.2 sec 51: 14516 of 19280 24.7% 238.82/s +18-Nov 15:03:32 test108 0.0 sec 25: 14491 of 19280 24.8% 637.97/s +18-Nov 15:03:32 test137 0.1 sec 16: 14475 of 19280 24.9% 144.90/s +18-Nov 15:03:32 test137 0.0 sec 1: 14474 of 19280 24.9% 332.67/s +18-Nov 15:03:32 test137 0.0 sec 1: 14473 of 19280 24.9% 258.67/s +18-Nov 15:03:32 test124 0.1 sec 5: 14468 of 19280 25.0% 35.33/s +18-Nov 15:03:32 test133 0.3 sec 8: 14460 of 19280 25.0% 26.33/s +18-Nov 15:03:33 test133 0.1 sec 20: 14440 of 19280 25.1% 143.37/s +18-Nov 15:03:33 test176 0.4 sec 34: 14406 of 19280 25.3% 79.76/s +18-Nov 15:03:33 test176 0.1 sec 10: 14396 of 19280 25.3% 164.55/s +18-Nov 15:03:33 test197 0.2 sec 18: 14378 of 19280 25.4% 110.78/s +18-Nov 15:03:33 test197 0.2 sec 3: 14375 of 19280 25.4% 18.00/s +18-Nov 15:03:33 test201 0.0 sec 23: 14352 of 19280 25.6% 593.30/s +18-Nov 15:03:34 test208 0.1 sec 17: 14335 of 19280 25.6% 335.33/s +18-Nov 15:03:34 test214 0.0 sec 34: 14301 of 19280 25.8% 10783.38/s +18-Nov 15:03:34 test214 0.0 sec 5: 14296 of 19280 25.9% 2305.21/s +18-Nov 15:03:34 test223 0.0 sec 28: 14268 of 19280 26.0% 3819.40/s +18-Nov 15:03:34 test223 0.0 sec 1: 14267 of 19280 26.0% 68.29/s +18-Nov 15:03:34 test241 0.1 sec 62: 14205 of 19280 26.3% 1081.33/s +18-Nov 15:03:34 test241 0.0 sec 8: 14197 of 19280 26.4% 209.50/s +18-Nov 15:03:34 test270 0.0 sec 288: 13909 of 19280 27.9% 13398.46/s +18-Nov 15:03:34 test199 0.0 sec 16: 13893 of 19280 27.9% 6206.36/s +18-Nov 15:03:34 test210 0.1 sec 1: 13892 of 19280 27.9% 7.98/s +18-Nov 15:03:34 test210 0.0 sec 3: 13889 of 19280 28.0% 3517.00/s +18-Nov 15:03:34 test165 0.0 sec 13: 13876 of 19280 28.0% 2925.95/s +18-Nov 15:03:34 test221 0.1 sec 7: 13869 of 19280 28.1% 73.00/s +18-Nov 15:03:34 test221 0.0 sec 2: 13867 of 19280 28.1% 1668.06/s +18-Nov 15:03:34 test278 0.0 sec 51: 13816 of 19280 28.3% 2548.85/s +18-Nov 15:03:34 test162 0.0 sec 20: 13796 of 19280 28.4% 1156.80/s +18-Nov 15:03:34 test162 0.0 sec 1: 13795 of 19280 28.4% 40.64/s +18-Nov 15:03:34 test275 0.0 sec 27: 13768 of 19280 28.6% 1204.17/s +18-Nov 15:03:34 test220 0.2 sec 10: 13758 of 19280 28.6% 63.57/s +18-Nov 15:03:35 test83 0.2 sec 11: 13747 of 19280 28.7% 44.37/s +18-Nov 15:03:35 test83 0.0 sec 1: 13746 of 19280 28.7% 1275.51/s +18-Nov 15:03:35 test04 0.7 sec 19: 13727 of 19280 28.8% 28.70/s +18-Nov 15:03:35 test04 0.0 sec 8: 13719 of 19280 28.8% 1127.24/s +18-Nov 15:03:35 test132 0.0 sec 14: 13705 of 19280 28.9% 523.48/s +18-Nov 15:03:35 test82 0.2 sec 16: 13689 of 19280 29.0% 66.12/s +18-Nov 15:03:36 test202 0.0 sec 77: 13612 of 19280 29.4% 4569.19/s +18-Nov 15:03:36 test202 0.0 sec 2: 13610 of 19280 29.4% 183.91/s +18-Nov 15:03:36 test202 0.0 sec 4: 13606 of 19280 29.4% 403.71/s +18-Nov 15:03:36 test222 0.0 sec 39: 13567 of 19280 29.6% 1000.08/s +18-Nov 15:03:36 test204 0.0 sec 10: 13557 of 19280 29.7% 534.27/s +18-Nov 15:03:36 test258 0.1 sec 19: 13538 of 19280 29.8% 211.41/s +18-Nov 15:03:36 test258 0.0 sec 2: 13536 of 19280 29.8% 2314.81/s +18-Nov 15:03:37 test136 0.9 sec 10: 13526 of 19280 29.8% 11.27/s +18-Nov 15:03:37 test136 0.0 sec 32: 13494 of 19280 30.0% 2700.42/s +18-Nov 15:03:37 test128 0.8 sec 57: 13437 of 19280 30.3% 69.48/s +18-Nov 15:03:38 test128 0.1 sec 3: 13434 of 19280 30.3% 26.35/s +18-Nov 15:03:38 test144 0.2 sec 6: 13428 of 19280 30.4% 29.71/s +[malloc debugging turned off] +18-Nov 15:03:38 test81 0.6 sec 15: 13413 of 19280 30.4% 24.00/s +18-Nov 15:03:39 testc2(0,0) 0.4 sec 190: 13223 of 19280 31.4% 435.04/s +18-Nov 15:03:39 test239 0.0 sec 10: 13213 of 19280 31.5% 1160.23/s +18-Nov 15:03:39 test239 0.3 sec 1: 13212 of 19280 31.5% 3.14/s +18-Nov 15:03:40 test245 0.3 sec 34: 13178 of 19280 31.6% 101.63/s +18-Nov 15:03:40 test245 0.0 sec 8: 13170 of 19280 31.7% 1698.87/s +18-Nov 15:03:40 test159 0.4 sec 46: 13124 of 19280 31.9% 129.37/s +18-Nov 15:03:41 test259 0.9 sec 27: 13097 of 19280 32.1% 29.90/s +18-Nov 15:03:41 test259 0.0 sec 1: 13096 of 19280 32.1% 218.58/s +18-Nov 15:03:42 testc4(0) 1.1 sec 12: 13084 of 19280 32.1% 11.23/s +18-Nov 15:03:42 test157 0.6 sec 64: 13020 of 19280 32.5% 109.85/s +18-Nov 15:03:43 test157 0.2 sec 12: 13008 of 19280 32.5% 78.56/s +18-Nov 15:03:44 test182 1.3 sec 25: 12983 of 19280 32.7% 19.79/s +18-Nov 15:03:44 test182 0.2 sec 11: 12972 of 19280 32.7% 44.50/s +18-Nov 15:03:46 test195 1.9 sec 65: 12907 of 19280 33.1% 34.13/s +18-Nov 15:03:55 test173 9.2 sec 27: 12880 of 19280 33.2% 2.94/s +18-Nov 15:03:56 test173 0.4 sec 9: 12871 of 19280 33.2% 22.84/s +18-Nov 15:03:59 test135 3.7 sec 45: 12826 of 19280 33.5% 12.00/s +18-Nov 15:04:06 test84 6.8 sec 33: 12793 of 19280 33.6% 4.83/s +18-Nov 15:04:07 test84 0.3 sec 21: 12772 of 19280 33.8% 64.97/s +18-Nov 15:04:07 test215 0.1 sec 2: 12770 of 19280 33.8% 23.02/s +18-Nov 15:04:07 test80 0.2 sec 13: 12757 of 19280 33.8% 68.95/s +18-Nov 15:04:08 test200 0.7 sec 11: 12746 of 19280 33.9% 16.16/s +18-Nov 15:04:10 test283 2.2 sec 95: 12651 of 19280 34.4% 42.81/s +18-Nov 15:04:10 test254 0.2 sec 25: 12626 of 19280 34.5% 108.09/s +18-Nov 15:04:11 test254 1.1 sec 1: 12625 of 19280 34.5% 0.94/s +18-Nov 15:04:13 test142b 1.8 sec 25: 12600 of 19280 34.6% 13.75/s +18-Nov 15:04:13 test142b 0.0 sec 10: 12590 of 19280 34.7% 610.58/s +18-Nov 15:05:02 test142 48.9 sec 585: 12005 of 19280 37.7% 11.96/s +18-Nov 15:05:02 test142 0.4 sec 2: 12003 of 19280 37.7% 4.47/s +18-Nov 15:05:05 test54 3.0 sec 17: 11986 of 19280 37.8% 5.76/s +18-Nov 15:05:07 test54 1.1 sec 11: 11975 of 19280 37.9% 9.62/s +18-Nov 15:05:09 testcc(1) 2.1 sec 4: 11971 of 19280 37.9% 1.90/s +18-Nov 15:05:10 testcc(1) 1.6 sec 6: 11965 of 19280 37.9% 3.83/s +18-Nov 15:05:11 testc2(1,1) 0.2 sec 11: 11954 of 19280 38.0% 46.88/s +18-Nov 15:05:13 testc2(1,1) 2.4 sec 4: 11950 of 19280 38.0% 1.65/s +18-Nov 15:06:05 test227 52.5 sec 28: 11922 of 19280 38.2% 0.53/s +18-Nov 15:06:07 test141 1.1 sec 440: 11482 of 19280 40.4% 412.84/s +18-Nov 15:06:07 test179 0.0 sec 22: 11460 of 19280 40.6% 636.85/s +18-Nov 15:06:07 test179 0.6 sec 10: 11450 of 19280 40.6% 16.23/s +18-Nov 15:06:07 test188b 0.0 sec 38: 11412 of 19280 40.8% 1169.70/s +18-Nov 15:06:07 test185 0.0 sec 22: 11390 of 19280 40.9% 533.20/s +18-Nov 15:06:08 test256 0.2 sec 48: 11342 of 19280 41.2% 241.32/s +18-Nov 15:06:08 test256 0.0 sec 1: 11341 of 19280 41.2% 1132.50/s +18-Nov 15:06:08 test238b 0.7 sec 25: 11316 of 19280 41.3% 33.53/s +18-Nov 15:06:08 test238 0.1 sec 63: 11253 of 19280 41.6% 841.16/s +18-Nov 15:06:09 test186 0.9 sec 25: 11228 of 19280 41.8% 28.99/s +18-Nov 15:06:09 test186 0.1 sec : 11228 of 19280 41.8% +18-Nov 15:06:10 test186 0.1 sec : 11228 of 19280 41.8% +[malloc debugging turned on] +18-Nov 15:06:11 testca(1) 1.7 sec 38: 11190 of 19280 42.0% 22.50/s +18-Nov 15:06:13 testca(1) 1.7 sec 2: 11188 of 19280 42.0% 1.19/s +18-Nov 15:06:22 test130 8.7 sec 19: 11169 of 19280 42.1% 2.18/s +18-Nov 15:06:22 test130 0.4 sec 12: 11157 of 19280 42.1% 33.22/s +18-Nov 15:06:23 test148 0.5 sec 6: 11151 of 19280 42.2% 12.28/s +18-Nov 15:06:23 test148 0.0 sec 4: 11147 of 19280 42.2% 1554.00/s +18-Nov 15:06:24 test231 1.7 sec 386: 10761 of 19280 44.2% 229.67/s +18-Nov 15:06:24 test231 0.2 sec 7: 10754 of 19280 44.2% 30.76/s +18-Nov 15:06:25 test129 0.3 sec 7: 10747 of 19280 44.3% 22.65/s +18-Nov 15:06:28 test69 2.9 sec 16: 10731 of 19280 44.3% 5.51/s +18-Nov 15:06:30 test69 2.3 sec 3: 10728 of 19280 44.4% 1.28/s +18-Nov 15:06:32 test29 1.8 sec 154: 10574 of 19280 45.2% 84.98/s +18-Nov 15:06:34 test29 1.7 sec 2: 10572 of 19280 45.2% 1.15/s +18-Nov 15:06:34 test282 0.3 sec 15: 10557 of 19280 45.2% 48.42/s +18-Nov 15:06:34 test249 0.4 sec 29: 10528 of 19280 45.4% 68.68/s +18-Nov 15:06:35 test249 0.4 sec 1: 10527 of 19280 45.4% 2.47/s +18-Nov 15:06:35 test196 0.5 sec 17: 10510 of 19280 45.5% 32.77/s +18-Nov 15:06:36 test250 0.5 sec 80: 10430 of 19280 45.9% 155.33/s +18-Nov 15:06:37 test250 0.8 sec 2: 10428 of 19280 45.9% 2.38/s +18-Nov 15:06:37 test145 0.7 sec 20: 10408 of 19280 46.0% 29.53/s +18-Nov 15:06:37 test145 0.0 sec 6: 10402 of 19280 46.0% 1211.14/s +18-Nov 15:06:39 test229 2.1 sec 11: 10391 of 19280 46.1% 5.35/s +18-Nov 15:06:41 test209 1.7 sec 25: 10366 of 19280 46.2% 14.57/s +18-Nov 15:06:42 test224 1.3 sec 59: 10307 of 19280 46.5% 46.75/s +18-Nov 15:06:43 test191 0.3 sec 26: 10281 of 19280 46.7% 88.21/s +18-Nov 15:06:43 test191 0.1 sec 2: 10279 of 19280 46.7% 20.21/s +18-Nov 15:06:43 test150 0.0 sec 15: 10264 of 19280 46.8% 364.32/s +18-Nov 15:06:43 test240 0.3 sec 25: 10239 of 19280 46.9% 84.27/s +18-Nov 15:06:43 test240 0.3 sec 1: 10238 of 19280 46.9% 2.88/s +18-Nov 15:06:44 test237 0.3 sec 11: 10227 of 19280 47.0% 33.28/s +18-Nov 15:06:44 test237 0.0 sec 1: 10226 of 19280 47.0% 44.49/s +18-Nov 15:06:44 test237 0.0 sec 1: 10225 of 19280 47.0% 73.22/s +18-Nov 15:06:44 test237 0.0 sec 1: 10224 of 19280 47.0% 116.44/s +18-Nov 15:06:45 test184 1.2 sec 10: 10214 of 19280 47.0% 8.57/s +18-Nov 15:06:47 test236 2.0 sec 86: 10128 of 19280 47.5% 42.46/s +[malloc debugging turned off] +18-Nov 15:06:58 test230 10.6 sec 250: 9878 of 19280 48.8% 23.54/s +18-Nov 15:06:59 test230 1.6 sec 2: 9876 of 19280 48.8% 1.24/s +18-Nov 15:07:08 test18 8.3 sec 90: 9786 of 19280 49.2% 10.83/s +18-Nov 15:07:10 test18 2.7 sec 5: 9781 of 19280 49.3% 1.89/s +18-Nov 15:07:34 testc7(0) 23.6 sec 7: 9774 of 19280 49.3% 0.30/s +18-Nov 15:07:39 testc7(0) 5.0 sec 6: 9768 of 19280 49.3% 1.19/s +18-Nov 15:07:51 test193 12.4 sec 192: 9576 of 19280 50.3% 15.54/s +18-Nov 15:07:54 test127 2.6 sec 927: 8649 of 19280 55.1% 359.54/s +18-Nov 15:07:58 test23 4.4 sec 61: 8588 of 19280 55.5% 13.97/s +18-Nov 15:08:04 test243 5.7 sec 24: 8564 of 19280 55.6% 4.19/s +18-Nov 15:09:05 test53 60.7 sec 21: 8543 of 19280 55.7% 0.35/s +18-Nov 15:09:09 test53 3.9 sec 5: 8538 of 19280 55.7% 1.29/s +18-Nov 15:09:19 test242 10.4 sec 63: 8475 of 19280 56.0% 6.06/s +18-Nov 15:09:30 test17 10.3 sec 33: 8442 of 19280 56.2% 3.21/s +18-Nov 15:09:39 test246 9.0 sec 4: 8438 of 19280 56.2% 0.44/s +18-Nov 15:09:39 test206 0.5 sec 87: 8351 of 19280 56.7% 160.25/s +18-Nov 15:09:44 test206 4.7 sec 6: 8345 of 19280 56.7% 1.27/s +18-Nov 15:09:49 test251b 4.9 sec 25: 8320 of 19280 56.8% 5.08/s +18-Nov 15:10:00 test251 10.7 sec 94: 8226 of 19280 57.3% 8.75/s +18-Nov 15:10:13 test152 12.9 sec 93: 8133 of 19280 57.8% 7.23/s +18-Nov 15:10:27 test152 14.0 sec 64: 8069 of 19280 58.1% 4.58/s +18-Nov 15:10:29 test160 2.5 sec 17: 8052 of 19280 58.2% 6.83/s +18-Nov 15:10:53 test232 24.0 sec 38: 8014 of 19280 58.4% 1.58/s +18-Nov 15:10:54 test232 0.3 sec 4: 8010 of 19280 58.5% 13.38/s +18-Nov 15:11:58 test19 64.4 sec 32: 7978 of 19280 58.6% 0.50/s +18-Nov 15:11:59 test19 0.9 sec 87: 7891 of 19280 59.1% 98.32/s +18-Nov 15:13:28 test19b 88.9 sec 22: 7869 of 19280 59.2% 0.25/s +18-Nov 15:13:30 test19b 1.4 sec 18: 7851 of 19280 59.3% 12.96/s +18-Nov 15:13:31 test192 1.2 sec 3: 7848 of 19280 59.3% 2.59/s +18-Nov 15:13:39 test181 7.9 sec 4: 7844 of 19280 59.3% 0.51/s +18-Nov 15:13:43 test181 4.4 sec 11: 7833 of 19280 59.4% 2.52/s +[malloc debugging turned on] +18-Nov 15:13:53 test02 9.7 sec 3: 7830 of 19280 59.4% 0.31/s +18-Nov 15:14:05 test11 12.1 sec 12: 7818 of 19280 59.5% 0.99/s +18-Nov 15:14:08 test187 3.6 sec 6: 7812 of 19280 59.5% 1.65/s +18-Nov 15:14:10 test187 2.0 sec 1: 7811 of 19280 59.5% 0.50/s +18-Nov 15:14:14 test189 3.7 sec 6: 7805 of 19280 59.5% 1.63/s +18-Nov 15:14:17 test169 2.5 sec 32: 7773 of 19280 59.7% 12.71/s +18-Nov 15:14:20 test76 3.4 sec 14: 7759 of 19280 59.8% 4.08/s +18-Nov 15:14:28 test01 7.5 sec 691: 7068 of 19280 63.3% 92.28/s +18-Nov 15:14:32 test01 4.1 sec 1: 7067 of 19280 63.3% 0.24/s +18-Nov 15:14:36 test228 4.3 sec 26: 7041 of 19280 63.5% 6.11/s +18-Nov 15:14:40 test104 4.2 sec 36: 7005 of 19280 63.7% 8.53/s +18-Nov 15:15:07 test284 26.5 sec 68: 6937 of 19280 64.0% 2.57/s +18-Nov 15:15:09 test284 2.0 sec 4: 6933 of 19280 64.0% 2.04/s +18-Nov 15:15:19 test180 10.0 sec 3: 6930 of 19280 64.1% 0.30/s +18-Nov 15:15:21 test180 2.3 sec 7: 6923 of 19280 64.1% 3.06/s +18-Nov 15:15:30 test188 9.1 sec 169: 6754 of 19280 65.0% 18.59/s +18-Nov 15:15:54 test151b 23.6 sec 37: 6717 of 19280 65.2% 1.57/s +18-Nov 15:15:54 test151b 0.2 sec 15: 6702 of 19280 65.2% 73.12/s +18-Nov 15:16:14 test14b 19.4 sec 95: 6607 of 19280 65.7% 4.90/s +18-Nov 15:16:37 test14 23.8 sec 257: 6350 of 19280 67.1% 10.79/s +[malloc debugging turned off] +18-Nov 15:17:06 test125 28.2 sec 319: 6031 of 19280 68.7% 11.31/s +18-Nov 15:17:48 test10 42.5 sec 741: 5290 of 19280 72.6% 17.42/s +18-Nov 15:18:26 test75b 38.0 sec 293: 4997 of 19280 74.1% 7.71/s +18-Nov 15:18:55 test74 28.8 sec 4101: 896 of 19280 95.4% 142.28/s +18-Nov 15:21:00 test234 124.8 sec 198: 698 of 19280 96.4% 1.59/s +[malloc debugging turned on] +18-Nov 15:21:00 test154b 0.0 sec 12: 686 of 19280 96.4% 586.65/s +18-Nov 15:22:48 test154 108.2 sec 657: 29 of 19280 99.8% 6.07/s +18-Nov 15:22:54 test280 4.9 sec 12: 17 of 19280 99.9% 2.43/s +18-Nov 15:23:54 test21b 60.1 sec 17: all 19280 full 100% 0.28/s +[malloc debugging turned off] +18-Nov-2024 15:23:54 grbcov ending diff --git a/Tcov/testcov.m b/Tcov/testcov.m index b4e1762f30..3520baff89 100644 --- a/Tcov/testcov.m +++ b/Tcov/testcov.m @@ -1,6 +1,6 @@ %TESTCOV run all GraphBLAS tests, with statement coverage -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 if (ispc) @@ -14,9 +14,8 @@ spok_install ; cd ../../Tcov mex -g -R2018a ../Test/GB_spones_mex.c - debug_on ; - grbcover ; - testall ; + grbcov_testmake ; + testall ([ ], true) ; catch me debug_off ; rethrow (me) ; diff --git a/Test/Contents.m b/Test/Contents.m index fd1ce3e19c..93d7a0f49d 100644 --- a/Test/Contents.m +++ b/Test/Contents.m @@ -3,8 +3,8 @@ % Primary functiuns -% testmake - compiles the test interface to GraphBLAS -% testall - run all GraphBLAS tests +% testmake - compiles the test interface to GraphBLAS +% testall - run all GraphBLAS tests % mimics of GraphBLAS operations: % @@ -64,6 +64,7 @@ % GB_spec_vdiag - a mimic of GxB_Vector_diag % GB_spec_zeros - all-zero matrix of a given type. % GB_spec_getmask - return the mask, typecasted to logical +% GB_spec_kron_idx - C = kron(A,B), using the mykronidx operator % GB_user_op - apply a complex binary and unary operator % GB_user_opsall - return list of complex operators @@ -75,183 +76,231 @@ % Test scripts: -% test01 - test GraphBLAS error handling -% test02 - test GrB_*_dup -% test04 - test and demo for accumulator/mask and transpose -% test06 - test GrB_mxm on all semirings -% test09 - test GxB_subassign - -% test10 - test GrB_apply -% test11 - test GrB_*_extractTuples -% test14 - test GrB_reduce -% test17 - test GrB_*_extractElement -% test18 - test GrB_eWiseAdd, GxB_eWiseUnion, and GrB_eWiseMult -% test19 - test GxB_subassign and GrB_*_setElement with many pending operations -% test19b - test GrB_assign and GrB_*_setElement with many pending operations - -% test21b - test GrB_assign -% test23 - test GrB_*_build -% test29 - GrB_reduce with zombies - -% test53 - test GrB_Matrix_extract -% test54 - test GB_subref: numeric case with I=lo:hi, J=lo:hi - -% test69 - test GrB_assign with aliased inputs, C(:,:) = accum(C(:,:),C) - -% test74 - test GrB_mxm: all built-in semirings -% test75b - GrB_mxm and GrB_vxm on all semirings (shorter test than test75) -% test76 - test GxB_resize - -% test80 - rerun test06 with different matrices -% test81 - test GrB_Matrix_extract with index range, stride, & backwards -% test82 - test GrB_Matrix_extract with index range (hypersparse) -% test83 - test GrB_assign with J=lo:0:hi, an empty list, and C_replace true -% test84 - test GrB_assign (row and column with C in CSR/CSC format) - -% test104 - export/import -% test108 - test boolean monoids -% test109 - terminal monoid with user-defined type - -% test124 - GrB_extract, trigger case 6 -% test125 - test GrB_mxm: row and column scaling -% test127 - test GrB_eWiseAdd and GrB_eWiseMult (all types and operators) -% test128 - test eWiseMult, eWiseAdd, eWiseUnion, special cases - -% test129 - test GxB_select (tril and nonzero, hypersparse) - -% test130 - test GrB_apply (hypersparse cases) -% test132 - test GrB_*_setElement and GrB_*_*build -% test133 - test mask operations (GB_masker) -% test135 - reduce-to-scalar, built-in monoids with terminal values -% test136 - GxB_subassign, method 08, 09, 11 -% test137 - GrB_eWiseMult with FIRST and SECOND operators -% test138 - test assign, with coarse-only tasks in IxJ slice -% test139 - merge sort, special cases - -% test141 - test GrB_eWiseAdd (all types and operators) for dense matrices -% test142 - test GrB_assign for dense matrices -% test144 - test GB_cumsum -% test145 - test dot4 -% test148 - eWiseAdd with aliases - -% test150 - test GrB_mxm with typecasting and zombies (dot3 and saxpy) -% test151 - test bitwise operators -% test151b - test bitshift operators -% test152 - test C = A+B for dense A, B, and C -% test154 - test GrB_apply with scalar binding -% test155 - test GrB_*_setElement and GrB_*_removeElement -% test156 - test assign C=A with typecasting -% test157 - test sparsity formats -% test159 - test dot and saxpy with positional ops - -% testc2 - test complex A*B, A'*B, A*B', A'*B', A+B -% testc4 - test complex extractElement and setElement -% testc7 - test complex assign -% testca - test complex mxm, mxv, and vxm -% testcc - test complex transpose - -% test160 - test GrB_mxm -% test162 - test C=A*B with very sparse M -% test165 - test C=A*B' where A is diagonal and B becomes bitmap - -% test172 - eWiseMult with M bitmap/full -% test173 - test GrB_assign C=A -% test174 - bitmap assignment, C+=A -% test176 - test C(I,J) = scalar (method 09, 11), M bitmap -% test179 - bitmap select - -% test180 - subassign and assign -% test181 - test transpose with explicit zeros in the Mask -% test182 - test for internal wait that changes w from sparse/hyper to bitmap/full -% test183 - test GrB_eWiseMult with a hypersparse mask -% test184 - test special cases for mxm, transpose, and build -% test185 - test dot4 for all sparsity formats -% test186 - test saxpy for all sparsity formats -% test187 - test dup/assign for all sparsity formats -% test188 - test concat -% test189 - test large assignment - -% test191 - test split -% test192 - test GrB_assign C=scalar -% test193 - test GxB_Matrix_diag and GrB_Matrix_diag -% test194 - test GxB_Vector_diag -% test195 - test all variants of saxpy3 -% test196 - test large hypersparse concat -% test197 - test large sparse split -% test199 - test dot2 with hypersparse - -% test200 - test iso full matrix multiply -% test201 - test iso reduce to vector and reduce to scalar -% test202 - test iso add and emult -% test203 - test iso subref -% test204 - test iso diag -% test206 - test iso select -% test207 - test iso subref -% test208 - test iso apply, bind 1st and 2nd -% test209 - test iso build - -% test210 - test iso assign25: C=A, C empty, A dense, M structural -% test211 - test iso assign -% test212 - test iso mask all zero -% test213 - test iso assign (method 05d) -% test214 - test C=A'*B (tricount) -% test215 - test C=A'*B (dot2, ANY_PAIR semiring) -% test216 - test C=A, iso case -% test219 - test reduce to scalar - -% test220 - test mask C=Z, iso case -% test221 - test C += A where C is bitmap and A is full -% test222 - test user selectop for iso matrices -% test223 - test matrix multiply, C=A*B -% test224 - unpack/pack -% test225 - test mask operations (GB_masker) -% test226 - test kron with iso matrices -% test227 - test kron -% test228 - test serialize/deserialize for all sparsity formats -% test229 - set setElement - -% test230 - test GrB_apply with idxunop -% test231 - test GrB_select with idxunp -% test232 - test assign with GrB_Scalar -% test234 - test GxB_eWiseUnion -% test235 - test GxB_eWiseUnion and GrB_eWiseAdd -% test236 - test GxB_Matrix_sort and GxB_Vector_sort -% test237 - test GrB_mxm (saxpy4) -% test238 - test GrB_mxm (dot4 and dot2) -% test239 - test GxB_eWiseUnion - -% test240 - test GrB_mxm: dot4, saxpy4, saxpy5 -% test241 - test GrB_mxm: swap_rule -% test242 - test GxB_Iterator for matrices -% test243 - test GxB_Vector_Iterator -% test244 - test reshape -% test245 - test colscale (A*D) and rowscale (D*B) with complex types -% test246 - test GrB_mxm with different kinds of parallelism -% test247 - test saxpy3 fine-hash method -% test249 - GxB_Context object tests - -% test250 - basic tests +% test01 - test GraphBLAS error handling +% test02 - test GrB_*_dup +% test04 - test and demo for accumulator/mask and transpose +% test06 - test GrB_mxm on all semirings +% test09 - test GxB_subassign + +% test10 - test GrB_apply +% test11 - test GrB_*_extractTuples +% test14 - test GrB_reduce +% test14b - test GrB_reduce +% test17 - test GrB_*_extractElement +% test18 - test GrB_eWiseAdd, GxB_eWiseUnion, and GrB_eWiseMult +% test19 - test GxB_subassign and GrB_*_setElement with many pending operations +% test19b - test GrB_assign and GrB_*_setElement with many pending operations + +% test21b - test GrB_assign +% test23 - test GrB_*_build +% test29 - GrB_reduce with zombies + +% test53 - test GrB_Matrix_extract +% test54 - test GB_subref: numeric case with I=lo:hi, J=lo:hi + +% test69 - test GrB_assign with aliased inputs, C(:,:) = accum(C(:,:),C) + +% test74 - test GrB_mxm: all built-in semirings +% test75b - GrB_mxm and GrB_vxm on all semirings (shorter test than test75) +% test76 - test GxB_resize +% test78 - test subref + +% test80 - rerun test06 with different matrices +% test81 - test GrB_Matrix_extract with index range, stride, & backwards +% test82 - test GrB_Matrix_extract with index range (hypersparse) +% test83 - test GrB_assign with J=lo:0:hi, an empty list, and C_replace true +% test84 - test GrB_assign (row and column with C in CSR/CSC format) + +% test104 - export/import +% test108 - test boolean monoids +% test109 - terminal monoid with user-defined type + +% test124 - GrB_extract, trigger case 6 +% test125 - test GrB_mxm: row and column scaling +% test127 - test GrB_eWiseAdd and GrB_eWiseMult (all types and operators) +% test128 - test eWiseMult, eWiseAdd, eWiseUnion, special cases + +% test129 - test GxB_select (tril and nonzero, hypersparse) + +% test130 - test GrB_apply (hypersparse cases) +% test132 - test GrB_*_setElement and GrB_*_*build +% test133 - test mask operations (GB_masker) +% test135 - reduce-to-scalar, built-in monoids with terminal values +% test136 - GxB_subassign, method 08, 09, 11 +% test137 - GrB_eWiseMult with FIRST and SECOND operators +% test138 - test assign, with coarse-only tasks in IxJ slice +% test139 - merge sort, special cases + +% test141 - test GrB_eWiseAdd (all types and operators) for dense matrices +% test142 - test GrB_assign for dense matrices +% test142b - test GrB_assign for dense matrices +% test144 - test GB_cumsum +% test145 - test dot4 with rdiv2 operator +% test148 - eWiseAdd with aliases + +% test150 - test GrB_mxm with typecasting and zombies (dot3 and saxpy) + +% test151b - test bitshift operators +% test152 - test C = A+B for dense A, B, and C +% test154 - test GrB_apply with scalar binding +% test154b - test GrB_apply with scalar binding +% test155 - test GrB_*_setElement and GrB_*_removeElement + +% test157 - test sparsity formats +% test159 - test dot and saxpy with positional ops + +% testc2 - test complex A*B, A'*B, A*B', A'*B', A+B +% testc4 - test complex extractElement and setElement +% testc7 - test complex assign +% testca - test complex mxm, mxv, and vxm +% testcc - test complex transpose + +% test160 - test GrB_mxm +% test162 - test C=A*B with very sparse M +% test165 - test C=A*B' where A is diagonal and B becomes bitmap +% test169 - C=A+B with different sparsity formats + +% test172 - eWiseMult with M bitmap/full +% test173 - test GrB_assign C=A +% test174 - bitmap assignment, C+=A +% test176 - test C(I,J) = scalar (method 09, 11), M bitmap +% test179 - bitmap select + +% test180 - subassign and assign +% test181 - test transpose with explicit zeros in the Mask +% test182 - test for internal wait that changes w from sparse/hyper to bitmap/full +% test183 - test GrB_eWiseMult with a hypersparse mask +% test184 - test special cases for mxm, transpose, and build +% test185 - test dot4 for all sparsity formats +% test186 - test saxpy for all sparsity formats +% test187 - test dup/assign for all sparsity formats +% test188 - test concat +% test188b - test concat +% test189 - test large assignment + +% test191 - test split +% test192 - test GrB_assign C=scalar +% test193 - test GxB_Matrix_diag and GrB_Matrix_diag +% test194 - test GxB_Vector_diag +% test195 - test all variants of saxpy3 +% test196 - test large hypersparse concat +% test197 - test large sparse split +% test199 - test dot2 with hypersparse + +% test200 - test iso full matrix multiply +% test201 - test iso reduce to vector and reduce to scalar +% test202 - test iso add and emult +% test203 - test iso subref +% test204 - test iso diag +% test206 - test iso select +% test207 - test iso subref +% test208 - test iso apply, bind 1st and 2nd +% test209 - test iso build + +% test210 - test iso assign25: C=A, C empty, A dense, M structural +% test211 - test iso assign +% test212 - test iso mask all zero +% test213 - test iso assign (method 05d) +% test214 - test C=A'*B (tricount) +% test215 - test C=A'*B (dot2, ANY_PAIR semiring) +% test216 - test C=A, iso case +% test219 - test reduce to scalar + +% test220 - test mask C=Z, iso case +% test221 - test C += A where C is bitmap and A is full +% test222 - test user selectop for iso matrices +% test223 - test matrix multiply, C=A*B +% test224 - unpack/pack +% test225 - test mask operations (GB_masker) +% test226 - test kron with iso matrices +% test227 - test kron +% test228 - test serialize/deserialize for all sparsity formats +% test229 - set setElement + +% test230 - test GrB_apply with idxunop +% test231 - test GrB_select with idxunp +% test232 - test assign with GrB_Scalar +% test234 - test GxB_eWiseUnion +% test235 - test GxB_eWiseUnion and GrB_eWiseAdd +% test236 - test GxB_Matrix_sort and GxB_Vector_sort +% test237 - test GrB_mxm (saxpy4) +% test238 - test GrB_mxm (dot4 and dot2) +% test238b - test GrB_mxm (dot4 and dot2) +% test239 - test GxB_eWiseUnion + +% test240 - test GrB_mxm: dot4, saxpy4, saxpy5 +% test241 - test GrB_mxm: swap_rule +% test242 - test GxB_Iterator for matrices +% test243 - test GxB_Vector_Iterator +% test244 - test reshape +% test245 - test colscale (A*D) and rowscale (D*B) with complex types +% test246 - test GrB_mxm (for GB_AxB_saxpy3_fineHash_phase2.c) +% test247 - test GrB_mxm (for GB_AxB_saxpy3_fineHash_phase2.c) +% test249 - GxB_Context object tests + +% test250 - JIT tests, set/get, other tests +% test251 - test dot4 for plus-pair semirings +% test251b - test dot4 for plus-pair semirings +% test252 - basic tests +% test253 - basic tests +% test254 - test masks with all types +% test255 - basic tests +% test256 - JIT error handling +% test257 - JIT error handling +% test258 - reduce to vector with user-defined type +% test259 - test with plus_plus semiring + +% test260 - test demacrofy +% test261 - test serialize/deserialize +% test262 - test GB_mask +% test263 - test JIT +% test264 - test enumify/macrofy +% test265 - test enumify/macrofy +% test267 - test JIT error handling +% test268 - test sparse masker, C=Z +% test269 - test GrB_get / GrB_set for types, scalars, vectors, and matrices + +% test270 - test GrB_get / GrB_set for unary ops +% test271 - test GrB_get / GrB_set for binary ops +% test272 - test Context +% test273 - test Global get/set +% test274 - test get/set for IndexUnary ops +% test275 - test get/set for monoids +% test276 - test get/set for semirings +% test277 - test get/set for context +% test278 - test get/set for descriptor +% test279 - test get/set for serialized blob + +% test280 - subassign method 26 +% test281 - test GrB_apply with user-defined idxunp +% test282 - test argmax with index binary op +% test283 - test index binary op +% test284 - test GrB_mxm using indexop-based semirings +% test285 - test GrB_assign (bitmap case, C+=A, whole matrix) +% test286 - test kron with idxop % Helper functions -% nthreads_get - get # of threads and chunk to use in GraphBLAS -% nthreads_set - set # of threads and chunk to use in GraphBLAS -% test10_compare - check results for test10 -% test_cast - z = cast (x,type) but handle complex types -% test_contains - same as contains (text, pattern) -% debug_off - turn off malloc debugging -% debug_on - turn on malloc debugging -% grbinfo - print info about the GraphBLAS version -% irand - construct a random integer matrix -% logstat - run a GraphBLAS test and log the results to log.txt -% runtest - run a single GraphBLAS test -% stat - report status of statement coverage and malloc debugging -% isequal_roundoff - compare two matrices, allowing for roundoff errors -% grb_clear_coverage - clear current statement coverage -% grb_get_coverage - return current statement coverage -% feature_numcores - determine # of cores the system has -% jit_reset - turn off the JIT and then set it back to its original state - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% nthreads_get - get # of threads and chunk to use in GraphBLAS +% nthreads_set - set # of threads and chunk to use in GraphBLAS +% test10_compare - check results for test10 +% test_cast - z = cast (x,type) but handle complex types +% test_contains - same as contains (text, pattern) +% debug_off - turn off malloc debugging +% debug_on - turn on malloc debugging +% grbinfo - print info about the GraphBLAS version +% irand - construct a random integer matrix +% logstat - run a GraphBLAS test and log the results to log.txt +% runtest - run a single GraphBLAS test +% stat - report status of statement coverage and malloc debugging +% isequal_roundoff - compare two matrices, allowing for roundoff errors +% grb_clear_coverage - clear current statement coverage +% grb_get_coverage - return current statement coverage +% feature_numcores - determine # of cores the system has +% jit_reset - turn off the JIT and then set it back to its original state +% grblines - total # of lines in the test coverage +% set_malloc_debug - Turn on/off malloc debugging and mark the log.txt + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 diff --git a/Test/GB_mex.h b/Test/GB_mex.h index ed6265b8de..906b394da6 100644 --- a/Test/GB_mex.h +++ b/Test/GB_mex.h @@ -12,7 +12,7 @@ #include "../Source/mxm/GB_mxm.h" #include "../Source/pending/GB_Pending.h" -#include "../Source/ewise/GB_add.h" +#include "../Source/add/GB_add.h" #include "../Source/extract/GB_subref.h" #include "../Source/transpose/GB_transpose.h" #include "../Source/sort/GB_sort.h" diff --git a/Test/GB_mex_AplusB.c b/Test/GB_mex_AplusB.c index ac4252fb5a..12fcb78241 100644 --- a/Test/GB_mex_AplusB.c +++ b/Test/GB_mex_AplusB.c @@ -72,7 +72,7 @@ void mexFunction // C = A+B using the op. No mask, so this will always work. bool ignore ; METHOD (GB_add (C, A->type, true, NULL, false, false, &ignore, A, B, - false, NULL, NULL, op, false, Werk)) ; + false, NULL, NULL, op, false, false, Werk)) ; // return C as a plain sparse matrix pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C AplusB result", false) ; diff --git a/Test/GB_mex_AxB_idx.c b/Test/GB_mex_AxB_idx.c new file mode 100644 index 0000000000..d4623aaaef --- /dev/null +++ b/Test/GB_mex_AxB_idx.c @@ -0,0 +1,352 @@ +//------------------------------------------------------------------------------ +// GB_mex_AxB_idx: C=A*B, A'*B, A*B', or A'*B' using the indexop semirings +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This is for testing only. See GrB_mxm instead. + +// monoid: min, max, plus, times +// mult: firsti, firsti1, firstj, firstj1, secondi, secondi1, secondj, secondj1 + +#include "GB_mex.h" +#include "GB_mex_errors.h" + +#define USAGE "C = GB_mex_AxB_idx (A, B, atrans, btrans, axb_method," \ + " C_is_csc, builtin, add, mult)" + +#define FREE_ALL \ +{ \ + GrB_Matrix_free (&A) ; \ + GrB_Matrix_free (&B) ; \ + GrB_Matrix_free (&C) ; \ + GrB_Scalar_free (&Theta) ; \ + GrB_Descriptor_free (&desc) ; \ + GrB_BinaryOp_free (&mult) ; \ + GxB_IndexBinaryOp_free (&Iop) ; \ + GrB_Monoid_free (&monoid) ; \ + GrB_Semiring_free (&semiring) ; \ + GB_mx_put_global (true) ; \ +} + +//------------------------------------------------------------------------------ +// user-defined index binary operators +//------------------------------------------------------------------------------ + +void firsti_theta (int64_t *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) ; + +void firsti_theta (int64_t *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) +{ + (*z) = ix + (*theta) ; +} + +#define FIRSTI_THETA \ +"void firsti_theta (int64_t *z, \n" \ +" const void *x, GrB_Index ix, GrB_Index jx, \n" \ +" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const int64_t *theta) \n" \ +"{ \n" \ +" (*z) = ix + (*theta) ; \n" \ +"}" + +void secondi_theta (int64_t *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) ; + +void secondi_theta (int64_t *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) +{ + (*z) = iy + (*theta) ; +} + +#define SECONDI_THETA \ +"void secondi_theta (int64_t *z, \n" \ +" const void *x, GrB_Index ix, GrB_Index jx, \n" \ +" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const int64_t *theta) \n" \ +"{ \n" \ +" (*z) = iy + (*theta) ; \n" \ +"}" + +void firstj_theta (int64_t *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) ; + +void firstj_theta (int64_t *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) +{ + (*z) = jx + (*theta) ; +} + +#define FIRSTJ_THETA \ +"void firstj_theta (int64_t *z, \n" \ +" const void *x, GrB_Index ix, GrB_Index jx, \n" \ +" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const int64_t *theta) \n" \ +"{ \n" \ +" (*z) = jx + (*theta) ; \n" \ +"}" + +void secondj_theta (int64_t *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) ; + +void secondj_theta (int64_t *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) +{ + (*z) = jy + (*theta) ; +} + +#define SECONDJ_THETA \ +"void secondj_theta (int64_t *z, \n" \ +" const void *x, GrB_Index ix, GrB_Index jx, \n" \ +" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const int64_t *theta) \n" \ +"{ \n" \ +" (*z) = jy + (*theta) ; \n" \ +"}" + +//------------------------------------------------------------------------------ + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + GrB_Info info = GrB_SUCCESS ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL, B = NULL, C = NULL ; + GrB_Scalar Theta = NULL ; + GrB_BinaryOp mult = NULL ; + GxB_IndexBinaryOp Iop = NULL ; + GrB_Semiring semiring = NULL ; + GrB_Index anrows = 0, ancols = 0, bnrows = 0, bncols = 0 ; + GrB_Descriptor desc = NULL ; + GrB_Monoid monoid = NULL ; + + // check inputs + if (nargout > 1 || nargin < 2 || nargin > 9) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + #define GET_DEEP_COPY ; + #define FREE_DEEP_COPY ; + + // get A and B + A = GB_mx_mxArray_to_Matrix (pargin [0], "A", false, true) ; + B = GB_mx_mxArray_to_Matrix (pargin [1], "B", false, true) ; + if (A == NULL || B == NULL) + { + FREE_ALL ; + mexErrMsgTxt ("failed") ; + } + + // get the atrans option + bool GET_SCALAR (2, bool, atrans, false) ; + + // get the btrans option + bool GET_SCALAR (3, bool, btrans, false) ; + + // get the axb_method + GrB_Desc_Value GET_SCALAR (4, GrB_Desc_Value, AxB_method, GxB_DEFAULT) ; + + // get the C_is_csc option + bool GET_SCALAR (5, bool, C_is_csc, true) ; + + // get the builtin option + bool GET_SCALAR (6, bool, builtin, true) ; + + // get the add monoid; defaults to 'min' + #define LEN 256 + char addname [LEN+1] ; + strcpy (addname, "min") ; + if (nargin > 7) + { + int len = GB_mx_mxArray_to_string (addname, LEN, pargin [7]) ; + if (len == -1) + { + mexErrMsgTxt ("addname must be char") ; + } + } + + // get the mult operator; defaults to 'secondi1' + char multname [LEN+1] ; + strcpy (multname, "secondi1") ; + if (nargin > 8) + { + int len = GB_mx_mxArray_to_string (multname, LEN, pargin [8]) ; + if (len == -1) + { + mexErrMsgTxt ("multname must be char") ; + } + } + + // set the Descriptor + OK (GrB_Descriptor_new (&desc)) ; + OK (GrB_Descriptor_set (desc, GrB_INP0, atrans ? GrB_TRAN : GxB_DEFAULT)) ; + OK (GrB_Descriptor_set (desc, GrB_INP1, btrans ? GrB_TRAN : GxB_DEFAULT)) ; + OK (GrB_Descriptor_set (desc, GxB_AxB_METHOD, AxB_method)) ; + + // determine the dimensions + OK (GrB_Matrix_nrows (&anrows, A)) ; + OK (GrB_Matrix_ncols (&ancols, A)) ; + OK (GrB_Matrix_nrows (&bnrows, B)) ; + OK (GrB_Matrix_ncols (&bncols, B)) ; + GrB_Index cnrows = (atrans) ? ancols : anrows ; + GrB_Index cncols = (btrans) ? bnrows : bncols ; + + // create the output matrix C + OK (GrB_Matrix_new (&C, GrB_INT64, cnrows, cncols)) ; + OK (GrB_Matrix_set_INT32 (C, C_is_csc, GrB_STORAGE_ORIENTATION_HINT)) ; + + // create the monoid + if (MATCH (addname, "min" )) monoid = GrB_MIN_MONOID_INT64 ; + else if (MATCH (addname, "max" )) monoid = GrB_MAX_MONOID_INT64 ; + else if (MATCH (addname, "plus" )) monoid = GrB_PLUS_MONOID_INT64 ; + else if (MATCH (addname, "times")) monoid = GrB_TIMES_MONOID_INT64 ; + else + { + mexErrMsgTxt ("add not supported") ; + } + + // create the mult operator + if (builtin) + { + + //---------------------------------------------------------------------- + // built-in operator + //---------------------------------------------------------------------- + + if (MATCH (multname, "firsti" )) mult = GxB_FIRSTI_INT64 ; + else if (MATCH (multname, "firsti1" )) mult = GxB_FIRSTI1_INT64 ; + else if (MATCH (multname, "firstj" )) mult = GxB_FIRSTJ_INT64 ; + else if (MATCH (multname, "firstj1" )) mult = GxB_FIRSTJ1_INT64 ; + else if (MATCH (multname, "secondi" )) mult = GxB_SECONDI_INT64 ; + else if (MATCH (multname, "secondi1")) mult = GxB_SECONDI1_INT64 ; + else if (MATCH (multname, "secondj" )) mult = GxB_SECONDJ_INT64 ; + else if (MATCH (multname, "secondj1")) mult = GxB_SECONDJ1_INT64 ; + else + { + mexErrMsgTxt ("mult not supported") ; + } + + } + else + { + + //---------------------------------------------------------------------- + // user-defined operator + //---------------------------------------------------------------------- + + // create the index binary op + int theta ; + if (MATCH (multname, "firsti" )) + { + theta = 0 ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) firsti_theta, + GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, + "firsti_theta", FIRSTI_THETA)) ; + } + else if (MATCH (multname, "firsti1")) + { + theta = 1 ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) firsti_theta, + GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, + "firsti_theta", FIRSTI_THETA)) ; + } + else if (MATCH (multname, "firstj" )) + { + theta = 0 ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) firstj_theta, + GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, + "firstj_theta", FIRSTJ_THETA)) ; + } + else if (MATCH (multname, "firstj1")) + { + theta = 1 ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) firstj_theta, + GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, + "firstj_theta", FIRSTJ_THETA)) ; + } + else if (MATCH (multname, "secondi" )) + { + theta = 0 ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) secondi_theta, + GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, + "secondi_theta", SECONDI_THETA)) ; + } + else if (MATCH (multname, "secondi1")) + { + theta = 1 ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) secondi_theta, + GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, + "secondi_theta", SECONDI_THETA)) ; + } + else if (MATCH (multname, "secondj" )) + { + theta = 0 ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) secondj_theta, + GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, + "secondj_theta", SECONDJ_THETA)) ; + } + else if (MATCH (multname, "secondj1")) + { + theta = 1 ; + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) secondj_theta, + GrB_INT64, GrB_FP64, GrB_FP64, GrB_INT64, + "secondj_theta", SECONDJ_THETA)) ; + } + else + { + mexErrMsgTxt ("mult not supported") ; + } + + // create the mult binary op + OK (GrB_Scalar_new (&Theta, GrB_INT64)) ; + OK (GrB_Scalar_setElement_INT64 (Theta, theta)) ; + OK (GxB_BinaryOp_new_IndexOp (&mult, Iop, Theta)) ; + } + + // create the semiring + OK (GrB_Semiring_new (&semiring, monoid, mult)) ; + // GxB_print (semiring, 5) ; + + // C = A*B, A'*B, A*B', or A'*B' + OK (GrB_mxm (C, NULL, NULL, semiring, A, B, desc)) ; + + // return C + pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C AxB idx result", true) ; + FREE_ALL ; +} + diff --git a/Test/GB_mex_Matrix_extract_UDT.c b/Test/GB_mex_Matrix_extract_UDT.c new file mode 100644 index 0000000000..fb68401b95 --- /dev/null +++ b/Test/GB_mex_Matrix_extract_UDT.c @@ -0,0 +1,176 @@ +//------------------------------------------------------------------------------ +// GB_mex_Matrix_extract_UDT: interface for C = accum (C,A(I,J)) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" +#include "GB_mex_errors.h" + +#define USAGE "C = GB_mex_Matrix_extract (C, Mask, accum, A, I, J, desc, hack)" + +#define FREE_ALL \ +{ \ + GrB_Matrix_free_(&C) ; \ + GrB_Matrix_free_(&C2) ; \ + GrB_Matrix_free_(&Mask) ; \ + GrB_Matrix_free_(&A) ; \ + GrB_Matrix_free_(&A2) ; \ + GrB_free (&mydouble) ; \ + GrB_free (&castdouble) ; \ + GrB_free (&castback) ; \ + GrB_Descriptor_free_(&desc) ; \ + GB_mx_put_global (true) ; \ +} + +typedef double my_double ; +void cast_double (my_double *z, double *x) ; +void cast_double (my_double *z, double *x) { *z = (my_double) *x ; } +void cast_back (double *z, my_double *x) ; +void cast_back (double *z, my_double *x) { *z = (double) *x ; } + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + GrB_Info info = GrB_SUCCESS ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix C = NULL ; + GrB_Matrix Mask = NULL ; + GrB_Matrix A = NULL ; + GrB_Descriptor desc = NULL ; + GrB_Index *I = NULL, ni = 0, I_range [3] ; + GrB_Index *J = NULL, nj = 0, J_range [3] ; + bool ignore ; + GrB_Index m, n ; + + GrB_Type mydouble = NULL ; + GrB_UnaryOp castdouble = NULL, castback = NULL ; + GrB_Matrix A2 = NULL, C2 = NULL ; + + // check inputs + if (nargout > 1 || nargin < 6 || nargin > 8) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + // get C (make a deep copy) + C = GB_mx_mxArray_to_Matrix (pargin [0], "C input", true, true) ; + if (C == NULL) + { + FREE_ALL ; + mexErrMsgTxt ("C failed") ; + } + + // get Mask (shallow copy) + Mask = GB_mx_mxArray_to_Matrix (pargin [1], "Mask", false, false) ; + if (Mask == NULL && !mxIsEmpty (pargin [1])) + { + FREE_ALL ; + mexErrMsgTxt ("Mask failed") ; + } + + // get A (shallow copy) + A = GB_mx_mxArray_to_Matrix (pargin [3], "A input", false, true) ; + if (A == NULL) + { + FREE_ALL ; + mexErrMsgTxt ("A failed") ; + } + + // get accum, if present + bool user_complex = (Complex != GxB_FC64) + && (C->type == Complex || A->type == Complex) ; + GrB_BinaryOp accum ; + if (!GB_mx_mxArray_to_BinaryOp (&accum, pargin [2], "accum", + C->type, user_complex)) + { + FREE_ALL ; + mexErrMsgTxt ("accum failed") ; + } + + // get I + if (!GB_mx_mxArray_to_indices (&I, pargin [4], &ni, I_range, &ignore)) + { + FREE_ALL ; + mexErrMsgTxt ("I failed") ; + } + + // get J + if (!GB_mx_mxArray_to_indices (&J, pargin [5], &nj, J_range, &ignore)) + { + FREE_ALL ; + mexErrMsgTxt ("J failed") ; + } + + // get desc + if (!GB_mx_mxArray_to_Descriptor (&desc, PARGIN (6), "desc")) + { + FREE_ALL ; + mexErrMsgTxt ("desc failed") ; + } + + // get the hack option + bool GET_SCALAR (7, bool, hack, false) ; + + if (hack) + { + // A = (mydouble) A, if A is double + if (A->type == GrB_FP64 && C->type == GrB_FP64) + { +// printf ("hack A\n") ; + OK (GrB_Type_new (&mydouble, sizeof (double))) ; + OK (GrB_UnaryOp_new (&castdouble, cast_double, mydouble, GrB_FP64)) ; + OK (GrB_UnaryOp_new (&castback, cast_back, GrB_FP64, mydouble)) ; + OK (GrB_Matrix_nrows (&m, A)) ; + OK (GrB_Matrix_ncols (&n, A)) ; +// OK (GxB_print (A, 2)) ; + OK (GrB_Matrix_new (&A2, mydouble, m, n)) ; + OK (GrB_apply (A2, NULL, NULL, castdouble, A, NULL)) ; + OK (GrB_free (&A)) ; + A = A2 ; + A2 = NULL ; + +// OK (GxB_print (C, 2)) ; + OK (GrB_Matrix_nrows (&m, C)) ; + OK (GrB_Matrix_ncols (&n, C)) ; + OK (GrB_Matrix_new (&C2, mydouble, m, n)) ; + OK (GrB_apply (C2, NULL, NULL, castdouble, C, NULL)) ; + OK (GrB_free (&C)) ; + C = C2 ; + C2 = NULL ; + } + } + + // C = accum (C,A(I,J)) +// printf ("do exttract:\n") ; +// OK (GxB_print (Mask, 2)) ; +// OK (GxB_print (C, 2)) ; +// OK (GxB_print (A, 2)) ; + OK (GrB_Matrix_extract_(C, Mask, accum, A, I, ni, J, nj, desc)) ; + + if (C->type == mydouble) + { + OK (GrB_Matrix_nrows (&m, C)) ; + OK (GrB_Matrix_ncols (&n, C)) ; + OK (GrB_Matrix_new (&C2, GrB_FP64, m, n)) ; + OK (GrB_apply (C2, NULL, NULL, castback, C, NULL)) ; + OK (GrB_free (&C)) ; + C = C2 ; + C2 = NULL ; + } + + // return C as a struct and free the GraphBLAS C + pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C output", true) ; + + FREE_ALL ; +} + diff --git a/Test/GB_mex_Matrix_sort.c b/Test/GB_mex_Matrix_sort.c index 7d070f12f0..60b834456c 100644 --- a/Test/GB_mex_Matrix_sort.c +++ b/Test/GB_mex_Matrix_sort.c @@ -17,10 +17,14 @@ GrB_Matrix_free_(&A) ; \ GrB_Matrix_free_(&P) ; \ GrB_Matrix_free_(&C) ; \ + GrB_free (<) ; \ GrB_Descriptor_free_(&desc) ; \ GB_mx_put_global (true) ; \ } +void my_lt_double (bool *z, double *x, double *y) ; +void my_lt_double (bool *z, double *x, double *y) { (*z) = (*x) < (*y) ; } + void mexFunction ( int nargout, @@ -33,6 +37,7 @@ void mexFunction bool malloc_debug = GB_mx_get_global (true) ; GrB_Matrix A = NULL, C = NULL, P = NULL ; GrB_Descriptor desc = NULL ; + GrB_BinaryOp lt = NULL ; // check inputs if (nargout > 2 || nargin < 2 || nargin > 4) @@ -65,13 +70,23 @@ void mexFunction mexErrMsgTxt ("desc failed") ; } + // get arg1 + int GET_SCALAR (3, int, arg1, false) ; + + if (arg1 < 0 && op == GrB_LT_FP64) + { + // use a user-defined "<" op instead of GrB_LT_FP64 + GrB_BinaryOp_new (<, my_lt_double, GrB_BOOL, GrB_FP64, GrB_FP64) ; + op = lt ; + } + // create C and P GrB_Index nrows, ncols ; GrB_Matrix_nrows (&nrows, A) ; GrB_Matrix_ncols (&ncols, A) ; // P = GB_mex_Matrix_sort (op, A, desc, 1): do not compute C - bool P_only = (nargin == 4 && nargout == 1) ; + bool P_only = (arg1 >= 1 && nargout == 1) ; if (!P_only) { GrB_Matrix_new (&C, A->type, nrows, ncols) ; diff --git a/Test/GB_mex_argmax.c b/Test/GB_mex_argmax.c new file mode 100644 index 0000000000..a738dc322c --- /dev/null +++ b/Test/GB_mex_argmax.c @@ -0,0 +1,350 @@ +//------------------------------------------------------------------------------ +// GB_mex_argmax: compute [x,p]=argmax(A,dim,pr,jit) +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// This is for testing only. See GrB.argmax instead. + +#include "GB_mex.h" +#include "GB_mex_errors.h" + + typedef struct { int64_t k ; double v ; } tuple_kv ; +#define TUPLE_KV \ +"typedef struct { int64_t k ; double v ; } tuple_kv ;" + +void make_tuple_kv (tuple_kv *z, + const double *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) ; +void make_tuple_kv (tuple_kv *z, + const double *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const void *theta) +{ + z->k = (int64_t) jx + 1 ; + z->v = (*x) ; +} + +#define MAKE_TUPLE_KV \ +"void make_tuple_kv (tuple_kv *z, \n" \ +" const double *x, GrB_Index ix, GrB_Index jx, \n" \ +" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const void *theta) \n" \ +"{ \n" \ +" z->k = (int64_t) jx + 1 ; \n" \ +" z->v = (*x) ; \n" \ +"} \n" + + void getv_tuple_kv (double *z, const tuple_kv *x) ; + void getv_tuple_kv (double *z, const tuple_kv *x) { (*z) = x->v ; } +#define GETV_TUPLE_KV \ +"void getv_tuple_kv (double *z, const tuple_kv *x) { (*z) = x->v ; }" + + void getk_tuple_kv (int64_t *z, const tuple_kv *x) ; + void getk_tuple_kv (int64_t *z, const tuple_kv *x) { (*z) = x->k ; } +#define GETK_TUPLE_KV \ +"void getk_tuple_kv (int64_t *z, const tuple_kv *x) { (*z) = x->k ; }" + +void max_tuple_kv (tuple_kv *z, const tuple_kv *x, const tuple_kv *y) ; +void max_tuple_kv (tuple_kv *z, const tuple_kv *x, const tuple_kv *y) +{ + if (x->v > y->v || (x->v == y->v && x->k < y->k)) + { + z->k = x->k ; + z->v = x->v ; + } + else + { + z->k = y->k ; + z->v = y->v ; + } +} + +#define MAX_TUPLE_KV \ +"void max_tuple_kv (tuple_kv *z, const tuple_kv *x, const tuple_kv *y)\n" \ +"{ \n" \ +" if (x->v > y->v || (x->v == y->v && x->k < y->k)) \n" \ +" { \n" \ +" z->k = x->k ; \n" \ +" z->v = x->v ; \n" \ +" } \n" \ +" else \n" \ +" { \n" \ +" z->k = y->k ; \n" \ +" z->v = y->v ; \n" \ +" } \n" \ +"} \n" + +#define USAGE "[x,p] = GB_mex_argmax (A, dim, pr, jit)" + +#define FREE_ALL \ +{ \ + GrB_Matrix_free_(&A) ; \ + GrB_Matrix_free_(&x) ; \ + GrB_Matrix_free_(&p) ; \ + GrB_Type_free (&Tuple) ; \ + GxB_IndexBinaryOp_free (&Iop) ; \ + GrB_BinaryOp_free (&Bop) ; \ + GrB_BinaryOp_free (&MonOp) ; \ + GrB_Monoid_free (&Monoid) ; \ + GrB_Semiring_free (&Semiring) ; \ + GrB_UnaryOp_free (&Getv) ; \ + GrB_UnaryOp_free (&Getk) ; \ + GrB_Matrix_free (&y) ; \ + GrB_Matrix_free (&c) ; \ + GrB_Scalar_free (&Theta) ; \ + GrB_Scalar_free (&Beta) ; \ + GrB_Scalar_free (&Gunk) ; \ + GB_mx_put_global (true) ; \ +} + +#define FREE_WORK FREE_ALL + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + GrB_Info info = GrB_SUCCESS ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL ; + + GrB_Type Tuple = NULL ; + GxB_IndexBinaryOp Iop = NULL ; + GrB_BinaryOp Bop = NULL, MonOp = NULL ; + GrB_Monoid Monoid = NULL ; + GrB_Semiring Semiring = NULL ; + GrB_Scalar Theta = NULL, Beta = NULL, Gunk = NULL ; + GrB_UnaryOp Getv = NULL, Getk = NULL ; + GrB_Matrix x = NULL, p = NULL, c = NULL, y = NULL, z = NULL ; + GrB_Scalar s = NULL ; + + GB_WERK (USAGE) ; + + // check inputs + if (nargout > 2 || nargin < 1 || nargin > 4) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + #define GET_DEEP_COPY ; + #define FREE_DEEP_COPY ; + + // get A (shallow copy) + A = GB_mx_mxArray_to_Matrix (pargin [0], "A", false, true) ; + if (A == NULL) + { + FREE_ALL ; + mexErrMsgTxt ("failed") ; + } + GrB_Index nrows, ncols ; + OK (GrB_Matrix_nrows (&nrows, A)) ; + OK (GrB_Matrix_ncols (&ncols, A)) ; + + if (A->type != GrB_FP64) + { + FREE_ALL ; + mexErrMsgTxt ("A must be double") ; + } + + // get dim, default is 2 + int dim = (nargin > 1) ? ((int) mxGetScalar (pargin [1])) : 2 ; + if (!(dim == 1 || dim == 2)) + { + dim = 1 ; + } + + // get pr flag, default is false + bool pr = (nargin > 2) ? ((bool) mxGetScalar (pargin [2])) : false ; + + // get jit flag, default is true + bool jit = (nargin > 2) ? ((bool) mxGetScalar (pargin [3])) : true ; + + //-------------------------------------------------------------------------- + // create the types and operators + //-------------------------------------------------------------------------- + + OK (GrB_Scalar_new (&Theta, GrB_BOOL)) ; + OK (GrB_Scalar_setElement_BOOL (Theta, 1)) ; + if (jit) + { + OK (GxB_Type_new (&Tuple, sizeof (tuple_kv), "tuple_kv", TUPLE_KV)) ; + METHOD (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_tuple_kv, + Tuple, GrB_FP64, GrB_BOOL, GrB_BOOL, + "make_tuple_kv", MAKE_TUPLE_KV)) ; + } + else + { + OK (GrB_Type_new (&Tuple, sizeof (tuple_kv))) ; + METHOD (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) make_tuple_kv, + Tuple, GrB_FP64, GrB_BOOL, GrB_BOOL, + NULL, NULL)) ; + } + OK (GxB_IndexBinaryOp_wait (Iop, GrB_MATERIALIZE)) ; + char *error ; + OK (GxB_IndexBinaryOp_error (&error, Iop)) ; + if (error == NULL || strlen (error) > 0) + { + mexErrMsgTxt ("index binary op failed") ; + } + METHOD (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + if (pr) + { + // printf ("\njit enabled: %d\n", jit) ; + OK (GxB_IndexBinaryOp_fprint (Iop, "make_tuple_kv idx", 5, stdout)) ; + } + + tuple_kv id ; + memset (&id, 0, sizeof (tuple_kv)) ; + id.k = INT64_MAX ; + id.v = (double) (-INFINITY) ; + + if (jit) + { + OK (GxB_BinaryOp_new (&MonOp, (GxB_binary_function) max_tuple_kv, + Tuple, Tuple, Tuple, "max_tuple_kv", MAX_TUPLE_KV)) ; + } + else + { + OK (GrB_BinaryOp_new (&MonOp, (GxB_binary_function) max_tuple_kv, + Tuple, Tuple, Tuple)) ; + } + + OK (GrB_Monoid_new_UDT (&Monoid, MonOp, &id)) ; + OK (GrB_Semiring_new (&Semiring, Monoid, Bop)) ; + + size_t namelen = 0 ; + OK (GrB_Semiring_get_SIZE (Semiring, &namelen, GxB_THETA_TYPE_STRING)) ; + printf ("theta namelen: %d\n", (int) namelen) ; + CHECK (namelen == strlen ("GrB_BOOL") + 1) ; + char theta_type_name [256] ; + theta_type_name [0] = '\0' ; + OK (GrB_Semiring_get_String (Semiring, theta_type_name, + GxB_THETA_TYPE_STRING)) ; + printf ("theta type: [%s]\n", theta_type_name) ; + CHECK (strcmp (theta_type_name, "GrB_BOOL") == 0) ; + + if (jit) + { + OK (GxB_UnaryOp_new (&Getk, (GxB_unary_function) getk_tuple_kv, + GrB_INT64, Tuple, "getk_tuple_kv", GETK_TUPLE_KV)) ; + OK (GxB_UnaryOp_new (&Getv, (GxB_unary_function) getv_tuple_kv, + GrB_FP64, Tuple, "getv_tuple_kv", GETV_TUPLE_KV)) ; + } + else + { + OK (GrB_UnaryOp_new (&Getk, (GxB_unary_function) getk_tuple_kv, + GrB_INT64, Tuple)) ; + OK (GrB_UnaryOp_new (&Getv, (GxB_unary_function) getv_tuple_kv, + GrB_FP64, Tuple)) ; + } + + if (pr) + { + OK (GxB_Semiring_fprint (Semiring, "(max,maketuple)", 5, stdout)) ; + OK (GxB_UnaryOp_fprint (Getk, "Getk", 5, stdout)) ; + OK (GxB_UnaryOp_fprint (Getv, "Getv", 5, stdout)) ; + } + + //-------------------------------------------------------------------------- + // test get/set + //-------------------------------------------------------------------------- + + OK (GrB_Scalar_new (&Beta, GrB_INT64)) ; + OK (GxB_IndexBinaryOp_get_Scalar (Iop, Beta, GrB_OUTP_TYPE_CODE)) ; + int32_t code = -1; + OK (GrB_Scalar_extractElement_INT32 (&code, Beta)) ; + // printf ("code %d\n", code) ; + CHECK (code == GrB_UDT_CODE) ; + code = 62 ; + OK (GxB_IndexBinaryOp_get_INT32 (Iop, &code, GrB_OUTP_TYPE_CODE)) ; + CHECK (code == GrB_UDT_CODE) ; + size_t name_size ; + OK (GxB_IndexBinaryOp_get_SIZE (Iop, &name_size, GxB_JIT_C_NAME)) ; + // printf ("name size %d\n", (int) name_size) ; + char name [256] ; + OK (GxB_IndexBinaryOp_get_String (Iop, &name, GxB_JIT_C_NAME)) ; + // printf ("name [%s]\n", name) ; + int expected = GrB_INVALID_VALUE ; + ERR (GxB_IndexBinaryOp_get_VOID (Iop, &name, GxB_JIT_C_NAME)) ; + + OK (GxB_IndexBinaryOp_set_String (Iop, "my index binop", GrB_NAME)) ; + name [0] = '\0' ; + OK (GxB_IndexBinaryOp_get_String (Iop, name, GrB_NAME)) ; + // printf ("name [%s]\n", name) ; + CHECK (strcmp (name, "my index binop") == 0) ; + + expected = GrB_DOMAIN_MISMATCH ; + OK (GrB_Scalar_new (&Gunk, Tuple)) ; + ERR (GrB_BinaryOp_get_Scalar (Bop, Gunk, GxB_THETA)) ; + + //-------------------------------------------------------------------------- + // compute [x,p] = argmax (A,dim) + //-------------------------------------------------------------------------- + + if (dim == 1) + { + + //------------------------------------------------------------------ + // argmin/max of each column of A + //------------------------------------------------------------------ + + // y = zeros (nrows,1) ; + OK (GrB_Matrix_new (&y, GrB_BOOL, nrows, 1)) ; + OK (GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, + GrB_ALL, nrows, GrB_ALL, 1, NULL)) ; + + // c = A'*y using the argmin/argmax semiring + OK (GrB_Matrix_new (&c, Tuple, ncols, 1)) ; + OK (GrB_mxm (c, NULL, NULL, Semiring, A, y, GrB_DESC_T0)) ; + + // create x and p + OK (GrB_Matrix_new (&x, GrB_FP64, ncols, 1)) ; + OK (GrB_Matrix_new (&p, GrB_INT64, ncols, 1)) ; + + } + else + { + + //------------------------------------------------------------------ + // argmin/max of each row of A + //------------------------------------------------------------------ + + // y = zeros (ncols,1) ; + OK (GrB_Matrix_new (&y, GrB_BOOL, ncols, 1)) ; + OK (GrB_Matrix_assign_BOOL (y, NULL, NULL, 0, + GrB_ALL, ncols, GrB_ALL, 1, NULL)) ; + + // c = A*y using the argmin/argmax semiring + OK (GrB_Matrix_new (&c, Tuple, nrows, 1)) ; + OK (GrB_mxm (c, NULL, NULL, Semiring, A, y, NULL)) ; + + // create x and p + OK (GrB_Matrix_new (&x, GrB_FP64, nrows, 1)) ; + OK (GrB_Matrix_new (&p, GrB_INT64, nrows, 1)) ; + } + + // x = getv (c) + OK (GrB_Matrix_apply (x, NULL, NULL, Getv, c, NULL)) ; + // p = getk (c) + OK (GrB_Matrix_apply (p, NULL, NULL, Getk, c, NULL)) ; + + //-------------------------------------------------------------------------- + // return x and p as MATLAB sparse matrices + //-------------------------------------------------------------------------- + + pargout [0] = GB_mx_Matrix_to_mxArray (&x, "x result", false) ; + pargout [1] = GB_mx_Matrix_to_mxArray (&p, "p result", false) ; + FREE_ALL ; +} + diff --git a/Test/GB_mex_context_test.c b/Test/GB_mex_context_test.c index c871e5da4e..6657c81d33 100644 --- a/Test/GB_mex_context_test.c +++ b/Test/GB_mex_context_test.c @@ -61,6 +61,7 @@ void mexFunction GxB_Context Context = NULL ; METHOD (GxB_Context_new (&Context)) ; OK (GxB_Context_set (Context, GxB_NTHREADS, 5)) ; + OK (GxB_Context_set_String (Context, "my context", GrB_NAME)) ; OK (GxB_Context_fprint (Context, "context", 3, stdout)) ; int nth = 0 ; OK (GxB_Context_get (GxB_CONTEXT_WORLD, GxB_NTHREADS, &nth)) ; diff --git a/Test/GB_mex_kron_idx.c b/Test/GB_mex_kron_idx.c new file mode 100644 index 0000000000..208380963b --- /dev/null +++ b/Test/GB_mex_kron_idx.c @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------ +// GB_mex_kron_idx: C = kron(A,B) with a user-defined index binary op +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" +#include "GB_mex_errors.h" + +#define USAGE "C = GB_mex_kron_idx (A, B, atrans, btrans, C_is_csc)" + +void mykronidx (double *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) ; + +void mykronidx (double *z, + const void *x, GrB_Index ix, GrB_Index jx, + const void *y, GrB_Index iy, GrB_Index jy, + const int64_t *theta) +{ + (*z) = (double) ( + (ix+1) * 1000000 + + (jx+1) * 10000 + + (iy+1) * 100 + + (jy+1)) ; +} + +#define MYKRONIDX_DEFN \ +"void mykronidx (double *z, \n" \ +" const void *x, GrB_Index ix, GrB_Index jx, \n" \ +" const void *y, GrB_Index iy, GrB_Index jy, \n" \ +" const int64_t *theta) \n" \ +"{ \n" \ +" (*z) = (double) ( \n" \ +" (ix+1) * 1000000 + \n" \ +" (jx+1) * 10000 + \n" \ +" (iy+1) * 100 + \n" \ +" (jy+1)) ; \n" \ +"}" + +#define FREE_ALL \ +{ \ + GrB_Matrix_free_(&A) ; \ + GrB_Matrix_free_(&B) ; \ + GrB_Matrix_free_(&C) ; \ + GrB_Scalar_free_(&Theta) ; \ + GrB_BinaryOp_free (&mult) ; \ + GxB_IndexBinaryOp_free (&Iop) ; \ + GrB_Descriptor_free (&desc) ; \ + GB_mx_put_global (true) ; \ +} + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + GrB_Info info = GrB_SUCCESS ; + bool malloc_debug = GB_mx_get_global (true) ; + GrB_Matrix A = NULL ; + GrB_Matrix B = NULL ; + GrB_Matrix C = NULL ; + GrB_Scalar Theta = NULL ; + GrB_BinaryOp mult = NULL ; + GxB_IndexBinaryOp Iop = NULL ; + GrB_Descriptor desc = NULL ; + GrB_Index anrows = 0, ancols = 0, bnrows = 0, bncols = 0 ; + + // check inputs + if (nargout > 1 || nargin < 2 || nargin > 5) + { + mexErrMsgTxt ("Usage: " USAGE) ; + } + + #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") ; + } + + // get B (shallow copy) + B = GB_mx_mxArray_to_Matrix (pargin [1], "B input", false, true) ; + if (B == NULL) + { + FREE_ALL ; + mexErrMsgTxt ("B failed") ; + } + + // get the atrans option + bool GET_SCALAR (2, bool, atrans, false) ; + + // get the btrans option + bool GET_SCALAR (3, bool, btrans, false) ; + + // get the C_is_csc option + bool GET_SCALAR (4, bool, C_is_csc, true) ; + + // set the Descriptor + OK (GrB_Descriptor_new (&desc)) ; + OK (GrB_Descriptor_set (desc, GrB_INP0, atrans ? GrB_TRAN : GxB_DEFAULT)) ; + OK (GrB_Descriptor_set (desc, GrB_INP1, btrans ? GrB_TRAN : GxB_DEFAULT)) ; + + // determine the dimensions + OK (GrB_Matrix_nrows (&anrows, A)) ; + OK (GrB_Matrix_ncols (&ancols, A)) ; + OK (GrB_Matrix_nrows (&bnrows, B)) ; + OK (GrB_Matrix_ncols (&bncols, B)) ; + GrB_Index cnrows = ((atrans) ? ancols : anrows) + * ((btrans) ? bncols : bnrows) ; + GrB_Index cncols = ((atrans) ? anrows : ancols) + * ((btrans) ? bnrows : bncols) ; + + // create the output matrix C + OK (GrB_Matrix_new (&C, GrB_FP64, cnrows, cncols)) ; + OK (GrB_Matrix_set_INT32 (C, C_is_csc, GrB_STORAGE_ORIENTATION_HINT)) ; + + // create the index binary op + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) mykronidx, + GrB_FP64, GrB_FP64, GrB_FP64, GrB_INT64, + "mykronidx", MYKRONIDX_DEFN)) ; + + // create the mult binary op + int64_t theta = 0 ; + OK (GrB_Scalar_new (&Theta, GrB_INT64)) ; + OK (GrB_Scalar_setElement_INT64 (Theta, theta)) ; + OK (GxB_BinaryOp_new_IndexOp (&mult, Iop, Theta)) ; + + // C = kron(A,B) + METHOD (GrB_Matrix_kronecker_BinaryOp_ (C, NULL, NULL, mult, A, B, desc)) ; + + // return C as a MATLAB sparse matrix and free the GraphBLAS C + pargout [0] = GB_mx_Matrix_to_mxArray (&C, "C output", false) ; + + FREE_ALL ; +} + diff --git a/Test/GB_mex_rdiv.c b/Test/GB_mex_rdiv.c index 5a1bdba3c0..5d61b2bd94 100644 --- a/Test/GB_mex_rdiv.c +++ b/Test/GB_mex_rdiv.c @@ -56,7 +56,7 @@ GrB_BinaryOp My_rdiv = NULL ; "{\n" \ " // escape this quote: \"\n" \ " /* escape this backslash \\ */\n" \ -" /* modified for GrB 9.3.0 */\n" \ +" /* revised for GrB 9.4.1 */\n" \ " (*z) = (*y) / (*x) ;\n" \ "}" diff --git a/Test/GB_mex_select.c b/Test/GB_mex_select.c index 9dff0c6c50..fefc88488d 100644 --- a/Test/GB_mex_select.c +++ b/Test/GB_mex_select.c @@ -67,7 +67,7 @@ void mexFunction #define GET_DEEP_COPY \ C = GB_mx_mxArray_to_Matrix (pargin [0], "C input", true, true) ; \ if (nargin > 7 && C != NULL) C->nvec_nonempty = -1 ; \ - GrB_set (C, false, GxB_HYPER_HASH) ; + GrB_set (C, false, (GrB_Field) GxB_HYPER_HASH) ; #define FREE_DEEP_COPY GrB_Matrix_free_(&C) ; GET_DEEP_COPY ; if (C == NULL) diff --git a/Test/GB_mex_test0.c b/Test/GB_mex_test0.c index c0fcb37635..3889ca6a42 100644 --- a/Test/GB_mex_test0.c +++ b/Test/GB_mex_test0.c @@ -850,7 +850,7 @@ void mexFunction bool scalar_is_full = GB_IS_FULL (a_scalar) ; if (!scalar_is_full) { - a_scalar->i [0] = GB_FLIP (0) ; + a_scalar->i [0] = GB_ZOMBIE (0) ; a_scalar->nzombies = 1 ; } @@ -3999,7 +3999,7 @@ void mexFunction Werk->where = "GB_Monoid_check" ; - info = GB_Monoid_check (NULL, "null monoid", G3, ff) ; + info = GB_Monoid_check (NULL, "null monoid", G3, ff, false) ; CHECK (info == GrB_NULL_POINTER) ; CHECK (monoidb == NULL) ; @@ -4007,26 +4007,29 @@ void mexFunction CHECK (monoidb != NULL) ; Werk->where = "GB_Monoid_check" ; - OK (GB_Monoid_check (monoidb, "monoidb ok", G3, ff)) ; + OK (GB_Monoid_check (monoidb, "monoidb ok", G3, ff, false)) ; expected = GrB_UNINITIALIZED_OBJECT ; monoidb->magic = GB_FREED ; - ERR (GB_Monoid_check (monoidb, "monoidb freed", G1, ff)) ; + ERR (GB_Monoid_check (monoidb, "monoidb freed", G1, ff, false)) ; monoidb->magic = GB_MAGIC ; expected = GrB_INVALID_OBJECT ; monoidb->op = NULL ; - ERR (GB_Monoid_check (monoidb, "monoidb invalid op", G1, ff)) ; + ERR (GB_Monoid_check (monoidb, "monoidb invalid op", G1, ff, false)) ; monoidb->op = GrB_TIMES_INT32 ; monoidb->op = GrB_EQ_INT32 ; - ERR (GB_Monoid_check (monoidb, "monoidb invalid op domains", G1, ff)) ; + ERR (GB_Monoid_check (monoidb, "monoidb invalid op domains", G1, ff, + false)) ; monoidb->op = GrB_TIMES_INT32 ; - OK (GB_Monoid_check (Complex_plus_monoid, "complex plus monoid", G3, ff)) ; - OK (GB_Monoid_check (Complex_times_monoid, "complex times monoid", G3, ff)) ; + OK (GB_Monoid_check (Complex_plus_monoid, "complex plus monoid", G3, ff, + false)) ; + OK (GB_Monoid_check (Complex_times_monoid, "complex times monoid", G3, ff, + false)) ; printf ("\nAll GB_Monoid_check tests passed (errors expected)\n") ; @@ -4863,7 +4866,7 @@ void mexFunction ERR (GB_Type_check (Tcrud, "", G0, NULL)) ; ERR (GB_UnaryOp_check (op1crud, "", G0, NULL)) ; ERR (GB_BinaryOp_check (op2crud, "", G0, NULL)) ; - ERR (GB_Monoid_check (monoid_crud, "", G0, NULL)) ; + ERR (GB_Monoid_check (monoid_crud, "", G0, NULL, false)) ; ERR (GB_Semiring_check (semicrud, "", G0, NULL)) ; ERR (GB_Vector_check (vcrud, "", G0, NULL)) ; ERR (GB_Matrix_check (Acrud, "", G0, NULL)) ; @@ -4892,7 +4895,7 @@ void mexFunction OK (GB_Type_check (Tcrud, "", G0, NULL)) ; OK (GB_UnaryOp_check (op1crud, "", G0, NULL)) ; OK (GB_BinaryOp_check (op2crud, "", G0, NULL)) ; - OK (GB_Monoid_check (monoid_crud, "", G0, NULL)) ; + OK (GB_Monoid_check (monoid_crud, "", G0, NULL, false)) ; OK (GB_Semiring_check (semicrud, "", G0, NULL)) ; OK (GB_Vector_check (vcrud, "", G0, NULL)) ; OK (GB_Matrix_check (Acrud, "", G0, NULL)) ; diff --git a/Test/GB_mex_test1.c b/Test/GB_mex_test1.c index 1deaef1692..ed70f90701 100644 --- a/Test/GB_mex_test1.c +++ b/Test/GB_mex_test1.c @@ -12,8 +12,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test1" - GrB_Info ack (int64_t *stuff, GrB_Matrix GunkIt) ; GrB_Info ack (int64_t *stuff, GrB_Matrix GunkIt) @@ -144,7 +142,8 @@ void mexFunction OK (GrB_Monoid_new_UINT16_(&m, GrB_PLUS_UINT16, (uint16_t) 0)) ; OK (GrB_Monoid_wait_(m, GrB_MATERIALIZE)) ; - OK (GB_Monoid_check (m, "plus uint16 monoid", GxB_COMPLETE, stdout)) ; + OK (GB_Monoid_check (m, "plus uint16 monoid", GxB_COMPLETE, stdout, + false)) ; uint16_t id ; OK (GxB_Monoid_identity (&id, m)) ; printf ("id is %d\n", id) ; @@ -156,7 +155,7 @@ void mexFunction m->identity = NULL ; GrB_Info expected = GrB_INVALID_OBJECT ; ERR (GB_Monoid_check (m, "mangled monoid, no identity", GxB_COMPLETE, - stdout)) ; + stdout, false)) ; m->identity = save_identity ; GrB_Monoid_free_(&m) ; @@ -164,7 +163,8 @@ void mexFunction int16_t id0 = INT16_MIN ; GrB_Monoid_new_INT16_(&m, GrB_MAX_INT16, id0) ; - OK (GB_Monoid_check (m, "max int16 monoid", GxB_COMPLETE, stdout)) ; + OK (GB_Monoid_check (m, "max int16 monoid", GxB_COMPLETE, stdout, + false)) ; int16_t id1 ; OK (GxB_Monoid_identity (&id1, m)) ; printf ("id1 is %d\n", id1) ; @@ -178,7 +178,8 @@ void mexFunction GrB_Monoid mm ; OK (GxB_Semiring_add (&mm, sem)) ; - OK (GB_Monoid_check (mm, "sem mm", GxB_COMPLETE, stdout)) ; + OK (GB_Monoid_check (mm, "sem mm", GxB_COMPLETE, stdout, + false)) ; OK (GxB_Semiring_multiply (&op, sem)) ; OK (GB_BinaryOp_check (op, "sem mult", GxB_COMPLETE, stdout)) ; diff --git a/Test/GB_mex_test10.c b/Test/GB_mex_test10.c index a0f3ee7d96..140bac5224 100644 --- a/Test/GB_mex_test10.c +++ b/Test/GB_mex_test10.c @@ -10,8 +10,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test10" - void mexFunction ( int nargout, diff --git a/Test/GB_mex_test11.c b/Test/GB_mex_test11.c index 9b5cb7d9e3..25065d5866 100644 --- a/Test/GB_mex_test11.c +++ b/Test/GB_mex_test11.c @@ -12,8 +12,6 @@ #include "../Source/jitifyer/GB_file.h" #include "../Source/jitifyer/GB_jitifyer.h" -#define USAGE "GB_mex_test11" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; @@ -89,6 +87,7 @@ void mexFunction if (jit_enabled) { + printf ("JIT enabled:\n") ; OK (GrB_Matrix_new (&A, GrB_FP32, 3, 4)) ; OK (GrB_assign (A, NULL, NULL, 1, GrB_ALL, 3, GrB_ALL, 4, NULL)) ; @@ -258,8 +257,9 @@ if (jit_enabled) OK (GrB_free (&MyType)) ; printf ("\n--------------------------- intentional compile errors:\n") ; - expected = GrB_INVALID_VALUE ; - ERR (GxB_Type_new (&MyType, 0, "mytype2", "garbage")) ; + + expected = GxB_JIT_ERROR ; + ERR (GxB_Type_new (&MyType, 0, "mytype2_crud", "garbage")) ; CHECK (MyType == NULL) ; printf ("\n-------------------------------------------------------\n\n") ; @@ -276,8 +276,7 @@ if (jit_enabled) printf ("new error log: [%s]\n", t) ; CHECK (MATCH (t, "/tmp/grb_error_log.txt")) ; - expected = GrB_INVALID_VALUE ; - ERR (GxB_Type_new (&MyType, 0, "mytype2", "garbage")) ; + ERR (GxB_Type_new (&MyType, 0, "mytype2_crud", "garbage")) ; CHECK (MyType == NULL) ; printf ("\n------------------------ compile error log (intentional):\n") ; @@ -291,8 +290,7 @@ if (jit_enabled) CHECK (MATCH (s, "/tmp/grberr2.txt")) ; OK (GxB_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; - expected = GrB_INVALID_VALUE ; - ERR (GxB_Type_new (&MyType, 0, "mytype2", "more garbage")) ; + ERR (GxB_Type_new (&MyType, 0, "mytype2_crud", "more garbage")) ; CHECK (MyType == NULL) ; printf ("\n------------------------ compile error log (intentional):\n") ; @@ -478,6 +476,8 @@ if (jit_enabled) if (jit_enabled) { + printf ("JIT enabled:\n") ; + bool ok = GB_file_mkdir (NULL) ; CHECK (!ok) ; ok = GB_file_unlock_and_close (NULL, NULL) ; diff --git a/Test/GB_mex_test12.c b/Test/GB_mex_test12.c index 85519ae8ce..72eebd094a 100644 --- a/Test/GB_mex_test12.c +++ b/Test/GB_mex_test12.c @@ -10,8 +10,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test12" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test13.c b/Test/GB_mex_test13.c index 1e7872a342..d64a582b03 100644 --- a/Test/GB_mex_test13.c +++ b/Test/GB_mex_test13.c @@ -10,8 +10,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test13" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test14.c b/Test/GB_mex_test14.c index 033260a513..505b3bbc92 100644 --- a/Test/GB_mex_test14.c +++ b/Test/GB_mex_test14.c @@ -10,8 +10,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test14" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test15.c b/Test/GB_mex_test15.c index 79943df637..a678684cea 100644 --- a/Test/GB_mex_test15.c +++ b/Test/GB_mex_test15.c @@ -10,8 +10,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test15" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test16.c b/Test/GB_mex_test16.c index 59a12474dd..e424589aa6 100644 --- a/Test/GB_mex_test16.c +++ b/Test/GB_mex_test16.c @@ -11,8 +11,6 @@ #include "GB_mex_errors.h" #include "../Source/jitifyer/GB_stringify.h" -#define USAGE "GB_mex_test16" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; @@ -123,8 +121,11 @@ void mexFunction code = GB_encodify_reduce (&e, &suffix, GB_JIT_KERNEL_REDUCE, mon, A) ; CHECK (code == UINT64_MAX) ; - code = GB_encodify_assign (&e, &suffix, 0, C, false, 0, 0, NULL, - false, false, mult, A, NULL, 0) ; + code = GB_encodify_assign (&e, &suffix, /* kcode: */ 0, C, + /* C_replace: */ false, /* Ikind: */ 0, /* Jkind: */ 0, /* M: */ NULL, + /* Mask_comp: */ false, /* Mask_struct: */ false, + /* accum: */ mult, A, /* scalar_type: */ NULL, /* S: */ NULL, + /* assign_kind: */ 0) ; CHECK (code == UINT64_MAX) ; code = GB_encodify_build (&e, &suffix, 0, mult, GrB_FP32, GrB_FP32) ; diff --git a/Test/GB_mex_test17.c b/Test/GB_mex_test17.c index 7c8bff4087..3585116953 100644 --- a/Test/GB_mex_test17.c +++ b/Test/GB_mex_test17.c @@ -10,8 +10,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test17" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test18.c b/Test/GB_mex_test18.c index 09ef7e1918..1dd1e9b3f4 100644 --- a/Test/GB_mex_test18.c +++ b/Test/GB_mex_test18.c @@ -11,8 +11,6 @@ #include "GB_mex_errors.h" #include "../Source/jitifyer/GB_stringify.h" -#define USAGE "GB_mex_test18" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; @@ -37,37 +35,42 @@ void mexFunction // test GB_demacrofy_name //-------------------------------------------------------------------------- - uint64_t scode ; + uint64_t method_code ; char *name_space, *kname, *suffix ; char name [4096] ; strcpy (name, "bad") ; - info = GB_demacrofy_name (name, &name_space, &kname, &scode, &suffix) ; + info = GB_demacrofy_name (name, &name_space, &kname, &method_code, + &suffix) ; CHECK (info == GrB_NO_VALUE) ; strcpy (name, "alsobad") ; - info = GB_demacrofy_name (name, &name_space, &kname, &scode, &suffix) ; + info = GB_demacrofy_name (name, &name_space, &kname, &method_code, + &suffix) ; CHECK (info == GrB_NO_VALUE) ; strcpy (name, "space__kname__007__suffix") ; - info = GB_demacrofy_name (name, &name_space, &kname, &scode, &suffix) ; + info = GB_demacrofy_name (name, &name_space, &kname, &method_code, + &suffix) ; CHECK (info == GrB_SUCCESS) ; CHECK (MATCH (name_space, "space")) ; CHECK (MATCH (kname, "kname")) ; CHECK (MATCH (suffix, "suffix")) ; - CHECK (scode == 7) ; + CHECK (method_code == 7) ; strcpy (name, "space__kname__mangle__suffix") ; - info = GB_demacrofy_name (name, &name_space, &kname, &scode, &suffix) ; + info = GB_demacrofy_name (name, &name_space, &kname, &method_code, + &suffix) ; CHECK (info == GrB_NO_VALUE) ; strcpy (name, "morespace__morekname__042") ; - info = GB_demacrofy_name (name, &name_space, &kname, &scode, &suffix) ; + info = GB_demacrofy_name (name, &name_space, &kname, &method_code, + &suffix) ; CHECK (info == GrB_SUCCESS) ; CHECK (MATCH (name_space, "morespace")) ; CHECK (MATCH (kname, "morekname")) ; CHECK (suffix == NULL) ; - CHECK (scode == 0x42) ; + CHECK (method_code == 0x42) ; //-------------------------------------------------------------------------- // finalize GraphBLAS diff --git a/Test/GB_mex_test19.c b/Test/GB_mex_test19.c index d832ae960b..effac0ab39 100644 --- a/Test/GB_mex_test19.c +++ b/Test/GB_mex_test19.c @@ -10,8 +10,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test19" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test2.c b/Test/GB_mex_test2.c index 3ce314aa4b..5d15b75e08 100644 --- a/Test/GB_mex_test2.c +++ b/Test/GB_mex_test2.c @@ -12,8 +12,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test2" - typedef struct { int stuff [16] ; @@ -95,7 +93,7 @@ void mexFunction OK (GxB_Matrix_Option_set ((GrB_Matrix) scalar, GxB_SPARSITY_CONTROL, GxB_SPARSE)) ; CHECK (scalar->i != NULL) ; - scalar->i [0] = GB_FLIP (0) ; + scalar->i [0] = GB_ZOMBIE (0) ; scalar->nzombies = 1 ; OK (GxB_Scalar_fprint (scalar, "scalar with zombie", 3, NULL)) ; expected = GrB_NO_VALUE ; diff --git a/Test/GB_mex_test20.c b/Test/GB_mex_test20.c index 1c247dd62c..1babd4db17 100644 --- a/Test/GB_mex_test20.c +++ b/Test/GB_mex_test20.c @@ -11,8 +11,6 @@ #include "GB_mex_errors.h" #include "../Source/mask/GB_mask.h" -#define USAGE "GB_mex_test20" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test21.c b/Test/GB_mex_test21.c index 8c42a5e545..b580e9573e 100644 --- a/Test/GB_mex_test21.c +++ b/Test/GB_mex_test21.c @@ -22,7 +22,6 @@ #include "GB_mex_errors.h" #include "../Source/jitifyer/GB_stringify.h" -#define USAGE "GB_mex_test21" #define HEADER fprintf (fp, "\n\n================================================================================\n") ; #define FREE_ALL ; @@ -74,13 +73,14 @@ void mexFunction const char *a, *cuda_type ; bool user_monoid_atomically ; bool has_cheeseburger = GB_enumify_cuda_atomic (&a, - &user_monoid_atomically, &cuda_type, NULL, 0, sizeof (uint32_t), 0) ; + &user_monoid_atomically, &cuda_type, NULL, GB_USER_binop_code, + sizeof (uint32_t), 0) ; CHECK (!has_cheeseburger) ; CHECK (user_monoid_atomically) ; CHECK (cuda_type == NULL) ; CHECK (a == NULL) ; - uint64_t scode ; + uint64_t method_code ; GrB_Matrix A, B, C, C_iso, H ; OK (GrB_Matrix_new (&A, GrB_BOOL, 5, 5)) ; OK (GrB_Matrix_new (&B, GrB_BOOL, 5, 5)) ; @@ -128,20 +128,20 @@ void mexFunction HEADER ; fprintf (fp, "GB_enumify_ewise / GB_macrofy_ewise, C iso\n") ; printf ("GB_enumify_ewise / GB_macrofy_ewise, C iso\n") ; - GB_enumify_ewise (&scode, false, false, true, /* C_iso: */ true, - /* C_in_iso: */ false, GxB_SPARSE, GrB_BOOL, /* M: */ NULL, - false, false, GrB_LAND, false, A, B) ; -// printf ("ewise scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_ewise (fp, scode, GrB_LAND, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; + GB_enumify_ewise (&method_code, false, false, false, true, + /* C_iso: */ true, /* C_in_iso: */ false, GxB_SPARSE, GrB_BOOL, + /* M: */ NULL, false, false, GrB_LAND, false, false, A, B) ; + GB_macrofy_ewise (fp, method_code, GB_JIT_KERNEL_ADD, + GrB_LAND, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; HEADER ; fprintf (fp, "GB_enumify_ewise / GB_macrofy_ewise, C non iso\n") ; printf ("GB_enumify_ewise / GB_macrofy_ewise, C non iso\n") ; - GB_enumify_ewise (&scode, false, false, true, /* C_iso: */ false, - /* C_in_iso: */ false, GxB_SPARSE, GrB_BOOL, /* M: */ NULL, - false, false, GrB_LAND, false, A, B) ; -// printf ("ewise scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_ewise (fp, scode, GrB_LAND, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; + GB_enumify_ewise (&method_code, false, false, false, true, + /* C_iso: */ false, /* C_in_iso: */ false, GxB_SPARSE, GrB_BOOL, + /* M: */ NULL, false, false, GrB_LAND, false, false, A, B) ; + GB_macrofy_ewise (fp, method_code, GB_JIT_KERNEL_ADD, + GrB_LAND, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; //-------------------------------------------------------------------------- // GB_enumify_mxm / GB_macrofy_mxm @@ -150,31 +150,28 @@ void mexFunction HEADER ; fprintf (fp, "GB_enumify_mxm / GB_macrofy_mxm, C iso\n") ; printf ("GB_enumify_mxm / GB_macrofy_mxm, C iso\n") ; - GB_enumify_mxm (&scode, /* C_iso: */ true, /* C_in_iso: */ true, + GB_enumify_mxm (&method_code, /* C_iso: */ true, /* C_in_iso: */ true, GxB_SPARSE, GrB_BOOL, /* M: */ NULL, false, false, GrB_LAND_LOR_SEMIRING_BOOL, /* flipxy: */ true, A, B) ; -// printf ("mxm scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_mxm (fp, scode, GrB_LAND_LOR_SEMIRING_BOOL, + GB_macrofy_mxm (fp, method_code, GrB_LAND_LOR_SEMIRING_BOOL, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; HEADER ; fprintf (fp, "GB_enumify_mxm / GB_macrofy_mxm, any_pair, flipxy\n") ; printf ("GB_enumify_mxm / GB_macrofy_mxm, any_pair, flipxy\n") ; - GB_enumify_mxm (&scode, /* C_iso: */ true, /* C_in_iso: */ false, + GB_enumify_mxm (&method_code, /* C_iso: */ true, /* C_in_iso: */ false, GxB_SPARSE, GrB_BOOL, /* M: */ NULL, false, false, GxB_ANY_PAIR_BOOL, /* flipxy: */ true, A, B) ; -// printf ("mxm scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_mxm (fp, scode, GxB_ANY_PAIR_BOOL, + GB_macrofy_mxm (fp, method_code, GxB_ANY_PAIR_BOOL, GrB_BOOL, GrB_BOOL, GrB_BOOL) ; HEADER ; fprintf (fp, "GB_enumify_mxm / GB_macrofy_mxm, any_pair fp32\n") ; printf ("GB_enumify_mxm / GB_macrofy_mxm, any_pair fp32\n") ; - GB_enumify_mxm (&scode, /* C_iso: */ false, /* C_in_iso: */ false, + GB_enumify_mxm (&method_code, /* C_iso: */ false, /* C_in_iso: */ false, GxB_SPARSE, GrB_FP32, /* M: */ NULL, false, false, GxB_ANY_PAIR_FP32, /* flipxy: */ true, A, B) ; -// printf ("mxm scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_mxm (fp, scode, GxB_ANY_PAIR_FP32, + GB_macrofy_mxm (fp, method_code, GxB_ANY_PAIR_FP32, GrB_FP32, GrB_FP32, GrB_FP32) ; //-------------------------------------------------------------------------- @@ -196,10 +193,9 @@ void mexFunction fprintf (fp, "GB_enumify_select / GB_macrofy_select: %s\n", op->name) ; printf ("GB_enumify_select / GB_macrofy_select: %s\n", op->name) ; // GxB_print (op, 3) ; - GB_enumify_select (&scode, /* C iso: */ false, /* inplace A: */ false, - op, /* flipij: */ false, A) ; -// printf ("select scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_select (fp, scode, op, GrB_BOOL) ; + GB_enumify_select (&method_code, /* C iso: */ false, + /* inplace A: */ false, op, /* flipij: */ false, A) ; + GB_macrofy_select (fp, method_code, op, GrB_BOOL) ; } HEADER ; @@ -208,11 +204,9 @@ void mexFunction GrB_IndexUnaryOp opi ; OK (GxB_IndexUnaryOp_new (&opi, (GxB_index_unary_function) opi32func, GxB_FC32, GxB_FC32, GxB_FC32, "opi32func", OPI32_DEFN)) ; -// GxB_print (opi, 3) ; - GB_enumify_select (&scode, /* C iso: */ false, /* inplace A: */ false, - opi, /* flipij: */ false, A) ; -// printf ("select scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_select (fp, scode, opi, GxB_FC32) ; + GB_enumify_select (&method_code, /* C iso: */ false, + /* inplace A: */ false, opi, /* flipij: */ false, A) ; + GB_macrofy_select (fp, method_code, opi, GxB_FC32) ; GrB_free (&opi) ; //-------------------------------------------------------------------------- @@ -231,20 +225,22 @@ void mexFunction GrB_UnaryOp op = unops [k] ; fprintf (fp, "GB_enumify_apply / GB_macrofy_apply: %s\n", op->name) ; printf ("GB_enumify_apply / GB_macrofy_apply: %s\n", op->name) ; - GB_enumify_apply (&scode, GxB_SPARSE, true, GrB_INT32, - (GB_Operator) op, false, A) ; -// printf ("apply scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_apply (fp, scode, (GB_Operator) op, GrB_INT32, GrB_INT32) ; + GB_enumify_apply (&method_code, GxB_SPARSE, true, GrB_INT32, + (GB_Operator) op, false, + GB_sparsity (A), true, GrB_INT32, A->iso, A->nzombies) ; + GB_macrofy_apply (fp, method_code, (GB_Operator) op, + GrB_INT32, GrB_INT32) ; } HEADER ; GrB_UnaryOp op1 = GxB_SQRT_FC64 ; fprintf (fp, "GB_enumify_apply / GB_macrofy_apply: %s\n", op1->name) ; printf ("GB_enumify_apply / GB_macrofy_apply: %s\n", op1->name) ; -// printf ("apply scode: %016" PRIx64 "\n", scode) ; - GB_enumify_apply (&scode, GxB_SPARSE, true, GrB_INT32, - (GB_Operator) op1, false, A) ; - GB_macrofy_apply (fp, scode, (GB_Operator) op1, GrB_INT32, GrB_INT32) ; + GB_enumify_apply (&method_code, GxB_SPARSE, true, GrB_INT32, + (GB_Operator) op1, false, + GB_sparsity (A), true, GrB_INT32, A->iso, A->nzombies) ; + GB_macrofy_apply (fp, method_code, (GB_Operator) op1, + GrB_INT32, GrB_INT32) ; //-------------------------------------------------------------------------- // GB_enumify_build / GB_macrofy_build @@ -254,17 +250,15 @@ void mexFunction GrB_BinaryOp op2 = GxB_TIMES_FC32 ; fprintf (fp, "GB_enumify_build / GB_macrofy_build: %s\n", op2->name) ; printf ("GB_enumify_build / GB_macrofy_build: %s\n", op2->name) ; - GB_enumify_build (&scode, op2, GrB_BOOL, GrB_BOOL) ; -// printf ("build scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_build (fp, scode, op2, GrB_BOOL, GrB_BOOL) ; + GB_enumify_build (&method_code, op2, GrB_BOOL, GrB_BOOL) ; + GB_macrofy_build (fp, method_code, op2, GrB_BOOL, GrB_BOOL) ; HEADER ; op2 = GrB_LAND ; fprintf (fp, "GB_enumify_build / GB_macrofy_build: %s\n", op2->name) ; printf ("GB_enumify_build / GB_macrofy_build: %s\n", op2->name) ; - GB_enumify_build (&scode, op2, GxB_FC32, GxB_FC32) ; -// printf ("build scode: %016" PRIx64 "\n", scode) ; - GB_macrofy_build (fp, scode, op2, GxB_FC32, GxB_FC32) ; + GB_enumify_build (&method_code, op2, GxB_FC32, GxB_FC32) ; + GB_macrofy_build (fp, method_code, op2, GxB_FC32, GxB_FC32) ; //-------------------------------------------------------------------------- // GB_enumify_assign / GB_macrofy_assign @@ -276,10 +270,11 @@ void mexFunction "C(lo:hi,lo:hi)=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:hi,lo:hi)=A (assign) \n") ; - GB_enumify_assign (&scode, C, false, GB_RANGE, GB_RANGE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - A, /* scalar_type: */ NULL, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C, false, GB_RANGE, GB_RANGE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + A, /* scalar_type: */ NULL, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -288,10 +283,11 @@ void mexFunction "C(lo:s:hi,lo:s:hi)=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:s:hi,lo:s:hi)=A (assign) \n") ; - GB_enumify_assign (&scode, C, false, GB_STRIDE, GB_STRIDE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - A, /* scalar_type: */ NULL, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C, false, GB_STRIDE, GB_STRIDE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + A, /* scalar_type: */ NULL, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -300,11 +296,11 @@ void mexFunction "C(i,J)=s (row assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(i,J)=s (row assign) \n") ; - GB_enumify_assign (&scode, C, false, GB_ALL, GB_LIST, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ NULL, /* scalar_type: */ GxB_FC32, + GB_enumify_assign (&method_code, C, false, GB_ALL, GB_LIST, /* M: */ NULL, + /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ NULL, /* scalar_type: */ GxB_FC32, /* S: */ NULL, /* assign_kind: */ GB_ROW_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -313,11 +309,11 @@ void mexFunction "C(I,j)=s (col assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(I,j)=s (col assign) \n") ; - GB_enumify_assign (&scode, C, false, GB_LIST, GB_ALL, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ NULL, /* scalar_type: */ GxB_FC32, + GB_enumify_assign (&method_code, C, false, GB_LIST, GB_ALL, /* M: */ NULL, + /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ NULL, /* scalar_type: */ GxB_FC32, /* S: */ NULL, /* assign_kind: */ GB_COL_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -326,10 +322,12 @@ void mexFunction "C_iso(lo:hi,lo:hi)=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C_iso(lo:hi,lo:hi)=A (assign) \n") ; - GB_enumify_assign (&scode, C_iso, false, GB_RANGE, GB_RANGE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ NULL, /* scalar_type: */ GrB_FP32, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C_iso, false, GB_RANGE, GB_RANGE, + /* M: */ NULL, + /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ NULL, /* scalar_type: */ GrB_FP32, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -338,10 +336,11 @@ void mexFunction "C_iso(lo:hi,lo:hi)+=s (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C_iso(lo:hi,lo:hi)+=s (assign) \n") ; - GB_enumify_assign (&scode, C_iso, false, GB_RANGE, GB_RANGE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ NULL, /* scalar_type: */ GrB_FP32, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C_iso, false, GB_RANGE, GB_RANGE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ NULL, /* scalar_type: */ GrB_FP32, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -350,10 +349,11 @@ void mexFunction "C_iso(lo:hi,lo:hi)+=s (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C_iso(lo:hi,lo:hi)+=s (assign) \n") ; - GB_enumify_assign (&scode, C_iso, false, GB_RANGE, GB_RANGE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ NULL, /* scalar_type: */ GrB_INT32, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C_iso, false, GB_RANGE, GB_RANGE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ NULL, /* scalar_type: */ GrB_INT32, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -362,10 +362,11 @@ void mexFunction "C(lo:hi,lo:hi)+=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:hi,lo:hi)+=A (assign) \n") ; - GB_enumify_assign (&scode, C, false, GB_RANGE, GB_RANGE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ H, /* scalar_type: */ NULL, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C, false, GB_RANGE, GB_RANGE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ H, /* scalar_type: */ NULL, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -374,10 +375,11 @@ void mexFunction "C(lo:hi,lo:hi)&=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:hi,lo:hi)&=A (assign) \n") ; - GB_enumify_assign (&scode, C, false, GB_RANGE, GB_RANGE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ A, /* scalar_type: */ NULL, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C, false, GB_RANGE, GB_RANGE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ A, /* scalar_type: */ NULL, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; // accum ztype == ctype @@ -389,10 +391,11 @@ void mexFunction "C(lo:hi,lo:hi)<=A (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C(lo:hi,lo:hi)<=A (assign) \n") ; - GB_enumify_assign (&scode, C, false, GB_RANGE, GB_RANGE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ A, /* scalar_type: */ NULL, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C, false, GB_RANGE, GB_RANGE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ A, /* scalar_type: */ NULL, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; HEADER ; @@ -401,37 +404,19 @@ void mexFunction "C_iso(lo:hi,lo:hi)<=H (assign) \n") ; printf ("GB_enumify_assign / GB_macrofy_assign: " "C_iso(lo:hi,lo:hi)<=H (assign) \n") ; - GB_enumify_assign (&scode, C_iso, false, GB_RANGE, GB_RANGE, /* M: */ NULL, - /* Mask_struct: */ false, /* Mask_comp: */ false, accum, - /* A: */ H, /* scalar_type: */ NULL, /* assign_kind: */ GB_ASSIGN) ; - GB_macrofy_assign (fp, scode, accum, + GB_enumify_assign (&method_code, C_iso, false, GB_RANGE, GB_RANGE, + /* M: */ NULL, /* Mask_comp: */ false, /* Mask_struct: */ false, accum, + /* A: */ H, /* scalar_type: */ NULL, /* S: */ NULL, + /* assign_kind: */ GB_ASSIGN) ; + GB_macrofy_assign (fp, method_code, accum, /* ctype: */ GrB_BOOL, /* atype: */ GrB_BOOL) ; -#if 0 -void GB_enumify_assign // enumerate a GrB_assign problem -( - // output: - uint64_t *scode, // unique encoding of the entire operation - // input: - // C matrix: - GrB_Matrix C, - bool C_replace, - // index types: - int Ikind, // 0: all (no I), 1: range, 2: stride, 3: list - int Jkind, // ditto - // M matrix: - GrB_Matrix M, // may be NULL - bool Mask_struct, // mask is structural - bool Mask_comp, // mask is complemented - // operator: - GrB_BinaryOp accum, // the accum operator (may be NULL) - // A matrix or scalar - GrB_Matrix A, // NULL for scalar assignment - GrB_Type scalar_type, - int assign_kind // 0: assign, 1: subassign, 2: row, 3: col -) -#endif + //-------------------------------------------------------------------------- + // test GB_macrofy_cast_input + //-------------------------------------------------------------------------- + HEADER ; + GB_macrofy_cast_input (fp, "stuff", "zarg", "xargs", "nil", NULL, NULL) ; //-------------------------------------------------------------------------- // finalize GraphBLAS diff --git a/Test/GB_mex_test22.c b/Test/GB_mex_test22.c index 826b16048d..a1dfb0363f 100644 --- a/Test/GB_mex_test22.c +++ b/Test/GB_mex_test22.c @@ -10,8 +10,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test22" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test24.c b/Test/GB_mex_test24.c index 8cca6c6b87..9ff667fbd4 100644 --- a/Test/GB_mex_test24.c +++ b/Test/GB_mex_test24.c @@ -11,8 +11,6 @@ #include "GB_mex_errors.h" #include "../Source/jitifyer/GB_stringify.h" -#define USAGE "GB_mex_test24" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test25.c b/Test/GB_mex_test25.c index 6c2c28379c..2c5900c38c 100644 --- a/Test/GB_mex_test25.c +++ b/Test/GB_mex_test25.c @@ -11,8 +11,6 @@ #include "GB_mex_errors.h" #include "../Source/get_set/GB_get_set.h" -#define USAGE "GB_mex_test25" - #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test26.c b/Test/GB_mex_test26.c index f53aa4cb12..f3a276a27e 100644 --- a/Test/GB_mex_test26.c +++ b/Test/GB_mex_test26.c @@ -10,8 +10,6 @@ #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 ; @@ -301,6 +299,7 @@ void mexFunction CHECK (type->hash != UINT64_MAX) ; printf (" hash: %016lx\n", type->hash) ; + printf (" test user name:\n") ; 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)) ; @@ -308,6 +307,7 @@ void mexFunction 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")) ; + OK (GxB_print (type, 3)) ; expected = GrB_ALREADY_SET ; ERR (GrB_Type_set_String_ (type, "another user name of a type", GrB_NAME)) ; diff --git a/Test/GB_mex_test27.c b/Test/GB_mex_test27.c index 7df6838a33..57c961f2cd 100644 --- a/Test/GB_mex_test27.c +++ b/Test/GB_mex_test27.c @@ -10,8 +10,6 @@ #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 ; @@ -21,7 +19,8 @@ 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) ; \ + printf ("\n%s: %s\n", name, cname) ; \ + OK (GxB_UnaryOp_fprint (op, "unop", 5, stdout)) ; \ OK (GrB_UnaryOp_get_SIZE (op, &size, GrB_NAME)) ; \ CHECK (size == strlen (name) + 1) ; \ GrB_Info info2, info3 ; \ @@ -45,13 +44,11 @@ #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) ; diff --git a/Test/GB_mex_test28.c b/Test/GB_mex_test28.c index 99de723d4f..521aaf965c 100644 --- a/Test/GB_mex_test28.c +++ b/Test/GB_mex_test28.c @@ -10,8 +10,6 @@ #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 ; @@ -22,7 +20,8 @@ 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) ; \ + printf ("\n%s: %s\n", name, cname) ; \ + OK (GxB_BinaryOp_fprint (op, "binop", 5, stdout)) ; \ OK (GrB_BinaryOp_get_SIZE (op, &size, GrB_NAME)) ; \ CHECK (size == strlen (name) + 1) ; \ GrB_Info info2, info3 ; \ @@ -46,13 +45,11 @@ #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) ; diff --git a/Test/GB_mex_test29.c b/Test/GB_mex_test29.c index 2dd2742697..7f52bac712 100644 --- a/Test/GB_mex_test29.c +++ b/Test/GB_mex_test29.c @@ -10,8 +10,6 @@ #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 ; @@ -197,7 +195,7 @@ void mexFunction OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &use_cmake, (GrB_Field) GxB_JIT_USE_CMAKE)) ; printf ("jit cmake %d\n", use_cmake) ; OK (GrB_Global_set_INT32_ (GrB_GLOBAL, 1, (GrB_Field) GxB_JIT_USE_CMAKE)) ; - OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i,(GrB_Field) GxB_JIT_USE_CMAKE)) ; + OK (GrB_Global_get_INT32_ (GrB_GLOBAL, &i,(GrB_Field) GxB_JIT_USE_CMAKE)) ; CHECK (i == 1) ; OK (GrB_Global_set_INT32_ (GrB_GLOBAL, use_cmake, (GrB_Field) GxB_JIT_USE_CMAKE)) ; diff --git a/Test/GB_mex_test3.c b/Test/GB_mex_test3.c index dd26bda547..9fa8a92fb2 100644 --- a/Test/GB_mex_test3.c +++ b/Test/GB_mex_test3.c @@ -561,8 +561,8 @@ void mexFunction OK (GxB_Matrix_fprint (A, "A for C=A", GxB_SHORT, NULL)) ; // C(I,I) = A - OK (GB_bitmap_assign_noM_noaccum (C, true, - I, 2, GB_LIST, NULL, I, 2, GB_LIST, NULL, + OK (GB_bitmap_assign_6 (C, true, + I, 2, 2, GB_LIST, NULL, I, 2, 2, GB_LIST, NULL, false, true, A, NULL, GrB_BOOL, GB_ASSIGN, NULL)) ; OK (GxB_Matrix_fprint (C, "C after C=A", GxB_SHORT, NULL)) ; diff --git a/Test/GB_mex_test30.c b/Test/GB_mex_test30.c index 6e60f60a39..5a306c1d42 100644 --- a/Test/GB_mex_test30.c +++ b/Test/GB_mex_test30.c @@ -10,8 +10,6 @@ #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 ; @@ -23,7 +21,8 @@ CHECK (MATCH (name, opname)) ; \ OK (GrB_IndexUnaryOp_get_String (op, cname, \ (GrB_Field) GxB_JIT_C_NAME)); \ - printf ("%s: %s\n", name, cname) ; \ + printf ("\n%s: %s\n", name, cname) ; \ + OK (GxB_IndexUnaryOp_fprint (op, "idxunop", 5, stdout)) ; \ OK (GrB_IndexUnaryOp_get_SIZE (op, &size, GrB_NAME)) ; \ CHECK (size == strlen (name) + 1) ; \ GrB_Info info2, info3 ; \ @@ -47,7 +46,6 @@ #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, diff --git a/Test/GB_mex_test31.c b/Test/GB_mex_test31.c index bdb37871f2..398f863c62 100644 --- a/Test/GB_mex_test31.c +++ b/Test/GB_mex_test31.c @@ -10,8 +10,6 @@ #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 ; @@ -21,21 +19,23 @@ size_t siz1, siz2, siz3 ; \ OK (GrB_Monoid_get_String (op, name, GrB_NAME)) ; \ CHECK (MATCH (name, opname)) ; \ + printf ("\n%s\n", name) ; \ + OK (GxB_Monoid_fprint (op, "monoid", 5, stdout)) ; \ 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) ; \ + 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) ; \ + 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) ; \ + 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) ; \ @@ -44,13 +44,11 @@ #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) ; diff --git a/Test/GB_mex_test32.c b/Test/GB_mex_test32.c index fd6f7075bf..b748750271 100644 --- a/Test/GB_mex_test32.c +++ b/Test/GB_mex_test32.c @@ -10,8 +10,6 @@ #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 ; @@ -21,21 +19,23 @@ size_t siz1, siz2, siz3 ; \ OK (GrB_Semiring_get_String (op, name, GrB_NAME)) ; \ CHECK (MATCH (name, opname)) ; \ + printf ("\nname: %s\n", name) ; \ + OK (GxB_Semiring_fprint (op, "semiring", 3, NULL)) ; \ 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) ; \ + 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) ; \ + 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) ; \ + 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) ; } \ @@ -44,13 +44,11 @@ #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) ; diff --git a/Test/GB_mex_test33.c b/Test/GB_mex_test33.c index 565fe7cc8c..83417d7ebc 100644 --- a/Test/GB_mex_test33.c +++ b/Test/GB_mex_test33.c @@ -10,8 +10,6 @@ #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 ; diff --git a/Test/GB_mex_test34.c b/Test/GB_mex_test34.c index 88b2bc1d7a..8f36169c63 100644 --- a/Test/GB_mex_test34.c +++ b/Test/GB_mex_test34.c @@ -10,40 +10,43 @@ #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) \ -{ \ +#define DGET(desc,value,field) \ +{ \ + if (print) \ + { \ + printf ("\ndescriptor: %s\n", #desc) ; \ + OK (GxB_Descriptor_fprint (desc, "desc", 5, stdout)) ; \ + } \ OK (GrB_Descriptor_get_INT32 (desc, &i, (GrB_Field) (field))) ; \ - CHECK (i == value) ; \ - OK (GrB_Scalar_clear (s_int32)) ; \ + CHECK (i == value) ; \ + OK (GrB_Scalar_clear (s_int32)) ; \ OK (GrB_Descriptor_get_Scalar (desc, s_int32, (GrB_Field) (field))) ; \ - int32_t iscalar = -1 ; \ - OK (GrB_Scalar_extractElement_INT32 (&iscalar, s_int32)) ; \ - CHECK (iscalar == value) ; \ - OK (GrB_Descriptor_get_SIZE (desc, &size, GrB_NAME)) ; \ - CHECK (size == GxB_MAX_NAME_LEN) ; \ - OK (GrB_Descriptor_get_String (desc, name, GrB_NAME)) ; \ - CHECK (MATCH (name, #desc)) ; \ + 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) \ -{ \ +#define DSET(desc,value,field) \ +{ \ OK (GrB_Descriptor_set_INT32 (desc, GrB_DEFAULT, (GrB_Field) (field))) ; \ OK (GrB_Descriptor_set_INT32 (desc, value, (GrB_Field) (field))) ; \ - int32_t i2 ; \ + int32_t i2 ; \ OK (GrB_Descriptor_get_INT32 (desc, &i2, (GrB_Field) (field))) ; \ - CHECK (i2 == value) ; \ + CHECK (i2 == value) ; \ OK (GrB_Descriptor_set_INT32 (desc, GrB_DEFAULT, (GrB_Field) (field))) ; \ - OK (GrB_Scalar_setElement_INT32 (s_int32, value)) ; \ + OK (GrB_Scalar_setElement_INT32 (s_int32, value)) ; \ OK (GrB_Descriptor_set_Scalar (desc, s_int32, (GrB_Field) (field))) ; \ - int32_t i3 ; \ + int32_t i3 ; \ OK (GrB_Descriptor_get_INT32 (desc, &i2, (GrB_Field) (field))) ; \ - CHECK (i2 == value) ; \ + CHECK (i2 == value) ; \ } void mexFunction @@ -130,7 +133,12 @@ GrB_DESC_RSCT0T1 ; // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN #endif + bool print = false ; + DGET (GrB_NULL , GrB_DEFAULT, GrB_OUTP_FIELD) ; + + print = true ; + 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) ; @@ -170,6 +178,8 @@ GrB_DESC_RSCT0T1 ; // GrB_REPLACE GrB_STRUCTURE GrB_COMP GrB_TRAN GrB_TRAN DGET (GrB_DESC_RSCT0 , GrB_REPLACE, GrB_OUTP_FIELD) ; DGET (GrB_DESC_RSCT0T1 , GrB_REPLACE, GrB_OUTP_FIELD) ; + print = false ; + printf ("\n") ; DGET (GrB_NULL , GrB_DEFAULT, GrB_MASK_FIELD) ; diff --git a/Test/GB_mex_test35.c b/Test/GB_mex_test35.c index 0708008f95..c325493f91 100644 --- a/Test/GB_mex_test35.c +++ b/Test/GB_mex_test35.c @@ -10,8 +10,6 @@ #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 ; diff --git a/Test/GB_mex_test36.c b/Test/GB_mex_test36.c index e2d9fa8b2f..04902de18f 100644 --- a/Test/GB_mex_test36.c +++ b/Test/GB_mex_test36.c @@ -18,7 +18,6 @@ #include "GB_mex.h" #include "GB_mex_errors.h" -#define USAGE "GB_mex_test36" #define FREE_ALL ; #define GET_DEEP_COPY ; #define FREE_DEEP_COPY ; diff --git a/Test/GB_mex_test37.c b/Test/GB_mex_test37.c new file mode 100644 index 0000000000..e05d7987b9 --- /dev/null +++ b/Test/GB_mex_test37.c @@ -0,0 +1,691 @@ +//------------------------------------------------------------------------------ +// GB_mex_test37: index binary op tests +//------------------------------------------------------------------------------ + +// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +#include "GB_mex.h" +#include "GB_mex_errors.h" + +//------------------------------------------------------------------------------ +// isequal: ensure two matrices are identical +//------------------------------------------------------------------------------ + +#undef FREE_ALL +#define FREE_ALL \ +{ \ + GrB_Matrix_free (&D) ; \ +} + +bool isequal (GrB_Matrix C1, GrB_Matrix C2) ; +bool isequal (GrB_Matrix C1, GrB_Matrix C2) +{ + GrB_Info info = GrB_SUCCESS ; + GrB_Matrix D = NULL ; + // finish any pending work + OK (GrB_Matrix_wait (C1, GrB_MATERIALIZE)) ; + OK (GrB_Matrix_wait (C2, GrB_MATERIALIZE)) ; + // ensure C2 has the same sparsity and row/col storage as C1 + int32_t s ; + OK (GrB_Matrix_get_INT32 (C1, &s, GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_set_INT32 (C2, s, GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_get_INT32 (C1, &s, (GrB_Field) GxB_SPARSITY_STATUS)) ; + OK (GrB_Matrix_set_INT32 (C2, s, (GrB_Field) GxB_SPARSITY_CONTROL)) ; + OK (GrB_Matrix_wait (C1, GrB_MATERIALIZE)) ; + OK (GrB_Matrix_wait (C2, GrB_MATERIALIZE)) ; + // check if C1 and C2 are equal + bool ok = GB_mx_isequal (C1, C2, 0) ; + if (!ok) + { + printf ("\n=========================================\n") ; + printf ("matrices differ!\n") ; + printf ("\n=========================================\n") ; + GrB_Index nvals = 0, nrows = 0, ncols = 0 ; + OK (GrB_Matrix_nrows (&nrows, C1)) ; + OK (GrB_Matrix_ncols (&ncols, C1)) ; + OK (GrB_Matrix_new (&D, GrB_FP64, nrows, ncols)) ; + OK (GrB_Matrix_eWiseAdd_BinaryOp (D, NULL, NULL, GrB_MINUS_FP64, + C1, C2, NULL)) ; + OK (GrB_Matrix_select_FP64 (D, NULL, NULL, GrB_VALUENE_FP64, D, + (double) 0, NULL)) ; + OK (GrB_Matrix_nvals (&nvals, D)) ; + OK (GxB_print (D, 5)) ; + OK (GrB_Matrix_free (&D)) ; + } + return (ok) ; +} + +//------------------------------------------------------------------------------ +// test37_idxbinop +//------------------------------------------------------------------------------ + +void test37_idxbinop (double *z, + const double *x, GrB_Index ix, GrB_Index jx, + const double *y, GrB_Index iy, GrB_Index jy, + const double *theta) ; + +void test37_idxbinop (double *z, + const double *x, GrB_Index ix, GrB_Index jx, + const double *y, GrB_Index iy, GrB_Index jy, + const double *theta) +{ + (*z) = (*x) + 2*(*y) - 42*ix + jx + 3*iy + 1000*jy - (*theta) ; +} + +#define TEST37_IDXBINOP \ +"void test37_idxbinop (double *z, \n" \ +" const double *x, GrB_Index ix, GrB_Index jx, \n" \ +" const double *y, GrB_Index iy, GrB_Index jy, \n" \ +" const double *theta) \n" \ +"{ \n" \ +" (*z) = (*x) + 2*(*y) - 42*ix + jx + 3*iy + 1000*jy - (*theta) ; \n" \ +"} \n" + +//------------------------------------------------------------------------------ +// ewise: compute the result without using GraphBLAS +//------------------------------------------------------------------------------ + +// C0 = add (A,A') +// B0 = union (A,A') +// E0 = emult (A,A') +// G0 = emult (A,A') + +#define FREE_WORK \ +{ \ + if (Ab != NULL) { free_function (Ab) ; } ; Ab = NULL ; \ + if (Ax != NULL) { free_function (Ax) ; } ; Ax = NULL ; \ + if (Bb != NULL) { free_function (Bb) ; } ; Bb = NULL ; \ + if (Bx != NULL) { free_function (Bx) ; } ; Bx = NULL ; \ + GrB_Matrix_free (&a) ; \ + GrB_Matrix_free (&b) ; \ + GrB_Matrix_free (&T) ; \ +} + +#undef FREE_ALL +#define FREE_ALL \ +{ \ + FREE_WORK ; \ + GrB_Matrix_free (&C) ; \ +} + +GrB_Info ewise +( + GrB_Matrix *C_handle, + GrB_Matrix A, + GrB_Matrix M, + double *alpha, + double *beta, + double *theta, + int kind +) ; + +GrB_Info ewise +( + GrB_Matrix *C_handle, + GrB_Matrix A, + GrB_Matrix M, + double *alpha, + double *beta, + double *theta, + int kind +) +{ + GrB_Info info = GrB_SUCCESS ; + int8_t *Ab = NULL, *Bb = NULL, *Tb = NULL ; + double *Ax = NULL, *Bx = NULL, *Tx = NULL ; + GrB_Matrix T = NULL, C = NULL, a = NULL, b = NULL ; + GrB_Index Ab_size = 0, Ax_size = 0, A_nvals = 0, + Bb_size = 0, Bx_size = 0, B_nvals = 0, + Tb_size = 0, Tx_size = 0, T_nvals = 0 ; + void (* free_function) (void *) = NULL ; + GrB_Index n = 0 ; + (*C_handle) = NULL ; + + //-------------------------------------------------------------------------- + // get the current free function + //-------------------------------------------------------------------------- + + free_function = GB_Global_free_function_get ( ) ; + + //-------------------------------------------------------------------------- + // create bitmap format of A, A', and T + //-------------------------------------------------------------------------- + + OK (GrB_Matrix_nrows (&n, A)) ; + + // a = A + OK (GrB_Matrix_dup (&a, A)) ; + + // b = A' + OK (GrB_Matrix_dup (&b, A)) ; + OK (GrB_transpose (b, NULL, NULL, b, NULL)) ; + + // extract a in bitmap CSC format + OK (GxB_Matrix_unpack_BitmapC (a, &Ab, &Ax, &Ab_size, &Ax_size, + NULL, &A_nvals, NULL)) ; + GrB_Matrix_free (&a) ; + + // extract b in bitmap CSC format + OK (GxB_Matrix_unpack_BitmapC (b, &Bb, &Bx, &Bb_size, &Bx_size, + NULL, &B_nvals, NULL)) ; + GrB_Matrix_free (&b) ; + + // create T and extract in bitmap CSC format + OK (GrB_Matrix_new (&T, GrB_FP64, n, n)) ; + OK (GxB_Matrix_unpack_BitmapC (T, &Tb, &Tx, &Tb_size, &Tx_size, + NULL, &T_nvals, NULL)) ; + + //-------------------------------------------------------------------------- + // t = op (a,b,theta) + //-------------------------------------------------------------------------- + + // 0: C0 = add (A,A') + // 1: B0 = union (A,A') + // 2: E0 = emult (A,A') + // 3: G0 = emult (A,A') + + T_nvals = 0 ; + + for (GrB_Index i = 0 ; i < n ; i++) + { + for (GrB_Index j = 0 ; j < n ; j++) + { + int64_t p = i + j*n ; + + int8_t ab = Ab [p] ; + int8_t bb = Bb [p] ; + int8_t tb = 0 ; + double ax = Ax [p] ; + double bx = Bx [p] ; + double tx = 0 ; + + if (ab && bb) + { + // both A(i,j) and B(i,j) are present: apply the operator + test37_idxbinop (&tx, &ax, i, j, &bx, i, j, theta) ; + tb = 1 ; + } + else if (ab && !bb) + { + // A(i,j) is present but B(i,j) is not + switch (kind) + { + case 0 : // add + tx = ax ; + tb = 1 ; + break ; + case 1 : // union + test37_idxbinop (&tx, &ax, i, j, beta, i, j, theta) ; + tb = 1 ; + break ; + default : // emult + break ; + } + } + else if (!ab && bb) + { + // B(i,j) is present but A(i,j) is not + switch (kind) + { + case 0 : // add + tx = bx ; + tb = 1 ; + break ; + case 1 : // union + test37_idxbinop (&tx, alpha, i, j, &bx, i, j, theta) ; + tb = 1 ; + break ; + default: + break ; + } + } + + // save the result in T(i,j) + Tx [p] = tx ; + Tb [p] = tb ; + T_nvals += tb ; + } + } + + // pack T in bitmap CSC format + OK (GxB_Matrix_pack_BitmapC (T, &Tb, &Tx, Tb_size, Tx_size, + false, T_nvals, NULL)) ; + + //-------------------------------------------------------------------------- + // create C + //-------------------------------------------------------------------------- + + if (kind == 3) + { + // C = T + OK (GrB_Matrix_new (&C, GrB_FP64, n, n)) ; + OK (GrB_Matrix_assign (C, M, NULL, T, GrB_ALL, n, GrB_ALL, n, + GrB_DESC_R)) ; + } + else + { + C = T ; + T = NULL ; + } + + //-------------------------------------------------------------------------- + // free workspace and return result + //-------------------------------------------------------------------------- + + (*C_handle) = C ; + FREE_WORK ; + return (GrB_SUCCESS) ; +} + +#undef FREE_WORK + +//------------------------------------------------------------------------------ + +#define GET_DEEP_COPY ; +#define FREE_DEEP_COPY ; + +#undef FREE_ALL +#define FREE_ALL \ +{ \ + GrB_Scalar_free (&Theta) ; \ + GrB_Scalar_free (&Alpha) ; \ + GrB_Scalar_free (&Beta) ; \ + GrB_Scalar_free (&Crud_Scalar) ; \ + GrB_Type_free (&Crud_Type) ; \ + GrB_Matrix_free (&A) ; \ + GrB_Matrix_free (&M) ; \ + GrB_Matrix_free (&A2) ; \ + GrB_Matrix_free (&C1) ; \ + GrB_Matrix_free (&C2) ; \ + GrB_Matrix_free (&B1) ; \ + GrB_Matrix_free (&B2) ; \ + GrB_Matrix_free (&E1) ; \ + GrB_Matrix_free (&E2) ; \ + GrB_Matrix_free (&F1) ; \ + GrB_Matrix_free (&F2) ; \ + GrB_Matrix_free (&G1) ; \ + GrB_Matrix_free (&G2) ; \ + GrB_Matrix_free (&C0) ; \ + GrB_Matrix_free (&B0) ; \ + GrB_Matrix_free (&E0) ; \ + GrB_Matrix_free (&G0) ; \ + GrB_BinaryOp_free (&Bop) ; \ + GxB_IndexBinaryOp_free (&Iop) ; \ +} + +void mexFunction +( + int nargout, + mxArray *pargout [ ], + int nargin, + const mxArray *pargin [ ] +) +{ + + //-------------------------------------------------------------------------- + // startup GraphBLAS + //-------------------------------------------------------------------------- + + GrB_Info info ; + bool malloc_debug = GB_mx_get_global (true) ; + + //-------------------------------------------------------------------------- + // create index binary ops and test matrices + //-------------------------------------------------------------------------- + + GrB_Type Crud_Type = NULL ; + GrB_Scalar Theta = NULL, Alpha = NULL, Beta = NULL, Crud_Scalar ; + GxB_IndexBinaryOp Iop = NULL, Crud_Iop = NULL ; + GrB_BinaryOp Bop = NULL, Crud_Bop = NULL ; + GrB_Matrix A = NULL, C1 = NULL, C2 = NULL, B1 = NULL, B2 = NULL, + E1 = NULL, E2 = NULL, A2 = NULL, F1 = NULL, F2 = NULL, M = NULL, + G1 = NULL, G2 = NULL, C0 = NULL, B0 = NULL, E0 = NULL, G0 = NULL ; + + OK (GrB_Matrix_new (&A, GrB_FP64, 10, 10)) ; + + OK (GrB_Matrix_new (&C1, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&C2, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&B1, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&B2, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&E1, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&E2, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&F1, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&F2, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&G1, GrB_FP64, 10, 10)) ; + OK (GrB_Matrix_new (&G2, GrB_FP64, 10, 10)) ; + + // C1 and B1 always stay by column + OK (GrB_Matrix_set_INT32 (C1, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_set_INT32 (B1, GrB_COLMAJOR, GrB_STORAGE_ORIENTATION_HINT)) ; + + double x = 1 ; + for (int64_t i = 0 ; i < 9 ; i++) + { + OK (GrB_Matrix_setElement_FP64 (A, x, i, i)) ; + x = x*1.2 ; + OK (GrB_Matrix_setElement_FP64 (A, x, i, i+1)) ; + x = x*1.2 ; + OK (GrB_Matrix_setElement_FP64 (A, x, i+1, i)) ; + x = x*1.2 ; + } + OK (GrB_Matrix_setElement_FP64 (A, x, 9, 9)) ; + x = x - 1000 ; + OK (GrB_Matrix_setElement_FP64 (A, x, 5, 2)) ; + + double theta = x ; + OK (GrB_Scalar_new (&Theta, GrB_FP64)) ; + OK (GrB_Scalar_setElement_FP64 (Theta, theta)) ; + + OK (GxB_IndexBinaryOp_new (&Iop, + (GxB_index_binary_function) test37_idxbinop, + GrB_FP64, GrB_FP64, GrB_FP64, GrB_FP64, + "test37_idxbinop", TEST37_IDXBINOP)) ; + + OK (GxB_IndexBinaryOp_set_String (Iop, "test37 idx binop", GrB_NAME)) ; + OK (GxB_print (Iop, 5)) ; + + size_t theta_type_namelen = 0 ; + OK (GxB_IndexBinaryOp_get_SIZE (Iop, &theta_type_namelen, + GxB_THETA_TYPE_STRING)) ; + printf ("theta name length: %d\n", (int) theta_type_namelen) ; + CHECK (theta_type_namelen == strlen ("GrB_FP64") + 1) ; + + char theta_type_name [256] ; + theta_type_name [0] = '\0' ; + OK (GxB_IndexBinaryOp_get_String (Iop, &theta_type_name, + GxB_THETA_TYPE_STRING)) ; + CHECK (strcmp (theta_type_name, "GrB_FP64") == 0) ; + + int32_t theta_type_code = -1 ; + OK (GxB_IndexBinaryOp_get_INT32 (Iop, &theta_type_code, + GxB_THETA_TYPE_CODE)) ; + CHECK (theta_type_code == GrB_FP64_CODE) ; + + OK (GrB_BinaryOp_get_INT32 (GxB_FIRSTI1_INT32, &theta_type_code, + GxB_THETA_TYPE_CODE)) ; + CHECK (theta_type_code == GrB_INT32_CODE) ; + + OK (GrB_BinaryOp_get_INT32 (GxB_FIRSTI1_INT64, &theta_type_code, + GxB_THETA_TYPE_CODE)) ; + CHECK (theta_type_code == GrB_INT64_CODE) ; + + OK (GxB_BinaryOp_new_IndexOp (&Bop, Iop, Theta)) ; + OK (GxB_print (Bop, 5)) ; + + OK (GrB_Scalar_new (&Alpha, GrB_FP64)) ; + + double y = 0 ; + int expected = GrB_INVALID_VALUE ; + ERR (GxB_IndexBinaryOp_get_Scalar (Iop, Alpha, GxB_THETA)) ; + + y = 0 ; + OK (GrB_Scalar_clear (Alpha)) ; + OK (GrB_BinaryOp_get_Scalar (Bop, Alpha, GxB_THETA)) ; + OK (GrB_Scalar_extractElement_FP64 (&y, Alpha)) ; + CHECK (y == theta) ; + + theta_type_code = -1 ; + OK (GrB_BinaryOp_get_INT32 (Bop, &theta_type_code, + GxB_THETA_TYPE_CODE)) ; + CHECK (theta_type_code == GrB_FP64_CODE) ; + + theta_type_namelen = 0 ; + OK (GrB_BinaryOp_get_SIZE (Bop, &theta_type_namelen, + GxB_THETA_TYPE_STRING)) ; + CHECK (theta_type_namelen == strlen ("GrB_FP64") + 1) ; + + theta_type_name [0] = '\0' ; + OK (GrB_BinaryOp_get_String (Bop, &theta_type_name, + GxB_THETA_TYPE_STRING)) ; + CHECK (strcmp (theta_type_name, "GrB_FP64") == 0) ; + + double alpha = 3.14159 ; + double beta = 42 ; + OK (GrB_Scalar_new (&Beta, GrB_FP64)) ; + OK (GrB_Scalar_setElement_FP64 (Alpha, alpha)) ; + OK (GrB_Scalar_setElement_FP64 (Beta, beta)) ; + + OK (GrB_Matrix_dup (&A2, A)) ; + OK (GrB_Matrix_dup (&M, A)) ; + + OK (GrB_Matrix_set_INT32 (M, GxB_SPARSE, + (GrB_Field) GxB_SPARSITY_CONTROL)) ; + + //-------------------------------------------------------------------------- + // create the expected results + //-------------------------------------------------------------------------- + + OK (ewise (&C0, A, NULL, NULL, NULL, &theta, 0)) ; // C0 = add(A,A') + OK (ewise (&B0, A, NULL, &alpha, &beta, &theta, 1)) ; // B0 = union(A,A') + OK (ewise (&E0, A, NULL, NULL, NULL, &theta, 2)) ; // E0 = emult(A,A') + OK (ewise (&G0, A, M, NULL, NULL, &theta, 3)) ; // G0 = emult(A,A') + + //-------------------------------------------------------------------------- + // test index binary ops + //-------------------------------------------------------------------------- + + for (int a1_sparsity = 0 ; a1_sparsity <= 1 ; a1_sparsity++) + { + for (int a2_sparsity = 0 ; a2_sparsity <= 1 ; a2_sparsity++) + { + for (int a1_store = 0 ; a1_store <= 1 ; a1_store++) + { + for (int a2_store = 0 ; a2_store <= 1 ; a2_store++) + { + for (int c2_store = 0 ; c2_store <= 1 ; c2_store++) + { + for (int b2_store = 0 ; b2_store <= 1 ; b2_store++) + { + for (int jit = 0 ; jit <= 1 ; jit++) + { + + printf (".") ; + + // turn on/off the JIT + OK (GrB_Global_set_INT32 (GrB_GLOBAL, + jit ? GxB_JIT_ON : GxB_JIT_OFF, + (GrB_Field) GxB_JIT_C_CONTROL)) ; + + // change A sparsity + OK (GrB_Matrix_set_INT32 (A, + a1_sparsity ? GxB_SPARSE : GxB_BITMAP, + (GrB_Field) GxB_SPARSITY_CONTROL)) ; + + // change A storage orientation + OK (GrB_Matrix_set_INT32 (A, + a1_store ? GrB_ROWMAJOR : GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + + // C1 = add (A, A') + OK (GrB_Matrix_eWiseAdd_BinaryOp (C1, + NULL, NULL, Bop, A, A, GrB_DESC_T1)) ; + // B1 = union (A, A') + OK (GxB_Matrix_eWiseUnion (B1, NULL, NULL, Bop, + A, Alpha, A, Beta, GrB_DESC_T1)) ; + // E1 = emult (A, A') + OK (GrB_Matrix_eWiseMult_BinaryOp (E1, + NULL, NULL, Bop, A, A, GrB_DESC_T1)) ; + // F1 = emult (A, A') + OK (GrB_Matrix_eWiseMult_BinaryOp (F1, + NULL, NULL, Bop, A, A2, GrB_DESC_T1)) ; + // G1 = emult (A, A') + OK (GrB_Matrix_eWiseMult_BinaryOp (G1, + M, NULL, Bop, A, A2, GrB_DESC_RT1)) ; + + // change A sparsity again + OK (GrB_Matrix_set_INT32 (A2, + a2_sparsity ? GxB_SPARSE : GxB_BITMAP, + (GrB_Field) GxB_SPARSITY_CONTROL)) ; + + // change A storage again + OK (GrB_Matrix_set_INT32 (A, + a2_store ? GrB_ROWMAJOR : GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + + // change C2, etc storage + OK (GrB_Matrix_set_INT32 (C2, + c2_store ? GrB_ROWMAJOR : GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_set_INT32 (B2, + b2_store ? GrB_ROWMAJOR : GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_set_INT32 (E2, + b2_store ? GrB_ROWMAJOR : GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_set_INT32 (F2, + b2_store ? GrB_ROWMAJOR : GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + OK (GrB_Matrix_set_INT32 (G2, + b2_store ? GrB_ROWMAJOR : GrB_COLMAJOR, + GrB_STORAGE_ORIENTATION_HINT)) ; + + // C2 = add (A, A') + OK (GrB_Matrix_eWiseAdd_BinaryOp (C2, + NULL, NULL, Bop, A, A, GrB_DESC_T1)) ; + // B2 = union (A, A') + OK (GxB_Matrix_eWiseUnion (B2, NULL, NULL, + Bop, A, Alpha, A, Beta, GrB_DESC_T1)) ; + // E2 = emult (A, A') + OK (GrB_Matrix_eWiseMult_BinaryOp (E2, + NULL, NULL, Bop, A, A, GrB_DESC_T1)) ; + // F2 = emult (A, A2') + OK (GrB_Matrix_eWiseMult_BinaryOp (F2, + NULL, NULL, Bop, A, A2, GrB_DESC_T1)) ; + // G2 = emult (A, A2') + OK (GrB_Matrix_eWiseMult_BinaryOp (G2, + M, NULL, Bop, A, A2, GrB_DESC_RT1)) ; + + CHECK (isequal (C1, C2)) ; + CHECK (isequal (B1, B2)) ; + CHECK (isequal (E1, E2)) ; + CHECK (isequal (F1, F2)) ; + CHECK (isequal (F1, E2)) ; + CHECK (isequal (G1, G2)) ; + + CHECK (isequal (C1, C0)) ; + CHECK (isequal (B1, B0)) ; + CHECK (isequal (E1, E0)) ; + CHECK (isequal (G1, G0)) ; + } + } + } + } + } + } + } + + //------------------------------------------------------------------------ + // error tests + //------------------------------------------------------------------------ + + // turn on the JIT + OK (GrB_Global_set_INT32 (GrB_GLOBAL, GxB_JIT_ON, + (GrB_Field) GxB_JIT_C_CONTROL)) ; + + int save_jit = 0, save_burble = 0 ; + OK (GxB_get (GxB_JIT_C_CONTROL, &save_jit)) ; + CHECK (save_jit == GxB_JIT_ON) ; + + printf ("\nerror handling tests: JIT is %d\n", save_jit) ; + + expected = GrB_INVALID_OBJECT ; + void *p = Bop->theta_type = NULL ; + Bop->theta_type = NULL ; + ERR (GB_BinaryOp_check (Bop, "Bop: bad theta_type", 5, stdout)) ; + Bop->theta_type = p ; + + p = Iop->idxbinop_function ; + Iop->idxbinop_function = NULL ; + ERR (GB_IndexBinaryOp_check (Iop, "Iop: null function", 5, stdout)) ; + Iop->idxbinop_function = p ; + + p = Iop->ztype ; + Iop->ztype = NULL ; + ERR (GB_IndexBinaryOp_check (Iop, "Iop: null ztype", 5, stdout)) ; + Iop->ztype = p ; + + p = Iop->xtype ; + Iop->xtype = NULL ; + ERR (GB_IndexBinaryOp_check (Iop, "Iop: null xtype", 5, stdout)) ; + Iop->xtype = p ; + + p = Iop->ytype ; + Iop->ytype = NULL ; + ERR (GB_IndexBinaryOp_check (Iop, "Iop: null ytype", 5, stdout)) ; + Iop->ytype = p ; + + p = Iop->theta_type ; + Iop->theta_type = NULL ; + ERR (GB_IndexBinaryOp_check (Iop, "Iop: null theta_type", 5, stdout)) ; + Iop->theta_type = p ; + + GB_Opcode code = Iop->opcode ; + Iop->opcode = GB_PLUS_binop_code ; + ERR (GB_IndexBinaryOp_check (Iop, "Iop: invalid opcode", 5, stdout)) ; + Iop->opcode = code ; + + int len = Iop->name_len ; + Iop->name_len = 3 ; + ERR (GB_IndexBinaryOp_check (Iop, "Iop: invalid name_len", 5, stdout)) ; + Iop->name_len = len ; + + expected = GrB_NULL_POINTER ; + ERR (GB_IndexBinaryOp_check (NULL, "Iop: null", 5, stdout)) ; + + expected = GrB_INVALID_VALUE ; + ERR (GxB_IndexBinaryOp_set_Scalar (Iop, Theta, GrB_NAME)) ; + ERR (GxB_IndexBinaryOp_set_INT32 (Iop, 2, GrB_SIZE)) ; + ERR (GxB_IndexBinaryOp_set_VOID (Iop, NULL, GrB_SIZE, 0)) ; + + expected = GrB_DOMAIN_MISMATCH ; + OK (GrB_Type_new (&Crud_Type, 4)) ; + OK (GrB_Scalar_new (&Crud_Scalar, Crud_Type)) ; + ERR (GxB_BinaryOp_new_IndexOp (&Crud_Bop, Iop, Crud_Scalar)) ; + ERR (GrB_Matrix_apply (A, NULL, NULL, Bop, A, NULL)) ; + + //------------------------------------------------------------------------ + // JIT testing + //------------------------------------------------------------------------ + + printf ("\n\n-------------- lots of compiler errors expected here:\n") ; + + #define CRUD_IDXBINOP \ + "void crud_idxbinop (double *z, " \ + " const double *x, GrB_Index ix, GrB_Index jx, " \ + " const double *y, GrB_Index iy, GrB_Index jy, " \ + " const double *theta) " \ + "{ " \ + " compiler error occurs here " \ + "}" + + printf ("-------- test JIT compiler error:\n") ; + + // turn on the JIT and the burble + OK (GxB_get (GxB_JIT_C_CONTROL, &save_jit)) ; + OK (GxB_get (GxB_BURBLE, &save_burble)) ; + OK (GxB_set (GxB_BURBLE, true)) ; + OK (GxB_set (GxB_JIT_C_CONTROL, GxB_JIT_OFF)) ; + OK (GxB_set (GxB_JIT_C_CONTROL, GxB_JIT_ON)) ; + + expected = GxB_JIT_ERROR ; + ERR (GxB_IndexBinaryOp_new (&Crud_Iop, NULL, + GrB_FP64, GrB_FP64, GrB_FP64, GrB_FP64, + "crud_idxbinop", CRUD_IDXBINOP)) ; + + // restore the JIT control and the burble + OK (GxB_set (GxB_JIT_C_CONTROL, save_jit)) ; + OK (GxB_set (GxB_BURBLE, save_burble)) ; + printf ("\n-------- lots of JIT compiler errors expected above\n") ; + + //------------------------------------------------------------------------ + // finalize GraphBLAS + //------------------------------------------------------------------------ + + FREE_ALL ; + GB_mx_put_global (true) ; + printf ("\nGB_mex_test37: all tests passed\n\n") ; +} + diff --git a/Test/GB_mex_test9.c b/Test/GB_mex_test9.c index e3aff26c21..0dca3c5494 100644 --- a/Test/GB_mex_test9.c +++ b/Test/GB_mex_test9.c @@ -133,31 +133,34 @@ void mexFunction // Using GB_boolean_rename results in these cases not being tested. int ecode = -1 ; - GB_enumify_binop (&ecode, GB_MIN_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_MIN_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 18) ; - GB_enumify_binop (&ecode, GB_MAX_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_MAX_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 17) ; - GB_enumify_binop (&ecode, GB_TIMES_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_TIMES_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 18) ; - GB_enumify_binop (&ecode, GB_PLUS_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_PLUS_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 17) ; - GB_enumify_binop (&ecode, GB_NE_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_NE_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 16) ; - GB_enumify_binop (&ecode, GB_ISEQ_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_ISEQ_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 15) ; - GB_enumify_binop (&ecode, GB_ISNE_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_ISNE_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 16) ; - GB_enumify_binop (&ecode, GB_DIV_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_DIV_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 1) ; - GB_enumify_binop (&ecode, GB_RDIV_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_RDIV_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 2) ; - GB_enumify_binop (&ecode, GB_RMINUS_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_RMINUS_binop_code, GB_BOOL_code, false, false); CHECK (ecode == 16) ; - GB_enumify_binop (&ecode, GB_POW_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_POW_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 71) ; - GB_enumify_binop (&ecode, GB_MINUS_binop_code, GB_BOOL_code, false) ; + GB_enumify_binop (&ecode, GB_MINUS_binop_code, GB_BOOL_code, false, false) ; CHECK (ecode == 16) ; + GB_enumify_binop (&ecode, GB_NOP_code, GB_BOOL_code, false, false) ; + CHECK (ecode == 255) ; + GB_enumify_identity (&ecode, GB_MIN_binop_code, GB_BOOL_code) ; CHECK (ecode == 2) ; GB_enumify_identity (&ecode, GB_MAX_binop_code, GB_BOOL_code) ; @@ -173,7 +176,7 @@ void mexFunction CHECK (ecode == 2) ; FILE *fp = fopen ("/tmp/GB_tcov_gunk.h", "w") ; - GB_macrofy_binop (fp, "nothing", false, false, false, + GB_macrofy_binop (fp, "nothing", false, false, false, false, false, 199, false, NULL, NULL, NULL, NULL) ; fclose (fp) ; diff --git a/Test/GB_spec_kron.m b/Test/GB_spec_kron.m index 3034a499c7..e4e073c65b 100644 --- a/Test/GB_spec_kron.m +++ b/Test/GB_spec_kron.m @@ -76,30 +76,9 @@ end end -%{ - % do the values - S = GB_spec_zeros ([bnrows bncols], xtype) ; - for j = 1:ancols - for i = 1:anrows - if A.pattern (i,j) - S (:,:) = A1 (i,j) ; - ci = (i-1) * bnrows + 1 ; - cj = (j-1) * bncols + 1 ; - p = B.pattern ; - K = GB_spec_op (mult, S(p), B1(p)) ; - Tblock = GB_spec_zeros ([bnrows bncols], ztype) ; - Tblock (p) = K ; - T.matrix (ci:ci+bnrows-1, cj:cj+bncols-1) = Tblock ; - T.pattern (ci:ci+bnrows-1, cj:cj+bncols-1) = B.pattern ; - end - end - end -%} - assert (isequal (ztype, GB_spec_type (T.matrix))) ; T.class = ztype ; % C = accum (C,T): apply the accum, then Mask, and return the result C = GB_spec_accum_mask (C, Mask, accum, T, C_replace, Mask_comp, 0) ; - diff --git a/Test/GB_spec_kron_idx.m b/Test/GB_spec_kron_idx.m new file mode 100644 index 0000000000..37c711222e --- /dev/null +++ b/Test/GB_spec_kron_idx.m @@ -0,0 +1,57 @@ +function C = GB_spec_kron_idx (A, B, atrans, btrans) +% C = kron(A,B), using the mykronidx operator + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +if (nargin < 3) + atrans = [ ] ; +end +if (nargin < 4) + btrans = [ ] ; +end +if (isempty (atrans)) + atrans = 0 ; +end +if (isempty (btrans)) + btrans = 0 ; +end + +if (atrans) + A = A' ; +end + +if (btrans) + B = B' ; +end + +[ia,ja,x] = find (A) ; +[ib,jb,x] = find (B) ; + +anz = length (ia) ; +bnz = length (ib) ; +cnz = anz * bnz ; + +ic = zeros (cnz,1) ; +jc = zeros (cnz,1) ; +xc = zeros (cnz,1) ; +[ma, na] = size (A) ; +[mb, nb] = size (B) ; +nc = na * nb ; +mc = ma * mb ; + +kc = 0 ; +for ka = 1:anz + for kb = 1:bnz + kc = kc + 1 ; + ic (kc) = (ia (ka) - 1) * mb + ib (kb) ; + jc (kc) = (ja (ka) - 1) * nb + jb (kb) ; + xc (kc) = (ia (ka) * 1000000 + ... + ja (ka) * 10000 + ... + ib (kb) * 100 + ... + jb (kb)) ; + end +end + +C = sparse (ic, jc, xc, mc, nc) ; + diff --git a/Test/README.txt b/Test/README.txt index 8572966dd3..fa26f4731b 100644 --- a/Test/README.txt +++ b/Test/README.txt @@ -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. SPDX-License-Identifier: Apache-2.0 GraphBLAS/Test: @@ -27,7 +27,7 @@ For Linux or Mac, in the GraphBLAS/GraphBLAS folder, type To run the tests, use the following command in this directory, in the MATLAB/Octave Command Window: - make ; testall + testmake ; testall Longer tests can be done as well (this can take a whole day): diff --git a/Test/grblines.m b/Test/grblines.m new file mode 100644 index 0000000000..f51979adfd --- /dev/null +++ b/Test/grblines.m @@ -0,0 +1,11 @@ +function n = grblines +%GRBLINES total # of lines in the test coverage +n = 1 ; +if (~isempty (strfind (pwd, 'Tcov'))) + % load in the # of lines in the test coverage + fp = fopen ('tmp_cover/count', 'r') ; + n = textscan (fp, '%f') ; + n = n {1} ; + fclose (fp) ; +end + diff --git a/Test/logstat.m b/Test/logstat.m index 111e7898e5..a5c0a5e330 100644 --- a/Test/logstat.m +++ b/Test/logstat.m @@ -22,14 +22,20 @@ function logstat (testscript, threads, jit_controls, factory_controls) GB_mex_factory_control (1) ; [debug, compact, malloc, covered] = GB_mex_debug ; +test_coverage = (~isempty (strfind (pwd, 'Tcov'))) ; +if (test_coverage) + global GraphBLAS_debug GraphBLAS_grbcov +% global GraphBLAS_grbcovs GraphBLAS_scripts GraphBLAS_times +end + % default JIT controls if (nargin < 3) jit_controls = [ ] ; end if (isempty (jit_controls)) jit_controls {1} = 4 ; % JIT on - jit_controls {2} = 0 ; % JIT off - jit_controls {3} = 4 ; % JIT on +% jit_controls {2} = 0 ; % JIT off +% jit_controls {3} = 4 ; % JIT on end % default factory controls @@ -38,8 +44,15 @@ function logstat (testscript, threads, jit_controls, factory_controls) end if (isempty (factory_controls)) factory_controls {1} = 1 ; % factory on - factory_controls {2} = 1 ; % factory on - factory_controls {3} = 0 ; % factory off +% factory_controls {2} = 1 ; % factory on +% factory_controls {3} = 0 ; % factory off +end + +if (0) + jall = {4,3,2,1,0,4,3,2,1,0} ; + fall = {1,1,1,1,1,0,0,0,0,0} ; + jit_controls = jall ; + factory_controls = fall ; end if (nargin < 2) @@ -58,13 +71,10 @@ function logstat (testscript, threads, jit_controls, factory_controls) end end -n = 1 ; -if (~isempty (strfind (pwd, 'Tcov'))) - % load in the # of lines in the test coverage - fp = fopen ('tmp_cover/count', 'r') ; - n = textscan (fp, '%f') ; - n = n {1} ; - fclose (fp) ; +try + n = grblines ; % total # of lines in the test coverage +catch + n = 0 ; end for control_trial = 1:length (jit_controls) @@ -80,7 +90,8 @@ function logstat (testscript, threads, jit_controls, factory_controls) factory_control = 1 ; end GB_mex_factory_control (factory_control) ; - fprintf ('\nTrial: jit: %d factory: %d\n', jit_control, factory_control) ; + fprintf ('\nTrial: jit: %d factory: %d\n', ... + jit_control, factory_control) ; clast = grb_get_coverage ; @@ -141,14 +152,15 @@ function logstat (testscript, threads, jit_controls, factory_controls) fprintf ( '%s %-11s %7.1f sec ', s, testscript, t) ; fprintf (f, '%s %-11s %7.1f sec ', s, testscript, t) ; - if (~isempty (strfind (pwd, 'Tcov'))) - 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 (test_coverage) + +% GraphBLAS_grbcovs {end+1} = GraphBLAS_grbcov (1:n) ; +% GraphBLAS_scripts {end+1} = sprintf ('%s.%d.%d.%d', testscript, ... +% jit_control, factory_control, trial) ; +% GraphBLAS_times {end+1} = t ; +% save grbstat GraphBLAS_debug GraphBLAS_grbcov +% GraphBLAS_grbcovs GraphBLAS_scripts GraphBLAS_times + if (isempty (GraphBLAS_debug)) GraphBLAS_debug = false ; end @@ -193,3 +205,7 @@ function logstat (testscript, threads, jit_controls, factory_controls) end end +% f = fopen ('log.txt', 'a') ; +% fprintf (f,'\n') ; +% fclose (f) ; + diff --git a/Test/set_malloc_debug.m b/Test/set_malloc_debug.m new file mode 100644 index 0000000000..2bf4afe58b --- /dev/null +++ b/Test/set_malloc_debug.m @@ -0,0 +1,33 @@ +function set_malloc_debug (mdebug, new_debug_state) +%SET_MALLOC_DEBUG Turn on/off malloc debugging and mark the log.txt +% +% set_malloc_debug (mdebug, new_debug_state) +% +% If mdebug is false, then no malloc debugging is performed, +% and the global GraphBLAS_debug is just set to false, regardless +% of new_debug_state. +% +% If mdebug is true, then the global GraphBLAS_debug flag is set +% to new_debug_state, and this action is logged in the log.txt file. + +if (mdebug) + % with malloc debugging, but allow it to be switched on or off, + % depending on the test + if (new_debug_state) + debug_on + fprintf ('================[malloc debugging turned on]============\n') ; + fp = fopen ('log.txt', 'a') ; + fprintf (fp, '[malloc debugging turned on]\n') ; + fclose (fp) ; + else + debug_off + fprintf ('================[malloc debugging turned off]===========\n') ; + fp = fopen ('log.txt', 'a') ; + fprintf (fp, '[malloc debugging turned off]\n') ; + fclose (fp) ; + end +else + % no malloc debugging; ignore new_debug_state + debug_off +end + diff --git a/Test/test04.m b/Test/test04.m index 9e7af48cc4..5fbe1251be 100644 --- a/Test/test04.m +++ b/Test/test04.m @@ -1,7 +1,7 @@ function test04 %TEST04 test and demo for accumulator/mask and transpose -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('\n-------------------- simple mask and transpose tests\n') ; diff --git a/Test/test10.m b/Test/test10.m index 8980d636a9..3ebfd440ab 100644 --- a/Test/test10.m +++ b/Test/test10.m @@ -4,11 +4,13 @@ % SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 +% NOTE: for full test coverage, the JIT cache must be empty before running +% this test, or before running testall. + fprintf ('\ntest10: GrB_apply tests\n') ; [~, unary_ops, ~, types, ~, ~] = GB_spec_opsall ; types = types.all ; -unary_ops = unary_ops.all ; rng ('default') ; @@ -17,6 +19,14 @@ dt = struct ('inp0', 'tran') ; dr = struct ('outp', 'replace') ; +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + for k1 = 1:length(types) atype = types {k1} ; fprintf ('\n%s: ', atype) ; @@ -25,44 +35,44 @@ Cin = GB_spec_random (m, n, 0.3, 100, atype) ; Cmask = spones (GB_mex_cast (full (Cin.matrix), Cin.class)) ; - % for most operators + % most operators : A = GB_spec_random (m, n, 0.3, 100, atype) ; B = GB_spec_random (n, m, 0.3, 100, atype) ; A_matrix = A.matrix ; B_matrix = B.matrix ; - % for pow, sqrt, log, log10, log2, gammaln (domain is [0,inf]) + % pow, sqrt, log, log10, log2, gammaln (domain is [0,inf]): A_pos_matrix = abs (A.matrix) ; B_pos_matrix = abs (B.matrix) ; - % for asin, acos, atanh (domain is [-1,1]) + % asin, acos, atanh (domain is [-1,1]): A_1_matrix = A_matrix ; B_1_matrix = B_matrix ; A_1_matrix (abs (A_matrix) > 1) = 1 ; B_1_matrix (abs (B_matrix) > 1) = 1 ; - % for acosh, asech (domain is [1, inf]) + % acosh, asech (domain is [1, inf]): A_1inf_matrix = A_matrix ; B_1inf_matrix = B_matrix ; A_1inf_matrix (A_matrix < 1 & A_matrix ~= 0) = 1 ; B_1inf_matrix (B_matrix < 1 & B_matrix ~= 0) = 1 ; - % for log1p (domain is [-1, inf]) + % log1p (domain is [-1, inf]): A_n1inf_matrix = A_matrix ; B_n1inf_matrix = B_matrix ; A_n1inf_matrix (A_matrix < -1) = 1 ; B_n1inf_matrix (B_matrix < -1) = 1 ; - % for tanh: domain is [-inf,inf], but rounding to - % integers fails when x is outside this range + % tanh: domain is [-inf,inf], but rounding to + % integers fails when x is outside this range: A_5_matrix = A_matrix ; B_5_matrix = B_matrix ; A_5_matrix (abs (A_matrix) > 5) = 5 ; B_5_matrix (abs (B_matrix) > 5) = 5 ; - % for gamma: domain is [-inf,inf], but not defined for negative - % integers, and rounding to integers fails when x is outside this range + % gamma: domain is [-inf,inf], but not defined if negative + % integers, and rounding to integers fails when x is outside this range: A_pos5_matrix = A_matrix ; B_pos5_matrix = B_matrix ; A_pos5_matrix (A_matrix <= 0.1 & A_matrix ~= 0) = 0.1 ; @@ -70,40 +80,91 @@ A_pos5_matrix (A_matrix > 5) = 5 ; B_pos5_matrix (B_matrix > 5) = 5 ; -%{ - % for minv: do not try 1/0 for the complex case - A_nonzero_matrix = A_matrix ; - B_nonzero_matrix = B_matrix ; - A_pattern = full (logical (spones (A_matrix))) ; - B_pattern = full (logical (spones (B_matrix))) ; - A_zero = full (abs (A_nonzero_matrix) < 1) ; - B_zero = full (abs (B_nonzero_matrix) < 1) ; - A_nonzero_matrix (A_pattern & A_zero) = 1 ; - B_nonzero_matrix (B_pattern & B_zero) = 1 ; -%} - - % do longer tests for a few types + % do longer tests with a few types longer_tests = isequal (atype, 'double') || isequal (atype, 'int64') ; if (longer_tests) - hrange = [0 1] ; - crange = [0 1] ; + hrange = 0 ; % SKIP [0 1] ; + crange = 0 ; % SKIP [0 1] ; else hrange = 0 ; crange = 1 ; end - for k2 = 1:length(unary_ops) - op.opname = unary_ops {k2} ; - if (longer_tests) - fprintf ('\n') ; - end - fprintf (' %s', op.opname) ; + % skip some ops, depending on the atype + unops = unary_ops.all ; + if (isequal (atype, 'int64')) + % just do some of the ops + unops = [unary_ops.alltypes unary_ops.real unary_ops.int ... + unary_ops.positional] ; + elseif (test_contains (atype, 'int')) + unops = [unary_ops.alltypes unary_ops.real unary_ops.int ] ; + else + % do all of the ops + unops = unary_ops.all ; + end + unops = setdiff (unops, {'one'}) ; + if (~test_contains (atype, 'logical')) + unops = setdiff (unops, {'identity'}) ; + end + if (isequal (atype, 'double')) + unops = setdiff (unops, {'ainv'}) ; + end + if (test_contains (atype, 'complex')) + unops = setdiff (unops, {'not', 'lgamma', 'tgamma', 'erf', 'erfc', ... + 'frexpx', 'frexpe', 'cbrt'}) ; + end + if (~(isequal (atype, 'logical') || isequal (atype, 'single complex'))) + unops = setdiff (unops, {'conj'}) ; + end + if (isequal (atype, 'double') || isequal (atype, 'single')) + unops = setdiff (unops, {'real', 'imag', 'carg'}) ; + end + if (test_contains (atype, 'double') || ... + test_contains (atype, 'single') || ... + isequal (atype, 'logical')) + unops = setdiff (unops, {'bnot'}) ; + end + + % just do some of the optypes, depending on the matrix type + switch (atype) + case 'logical' + optypes = types ; % do all optypes + case 'int8' + optypes = { 'logical', 'int8', 'int16' } ; + case 'int16' + optypes = { 'int16' } ; + case 'int32' + optypes = { 'int32' } ; + case 'int64' + optypes = { 'int32', 'int64' } ; + case 'uint8' + optypes = { 'uint8' } ; + case 'uint16' + optypes = { 'uint16' } ; + case 'uint32' + optypes = { 'uint32' } ; + case 'uint64' + optypes = { 'uint64' } ; + case 'single' + optypes = { 'single' } ; + case 'double' + optypes = { 'double' } ; + case 'single complex' + optypes = { 'single complex' } ; + case 'double complex' + optypes = { 'double complex' } ; + end + + for k2 = 1:length(unops) + op.opname = unops {k2} ; + fprintf ('\n%-12s ', op.opname) ; GB_mex_finalize ; - for k3 = 1:length(types) - op.optype = types {k3} ; + for k3 = 1:length(optypes) + op.optype = optypes {k3} ; - if (ispc && test_contains (op.opname, 'asin') && test_contains (op.optype, 'complex')) + if (ispc && test_contains (op.opname, 'asin') && ... + test_contains (op.optype, 'complex')) % casin and casinf are broken on Windows fprintf ('#') ; continue ; @@ -123,7 +184,6 @@ catch continue end - fprintf ('.') ; A.matrix = A_matrix ; B.matrix = B_matrix ; @@ -145,7 +205,7 @@ if (~test_contains (optype, 'complex')) - % for real operators, avoiding complex results + % real operators, avoiding complex results: switch (opname) case { 'pow', 'sqrt', 'log', 'log10', 'log2', ... 'gammaln', 'lgamma' } @@ -187,118 +247,137 @@ end - % op - tol = 0 ; - if (test_contains (optype, 'single') || test_contains (atype, 'single')) + if (test_contains (optype, 'single') || ... + test_contains (atype, 'single')) tol = 1e-5 ; - elseif (test_contains (optype, 'double') || test_contains (atype, 'double')) + elseif (test_contains (optype, 'double') || ... + test_contains (atype, 'double')) tol = 1e-12 ; end - for A_sparsity = [hrange 2] - - if (A_sparsity == 0) - A_is_hyper = 0 ; - A_is_bitmap = 0 ; - A_sparsity_control = 2 ; % sparse - elseif (A_sparsity == 1) - A_is_hyper = 1 ; - A_is_bitmap = 0 ; - A_sparsity_control = 1 ; % hypersparse - else - A_is_hyper = 0 ; - A_is_bitmap = 1 ; - A_sparsity_control = 4 ; % bitmap - end - - for A_is_csc = crange - - if (longer_tests) - fprintf ('.') ; - end + for A_sparsity = 0 % SKIP [hrange 2] + + if (A_sparsity == 0) + A_is_hyper = 0 ; + A_is_bitmap = 0 ; + A_sparsity_control = 2 ; % sparse + elseif (A_sparsity == 1) + A_is_hyper = 1 ; + A_is_bitmap = 0 ; + A_sparsity_control = 1 ; % hypersparse + else + A_is_hyper = 0 ; + A_is_bitmap = 1 ; + A_sparsity_control = 4 ; % bitmap + end - for C_is_hyper = hrange - for C_is_csc = crange - for M_is_hyper = hrange - for M_is_csc = crange - A.is_csc = A_is_csc ; A.is_hyper = A_is_hyper ; - Cin.is_csc = C_is_csc ; Cin.is_hyper = C_is_hyper ; - B.is_csc = A_is_csc ; B.is_hyper = A_is_hyper ; - Mask.is_csc = M_is_csc ; Mask.is_hyper = M_is_hyper ; - - A.sparsity = A_sparsity_control ; - B.sparsity = A_sparsity_control ; - - % no mask - C1 = GB_spec_apply (Cin, [], [], op, A, []) ; - C2 = GB_mex_apply (Cin, [], [], op, A, []) ; - test10_compare (op, C1, C2, tol) ; - - % with mask - C1 = GB_spec_apply (Cin, Mask, [], op, A, []) ; - C2 = GB_mex_apply (Cin, Mask, [], op, A, []) ; - test10_compare (op, C1, C2, tol) ; - - % with C == mask, and outp = replace - C1 = GB_spec_apply (Cin, Cmask, [], op, A, dr) ; - C2 = GB_mex_apply_maskalias (Cin, [], op, A, dr) ; - test10_compare (op, C1, C2, tol) ; - - % no mask, transpose - C1 = GB_spec_apply (Cin, [], [], op, B, dt) ; - C2 = GB_mex_apply (Cin, [], [], op, B, dt) ; - test10_compare (op, C1, C2, tol) ; - - % with mask, transpose - C1 = GB_spec_apply (Cin, Mask, [], op, B, dt) ; - C2 = GB_mex_apply (Cin, Mask, [], op, B, dt) ; - test10_compare (op, C1, C2, tol) ; + for A_is_csc = crange + for C_is_hyper = hrange + for C_is_csc = crange + for M_is_hyper = hrange + for M_is_csc = crange + + A.is_csc = A_is_csc ; A.is_hyper = A_is_hyper ; + Cin.is_csc = C_is_csc ; Cin.is_hyper = C_is_hyper ; + B.is_csc = A_is_csc ; B.is_hyper = A_is_hyper ; + Mask.is_csc = M_is_csc ; Mask.is_hyper = M_is_hyper ; + + A.sparsity = A_sparsity_control ; + B.sparsity = A_sparsity_control ; + + % no mask + C1 = GB_spec_apply (Cin, [], [], op, A, []) ; + C2 = GB_mex_apply (Cin, [], [], op, A, []) ; + test10_compare (op, C1, C2, tol) ; + + % with mask + C1 = GB_spec_apply (Cin, Mask, [], op, A, []) ; + C2 = GB_mex_apply (Cin, Mask, [], op, A, []) ; + test10_compare (op, C1, C2, tol) ; + + % with C == mask, and outp = replace + C1 = GB_spec_apply (Cin, Cmask, [], op, A, dr) ; + C2 = GB_mex_apply_maskalias (Cin, [], op, A, dr) ; + test10_compare (op, C1, C2, tol) ; + + % no mask, transpose + C1 = GB_spec_apply (Cin, [], [], op, B, dt) ; + C2 = GB_mex_apply (Cin, [], [], op, B, dt) ; + test10_compare (op, C1, C2, tol) ; + + % with mask, transpose + C1 = GB_spec_apply (Cin, Mask, [], op, B, dt) ; + C2 = GB_mex_apply (Cin, Mask, [], op, B, dt) ; + test10_compare (op, C1, C2, tol) ; + + skip_arc = false ; + switch (opname) + % the results from these operators must be checked + % before summing their results with the accum operator, + % so skip the rest of the tests. + case {'acos', 'asin', 'atan' 'acosh', 'asinh', 'atanh'} + skip_arc = true ; + end + + if (~skip_arc) + + % no mask, with accum + C1 = GB_spec_apply (Cin, [], 'plus', op, A, []) ; + C2 = GB_mex_apply (Cin, [], 'plus', op, A, []) ; + test10_compare (op, C1, C2, tol) ; + + % with mask and accum + C1 = GB_spec_apply (Cin, Mask, 'plus', op, A, []) ; + C2 = GB_mex_apply (Cin, Mask, 'plus', op, A, []) ; + test10_compare (op, C1, C2, tol) ; + + % with C == mask and accum, and outp = replace + C1 = GB_spec_apply (Cin, Cmask, 'plus', op, A, dr) ; + C2 = GB_mex_apply_maskalias (Cin, 'plus', op, A, dr) ; + test10_compare (op, C1, C2, tol) ; + + % no mask, with accum, transpose + C1 = GB_spec_apply (Cin, [], 'plus', op, B, dt) ; + C2 = GB_mex_apply (Cin, [], 'plus', op, B, dt) ; + test10_compare (op, C1, C2, tol) ; + + % with mask and accum, transpose + C1 = GB_spec_apply (Cin, Mask, 'plus', op, B, dt) ; + C2 = GB_mex_apply (Cin, Mask, 'plus', op, B, dt) ; + test10_compare (op, C1, C2, tol) ; + + end + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf ('\n[%d,%d,%d,%d,%d,%d]', ... + A_sparsity , ... + A_is_csc , ... + C_is_hyper , ... + C_is_csc , ... + M_is_hyper , ... + M_is_csc ) ; + fprintf (' (%d, %d, %s).\n', d, c - cfirst, optype) ; + else + fprintf ('.') ; + end + clast = c ; + else + fprintf ('.') ; + end - switch (opname) - % the results from these operators must be check before summing - % their results with the accum operator, so skip the rest of - % the tests. - case { 'acos', 'asin', 'atan' 'acosh', 'asinh', 'atanh' } - continue ; + end + end + end + end + end end - - % no mask, with accum - C1 = GB_spec_apply (Cin, [], 'plus', op, A, []) ; - C2 = GB_mex_apply (Cin, [], 'plus', op, A, []) ; - test10_compare (op, C1, C2, tol) ; - - % with mask and accum - C1 = GB_spec_apply (Cin, Mask, 'plus', op, A, []) ; - C2 = GB_mex_apply (Cin, Mask, 'plus', op, A, []) ; - test10_compare (op, C1, C2, tol) ; - - % with C == mask and accum, and outp = replace - C1 = GB_spec_apply (Cin, Cmask, 'plus', op, A, dr) ; - C2 = GB_mex_apply_maskalias (Cin, 'plus', op, A, dr) ; - test10_compare (op, C1, C2, tol) ; - - % no mask, with accum, transpose - C1 = GB_spec_apply (Cin, [], 'plus', op, B, dt) ; - C2 = GB_mex_apply (Cin, [], 'plus', op, B, dt) ; - test10_compare (op, C1, C2, tol) ; - - % with mask and accum, transpose - C1 = GB_spec_apply (Cin, Mask, 'plus', op, B, dt) ; - C2 = GB_mex_apply (Cin, Mask, 'plus', op, B, dt) ; - test10_compare (op, C1, C2, tol) ; - end end - - end - end - end - end - end - end fprintf ('\n') ; - end fprintf ('\ntest10: all tests passed\n') ; diff --git a/Test/test11.m b/Test/test11.m index 5b5117c6f1..c73a3943fd 100644 --- a/Test/test11.m +++ b/Test/test11.m @@ -70,5 +70,16 @@ end end +% iso bitmap case +clear A +A.matrix = pi * sparse (rand (5) > 0.5) ; +A.iso = true ; +A.sparsity = 4 ; +[I1, J1, X1] = GB_mex_extractTuples (A, 'double') ; +[I2, J2, X2] = GB_spec_extractTuples (A, 'double') ; +assert (isequal (I1, I2)) ; +assert (isequal (J1, J2)) ; +assert (isequal (X1, X2)) ; + fprintf ('\ntest11: all tests passed\n') ; diff --git a/Test/test125.m b/Test/test125.m index d7661ef96d..093c549fe2 100644 --- a/Test/test125.m +++ b/Test/test125.m @@ -6,29 +6,16 @@ % SPDX-License-Identifier: Apache-2.0 [binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -% mult_ops = binops.positional ; mult_ops = binops.all ; types = types.all ; -if (nargin < 1) - fulltest = 1 ; -end - -if (fulltest) - fprintf ('-------------- GrB_mxm on all semirings (row,col scale)\n') ; - n_semirings_max = inf ; -else - fprintf ('quick test of GrB_mxm (dot product method)\n') ; - n_semirings_max = 1 ; -end +fprintf ('-------------- GrB_mxm on all semirings (row,col scale)\n') ; dnn = struct ; dtn = struct ( 'inp0', 'tran' ) ; dnt = struct ( 'inp1', 'tran' ) ; dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; -ntrials = 0 ; - rng ('default') ; n = 10 ; @@ -46,16 +33,12 @@ for k1 = 1:length(mult_ops) mulop = mult_ops {k1} ; - if (fulltest) - fprintf ('\n%-10s ', mulop) ; - end + fprintf ('\n%-10s ', mulop) ; nmult_semirings = 0 ; for k2 = 1:length(add_ops) addop = add_ops {k2} ; - if (fulltest) - fprintf ('.') ; - end + fprintf ('.') ; for k3 = 1:length (types) type = types {k3} ; @@ -79,11 +62,6 @@ continue end - if (n_semirings+1 > n_semirings_max) - fprintf ('\ntest125: all quick tests passed\n') ; - return ; - end - n_semirings = n_semirings + 1 ; nmult_semirings = nmult_semirings + 1 ; A.class = type ; @@ -100,42 +78,6 @@ C0 = GB_spec_mxm (C, [ ], [ ], semiring, B, A, dnn); GB_spec_compare (C0, C1, identity) ; - % dump the semiring list to compare with Source/FactoryKernels - switch (xtype) - case { 'logical' } - xtype = 'bool' ; - case { 'single complex' } - xtype = 'fc32' ; - case { 'double complex' } - xtype = 'fc64' ; - case { 'single' } - xtype = 'fp32' ; - case { 'double' } - xtype = 'fp64' ; - end - - switch (add_opname) - case { 'xor' } - add_opname = 'lxor' ; - case { 'or' } - add_opname = 'lor' ; - case { 'and' } - add_opname = 'land' ; - end - - switch (mult_opname) - case { 'xor' } - mult_opname = 'lxor' ; - case { 'or' } - mult_opname = 'lor' ; - case { 'and' } - mult_opname = 'land' ; - case { 'pair', 'oneb' } - switch (add_opname) - case { 'eq', 'land', 'lor', 'min', 'max', 'times' } - add_opname = 'any' ; - end - end end end fprintf (' %4d', nmult_semirings) ; diff --git a/Test/test127.m b/Test/test127.m index 0541858bbd..05005eb17a 100644 --- a/Test/test127.m +++ b/Test/test127.m @@ -1,7 +1,7 @@ function test127 %TEST127 test GrB_eWiseAdd and GrB_eWiseMult (all types and operators) -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 [binops, ~, ~, types, ~, ~] = GB_spec_opsall ; @@ -82,15 +82,27 @@ ATmat2 = Amat2.' ; BTmat2 = Bmat2.' ; -for k1 = 1:length (types) - type = types {k1} ; - fprintf ('\n\n%-8s : ', type) ; +M_is_very_sparse = 0 ; +M_is_csc = 0 ; +A_is_csc = 0 ; +B_is_csc = 0 ; +C_is_csc = 0 ; +C_sparsity_control = 0 ; +M_sparsity_control = 0 ; - for k2 = 1:length(binops) - binop = binops {k2} ; +for k2 = 1:length(binops) + binop = binops {k2} ; + + for k1 = 1:length (types) + type = types {k1} ; op.opname = binop ; op.optype = type ; + try + GB_spec_operator (op) ; + catch + continue ; + end if (test_contains (type, 'single')) tol = 1e-5 ; @@ -99,329 +111,158 @@ else tol = 0 ; end - - try - GB_spec_operator (op) ; - catch - continue ; - end - - fprintf (' %s', binop) ; for A_sparsity_control = 0:1 - for A_is_csc = 0 % 0:1 - for B_sparsity_control = 0:1 - for B_is_csc = 0 % 0:1 - for C_sparsity_control = 0:1 - for C_is_csc = 0 % 0:1 - - if (A_sparsity_control == 0) - A_is_hyper = 0 ; % not hyper - A_sparsity = 1 ; % sparse - else - A_is_hyper = 0 ; % not hyper - A_sparsity = 4 ; % bitmap - end - - if (B_sparsity_control == 0) - B_is_hyper = 0 ; % not hyper - B_sparsity = 1 ; % sparse - else - B_is_hyper = 0 ; % not hyper - B_sparsity = 4 ; % bitmap - end - - if (C_sparsity_control == 0) - C_is_hyper = 0 ; % not hyper - C_sparsity = 1 ; % sparse - else - C_is_hyper = 0 ; % not hyper - C_sparsity = 4 ; % bitmap - end - - for native = 1 % 0:1 - - clear A AT B BT C u v - - if (isequal (binop, 'pow')) - A.matrix = Amat2 ; - AT.matrix = ATmat2 ; - B.matrix = Bmat2 ; - BT.matrix = BTmat2 ; - C.matrix = Cmat2 ; - u.matrix = uvec2 ; - v.matrix = vvec2 ; - else - A.matrix = Amat ; - AT.matrix = ATmat ; - B.matrix = Bmat ; - BT.matrix = BTmat ; - C.matrix = Cmat ; - u.matrix = uvec ; - v.matrix = vvec ; - end - - A.is_hyper = A_is_hyper ; - A.is_csc = A_is_csc ; - A.sparsity = A_sparsity ; - if (native) - A.class = op.optype ; - end - - AT.is_hyper = A_is_hyper ; - AT.sparsity = A_sparsity ; - AT.is_csc = A_is_csc ; - if (native) - AT.class = op.optype ; - end - - B.is_hyper = B_is_hyper ; - B.sparsity = B_sparsity ; - B.is_csc = B_is_csc ; - if (native) - B.class = op.optype ; - end - - BT.is_hyper = B_is_hyper ; - BT.sparsity = B_sparsity ; - BT.is_csc = B_is_csc ; - if (native) - BT.class = op.optype ; - end - - C.is_hyper = C_is_hyper ; - C.is_csc = C_is_csc ; - C.sparsity = C_sparsity ; - - u.is_csc = true ; - if (native) - u.class = op.optype ; - end - - v.is_csc = true ; - if (native) - v.class = op.optype ; - end - - %--------------------------------------- - % A+B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, A, B, dnn) ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, A, B, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseAdd (w, [ ], [ ], op, u, v, dnn) ; - w1 = GB_mex_Vector_eWiseAdd (w, [ ], [ ], op, u, v, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'+B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, AT, B, dtn) ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, AT, B, dtn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A+B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, A, BT, dnt) ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, A, BT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'+B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, AT, BT, dtt) ; - C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, AT, BT, dtt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, A, B, dnn) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, A, B, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseMult (w, [ ], [ ], op, u, v, dnn) ; - w1 = GB_mex_Vector_eWiseMult (w, [ ], [ ], op, u, v, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'.*B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, AT, B, dtn) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, AT, B, dtn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % B.*A' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, B, AT, dnt) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, B, AT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, A, BT, dnt) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, A, BT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'.*B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, AT, BT, dtt) ; - C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, AT, BT, dtt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %----------------------------------------------- - % with mask - %----------------------------------------------- - - for M_is_very_sparse = 0 % 0:1 - % for M_is_hyper = 0 % 0:1 - for M_sparsity_control = 0:1 - for M_is_csc = 0 % 0:1 - - clear Mask mask - if (M_is_very_sparse) - Mask.matrix = Maskmat2 ; - mask.matrix = maskvec2 ; - else - Mask.matrix = Maskmat ; - mask.matrix = maskvec ; - end - - if (M_sparsity_control == 0) - M_is_hyper = 0 ; % not hyper - M_sparsity = 1 ; % sparse - else - M_is_hyper = 0 ; % not hyper - M_sparsity = 4 ; % bitmap - end - - Mask.is_hyper = M_is_hyper ; - Mask.sparsity = M_sparsity ; - Mask.is_csc = M_is_csc ; - mask.is_csc = true ; - - %--------------------------------------- - % A+B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn) ; - w1 = GB_mex_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A+B, with mask complemented - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn_notM) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn_notM) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn_notM) ; - w1 = GB_mex_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn_notM) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'+B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, AT, B, dtn) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, AT, B, dtn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A+B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, BT, dnt) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, BT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'+B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, AT, BT, dtt) ; - C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, AT, BT, dtt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn) ; - w1 = GB_mex_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'.*B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, AT, B, dtn) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, AT, B, dtn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, BT, dnt) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, BT, dnt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'.*B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, AT, BT, dtt) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, AT, BT, dtt) ; - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B, with mask complemented - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn_notM) ; - C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn_notM) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn_notM) ; - w1 = GB_mex_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn_notM) ; - GB_spec_compare (w0, w1, 0, tol) ; - - - end - end - end - end - end - end - end - end - end + for B_sparsity_control = 0:1 + + if (A_sparsity_control == 1 && B_sparsity_control == 0) + continue ; + end + + %--------------------------------------------------------------- + % create the test matrices + %--------------------------------------------------------------- + + if (A_sparsity_control == 0) + A_is_hyper = 0 ; % not hyper + A_sparsity = 1 ; % sparse + else + A_is_hyper = 0 ; % not hyper + A_sparsity = 4 ; % bitmap + end + + if (B_sparsity_control == 0) + B_is_hyper = 0 ; % not hyper + B_sparsity = 1 ; % sparse + else + B_is_hyper = 0 ; % not hyper + B_sparsity = 4 ; % bitmap + end + + if (C_sparsity_control == 0) + C_is_hyper = 0 ; % not hyper + C_sparsity = 1 ; % sparse + else + C_is_hyper = 0 ; % not hyper + C_sparsity = 4 ; % bitmap + end + + clear A AT B BT C u v + + if (isequal (binop, 'pow')) + A.matrix = Amat2 ; + AT.matrix = ATmat2 ; + B.matrix = Bmat2 ; + BT.matrix = BTmat2 ; + C.matrix = Cmat2 ; + u.matrix = uvec2 ; + v.matrix = vvec2 ; + else + A.matrix = Amat ; + AT.matrix = ATmat ; + B.matrix = Bmat ; + BT.matrix = BTmat ; + C.matrix = Cmat ; + u.matrix = uvec ; + v.matrix = vvec ; + end + + A.is_hyper = A_is_hyper ; + A.is_csc = A_is_csc ; + A.sparsity = A_sparsity ; + A.class = op.optype ; + + AT.is_hyper = A_is_hyper ; + AT.sparsity = A_sparsity ; + AT.is_csc = A_is_csc ; + AT.class = op.optype ; + + B.is_hyper = B_is_hyper ; + B.sparsity = B_sparsity ; + B.is_csc = B_is_csc ; + B.class = op.optype ; + + BT.is_hyper = B_is_hyper ; + BT.sparsity = B_sparsity ; + BT.is_csc = B_is_csc ; + BT.class = op.optype ; + + C.is_hyper = C_is_hyper ; + C.is_csc = C_is_csc ; + C.sparsity = C_sparsity ; + + u.is_csc = true ; + u.class = op.optype ; + + v.is_csc = true ; + v.class = op.optype ; + + clear Mask mask + if (M_is_very_sparse) + Mask.matrix = Maskmat2 ; + mask.matrix = maskvec2 ; + else + Mask.matrix = Maskmat ; + mask.matrix = maskvec ; + end + + if (M_sparsity_control == 0) + M_is_hyper = 0 ; % not hyper + M_sparsity = 1 ; % sparse + else + M_is_hyper = 0 ; % not hyper + M_sparsity = 4 ; % bitmap + end + + Mask.is_hyper = M_is_hyper ; + Mask.sparsity = M_sparsity ; + Mask.is_csc = M_is_csc ; + mask.is_csc = true ; + + %--------------------------------------------------------------- + % A+B + %--------------------------------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, A, B, dnn) ; + C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, A, B, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------------------------------- + % A.*B + %--------------------------------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, A, B, dnn) ; + C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, A, B, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------------------------------- + % A'.*B + %--------------------------------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, AT, B, dtn) ; + C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, AT, B, dtn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------------------------------- + % B.*A' + %--------------------------------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, B, AT, dnt) ; + C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, B, AT, dnt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------------------------------- + % A.*B, with mask + %--------------------------------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn) ; + C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + end end end + fprintf ('.') ; end fprintf ('\ntest127: all tests passed\n') ; diff --git a/Test/test135.m b/Test/test135.m index 3f4a3a031a..6b378b95f5 100644 --- a/Test/test135.m +++ b/Test/test135.m @@ -1,7 +1,7 @@ function test135 %TEST135 reduce-to-scalar, built-in monoids with terminal values -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 fprintf ('test135: reduce to scalar\n') ; @@ -14,34 +14,63 @@ nthreads_max = feature_numcores %------------------------------------------------------------------------------- -fprintf ('================== int8 min:\n') ; -X = rand (n,1) ; -X = (256 * X) - 128 ; -X = int8 (X) ; -s = int8 (inf) ; -tic -c0 = min (X) ; -tm = toc ; -fprintf ('built-in: %g sec\n', tm) ; +fprintf ('================== int32 min:\n') ; + + X = rand (n,1) ; + X = (double (int32 (inf)) * X) - double (int32 (inf) / 2) ; + X = int32 (X) ; + X (n/2) = int32 (-inf) ; + s = int32 (inf) ; + tic + c0 = min (X) ; + tm = toc ; + fprintf ('built-in: %g sec\n', tm) ; + A.matrix = sparse (double (X)) ; + A.pattern = logical (spones (X)) ; + A.class = 'int32' ; + nthreads_set (1,1) ; + tic + c1 = GB_mex_reduce_to_scalar (s, [ ], 'min', A) ; + t1 = toc ; + assert (c1 == c0) ; + fprintf ('1 thread %g sec\n', t1) ; + for nth = 2:64 + nthreads_set (nth,1) ; + tic + c2 = GB_mex_reduce_to_scalar (s, [ ], 'min', A) ; + t2 = toc ; + assert (c2 == c0) ; + % fprintf ('%d threads %g sec\n', nth, t2) ; + end -A.matrix = sparse (double (X)) ; -A.pattern = logical (spones (X)) ; -A.class = 'int8' ; +%------------------------------------------------------------------------------- -nthreads_set (1,1) ; -tic -c1 = GB_mex_reduce_to_scalar (s, [ ], 'min', A) ; -t1 = toc ; -assert (c1 == c0) ; -fprintf ('1 thread %g sec\n', t1) ; +fprintf ('================== int8 min:\n') ; -nthreads_set (nthreads_max,1) ; -tic -c2 = GB_mex_reduce_to_scalar (s, [ ], 'min', A) ; -t2 = toc ; -assert (c2 == c0) ; -fprintf ('%d threads %g sec\n', nthreads_max, t2) ; + X = rand (n,1) ; + X = (256 * X) - 128 ; + X = int8 (X) ; + s = int8 (inf) ; + tic + c0 = min (X) ; + tm = toc ; + fprintf ('built-in: %g sec\n', tm) ; + A.matrix = sparse (double (X)) ; + A.pattern = logical (spones (X)) ; + A.class = 'int8' ; + nthreads_set (1,1) ; + tic + c1 = GB_mex_reduce_to_scalar (s, [ ], 'min', A) ; + t1 = toc ; + assert (c1 == c0) ; + fprintf ('1 thread %g sec\n', t1) ; + nthreads_set (nthreads_max,1) ; + tic + c2 = GB_mex_reduce_to_scalar (s, [ ], 'min', A) ; + t2 = toc ; + assert (c2 == c0) ; + fprintf ('%d threads %g sec\n', nthreads_max, t2) ; %------------------------------------------------------------------------------- fprintf ('================== double min:\n') ; diff --git a/Test/test14.m b/Test/test14.m index 65333c7f62..c15c1dc3c1 100644 --- a/Test/test14.m +++ b/Test/test14.m @@ -1,26 +1,145 @@ -function test14 +function test14(tasks) %TEST14 test GrB_reduce -% 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 fprintf ('\ntest14: reduce to column and scalar\n') ; +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 'min', 1, 0, 0}, ... % ( 19, 19) + { 'max', 1, 0, 0}, ... % ( 10, 29) + { 'any', 1, 0, 0}, ... % ( 10, 39) + { 'or', 1, 0, 0}, ... % ( 1, 40) + { 'and', 1, 0, 0}, ... % ( 1, 41) + { 'xor', 1, 0, 0}, ... % ( 8, 49) + { 'eq', 1, 0, 0}, ... % ( 10, 59) + { 'min', 1, 0, 1}, ... % ( 7, 66) + { 'min', 1, 1, 0}, ... % ( 2, 68) + { 'min', 2, 0, 0}, ... % ( 11, 79) + { 'max', 2, 0, 0}, ... % ( 9, 88) + { 'plus', 2, 0, 0}, ... % ( 8, 96) + { 'times', 2, 0, 0}, ... % ( 9, 105) + { 'any', 2, 0, 0}, ... % ( 9, 114) + { 'min', 2, 0, 1}, ... % ( 2, 116) + { 'min', 3, 0, 0}, ... % ( 30, 146) + { 'max', 3, 0, 0}, ... % ( 17, 163) + { 'plus', 3, 0, 0}, ... % ( 13, 176) + { 'times', 3, 0, 0}, ... % ( 24, 200) + { 'any', 3, 0, 0}, ... % ( 16, 216) + { 'min', 4, 0, 0}, ... % ( 10, 226) + { 'max', 4, 0, 0}, ... % ( 9, 235) + { 'plus', 4, 0, 0}, ... % ( 8, 243) + { 'times', 4, 0, 0}, ... % ( 8, 251) + { 'any', 4, 0, 0}, ... % ( 9, 260) + { 'min', 5, 0, 0}, ... % ( 10, 270) + { 'max', 5, 0, 0}, ... % ( 9, 279) + { 'plus', 5, 0, 0}, ... % ( 8, 287) + { 'times', 5, 0, 0}, ... % ( 9, 296) + { 'any', 5, 0, 0}, ... % ( 9, 305) + { 'min', 6, 0, 0}, ... % ( 12, 317) + { 'max', 6, 0, 0}, ... % ( 9, 326) + { 'plus', 6, 0, 0}, ... % ( 8, 334) + { 'times', 6, 0, 0}, ... % ( 9, 343) + { 'any', 6, 0, 0}, ... % ( 9, 352) + { 'bor', 6, 0, 0}, ... % ( 14, 366) + { 'band', 6, 0, 0}, ... % ( 12, 378) + { 'bxor', 6, 0, 0}, ... % ( 3, 381) + { 'bxnor', 6, 0, 0}, ... % ( 10, 391) + { 'min', 7, 0, 0}, ... % ( 17, 408) + { 'max', 7, 0, 0}, ... % ( 13, 421) + { 'plus', 7, 0, 0}, ... % ( 7, 428) + { 'times', 7, 0, 0}, ... % ( 9, 437) + { 'any', 7, 0, 0}, ... % ( 9, 446) + { 'bor', 7, 0, 0}, ... % ( 4, 450) + { 'band', 7, 0, 0}, ... % ( 3, 453) + { 'bxor', 7, 0, 0}, ... % ( 2, 455) + { 'bxnor', 7, 0, 0}, ... % ( 2, 457) + { 'min', 8, 0, 0}, ... % ( 10, 467) + { 'max', 8, 0, 0}, ... % ( 9, 476) + { 'plus', 8, 0, 0}, ... % ( 8, 484) + { 'times', 8, 0, 0}, ... % ( 9, 493) + { 'any', 8, 0, 0}, ... % ( 9, 502) + { 'bor', 8, 0, 0}, ... % ( 4, 506) + { 'band', 8, 0, 0}, ... % ( 3, 509) + { 'bxor', 8, 0, 0}, ... % ( 2, 511) + { 'bxnor', 8, 0, 0}, ... % ( 2, 513) + { 'min', 8, 0, 1}, ... % ( 2, 515) + { 'min', 9, 0, 0}, ... % ( 12, 527) + { 'max', 9, 0, 0}, ... % ( 9, 536) + { 'plus', 9, 0, 0}, ... % ( 8, 544) + { 'times', 9, 0, 0}, ... % ( 9, 553) + { 'any', 9, 0, 0}, ... % ( 9, 562) + { 'bor', 9, 0, 0}, ... % ( 5, 567) + { 'band', 9, 0, 0}, ... % ( 3, 570) + { 'bxor', 9, 0, 0}, ... % ( 2, 572) + { 'bxnor', 9, 0, 0}, ... % ( 2, 574) + { 'min', 10, 0, 0}, ... % ( 12, 586) + { 'max', 10, 0, 0}, ... % ( 9, 595) + { 'plus', 10, 0, 0}, ... % ( 8, 603) + { 'times', 10, 0, 0}, ... % ( 9, 612) + { 'any', 10, 0, 0}, ... % ( 9, 621) + { 'min', 11, 0, 0}, ... % ( 9, 630) + { 'max', 11, 0, 0}, ... % ( 6, 636) + { 'plus', 11, 0, 0}, ... % ( 6, 642) + { 'times', 11, 0, 0}, ... % ( 9, 651) + { 'any', 11, 0, 0}, ... % ( 9, 660) + { 'plus', 12, 0, 0}, ... % ( 11, 671) + { 'times', 12, 0, 0}, ... % ( 8, 679) + { 'any', 12, 0, 0}, ... % ( 9, 688) + { 'plus', 13, 0, 0}, ... % ( 10, 698) + { 'times', 13, 0, 0}, ... % ( 7, 705) + { 'any', 13, 0, 0}, ... % ( 9, 714) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + [~, ~, add_ops, types, ~, ~] = GB_spec_opsall ; types = types.all ; -rng ('default') ; - m = 8 ; n = 4 ; dt = struct ('inp0', 'tran') ; +ntypes = length (types) ; +A_matrices = cell (ntypes,1) ; +B_matrices = cell (ntypes,1) ; +w_matrices = cell (ntypes,1) ; +m_matrices = cell (ntypes,1) ; + +rng ('default') ; for k1 = 1:length(types) atype = types {k1} ; - fprintf ('.') ; - A = GB_spec_random (m, n, 0.3, 100, atype) ; - B = GB_spec_random (n, m, 0.3, 100, atype) ; - w = GB_spec_random (m, 1, 0.3, 100, atype) ; + A_matrices {k1} = GB_spec_random (m, n, 0.3, 100, atype) ; + B_matrices {k1} = GB_spec_random (n, m, 0.3, 100, atype) ; + w_matrices {k1} = GB_spec_random (m, 1, 0.3, 100, atype) ; + m_matrices {k1} = GB_random_mask (m, 1, 0.5, true, false) ; +end + +for kk = 1:length(tasks) + task = tasks {kk} ; + op = task {1} ; + k1 = task {2} ; + A_is_hyper = task {3} ; + A_is_csc = task {4} ; + + atype = types {k1} ; + + A = A_matrices {k1} ; + B = B_matrices {k1} ; + w = w_matrices {k1} ; cin = GB_mex_cast (0, atype) ; clear S_input @@ -33,205 +152,201 @@ E_input.pattern = false ; E_input.class = atype ; - mask = GB_random_mask (m, 1, 0.5, true, false) ; + mask = m_matrices {k1} ; - if (isequal (atype, 'logical')) - ops = {'or', 'and', 'xor', 'eq', 'any'} ; - else - ops = {'min', 'max', 'plus', 'times', 'any'} ; - end + is_float = test_contains (atype, 'single') || ... + test_contains (atype, 'double') ; + + A.is_csc = A_is_csc ; A.is_hyper = A_is_hyper ; + B.is_csc = A_is_csc ; B.is_hyper = A_is_hyper ; - if (isequal (atype, 'double')) - hrange = [0 1] ; - crange = [0 1] ; + if (isequal (op, 'any')) + tol = [ ] ; + elseif (test_contains (atype, 'single')) + tol = 1e-5 ; + elseif (test_contains (atype, 'double')) + tol = 1e-12 ; else - hrange = 0 ; - crange = 1 ; + tol = 0 ; end - is_float = test_contains (atype, 'single') || test_contains (atype, 'double') ; - - for A_is_hyper = 0:1 - for A_is_csc = 0:1 + try + GB_spec_operator (op, atype) ; + identity = GB_spec_identity (op, atype) ; + catch + continue + end - A.is_csc = A_is_csc ; A.is_hyper = A_is_hyper ; - B.is_csc = A_is_csc ; B.is_hyper = A_is_hyper ; + % no mask + w1 = GB_spec_reduce_to_vector (w, [], [], op, A, []) ; + w2 = GB_mex_reduce_to_vector (w, [], [], op, A, []) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % no mask, with accum + w1 = GB_spec_reduce_to_vector (w, [], 'plus', op, A, []) ; + w2 = GB_mex_reduce_to_vector (w, [], 'plus', op, A, []) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % with mask + w1 = GB_spec_reduce_to_vector (w, mask, [], op, A, []) ; + w2 = GB_mex_reduce_to_vector (w, mask, [], op, A, []) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % with mask and accum + w1 = GB_spec_reduce_to_vector (w, mask, 'plus', op, A, []) ; + w2 = GB_mex_reduce_to_vector (w, mask, 'plus', op, A, []) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % no mask, transpose + w1 = GB_spec_reduce_to_vector (w, [], [], op, B, dt) ; + w2 = GB_mex_reduce_to_vector (w, [], [], op, B, dt) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % no mask, with accum, transpose + w1 = GB_spec_reduce_to_vector (w, [], 'plus', op, B, dt) ; + w2 = GB_mex_reduce_to_vector (w, [], 'plus', op, B, dt) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % with mask, transpose + w1 = GB_spec_reduce_to_vector (w, mask, [], op, B, dt) ; + w2 = GB_mex_reduce_to_vector (w, mask, [], op, B, dt) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % with mask and accum, transpose + w1 = GB_spec_reduce_to_vector (w, mask, 'plus', op, B, dt) ; + w2 = GB_mex_reduce_to_vector (w, mask, 'plus', op, B, dt) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % GB_spec_reduce_to_scalar always operates column-wise, but GrB_reduce + % operates in whatever order it is given: by column if CSC or by row if + % CSR. The result can vary slightly because of different round off + % errors. A_flip causes GB_spec_reduce_to_scalar to operate in the + % same order as GrB_reduce. + + A_flip = A ; + if (~A.is_csc && is_float) + A_flip.matrix = A_flip.matrix.' ; + A_flip.pattern = A_flip.pattern' ; + A_flip.is_csc = true ; + end - for k2 = 1:length(add_ops) - op = add_ops {k2} ; + % Parallel reduction leads to different roundoff. So even with A_flip, + % c1 and c2 can only be compared to within round-off error. - if (isequal (op, 'any')) - tol = [ ] ; - elseif (test_contains (atype, 'single')) - tol = 1e-5 ; - elseif (test_contains (atype, 'double')) - tol = 1e-12 ; + % to scalar + c2 = GB_mex_reduce_to_scalar (cin, [ ], op, A) ; + if (isequal (op, 'any')) + X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; + assert (any (X == c2)) ; + else + c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) else - tol = 0 ; - end - - try - GB_spec_operator (op, atype) ; - identity = GB_spec_identity (op, atype) ; - catch - continue + assert (isequal (c1, c2)) ; end + end - % no mask - w1 = GB_spec_reduce_to_vector (w, [], [], op, A, []) ; - w2 = GB_mex_reduce_to_vector (w, [], [], op, A, []) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % no mask, with accum - w1 = GB_spec_reduce_to_vector (w, [], 'plus', op, A, []) ; - w2 = GB_mex_reduce_to_vector (w, [], 'plus', op, A, []) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % with mask - w1 = GB_spec_reduce_to_vector (w, mask, [], op, A, []) ; - w2 = GB_mex_reduce_to_vector (w, mask, [], op, A, []) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % with mask and accum - w1 = GB_spec_reduce_to_vector (w, mask, 'plus', op, A, []) ; - w2 = GB_mex_reduce_to_vector (w, mask, 'plus', op, A, []) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % no mask, transpose - w1 = GB_spec_reduce_to_vector (w, [], [], op, B, dt) ; - w2 = GB_mex_reduce_to_vector (w, [], [], op, B, dt) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % no mask, with accum, transpose - w1 = GB_spec_reduce_to_vector (w, [], 'plus', op, B, dt) ; - w2 = GB_mex_reduce_to_vector (w, [], 'plus', op, B, dt) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % with mask, transpose - w1 = GB_spec_reduce_to_vector (w, mask, [], op, B, dt) ; - w2 = GB_mex_reduce_to_vector (w, mask, [], op, B, dt) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % with mask and accum, transpose - w1 = GB_spec_reduce_to_vector (w, mask, 'plus', op, B, dt) ; - w2 = GB_mex_reduce_to_vector (w, mask, 'plus', op, B, dt) ; - GB_spec_compare (w1, w2, identity, tol) ; - - % GB_spec_reduce_to_scalar always operates column-wise, but GrB_reduce - % operates in whatever order it is given: by column if CSC or by row if - % CSR. The result can vary slightly because of different round off - % errors. A_flip causes GB_spec_reduce_to_scalar to operate in the - % same order as GrB_reduce. - - A_flip = A ; - if (~A.is_csc && is_float) - A_flip.matrix = A_flip.matrix.' ; - A_flip.pattern = A_flip.pattern' ; - A_flip.is_csc = true ; - end - - % Parallel reduction leads to different roundoff. So even with A_flip, - % c1 and c2 can only be compared to within round-off error. - - % to scalar - c2 = GB_mex_reduce_to_scalar (cin, [ ], op, A) ; - if (isequal (op, 'any')) - X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; - assert (any (X == c2)) ; + % to GrB_Scalar + S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], op, A) ; + c2 = S.matrix ; + if (isequal (op, 'any')) + X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; + assert (any (X == c2)) ; + else + c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) else - c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end + assert (isequal (c1, c2)) ; end + end - % to GrB_Scalar - S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], op, A) ; - c2 = S.matrix ; - if (isequal (op, 'any')) - X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; - assert (any (X == c2)) ; + % to GrB_Scalar + S = GB_mex_reduce_to_GrB_Scalar (E_input, [ ], op, A) ; + c2 = S.matrix ; + if (isequal (op, 'any')) + X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; + assert (any (X == c2)) ; + else + c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) else - c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end + assert (isequal (c1, c2)) ; end + end - % to GrB_Scalar - S = GB_mex_reduce_to_GrB_Scalar (E_input, [ ], op, A) ; - c2 = S.matrix ; - if (isequal (op, 'any')) - X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; - assert (any (X == c2)) ; + % vector to GrB_Scalar + S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], op, w) ; + c2 = S.matrix ; + if (isequal (op, 'any')) + X = GB_mex_cast (full (w.matrix (w.pattern)), w.class) ; + assert (any (X == c2)) ; + else + c1 = GB_spec_reduce_to_scalar (cin, [ ], op, w) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) else - c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end + assert (isequal (c1, c2)) ; end + end - % vector to GrB_Scalar - S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], op, w) ; - c2 = S.matrix ; - if (isequal (op, 'any')) - X = GB_mex_cast (full (w.matrix (w.pattern)), w.class) ; - assert (any (X == c2)) ; + % to scalar, with accum + c2 = GB_mex_reduce_to_scalar (cin, 'plus', op, A) ; + if (~isequal (op, 'any')) + c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) else - c1 = GB_spec_reduce_to_scalar (cin, [ ], op, w) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end + assert (isequal (c1, c2)) ; end + end - % to scalar, with accum - c2 = GB_mex_reduce_to_scalar (cin, 'plus', op, A) ; - if (~isequal (op, 'any')) - c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end + % to GrB_Scalar, with accum + S = GB_mex_reduce_to_GrB_Scalar (S_input, 'plus', op, A) ; + c2 = S.matrix ; + if (~isequal (op, 'any')) + c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; end + end - % to GrB_Scalar, with accum - S = GB_mex_reduce_to_GrB_Scalar (S_input, 'plus', op, A) ; - c2 = S.matrix ; - if (~isequal (op, 'any')) - c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, A_flip) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end + % vector to GrB_Scalar, with accum + S = GB_mex_reduce_to_GrB_Scalar (S_input, 'plus', op, w) ; + c2 = S.matrix ; + if (~isequal (op, 'any')) + c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, w) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; end + end - % vector to GrB_Scalar, with accum - S = GB_mex_reduce_to_GrB_Scalar (S_input, 'plus', op, w) ; - c2 = S.matrix ; - if (~isequal (op, 'any')) - c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, w) ; - if (is_float) - assert (abs (c1-c2) < tol * (abs(c1) + 1)) - else - assert (isequal (c1, c2)) ; - end + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + oo = sprintf ('''%s''', op) ; + fprintf ('{%8s, %2d, %d, %d},', ... + oo, k1, A_is_hyper, A_is_csc) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; end - - end - end + clast = c ; + else + fprintf ('.') ; end + end +%------------------------------------------------------------------------------- +% final test +%------------------------------------------------------------------------------- + clear A A.matrix = sparse (4,5) ; A.pattern = false (4,5) ; diff --git a/Test/test142.m b/Test/test142.m index 25a0f00e26..505d4b1dba 100644 --- a/Test/test142.m +++ b/Test/test142.m @@ -1,22 +1,373 @@ -function test142 +function test142(tasks) %TEST142 test GrB_assign for dense matrices -% 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 -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -binops = binops.all ; -types = types.all ; +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { +{ '', 'logical', 1}, ... % ( 20, 20) +{ 'first', 'logical', 1}, ... % ( 3, 23) +{ 'second', 'logical', 1}, ... % ( 4, 27) +{ 'pair', 'logical', 1}, ... % ( 1, 28) +{ 'plus', 'logical', 1}, ... % ( 1, 29) +{ 'minus', 'logical', 1}, ... % ( 1, 30) +{ 'times', 'logical', 1}, ... % ( 1, 31) +{ 'div', 'logical', 1}, ... % ( 2, 33) +{ 'iseq', 'logical', 1}, ... % ( 1, 34) +{ 'pow', 'logical', 1}, ... % ( 1, 35) +{ 'isgt', 'logical', 1}, ... % ( 1, 36) +{ 'islt', 'logical', 1}, ... % ( 1, 37) +{ 'isle', 'logical', 1}, ... % ( 1, 38) +{ '', 'logical', 3}, ... % ( 3, 41) +{ '', 'int8', 1}, ... % ( 2, 43) +{ 'first', 'int8', 1}, ... % ( 1, 44) +{ '', 'int8', 2}, ... % ( 6, 50) +{ 'second', 'int8', 2}, ... % ( 1, 51) +{ 'pair', 'int8', 2}, ... % ( 1, 52) +{ 'plus', 'int8', 2}, ... % ( 1, 53) +{ 'minus', 'int8', 2}, ... % ( 2, 55) +{ 'rminus', 'int8', 2}, ... % ( 2, 57) +{ 'times', 'int8', 2}, ... % ( 2, 59) +{ 'div', 'int8', 2}, ... % ( 2, 61) +{ 'rdiv', 'int8', 2}, ... % ( 2, 63) +{ 'iseq', 'int8', 2}, ... % ( 1, 64) +{ 'isne', 'int8', 2}, ... % ( 1, 65) +{ 'pow', 'int8', 2}, ... % ( 2, 67) +{ 'min', 'int8', 2}, ... % ( 2, 69) +{ 'max', 'int8', 2}, ... % ( 2, 71) +{ 'isgt', 'int8', 2}, ... % ( 1, 72) +{ 'islt', 'int8', 2}, ... % ( 1, 73) +{ 'isge', 'int8', 2}, ... % ( 2, 75) +{ 'isle', 'int8', 2}, ... % ( 2, 77) +{ 'or', 'int8', 2}, ... % ( 2, 79) +{ 'and', 'int8', 2}, ... % ( 2, 81) +{ 'xor', 'int8', 2}, ... % ( 2, 83) +{ 'bor', 'int8', 2}, ... % ( 2, 85) +{ 'band', 'int8', 2}, ... % ( 2, 87) +{ 'bxor', 'int8', 2}, ... % ( 2, 89) +{ 'bxnor', 'int8', 2}, ... % ( 2, 91) +{ 'bget', 'int8', 2}, ... % ( 2, 93) +{ 'bset', 'int8', 2}, ... % ( 2, 95) +{ 'bclr', 'int8', 2}, ... % ( 2, 97) +{ 'bshift', 'int8', 2}, ... % ( 2, 99) +{ '', 'int16', 2}, ... % ( 7, 106) +{ 'second', 'int16', 2}, ... % ( 1, 107) +{ 'pair', 'int16', 2}, ... % ( 1, 108) +{ 'plus', 'int16', 2}, ... % ( 1, 109) +{ 'minus', 'int16', 2}, ... % ( 2, 111) +{ 'rminus', 'int16', 2}, ... % ( 2, 113) +{ 'times', 'int16', 2}, ... % ( 2, 115) +{ 'div', 'int16', 2}, ... % ( 2, 117) +{ 'rdiv', 'int16', 2}, ... % ( 2, 119) +{ 'iseq', 'int16', 2}, ... % ( 1, 120) +{ 'isne', 'int16', 2}, ... % ( 1, 121) +{ 'pow', 'int16', 2}, ... % ( 2, 123) +{ 'min', 'int16', 2}, ... % ( 2, 125) +{ 'max', 'int16', 2}, ... % ( 2, 127) +{ 'isgt', 'int16', 2}, ... % ( 1, 128) +{ 'islt', 'int16', 2}, ... % ( 1, 129) +{ 'isge', 'int16', 2}, ... % ( 2, 131) +{ 'isle', 'int16', 2}, ... % ( 2, 133) +{ 'or', 'int16', 2}, ... % ( 2, 135) +{ 'and', 'int16', 2}, ... % ( 2, 137) +{ 'xor', 'int16', 2}, ... % ( 2, 139) +{ 'bor', 'int16', 2}, ... % ( 2, 141) +{ 'band', 'int16', 2}, ... % ( 2, 143) +{ 'bxor', 'int16', 2}, ... % ( 2, 145) +{ 'bxnor', 'int16', 2}, ... % ( 2, 147) +{ 'bget', 'int16', 2}, ... % ( 2, 149) +{ 'bset', 'int16', 2}, ... % ( 2, 151) +{ 'bclr', 'int16', 2}, ... % ( 2, 153) +{ 'bshift', 'int16', 2}, ... % ( 1, 154) +{ 'bshift', 'int16', 3}, ... % ( 1, 155) +{ '', 'int32', 2}, ... % ( 6, 161) +{ 'second', 'int32', 2}, ... % ( 1, 162) +{ 'pair', 'int32', 2}, ... % ( 1, 163) +{ 'plus', 'int32', 2}, ... % ( 1, 164) +{ 'minus', 'int32', 2}, ... % ( 2, 166) +{ 'rminus', 'int32', 2}, ... % ( 2, 168) +{ 'times', 'int32', 2}, ... % ( 2, 170) +{ 'div', 'int32', 2}, ... % ( 2, 172) +{ 'rdiv', 'int32', 2}, ... % ( 2, 174) +{ 'iseq', 'int32', 2}, ... % ( 1, 175) +{ 'isne', 'int32', 2}, ... % ( 1, 176) +{ 'pow', 'int32', 2}, ... % ( 2, 178) +{ 'min', 'int32', 2}, ... % ( 2, 180) +{ 'max', 'int32', 2}, ... % ( 2, 182) +{ 'isgt', 'int32', 2}, ... % ( 1, 183) +{ 'islt', 'int32', 2}, ... % ( 1, 184) +{ 'isge', 'int32', 2}, ... % ( 2, 186) +{ 'isle', 'int32', 2}, ... % ( 2, 188) +{ 'or', 'int32', 2}, ... % ( 2, 190) +{ 'and', 'int32', 2}, ... % ( 2, 192) +{ 'xor', 'int32', 2}, ... % ( 2, 194) +{ 'bor', 'int32', 2}, ... % ( 2, 196) +{ 'band', 'int32', 2}, ... % ( 2, 198) +{ 'bxor', 'int32', 2}, ... % ( 2, 200) +{ 'bxnor', 'int32', 2}, ... % ( 2, 202) +{ 'bget', 'int32', 2}, ... % ( 2, 204) +{ 'bset', 'int32', 2}, ... % ( 2, 206) +{ 'bclr', 'int32', 2}, ... % ( 2, 208) +{ 'bshift', 'int32', 2}, ... % ( 1, 209) +{ 'bshift', 'int32', 3}, ... % ( 1, 210) +{ '', 'int64', 2}, ... % ( 6, 216) +{ 'second', 'int64', 2}, ... % ( 1, 217) +{ 'pair', 'int64', 2}, ... % ( 1, 218) +{ 'plus', 'int64', 2}, ... % ( 1, 219) +{ 'minus', 'int64', 2}, ... % ( 2, 221) +{ 'rminus', 'int64', 2}, ... % ( 2, 223) +{ 'times', 'int64', 2}, ... % ( 2, 225) +{ 'div', 'int64', 2}, ... % ( 2, 227) +{ 'rdiv', 'int64', 2}, ... % ( 2, 229) +{ 'iseq', 'int64', 2}, ... % ( 1, 230) +{ 'isne', 'int64', 2}, ... % ( 1, 231) +{ 'pow', 'int64', 2}, ... % ( 2, 233) +{ 'min', 'int64', 2}, ... % ( 2, 235) +{ 'max', 'int64', 2}, ... % ( 2, 237) +{ 'isgt', 'int64', 2}, ... % ( 1, 238) +{ 'islt', 'int64', 2}, ... % ( 1, 239) +{ 'isge', 'int64', 2}, ... % ( 2, 241) +{ 'isle', 'int64', 2}, ... % ( 2, 243) +{ 'or', 'int64', 2}, ... % ( 2, 245) +{ 'and', 'int64', 2}, ... % ( 2, 247) +{ 'xor', 'int64', 2}, ... % ( 2, 249) +{ 'bor', 'int64', 2}, ... % ( 2, 251) +{ 'band', 'int64', 2}, ... % ( 2, 253) +{ 'bxor', 'int64', 2}, ... % ( 2, 255) +{ 'bxnor', 'int64', 2}, ... % ( 2, 257) +{ 'bget', 'int64', 2}, ... % ( 2, 259) +{ 'bset', 'int64', 2}, ... % ( 2, 261) +{ 'bclr', 'int64', 2}, ... % ( 2, 263) +{ 'bshift', 'int64', 2}, ... % ( 1, 264) +{ 'bshift', 'int64', 3}, ... % ( 1, 265) +{ '', 'uint8', 2}, ... % ( 6, 271) +{ 'second', 'uint8', 2}, ... % ( 1, 272) +{ 'pair', 'uint8', 2}, ... % ( 1, 273) +{ 'plus', 'uint8', 2}, ... % ( 1, 274) +{ 'minus', 'uint8', 2}, ... % ( 2, 276) +{ 'rminus', 'uint8', 2}, ... % ( 2, 278) +{ 'times', 'uint8', 2}, ... % ( 2, 280) +{ 'div', 'uint8', 2}, ... % ( 2, 282) +{ 'rdiv', 'uint8', 2}, ... % ( 2, 284) +{ 'iseq', 'uint8', 2}, ... % ( 1, 285) +{ 'isne', 'uint8', 2}, ... % ( 1, 286) +{ 'pow', 'uint8', 2}, ... % ( 2, 288) +{ 'min', 'uint8', 2}, ... % ( 2, 290) +{ 'max', 'uint8', 2}, ... % ( 2, 292) +{ 'isgt', 'uint8', 2}, ... % ( 1, 293) +{ 'islt', 'uint8', 2}, ... % ( 1, 294) +{ 'isge', 'uint8', 2}, ... % ( 2, 296) +{ 'isle', 'uint8', 2}, ... % ( 2, 298) +{ 'or', 'uint8', 2}, ... % ( 2, 300) +{ 'and', 'uint8', 2}, ... % ( 2, 302) +{ 'xor', 'uint8', 2}, ... % ( 2, 304) +{ 'bor', 'uint8', 2}, ... % ( 2, 306) +{ 'band', 'uint8', 2}, ... % ( 2, 308) +{ 'bxor', 'uint8', 2}, ... % ( 2, 310) +{ 'bxnor', 'uint8', 2}, ... % ( 2, 312) +{ 'bget', 'uint8', 2}, ... % ( 2, 314) +{ 'bset', 'uint8', 2}, ... % ( 2, 316) +{ 'bclr', 'uint8', 2}, ... % ( 2, 318) +{ 'bshift', 'uint8', 2}, ... % ( 1, 319) +{ 'bshift', 'uint8', 3}, ... % ( 1, 320) +{ '', 'uint16', 2}, ... % ( 6, 326) +{ 'second', 'uint16', 2}, ... % ( 1, 327) +{ 'pair', 'uint16', 2}, ... % ( 1, 328) +{ 'plus', 'uint16', 2}, ... % ( 1, 329) +{ 'minus', 'uint16', 2}, ... % ( 2, 331) +{ 'rminus', 'uint16', 2}, ... % ( 2, 333) +{ 'times', 'uint16', 2}, ... % ( 2, 335) +{ 'div', 'uint16', 2}, ... % ( 2, 337) +{ 'rdiv', 'uint16', 2}, ... % ( 2, 339) +{ 'iseq', 'uint16', 2}, ... % ( 1, 340) +{ 'isne', 'uint16', 2}, ... % ( 1, 341) +{ 'pow', 'uint16', 2}, ... % ( 2, 343) +{ 'min', 'uint16', 2}, ... % ( 2, 345) +{ 'max', 'uint16', 2}, ... % ( 2, 347) +{ 'isgt', 'uint16', 2}, ... % ( 1, 348) +{ 'islt', 'uint16', 2}, ... % ( 1, 349) +{ 'isge', 'uint16', 2}, ... % ( 2, 351) +{ 'isle', 'uint16', 2}, ... % ( 2, 353) +{ 'or', 'uint16', 2}, ... % ( 2, 355) +{ 'and', 'uint16', 2}, ... % ( 2, 357) +{ 'xor', 'uint16', 2}, ... % ( 2, 359) +{ 'bor', 'uint16', 2}, ... % ( 2, 361) +{ 'band', 'uint16', 2}, ... % ( 2, 363) +{ 'bxor', 'uint16', 2}, ... % ( 2, 365) +{ 'bxnor', 'uint16', 2}, ... % ( 2, 367) +{ 'bget', 'uint16', 2}, ... % ( 2, 369) +{ 'bset', 'uint16', 2}, ... % ( 2, 371) +{ 'bclr', 'uint16', 2}, ... % ( 2, 373) +{ 'bshift', 'uint16', 2}, ... % ( 1, 374) +{ 'bshift', 'uint16', 3}, ... % ( 1, 375) +{ '', 'uint32', 2}, ... % ( 6, 381) +{ 'second', 'uint32', 2}, ... % ( 1, 382) +{ 'pair', 'uint32', 2}, ... % ( 1, 383) +{ 'plus', 'uint32', 2}, ... % ( 1, 384) +{ 'minus', 'uint32', 2}, ... % ( 2, 386) +{ 'rminus', 'uint32', 2}, ... % ( 2, 388) +{ 'times', 'uint32', 2}, ... % ( 2, 390) +{ 'div', 'uint32', 2}, ... % ( 2, 392) +{ 'rdiv', 'uint32', 2}, ... % ( 2, 394) +{ 'iseq', 'uint32', 2}, ... % ( 1, 395) +{ 'isne', 'uint32', 2}, ... % ( 1, 396) +{ 'pow', 'uint32', 2}, ... % ( 2, 398) +{ 'min', 'uint32', 2}, ... % ( 2, 400) +{ 'max', 'uint32', 2}, ... % ( 2, 402) +{ 'isgt', 'uint32', 2}, ... % ( 1, 403) +{ 'islt', 'uint32', 2}, ... % ( 1, 404) +{ 'isge', 'uint32', 2}, ... % ( 2, 406) +{ 'isle', 'uint32', 2}, ... % ( 2, 408) +{ 'or', 'uint32', 2}, ... % ( 2, 410) +{ 'and', 'uint32', 2}, ... % ( 2, 412) +{ 'xor', 'uint32', 2}, ... % ( 2, 414) +{ 'bor', 'uint32', 2}, ... % ( 2, 416) +{ 'band', 'uint32', 2}, ... % ( 2, 418) +{ 'bxor', 'uint32', 2}, ... % ( 2, 420) +{ 'bxnor', 'uint32', 2}, ... % ( 2, 422) +{ 'bget', 'uint32', 2}, ... % ( 2, 424) +{ 'bset', 'uint32', 2}, ... % ( 2, 426) +{ 'bclr', 'uint32', 2}, ... % ( 2, 428) +{ 'bshift', 'uint32', 2}, ... % ( 1, 429) +{ 'bshift', 'uint32', 3}, ... % ( 1, 430) +{ '', 'uint64', 2}, ... % ( 6, 436) +{ 'second', 'uint64', 2}, ... % ( 1, 437) +{ 'pair', 'uint64', 2}, ... % ( 1, 438) +{ 'plus', 'uint64', 2}, ... % ( 1, 439) +{ 'minus', 'uint64', 2}, ... % ( 2, 441) +{ 'rminus', 'uint64', 2}, ... % ( 2, 443) +{ 'times', 'uint64', 2}, ... % ( 2, 445) +{ 'div', 'uint64', 2}, ... % ( 2, 447) +{ 'rdiv', 'uint64', 2}, ... % ( 2, 449) +{ 'iseq', 'uint64', 2}, ... % ( 1, 450) +{ 'isne', 'uint64', 2}, ... % ( 1, 451) +{ 'pow', 'uint64', 2}, ... % ( 2, 453) +{ 'min', 'uint64', 2}, ... % ( 2, 455) +{ 'max', 'uint64', 2}, ... % ( 2, 457) +{ 'isgt', 'uint64', 2}, ... % ( 1, 458) +{ 'islt', 'uint64', 2}, ... % ( 1, 459) +{ 'isge', 'uint64', 2}, ... % ( 2, 461) +{ 'isle', 'uint64', 2}, ... % ( 2, 463) +{ 'or', 'uint64', 2}, ... % ( 2, 465) +{ 'and', 'uint64', 2}, ... % ( 2, 467) +{ 'xor', 'uint64', 2}, ... % ( 2, 469) +{ 'bor', 'uint64', 2}, ... % ( 2, 471) +{ 'band', 'uint64', 2}, ... % ( 2, 473) +{ 'bxor', 'uint64', 2}, ... % ( 2, 475) +{ 'bxnor', 'uint64', 2}, ... % ( 2, 477) +{ 'bget', 'uint64', 2}, ... % ( 2, 479) +{ 'bset', 'uint64', 2}, ... % ( 2, 481) +{ 'bclr', 'uint64', 2}, ... % ( 2, 483) +{ 'bshift', 'uint64', 2}, ... % ( 1, 484) +{ 'bshift', 'uint64', 3}, ... % ( 1, 485) +{ '', 'single', 2}, ... % ( 6, 491) +{ 'second', 'single', 2}, ... % ( 1, 492) +{ 'pair', 'single', 2}, ... % ( 1, 493) +{ 'plus', 'single', 2}, ... % ( 1, 494) +{ 'minus', 'single', 2}, ... % ( 2, 496) +{ 'rminus', 'single', 2}, ... % ( 2, 498) +{ 'times', 'single', 2}, ... % ( 2, 500) +{ 'div', 'single', 2}, ... % ( 2, 502) +{ 'rdiv', 'single', 2}, ... % ( 2, 504) +{ 'iseq', 'single', 2}, ... % ( 1, 505) +{ 'isne', 'single', 2}, ... % ( 1, 506) +{ 'pow', 'single', 2}, ... % ( 2, 508) +{ 'min', 'single', 2}, ... % ( 2, 510) +{ 'max', 'single', 2}, ... % ( 2, 512) +{ 'isgt', 'single', 2}, ... % ( 1, 513) +{ 'islt', 'single', 2}, ... % ( 1, 514) +{ 'isge', 'single', 2}, ... % ( 2, 516) +{ 'isle', 'single', 2}, ... % ( 2, 518) +{ 'or', 'single', 2}, ... % ( 2, 520) +{ 'and', 'single', 2}, ... % ( 2, 522) +{ 'xor', 'single', 2}, ... % ( 2, 524) +{ 'atan2', 'single', 2}, ... % ( 2, 526) +{ 'hypot', 'single', 2}, ... % ( 2, 528) +{ 'fmod', 'single', 2}, ... % ( 2, 530) +{ 'remainder', 'single', 2}, ... % ( 2, 532) +{ 'ldexp', 'single', 2}, ... % ( 2, 534) +{ 'copysign', 'single', 2}, ... % ( 2, 536) +{ '', 'double', 2}, ... % ( 4, 540) +{ 'second', 'double', 2}, ... % ( 1, 541) +{ 'pair', 'double', 2}, ... % ( 1, 542) +{ 'plus', 'double', 2}, ... % ( 1, 543) +{ 'minus', 'double', 2}, ... % ( 2, 545) +{ 'rminus', 'double', 2}, ... % ( 2, 547) +{ 'times', 'double', 2}, ... % ( 2, 549) +{ 'div', 'double', 2}, ... % ( 2, 551) +{ 'rdiv', 'double', 2}, ... % ( 2, 553) +{ 'iseq', 'double', 2}, ... % ( 1, 554) +{ 'isne', 'double', 2}, ... % ( 1, 555) +{ 'pow', 'double', 2}, ... % ( 2, 557) +{ 'min', 'double', 2}, ... % ( 2, 559) +{ 'max', 'double', 2}, ... % ( 2, 561) +{ 'isgt', 'double', 2}, ... % ( 1, 562) +{ 'islt', 'double', 2}, ... % ( 1, 563) +{ 'isge', 'double', 2}, ... % ( 2, 565) +{ 'isle', 'double', 2}, ... % ( 2, 567) +{ 'or', 'double', 2}, ... % ( 2, 569) +{ 'and', 'double', 2}, ... % ( 2, 571) +{ 'xor', 'double', 2}, ... % ( 2, 573) +{ 'atan2', 'double', 2}, ... % ( 2, 575) +{ 'hypot', 'double', 2}, ... % ( 2, 577) +{ 'fmod', 'double', 2}, ... % ( 2, 579) +{ 'remainder', 'double', 2}, ... % ( 2, 581) +{ 'ldexp', 'double', 2}, ... % ( 2, 583) +{ 'copysign', 'double', 2}, ... % ( 2, 585) +{ '', 'single complex', 2}, ... % ( 6, 591) +{ 'second', 'single complex', 2}, ... % ( 1, 592) +{ 'pair', 'single complex', 2}, ... % ( 1, 593) +{ 'plus', 'single complex', 2}, ... % ( 1, 594) +{ 'minus', 'single complex', 2}, ... % ( 2, 596) +{ 'rminus', 'single complex', 2}, ... % ( 2, 598) +{ 'times', 'single complex', 2}, ... % ( 2, 600) +{ 'div', 'single complex', 2}, ... % ( 2, 602) +{ 'rdiv', 'single complex', 2}, ... % ( 2, 604) +{ 'iseq', 'single complex', 2}, ... % ( 1, 605) +{ 'isne', 'single complex', 2}, ... % ( 1, 606) +{ 'pow', 'single complex', 2}, ... % ( 2, 608) +{ 'pair', 'single complex', 3}, ... % ( 1, 609) +{ '', 'double complex', 2}, ... % ( 6, 615) +{ 'second', 'double complex', 2}, ... % ( 1, 616) +{ 'pair', 'double complex', 2}, ... % ( 1, 617) +{ 'plus', 'double complex', 2}, ... % ( 1, 618) +{ 'minus', 'double complex', 2}, ... % ( 2, 620) +{ 'rminus', 'double complex', 2}, ... % ( 2, 622) +{ 'times', 'double complex', 2}, ... % ( 2, 624) +{ 'div', 'double complex', 2}, ... % ( 2, 626) +{ 'rdiv', 'double complex', 2}, ... % ( 2, 628) +{ 'iseq', 'double complex', 2}, ... % ( 1, 629) +{ 'isne', 'double complex', 2}, ... % ( 1, 630) +{ 'pow', 'double complex', 2}, ... % ( 2, 632) +{ 'pair', 'double complex', 3}, ... % ( 1, 633) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + +% [binops, ~, ~, types, ~, ~] = GB_spec_opsall ; +% binops = binops.all ; +% types = types.all ; fprintf ('test142 ------------ GrB_assign with dense matrices\n') ; m = 10 ; n = 12 ; +% create the test matrices rng ('default') ; - M = sprand (m, n, 0.5) ; - Amat2 = sparse (2 * rand (m,n)) ; Bmat2 = sparse (2 * sprand (m,n, 0.5)) ; Cmat2 = sparse (2 * rand (m,n)) ; @@ -40,33 +391,43 @@ C.sparsity = 8 ; X.sparsity = 8 ; -for k1 = 1:length (types) - type = types {k1} ; - fprintf ('%s ', type) ; +for kk = 1:length(tasks) + task = tasks {kk} ; + binop = task {1} ; + type = task {2} ; + k3 = task {3} ; + +% end +% for k1 = 1:length (types) +% type = types {k1} ; + % fprintf ('%s ', type) ; A.class = type ; id = test_cast (0, type) ; A_iso = A ; A_iso.iso = true ; - for k3 = 1:3 - - if (k3 == 1) - X.class = type ; - B.class = type ; - C.class = 'logical' ; - S.class = 'logical' ; - elseif (k3 == 2) - X.class = type ; - B.class = type ; - C.class = type ; - S.class = type ; - else - X.class = 'int8' ; - B.class = 'int8' ; - C.class = type ; - S.class = type ; - end +% for k3 = 1:3 + + if (k3 == 1) + X.class = type ; + B.class = type ; + C.class = 'logical' ; + S.class = 'logical' ; + elseif (k3 == 2) + X.class = type ; + B.class = type ; + C.class = type ; + S.class = type ; + else + X.class = 'int8' ; + B.class = 'int8' ; + C.class = type ; + S.class = type ; + end + +% binop = [ ] ; + if (isempty (binop)) %--------------------------------------- % C = A where A is dense @@ -140,76 +501,106 @@ C1 = GB_mex_assign (S, [ ], [ ], X, [ ], [ ], [ ]) ; GB_spec_compare (C0, C1) ; + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + tt = sprintf ('''%s''', type) ; + oo = sprintf ('''%s''', '') ; + fprintf ('{%12s, %16s, %2d},', oo, tt, k3) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + end + %--------------------------------------- % with accum operators %--------------------------------------- - for k2 = 1:length(binops) - binop = binops {k2} ; - - tol = [ ] ; - switch (binop) - case { 'pow', 'atan2', 'hypot', 'remainder' } - A.matrix = Amat2 ; - B.matrix = Bmat2 ; - C.matrix = Cmat2 ; - if (test_contains (type, 'single')) - tol = 1e-5 ; - elseif (test_contains (type, 'double')) - tol = 1e-12 ; - end - otherwise - A.matrix = Amat ; - B.matrix = Bmat ; - C.matrix = Cmat ; - end - - accum.opname = binop ; - accum.optype = type ; +% for k2 = 1:length(binops) +% binop = binops {k2} ; + + if (~isempty (binop)) + + tol = [ ] ; + switch (binop) + case { 'pow', 'atan2', 'hypot', 'remainder' } + A.matrix = Amat2 ; + B.matrix = Bmat2 ; + C.matrix = Cmat2 ; + if (test_contains (type, 'single')) + tol = 1e-5 ; + elseif (test_contains (type, 'double')) + tol = 1e-12 ; + end + otherwise + A.matrix = Amat ; + B.matrix = Bmat ; + C.matrix = Cmat ; + end - try - GB_spec_operator (accum) ; - catch - continue - end + accum.opname = binop ; + accum.optype = type ; - if (GB_spec_is_positional (accum)) - continue ; - end + try + GB_spec_operator (accum) ; + catch + continue + end - %--------------------------------------- - % C += A where A is dense - %--------------------------------------- + if (GB_spec_is_positional (accum)) + continue ; + end - C0 = GB_spec_assign (C, [ ], accum, A, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, [ ], accum, A, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, id, tol) ; + %--------------------------------------- + % C += A where A is dense + %--------------------------------------- - %--------------------------------------- - % C += B where B is sparse - %--------------------------------------- + C0 = GB_spec_assign (C, [ ], accum, A, [ ], [ ], [ ], false) ; + C1 = GB_mex_assign (C, [ ], accum, A, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1, id, tol) ; - C0 = GB_spec_assign (C, [ ], accum, B, [ ], [ ], [ ], false) ; - C1 = GB_mex_assign (C, [ ], accum, B, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, id, tol) ; + %--------------------------------------- + % C += B where B is sparse + %--------------------------------------- - %--------------------------------------- - % C += x - %--------------------------------------- + C0 = GB_spec_assign (C, [ ], accum, B, [ ], [ ], [ ], false) ; + C1 = GB_mex_assign (C, [ ], accum, B, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1, id, tol) ; - C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], [ ], true) ; - C1 = GB_mex_assign (C, [ ], accum, X, [ ], [ ], [ ]) ; - GB_spec_compare (C0, C1, id, tol) ; + %--------------------------------------- + % C += x + %--------------------------------------- - %--------------------------------------- - % C += x - %--------------------------------------- + C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], [ ], true) ; + C1 = GB_mex_assign (C, [ ], accum, X, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1, id, tol) ; - C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], drep, true) ; - C1 = GB_mex_subassign (C, [ ], accum, X, [ ], [ ], drep) ; - GB_spec_compare (C0, C1, id, tol) ; + %--------------------------------------- + % C += x + %--------------------------------------- + C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], drep, true) ; + C1 = GB_mex_subassign (C, [ ], accum, X, [ ], [ ], drep) ; + GB_spec_compare (C0, C1, id, tol) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + tt = sprintf ('''%s''', type) ; + oo = sprintf ('''%s''', binop) ; + fprintf ('{%12s, %16s, %2d},', oo, tt, k3) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; + end + clast = c ; + else + fprintf ('.') ; end + end end diff --git a/Test/test142b.m b/Test/test142b.m new file mode 100644 index 0000000000..07b7cbe74f --- /dev/null +++ b/Test/test142b.m @@ -0,0 +1,22 @@ +function test142b(tasks) +%TEST142B test GrB_assign for dense matrices + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { '', 'logical', 1}, ... % ( 5, 5) + { 'second', 'logical', 1}, ... % ( 1, 6) + { '', 'single complex', 1}, ... % ( 1, 7) + { 'pair', 'single complex', 2}, ... % ( 1, 8) + { 'pair', 'double complex', 2}, ... % ( 1, 9) + } ; +end + +test142 (tasks) ; + diff --git a/Test/test14b.m b/Test/test14b.m new file mode 100644 index 0000000000..d7ec68fa85 --- /dev/null +++ b/Test/test14b.m @@ -0,0 +1,42 @@ +function test14b(tasks) +%TEST14B test GrB_reduce + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 'min', 1, 0, 0}, ... % ( 7, 7) + { 'max', 1, 0, 0}, ... % ( 3, 10) + { 'any', 1, 0, 0}, ... % ( 3, 13) + { 'eq', 1, 0, 0}, ... % ( 1, 14) + { 'min', 2, 0, 0}, ... % ( 6, 20) + { 'max', 2, 0, 0}, ... % ( 4, 24) + { 'plus', 2, 0, 0}, ... % ( 1, 25) + { 'times', 2, 0, 0}, ... % ( 3, 28) + { 'min', 4, 0, 0}, ... % ( 4, 32) + { 'max', 4, 0, 0}, ... % ( 2, 34) + { 'min', 5, 0, 0}, ... % ( 4, 38) + { 'max', 5, 0, 0}, ... % ( 2, 40) + { 'plus', 5, 0, 0}, ... % ( 1, 41) + { 'min', 6, 0, 0}, ... % ( 3, 44) + { 'max', 6, 0, 0}, ... % ( 2, 46) + { 'min', 8, 0, 0}, ... % ( 2, 48) + { 'max', 8, 0, 0}, ... % ( 1, 49) + { 'min', 9, 0, 0}, ... % ( 2, 51) + { 'max', 9, 0, 0}, ... % ( 1, 52) + { 'min', 10, 0, 0}, ... % ( 6, 58) + { 'plus', 10, 0, 0}, ... % ( 1, 59) + { 'times', 10, 0, 0}, ... % ( 1, 60) + { 'plus', 11, 0, 0}, ... % ( 1, 61) + { 'plus', 12, 0, 0}, ... % ( 1, 62) + } ; +end + +test14 (tasks) ; + + diff --git a/Test/test151b.m b/Test/test151b.m index ae6301fe36..4f1ec41d8a 100644 --- a/Test/test151b.m +++ b/Test/test151b.m @@ -1,7 +1,7 @@ function test151b %TEST151B test bitshift operators -% 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 fprintf ('test151b: test bshift operator\n') ; @@ -17,15 +17,20 @@ C10 = sparse (10,10) ; desc.mask = 'complement' ; -for k = 1:8 +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end +for k = 1:8 type = types {k} ; nbits = int_nbits (k) ; - fprintf ('\n%s', type) ; - for trial = 1:4 - fprintf ('.') ; + % create the test matrices imax = double (intmax (type) / 4) ; A = GB_mex_cast (imax * rand (4), type) ; B = GB_mex_cast ((nbits-1) * rand (4), type) + 1 ; @@ -36,61 +41,170 @@ M = sparse (mod (magic (4), 2)) ; clear M2 ; M2.matrix = M ; M2.class = 'logical' ; - for A_sparsity = [1 2 4 8] - for B_sparsity = [1 2 4 8] - for M_sparsity = [1 2 4 8] - A2.sparsity = A_sparsity ; - B2.sparsity = B_sparsity ; - M2.sparsity = M_sparsity ; + % determine the tests to run + Sparsities = { } ; + switch (k) + case 1 + if (trial == 1) + Sparsities = { + { 1, 1, 1, 1, 1}, ... % ( 3, 3) + { 1, 1, 1, 1, 4}, ... % ( 3, 6) + { 1, 1, 1, 4, 1}, ... % ( 9, 15) + { 1, 1, 1, 4, 4}, ... % ( 8, 23) + { 1, 1, 1, 8, 1}, ... % ( 4, 27) + { 1, 1, 4, 1, 1}, ... % ( 6, 33) + { 1, 1, 4, 1, 4}, ... % ( 6, 39) + { 1, 1, 4, 4, 1}, ... % ( 10, 49) + { 1, 1, 4, 4, 4}, ... % ( 1, 50) + { 1, 1, 4, 8, 1}, ... % ( 4, 54) + { 1, 1, 8, 1, 1}, ... % ( 2, 56) + { 1, 1, 8, 8, 1}, ... % ( 3, 59) + { 1, 1, 8, 8, 4}, ... % ( 2, 61) + } ; + elseif (trial == 4) + Sparsities = { + { 1, 4, 1, 1, 1}, ... % ( 1, 62) + { 1, 4, 1, 1, 4}, ... % ( 2, 64) + { 1, 4, 4, 1, 1}, ... % ( 2, 66) + { 1, 4, 4, 1, 4}, ... % ( 1, 67) + { 1, 4, 4, 4, 4}, ... % ( 1, 68) + { 1, 4, 4, 8, 1}, ... % ( 4, 72) + } ; + end + case 2 + if (trial == 1) + Sparsities = { + { 2, 1, 1, 1, 1}, ... % ( 5, 77) + { 2, 1, 1, 4, 1}, ... % ( 1, 78) + { 2, 1, 4, 1, 1}, ... % ( 1, 79) + { 2, 1, 4, 4, 1}, ... % ( 2, 81) + } ; + end + case 3 + if (trial == 1) + Sparsities = { + { 3, 1, 1, 1, 1}, ... % ( 3, 84) + { 3, 1, 1, 4, 1}, ... % ( 1, 85) + { 3, 1, 4, 1, 1}, ... % ( 1, 86) + { 3, 1, 4, 4, 1}, ... % ( 2, 88) + } ; + end + case 4 + if (trial == 1) + Sparsities = { + { 4, 1, 1, 1, 1}, ... % ( 3, 91) + { 4, 1, 1, 4, 1}, ... % ( 1, 92) + { 4, 1, 4, 1, 1}, ... % ( 1, 93) + { 4, 1, 4, 4, 1}, ... % ( 2, 95) + } ; + end + case 5 + if (trial == 1) + Sparsities = { + { 5, 1, 1, 1, 1}, ... % ( 3, 98) + { 5, 1, 1, 4, 1}, ... % ( 1, 99) + { 5, 1, 4, 1, 1}, ... % ( 1, 100) + { 5, 1, 4, 4, 1}, ... % ( 2, 102) + } ; + end + case 6 + if (trial == 1) + Sparsities = { + { 6, 1, 1, 1, 1}, ... % ( 3, 105) + { 6, 1, 1, 4, 1}, ... % ( 1, 106) + { 6, 1, 4, 1, 1}, ... % ( 1, 107) + { 6, 1, 4, 4, 1}, ... % ( 2, 109) + } ; + end + case 7 + if (trial == 1) + Sparsities = { + { 7, 1, 1, 1, 1}, ... % ( 3, 112) + { 7, 1, 1, 4, 1}, ... % ( 1, 113) + { 7, 1, 4, 1, 1}, ... % ( 1, 114) + { 7, 1, 4, 4, 1}, ... % ( 2, 116) + } ; + end + case 8 + if (trial == 1) + Sparsities = { + { 8, 1, 1, 1, 1}, ... % ( 3, 119) + { 8, 1, 1, 4, 1}, ... % ( 1, 120) + { 8, 1, 4, 1, 1}, ... % ( 1, 121) + { 8, 1, 4, 4, 1}, ... % ( 2, 123) + } ; + end + end - for j = 1:length (ops2) - opname = ops2 {j} ; - % C1 = bitop (A, B) ; + % run the tests + for kk = 1:length(Sparsities) + Sparsity = Sparsities {kk} ; + A_sparsity = Sparsity {3} ; + B_sparsity = Sparsity {4} ; + M_sparsity = Sparsity {5} ; + + A2.sparsity = A_sparsity ; + B2.sparsity = B_sparsity ; + M2.sparsity = M_sparsity ; + + opname = 'bshift' ; op.opname = opname ; op.optype = type ; - C1 = GB_spec_Matrix_eWiseMult(Cin, [ ], [ ], op, A2, B2, [ ]) ; - C2 = GB_mex_Matrix_eWiseMult (Cin, [ ], [ ], op, A2, B2, [ ]) ; + % C1 = bitop (A, B) ; + C1 = GB_spec_Matrix_eWiseMult(Cin, [], [], op, A2, B2, []) ; + C2 = GB_mex_Matrix_eWiseMult (Cin, [], [], op, A2, B2, []) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseAdd (Cin, [ ], [ ], op, A2, B2, [ ]) ; - C2 = GB_mex_Matrix_eWiseAdd (Cin, [ ], [ ], op, A2, B2, [ ]) ; + C1 = GB_spec_Matrix_eWiseAdd (Cin, [], [], op, A2, B2, []) ; + C2 = GB_mex_Matrix_eWiseAdd (Cin, [], [], op, A2, B2, []) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseUnion(Cin, [ ], [ ], op, A2, 3, B2, 2, [ ]) ; - C2 = GB_mex_Matrix_eWiseUnion (Cin, [ ], [ ], op, A2, 3, B2, 2, [ ]) ; + C1 = GB_spec_Matrix_eWiseUnion(Cin, [], [], op, A2, 3, B2, 2, []) ; + C2 = GB_mex_Matrix_eWiseUnion (Cin, [], [], op, A2, 3, B2, 2, []) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseAdd (Cin, [ ], [ ], op, B2, A2, [ ]) ; - C2 = GB_mex_Matrix_eWiseAdd (Cin, [ ], [ ], op, B2, A2, [ ]) ; + C1 = GB_spec_Matrix_eWiseAdd (Cin, [], [], op, B2, A2, []) ; + C2 = GB_mex_Matrix_eWiseAdd (Cin, [], [], op, B2, A2, []) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseUnion(Cin, [ ], [ ], op, B2, 3, A2, 2, [ ]) ; - C2 = GB_mex_Matrix_eWiseUnion (Cin, [ ], [ ], op, B2, 3, A2, 2, [ ]) ; + C1 = GB_spec_Matrix_eWiseUnion(Cin, [], [], op, B2, 3, A2, 2, []) ; + C2 = GB_mex_Matrix_eWiseUnion (Cin, [], [], op, B2, 3, A2, 2, []) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseMult(Cin, M2, [ ], op, A2, B2, [ ]) ; - C2 = GB_mex_Matrix_eWiseMult (Cin, M2, [ ], op, A2, B2, [ ]) ; + C1 = GB_spec_Matrix_eWiseMult(Cin, M2, [], op, A2, B2, []) ; + C2 = GB_mex_Matrix_eWiseMult (Cin, M2, [], op, A2, B2, []) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseAdd (Cin, M2, [ ], op, A2, B2, [ ]) ; - C2 = GB_mex_Matrix_eWiseAdd (Cin, M2, [ ], op, A2, B2, [ ]) ; + C1 = GB_spec_Matrix_eWiseAdd (Cin, M2, [], op, A2, B2, []) ; + C2 = GB_mex_Matrix_eWiseAdd (Cin, M2, [], op, A2, B2, []) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseUnion (Cin, M2, [ ], op, A2, 1, B2, 3, [ ]) ; - C2 = GB_mex_Matrix_eWiseUnion (Cin, M2, [ ], op, A2, 1, B2, 3, [ ]) ; + C1 = GB_spec_Matrix_eWiseUnion (Cin, M2, [], op, A2, 1, B2, 3, []) ; + C2 = GB_mex_Matrix_eWiseUnion (Cin, M2, [], op, A2, 1, B2, 3, []) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseMult(Cin, M2, [ ], op, A2, B2, desc) ; - C2 = GB_mex_Matrix_eWiseMult (Cin, M2, [ ], op, A2, B2, desc) ; + C1 = GB_spec_Matrix_eWiseMult(Cin, M2, [], op, A2, B2, desc) ; + C2 = GB_mex_Matrix_eWiseMult (Cin, M2, [], op, A2, B2, desc) ; GB_spec_compare (C1, C2) ; - C1 = GB_spec_Matrix_eWiseAdd (Cin, M2, [ ], op, A2, B2, desc) ; - C2 = GB_mex_Matrix_eWiseAdd (Cin, M2, [ ], op, A2, B2, desc) ; + C1 = GB_spec_Matrix_eWiseAdd (Cin, M2, [], op, A2, B2, desc) ; + C2 = GB_mex_Matrix_eWiseAdd (Cin, M2, [], op, A2, B2, desc) ; GB_spec_compare (C1, C2) ; - end - end - end + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf (... + '{%2d,%2d,%2d,%2d,%2d}, ... ', ... + k, trial, A_sparsity, B_sparsity, M_sparsity) ; + fprintf ('%% (%3d, %4d)\n', d, c - cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + end end end diff --git a/Test/test154.m b/Test/test154.m index 822a3f6311..4dc86638c5 100644 --- a/Test/test154.m +++ b/Test/test154.m @@ -1,15 +1,740 @@ -function test154 +function test154(tasks) %TEST154 test GrB_apply with scalar binding -% 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 -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -ops = binops.all ; -types = types.all ; +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { ... + { 'first', 'logical', 1, 1,-1, 1}, ... % ( 7, 7) + { 'first', 'logical', 1, 4,-1, 1}, ... % ( 1, 8) + { 'first', 'int8', 1, 1,-1, 1}, ... % ( 1, 9) + { 'first', 'int16', 1, 1,-1, 1}, ... % ( 1, 10) + { 'first', 'int32', 1, 1,-1, 1}, ... % ( 1, 11) + { 'first', 'int64', 1, 1,-1, 1}, ... % ( 1, 12) + { 'first', 'uint8', 1, 1,-1, 1}, ... % ( 1, 13) + { 'first', 'uint16', 1, 1,-1, 1}, ... % ( 1, 14) + { 'first', 'uint32', 1, 1,-1, 1}, ... % ( 1, 15) + { 'first', 'uint64', 1, 1,-1, 1}, ... % ( 1, 16) + { 'first', 'single', 1, 1,-1, 1}, ... % ( 1, 17) + { 'first', 'double', 1, 1,-1, 1}, ... % ( 1, 18) + { 'first', 'single complex', 1, 1,-1, 1}, ... % ( 1, 19) + { 'first', 'double complex', 1, 1,-1, 1}, ... % ( 1, 20) + { 'pair', 'logical', 1, 1,-1, 1}, ... % ( 1, 21) + { 'plus', 'logical', 1, 1,-1, 1}, ... % ( 6, 27) + { 'plus', 'logical', 4, 4,-1, 1}, ... % ( 5, 32) + { 'plus', 'int8', 1, 1,-1, 1}, ... % ( 3, 35) + { 'plus', 'int8', 4, 4,-1, 1}, ... % ( 1, 36) + { 'plus', 'int16', 1, 1,-1, 1}, ... % ( 3, 39) + { 'plus', 'int16', 4, 4,-1, 1}, ... % ( 3, 42) + { 'plus', 'int32', 1, 1,-1, 1}, ... % ( 3, 45) + { 'plus', 'int32', 4, 4,-1, 1}, ... % ( 1, 46) + { 'plus', 'int64', 1, 1,-1, 1}, ... % ( 3, 49) + { 'plus', 'int64', 4, 4,-1, 1}, ... % ( 1, 50) + { 'plus', 'uint8', 1, 1,-1, 1}, ... % ( 3, 53) + { 'plus', 'uint8', 4, 4,-1, 1}, ... % ( 1, 54) + { 'plus', 'uint16', 1, 1,-1, 1}, ... % ( 3, 57) + { 'plus', 'uint16', 4, 4,-1, 1}, ... % ( 1, 58) + { 'plus', 'uint32', 1, 1,-1, 1}, ... % ( 3, 61) + { 'plus', 'uint32', 4, 4,-1, 1}, ... % ( 1, 62) + { 'plus', 'uint64', 1, 1,-1, 1}, ... % ( 3, 65) + { 'plus', 'uint64', 4, 4,-1, 1}, ... % ( 1, 66) + { 'plus', 'single', 1, 1,-1, 1}, ... % ( 3, 69) + { 'plus', 'single', 4, 4,-1, 1}, ... % ( 1, 70) + { 'plus', 'double', 1, 1,-1, 1}, ... % ( 2, 72) + { 'plus', 'double', 4, 4,-1, 1}, ... % ( 1, 73) + { 'plus', 'single complex', 1, 1,-1, 1}, ... % ( 3, 76) + { 'plus', 'single complex', 4, 4,-1, 1}, ... % ( 1, 77) + { 'plus', 'double complex', 1, 1,-1, 1}, ... % ( 3, 80) + { 'plus', 'double complex', 4, 4,-1, 1}, ... % ( 1, 81) + { 'minus', 'logical', 1, 1,-1, 1}, ... % ( 1, 82) + { 'minus', 'logical', 4, 4,-1, 1}, ... % ( 1, 83) + { 'minus', 'int8', 1, 1,-1, 1}, ... % ( 3, 86) + { 'minus', 'int8', 4, 4,-1, 1}, ... % ( 1, 87) + { 'minus', 'int16', 1, 1,-1, 1}, ... % ( 3, 90) + { 'minus', 'int16', 4, 4,-1, 1}, ... % ( 1, 91) + { 'minus', 'int32', 1, 1,-1, 1}, ... % ( 3, 94) + { 'minus', 'int32', 4, 4,-1, 1}, ... % ( 1, 95) + { 'minus', 'int64', 1, 1,-1, 1}, ... % ( 3, 98) + { 'minus', 'int64', 4, 4,-1, 1}, ... % ( 1, 99) + { 'minus', 'uint8', 1, 1,-1, 1}, ... % ( 3, 102) + { 'minus', 'uint8', 4, 4,-1, 1}, ... % ( 1, 103) + { 'minus', 'uint16', 1, 1,-1, 1}, ... % ( 3, 106) + { 'minus', 'uint16', 4, 4,-1, 1}, ... % ( 1, 107) + { 'minus', 'uint32', 1, 1,-1, 1}, ... % ( 3, 110) + { 'minus', 'uint32', 4, 4,-1, 1}, ... % ( 1, 111) + { 'minus', 'uint64', 1, 1,-1, 1}, ... % ( 3, 114) + { 'minus', 'uint64', 4, 4,-1, 1}, ... % ( 1, 115) + { 'minus', 'single', 1, 1,-1, 1}, ... % ( 3, 118) + { 'minus', 'single', 4, 4,-1, 1}, ... % ( 1, 119) + { 'minus', 'double', 1, 1,-1, 1}, ... % ( 3, 122) + { 'minus', 'double', 4, 4,-1, 1}, ... % ( 1, 123) + { 'minus', 'single complex', 1, 1,-1, 1}, ... % ( 3, 126) + { 'minus', 'single complex', 4, 4,-1, 1}, ... % ( 1, 127) + { 'minus', 'double complex', 1, 1,-1, 1}, ... % ( 3, 130) + { 'minus', 'double complex', 4, 4,-1, 1}, ... % ( 1, 131) + { 'rminus', 'int8', 1, 1,-1, 1}, ... % ( 3, 134) + { 'rminus', 'int8', 4, 4,-1, 1}, ... % ( 1, 135) + { 'rminus', 'int16', 1, 1,-1, 1}, ... % ( 3, 138) + { 'rminus', 'int16', 4, 4,-1, 1}, ... % ( 1, 139) + { 'rminus', 'int32', 1, 1,-1, 1}, ... % ( 3, 142) + { 'rminus', 'int32', 4, 4,-1, 1}, ... % ( 1, 143) + { 'rminus', 'int64', 1, 1,-1, 1}, ... % ( 3, 146) + { 'rminus', 'int64', 4, 4,-1, 1}, ... % ( 1, 147) + { 'rminus', 'uint8', 1, 1,-1, 1}, ... % ( 3, 150) + { 'rminus', 'uint8', 4, 4,-1, 1}, ... % ( 1, 151) + { 'rminus', 'uint16', 1, 1,-1, 1}, ... % ( 3, 154) + { 'rminus', 'uint16', 4, 4,-1, 1}, ... % ( 1, 155) + { 'rminus', 'uint32', 1, 1,-1, 1}, ... % ( 3, 158) + { 'rminus', 'uint32', 4, 4,-1, 1}, ... % ( 1, 159) + { 'rminus', 'uint64', 1, 1,-1, 1}, ... % ( 3, 162) + { 'rminus', 'uint64', 4, 4,-1, 1}, ... % ( 1, 163) + { 'rminus', 'single', 1, 1,-1, 1}, ... % ( 3, 166) + { 'rminus', 'single', 4, 4,-1, 1}, ... % ( 1, 167) + { 'rminus', 'double', 1, 1,-1, 1}, ... % ( 3, 170) + { 'rminus', 'double', 4, 4,-1, 1}, ... % ( 1, 171) + { 'rminus', 'single complex', 1, 1,-1, 1}, ... % ( 3, 174) + { 'rminus', 'single complex', 4, 4,-1, 1}, ... % ( 1, 175) + { 'rminus', 'double complex', 1, 1,-1, 1}, ... % ( 3, 178) + { 'rminus', 'double complex', 4, 4,-1, 1}, ... % ( 1, 179) + { 'times', 'logical', 1, 1,-1, 1}, ... % ( 3, 182) + { 'times', 'logical', 4, 4,-1, 1}, ... % ( 1, 183) + { 'times', 'int8', 1, 1,-1, 1}, ... % ( 3, 186) + { 'times', 'int8', 4, 4,-1, 1}, ... % ( 1, 187) + { 'times', 'int16', 1, 1,-1, 1}, ... % ( 3, 190) + { 'times', 'int16', 4, 4,-1, 1}, ... % ( 1, 191) + { 'times', 'int32', 1, 1,-1, 1}, ... % ( 3, 194) + { 'times', 'int32', 4, 4,-1, 1}, ... % ( 1, 195) + { 'times', 'int64', 1, 1,-1, 1}, ... % ( 3, 198) + { 'times', 'int64', 4, 4,-1, 1}, ... % ( 1, 199) + { 'times', 'uint8', 1, 1,-1, 1}, ... % ( 3, 202) + { 'times', 'uint8', 4, 4,-1, 1}, ... % ( 1, 203) + { 'times', 'uint16', 1, 1,-1, 1}, ... % ( 3, 206) + { 'times', 'uint16', 4, 4,-1, 1}, ... % ( 1, 207) + { 'times', 'uint32', 1, 1,-1, 1}, ... % ( 3, 210) + { 'times', 'uint32', 4, 4,-1, 1}, ... % ( 1, 211) + { 'times', 'uint64', 1, 1,-1, 1}, ... % ( 3, 214) + { 'times', 'uint64', 4, 4,-1, 1}, ... % ( 1, 215) + { 'times', 'single', 1, 1,-1, 1}, ... % ( 3, 218) + { 'times', 'single', 4, 4,-1, 1}, ... % ( 1, 219) + { 'times', 'double', 1, 1,-1, 1}, ... % ( 3, 222) + { 'times', 'double', 4, 4,-1, 1}, ... % ( 1, 223) + { 'times', 'single complex', 1, 1,-1, 1}, ... % ( 3, 226) + { 'times', 'single complex', 4, 4,-1, 1}, ... % ( 1, 227) + { 'times', 'double complex', 1, 1,-1, 1}, ... % ( 3, 230) + { 'times', 'double complex', 4, 4,-1, 1}, ... % ( 1, 231) + { 'div', 'int8', 1, 1,-1, 1}, ... % ( 3, 234) + { 'div', 'int8', 4, 4,-1, 1}, ... % ( 1, 235) + { 'div', 'int16', 1, 1,-1, 1}, ... % ( 3, 238) + { 'div', 'int16', 4, 4,-1, 1}, ... % ( 1, 239) + { 'div', 'int32', 1, 1,-1, 1}, ... % ( 3, 242) + { 'div', 'int32', 4, 4,-1, 1}, ... % ( 1, 243) + { 'div', 'int64', 1, 1,-1, 1}, ... % ( 3, 246) + { 'div', 'int64', 4, 4,-1, 1}, ... % ( 1, 247) + { 'div', 'uint8', 1, 1,-1, 1}, ... % ( 3, 250) + { 'div', 'uint8', 4, 4,-1, 1}, ... % ( 1, 251) + { 'div', 'uint16', 1, 1,-1, 1}, ... % ( 3, 254) + { 'div', 'uint16', 4, 4,-1, 1}, ... % ( 1, 255) + { 'div', 'uint32', 1, 1,-1, 1}, ... % ( 3, 258) + { 'div', 'uint32', 4, 4,-1, 1}, ... % ( 1, 259) + { 'div', 'uint64', 1, 1,-1, 1}, ... % ( 3, 262) + { 'div', 'uint64', 4, 4,-1, 1}, ... % ( 1, 263) + { 'div', 'single', 1, 1,-1, 1}, ... % ( 3, 266) + { 'div', 'single', 4, 4,-1, 1}, ... % ( 1, 267) + { 'div', 'double', 1, 1,-1, 1}, ... % ( 3, 270) + { 'div', 'double', 4, 4,-1, 1}, ... % ( 1, 271) + { 'div', 'single complex', 1, 1,-1, 1}, ... % ( 3, 274) + { 'div', 'single complex', 4, 4,-1, 1}, ... % ( 1, 275) + { 'div', 'double complex', 1, 1,-1, 1}, ... % ( 3, 278) + { 'div', 'double complex', 4, 4,-1, 1}, ... % ( 1, 279) + { 'rdiv', 'int8', 1, 1,-1, 1}, ... % ( 3, 282) + { 'rdiv', 'int8', 4, 4,-1, 1}, ... % ( 1, 283) + { 'rdiv', 'int16', 1, 1,-1, 1}, ... % ( 3, 286) + { 'rdiv', 'int16', 4, 4,-1, 1}, ... % ( 1, 287) + { 'rdiv', 'int32', 1, 1,-1, 1}, ... % ( 3, 290) + { 'rdiv', 'int32', 4, 4,-1, 1}, ... % ( 1, 291) + { 'rdiv', 'int64', 1, 1,-1, 1}, ... % ( 3, 294) + { 'rdiv', 'int64', 4, 4,-1, 1}, ... % ( 1, 295) + { 'rdiv', 'uint8', 1, 1,-1, 1}, ... % ( 3, 298) + { 'rdiv', 'uint8', 4, 4,-1, 1}, ... % ( 1, 299) + { 'rdiv', 'uint16', 1, 1,-1, 1}, ... % ( 3, 302) + { 'rdiv', 'uint16', 4, 4,-1, 1}, ... % ( 1, 303) + { 'rdiv', 'uint32', 1, 1,-1, 1}, ... % ( 3, 306) + { 'rdiv', 'uint32', 4, 4,-1, 1}, ... % ( 1, 307) + { 'rdiv', 'uint64', 1, 1,-1, 1}, ... % ( 3, 310) + { 'rdiv', 'uint64', 4, 4,-1, 1}, ... % ( 1, 311) + { 'rdiv', 'single', 1, 1,-1, 1}, ... % ( 3, 314) + { 'rdiv', 'single', 4, 4,-1, 1}, ... % ( 1, 315) + { 'rdiv', 'double', 1, 1,-1, 1}, ... % ( 3, 318) + { 'rdiv', 'double', 4, 4,-1, 1}, ... % ( 1, 319) + { 'rdiv', 'single complex', 1, 1,-1, 1}, ... % ( 3, 322) + { 'rdiv', 'single complex', 4, 4,-1, 1}, ... % ( 1, 323) + { 'rdiv', 'double complex', 1, 1,-1, 1}, ... % ( 3, 326) + { 'rdiv', 'double complex', 4, 4,-1, 1}, ... % ( 1, 327) + { 'iseq', 'logical', 1, 1,-1, 1}, ... % ( 1, 328) + { 'iseq', 'logical', 4, 4,-1, 1}, ... % ( 1, 329) + { 'iseq', 'int8', 1, 1,-1, 1}, ... % ( 3, 332) + { 'iseq', 'int8', 4, 4,-1, 1}, ... % ( 1, 333) + { 'iseq', 'int16', 1, 1,-1, 1}, ... % ( 3, 336) + { 'iseq', 'int16', 4, 4,-1, 1}, ... % ( 1, 337) + { 'iseq', 'int32', 1, 1,-1, 1}, ... % ( 3, 340) + { 'iseq', 'int32', 4, 4,-1, 1}, ... % ( 1, 341) + { 'iseq', 'int64', 1, 1,-1, 1}, ... % ( 3, 344) + { 'iseq', 'int64', 4, 4,-1, 1}, ... % ( 1, 345) + { 'iseq', 'uint8', 1, 1,-1, 1}, ... % ( 3, 348) + { 'iseq', 'uint8', 4, 4,-1, 1}, ... % ( 1, 349) + { 'iseq', 'uint16', 1, 1,-1, 1}, ... % ( 3, 352) + { 'iseq', 'uint16', 4, 4,-1, 1}, ... % ( 1, 353) + { 'iseq', 'uint32', 1, 1,-1, 1}, ... % ( 3, 356) + { 'iseq', 'uint32', 4, 4,-1, 1}, ... % ( 1, 357) + { 'iseq', 'uint64', 1, 1,-1, 1}, ... % ( 3, 360) + { 'iseq', 'uint64', 4, 4,-1, 1}, ... % ( 1, 361) + { 'iseq', 'single', 1, 1,-1, 1}, ... % ( 3, 364) + { 'iseq', 'single', 4, 4,-1, 1}, ... % ( 1, 365) + { 'iseq', 'double', 1, 1,-1, 1}, ... % ( 3, 368) + { 'iseq', 'double', 4, 4,-1, 1}, ... % ( 1, 369) + { 'iseq', 'single complex', 1, 1,-1, 1}, ... % ( 3, 372) + { 'iseq', 'single complex', 4, 4,-1, 1}, ... % ( 1, 373) + { 'iseq', 'double complex', 1, 1,-1, 1}, ... % ( 3, 376) + { 'iseq', 'double complex', 4, 4,-1, 1}, ... % ( 1, 377) + { 'isne', 'int8', 1, 1,-1, 1}, ... % ( 3, 380) + { 'isne', 'int8', 4, 4,-1, 1}, ... % ( 1, 381) + { 'isne', 'int16', 1, 1,-1, 1}, ... % ( 3, 384) + { 'isne', 'int16', 4, 4,-1, 1}, ... % ( 1, 385) + { 'isne', 'int32', 1, 1,-1, 1}, ... % ( 3, 388) + { 'isne', 'int32', 4, 4,-1, 1}, ... % ( 1, 389) + { 'isne', 'int64', 1, 1,-1, 1}, ... % ( 3, 392) + { 'isne', 'int64', 4, 4,-1, 1}, ... % ( 1, 393) + { 'isne', 'uint8', 1, 1,-1, 1}, ... % ( 3, 396) + { 'isne', 'uint8', 4, 4,-1, 1}, ... % ( 1, 397) + { 'isne', 'uint16', 1, 1,-1, 1}, ... % ( 3, 400) + { 'isne', 'uint16', 4, 4,-1, 1}, ... % ( 1, 401) + { 'isne', 'uint32', 1, 1,-1, 1}, ... % ( 3, 404) + { 'isne', 'uint32', 4, 4,-1, 1}, ... % ( 1, 405) + { 'isne', 'uint64', 1, 1,-1, 1}, ... % ( 3, 408) + { 'isne', 'uint64', 4, 4,-1, 1}, ... % ( 1, 409) + { 'isne', 'single', 1, 1,-1, 1}, ... % ( 3, 412) + { 'isne', 'single', 4, 4,-1, 1}, ... % ( 1, 413) + { 'isne', 'double', 1, 1,-1, 1}, ... % ( 3, 416) + { 'isne', 'double', 4, 4,-1, 1}, ... % ( 1, 417) + { 'isne', 'single complex', 1, 1,-1, 1}, ... % ( 3, 420) + { 'isne', 'single complex', 4, 4,-1, 1}, ... % ( 1, 421) + { 'isne', 'double complex', 1, 1,-1, 1}, ... % ( 3, 424) + { 'isne', 'double complex', 4, 4,-1, 1}, ... % ( 1, 425) + { 'eq', 'int8', 1, 1,-1, 1}, ... % ( 1, 426) + { 'eq', 'int8', 4, 4,-1, 1}, ... % ( 1, 427) + { 'eq', 'int16', 1, 1,-1, 1}, ... % ( 1, 428) + { 'eq', 'int16', 4, 4,-1, 1}, ... % ( 1, 429) + { 'eq', 'int32', 1, 1,-1, 1}, ... % ( 1, 430) + { 'eq', 'int32', 4, 4,-1, 1}, ... % ( 1, 431) + { 'eq', 'int64', 1, 1,-1, 1}, ... % ( 1, 432) + { 'eq', 'int64', 4, 4,-1, 1}, ... % ( 1, 433) + { 'eq', 'uint8', 1, 1,-1, 1}, ... % ( 1, 434) + { 'eq', 'uint8', 4, 4,-1, 1}, ... % ( 1, 435) + { 'eq', 'uint16', 1, 1,-1, 1}, ... % ( 1, 436) + { 'eq', 'uint16', 4, 4,-1, 1}, ... % ( 1, 437) + { 'eq', 'uint32', 1, 1,-1, 1}, ... % ( 1, 438) + { 'eq', 'uint32', 4, 4,-1, 1}, ... % ( 1, 439) + { 'eq', 'uint64', 1, 1,-1, 1}, ... % ( 1, 440) + { 'eq', 'uint64', 4, 4,-1, 1}, ... % ( 1, 441) + { 'eq', 'single', 1, 1,-1, 1}, ... % ( 1, 442) + { 'eq', 'single', 4, 4,-1, 1}, ... % ( 1, 443) + { 'eq', 'double', 1, 1,-1, 1}, ... % ( 1, 444) + { 'eq', 'double', 4, 4,-1, 1}, ... % ( 1, 445) + { 'eq', 'single complex', 1, 1,-1, 1}, ... % ( 1, 446) + { 'eq', 'single complex', 4, 4,-1, 1}, ... % ( 1, 447) + { 'eq', 'double complex', 1, 1,-1, 1}, ... % ( 1, 448) + { 'eq', 'double complex', 4, 4,-1, 1}, ... % ( 1, 449) + { 'ne', 'int8', 1, 1,-1, 1}, ... % ( 1, 450) + { 'ne', 'int8', 4, 4,-1, 1}, ... % ( 1, 451) + { 'ne', 'int16', 1, 1,-1, 1}, ... % ( 1, 452) + { 'ne', 'int16', 4, 4,-1, 1}, ... % ( 1, 453) + { 'ne', 'int32', 1, 1,-1, 1}, ... % ( 1, 454) + { 'ne', 'int32', 4, 4,-1, 1}, ... % ( 1, 455) + { 'ne', 'int64', 1, 1,-1, 1}, ... % ( 1, 456) + { 'ne', 'int64', 4, 4,-1, 1}, ... % ( 1, 457) + { 'ne', 'uint8', 1, 1,-1, 1}, ... % ( 1, 458) + { 'ne', 'uint8', 4, 4,-1, 1}, ... % ( 1, 459) + { 'ne', 'uint16', 1, 1,-1, 1}, ... % ( 1, 460) + { 'ne', 'uint16', 4, 4,-1, 1}, ... % ( 1, 461) + { 'ne', 'uint32', 1, 1,-1, 1}, ... % ( 1, 462) + { 'ne', 'uint32', 4, 4,-1, 1}, ... % ( 1, 463) + { 'ne', 'uint64', 1, 1,-1, 1}, ... % ( 1, 464) + { 'ne', 'uint64', 4, 4,-1, 1}, ... % ( 1, 465) + { 'ne', 'single', 1, 1,-1, 1}, ... % ( 1, 466) + { 'ne', 'single', 4, 4,-1, 1}, ... % ( 1, 467) + { 'ne', 'double', 1, 1,-1, 1}, ... % ( 1, 468) + { 'ne', 'double', 4, 4,-1, 1}, ... % ( 1, 469) + { 'ne', 'single complex', 1, 1,-1, 1}, ... % ( 1, 470) + { 'ne', 'single complex', 4, 4,-1, 1}, ... % ( 1, 471) + { 'ne', 'double complex', 1, 1,-1, 1}, ... % ( 1, 472) + { 'ne', 'double complex', 4, 4,-1, 1}, ... % ( 1, 473) + { 'pow', 'logical', 1, 1,-1, 1}, ... % ( 1, 474) + { 'pow', 'logical', 4, 4,-1, 1}, ... % ( 1, 475) + { 'pow', 'int8', 1, 1,-1, 1}, ... % ( 3, 478) + { 'pow', 'int8', 4, 4,-1, 1}, ... % ( 1, 479) + { 'pow', 'int16', 1, 1,-1, 1}, ... % ( 3, 482) + { 'pow', 'int16', 4, 4,-1, 1}, ... % ( 1, 483) + { 'pow', 'int32', 1, 1,-1, 1}, ... % ( 3, 486) + { 'pow', 'int32', 4, 4,-1, 1}, ... % ( 1, 487) + { 'pow', 'int64', 1, 1,-1, 1}, ... % ( 3, 490) + { 'pow', 'int64', 4, 4,-1, 1}, ... % ( 1, 491) + { 'pow', 'uint8', 1, 1,-1, 1}, ... % ( 3, 494) + { 'pow', 'uint8', 4, 4,-1, 1}, ... % ( 1, 495) + { 'pow', 'uint16', 1, 1,-1, 1}, ... % ( 3, 498) + { 'pow', 'uint16', 4, 4,-1, 1}, ... % ( 1, 499) + { 'pow', 'uint32', 1, 1,-1, 1}, ... % ( 3, 502) + { 'pow', 'uint32', 4, 4,-1, 1}, ... % ( 1, 503) + { 'pow', 'uint64', 1, 1,-1, 1}, ... % ( 3, 506) + { 'pow', 'uint64', 4, 4,-1, 1}, ... % ( 1, 507) + { 'pow', 'single', 1, 1,-1, 1}, ... % ( 3, 510) + { 'pow', 'single', 4, 4,-1, 1}, ... % ( 1, 511) + { 'pow', 'double', 1, 1,-1, 1}, ... % ( 3, 514) + { 'pow', 'double', 4, 4,-1, 1}, ... % ( 1, 515) + { 'pow', 'single complex', 1, 1,-1, 1}, ... % ( 3, 518) + { 'pow', 'single complex', 4, 4,-1, 1}, ... % ( 1, 519) + { 'pow', 'double complex', 1, 1,-1, 1}, ... % ( 3, 522) + { 'pow', 'double complex', 4, 4,-1, 1}, ... % ( 1, 523) + { 'min', 'int8', 1, 1,-1, 1}, ... % ( 3, 526) + { 'min', 'int8', 4, 4,-1, 1}, ... % ( 1, 527) + { 'min', 'int16', 1, 1,-1, 1}, ... % ( 3, 530) + { 'min', 'int16', 4, 4,-1, 1}, ... % ( 1, 531) + { 'min', 'int32', 1, 1,-1, 1}, ... % ( 3, 534) + { 'min', 'int32', 4, 4,-1, 1}, ... % ( 1, 535) + { 'min', 'int64', 1, 1,-1, 1}, ... % ( 3, 538) + { 'min', 'int64', 4, 4,-1, 1}, ... % ( 1, 539) + { 'min', 'uint8', 1, 1,-1, 1}, ... % ( 3, 542) + { 'min', 'uint8', 4, 4,-1, 1}, ... % ( 1, 543) + { 'min', 'uint16', 1, 1,-1, 1}, ... % ( 3, 546) + { 'min', 'uint16', 4, 4,-1, 1}, ... % ( 1, 547) + { 'min', 'uint32', 1, 1,-1, 1}, ... % ( 3, 550) + { 'min', 'uint32', 4, 4,-1, 1}, ... % ( 1, 551) + { 'min', 'uint64', 1, 1,-1, 1}, ... % ( 3, 554) + { 'min', 'uint64', 4, 4,-1, 1}, ... % ( 1, 555) + { 'min', 'single', 1, 1,-1, 1}, ... % ( 3, 558) + { 'min', 'single', 4, 4,-1, 1}, ... % ( 1, 559) + { 'min', 'double', 1, 1,-1, 1}, ... % ( 3, 562) + { 'min', 'double', 4, 4,-1, 1}, ... % ( 1, 563) + { 'max', 'int8', 1, 1,-1, 1}, ... % ( 3, 566) + { 'max', 'int8', 4, 4,-1, 1}, ... % ( 1, 567) + { 'max', 'int16', 1, 1,-1, 1}, ... % ( 3, 570) + { 'max', 'int16', 4, 4,-1, 1}, ... % ( 1, 571) + { 'max', 'int32', 1, 1,-1, 1}, ... % ( 3, 574) + { 'max', 'int32', 4, 4,-1, 1}, ... % ( 1, 575) + { 'max', 'int64', 1, 1,-1, 1}, ... % ( 3, 578) + { 'max', 'int64', 4, 4,-1, 1}, ... % ( 1, 579) + { 'max', 'uint8', 1, 1,-1, 1}, ... % ( 3, 582) + { 'max', 'uint8', 4, 4,-1, 1}, ... % ( 1, 583) + { 'max', 'uint16', 1, 1,-1, 1}, ... % ( 3, 586) + { 'max', 'uint16', 4, 4,-1, 1}, ... % ( 1, 587) + { 'max', 'uint32', 1, 1,-1, 1}, ... % ( 3, 590) + { 'max', 'uint32', 4, 4,-1, 1}, ... % ( 1, 591) + { 'max', 'uint64', 1, 1,-1, 1}, ... % ( 3, 594) + { 'max', 'uint64', 4, 4,-1, 1}, ... % ( 1, 595) + { 'max', 'single', 1, 1,-1, 1}, ... % ( 3, 598) + { 'max', 'single', 4, 4,-1, 1}, ... % ( 1, 599) + { 'max', 'double', 1, 1,-1, 1}, ... % ( 3, 602) + { 'max', 'double', 4, 4,-1, 1}, ... % ( 1, 603) + { 'isgt', 'logical', 1, 1,-1, 1}, ... % ( 1, 604) + { 'isgt', 'logical', 4, 4,-1, 1}, ... % ( 1, 605) + { 'isgt', 'int8', 1, 1,-1, 1}, ... % ( 3, 608) + { 'isgt', 'int8', 4, 4,-1, 1}, ... % ( 1, 609) + { 'isgt', 'int16', 1, 1,-1, 1}, ... % ( 3, 612) + { 'isgt', 'int16', 4, 4,-1, 1}, ... % ( 1, 613) + { 'isgt', 'int32', 1, 1,-1, 1}, ... % ( 3, 616) + { 'isgt', 'int32', 4, 4,-1, 1}, ... % ( 1, 617) + { 'isgt', 'int64', 1, 1,-1, 1}, ... % ( 3, 620) + { 'isgt', 'int64', 4, 4,-1, 1}, ... % ( 1, 621) + { 'isgt', 'uint8', 1, 1,-1, 1}, ... % ( 3, 624) + { 'isgt', 'uint8', 4, 4,-1, 1}, ... % ( 1, 625) + { 'isgt', 'uint16', 1, 1,-1, 1}, ... % ( 3, 628) + { 'isgt', 'uint16', 4, 4,-1, 1}, ... % ( 1, 629) + { 'isgt', 'uint32', 1, 1,-1, 1}, ... % ( 3, 632) + { 'isgt', 'uint32', 4, 4,-1, 1}, ... % ( 1, 633) + { 'isgt', 'uint64', 1, 1,-1, 1}, ... % ( 3, 636) + { 'isgt', 'uint64', 4, 4,-1, 1}, ... % ( 1, 637) + { 'isgt', 'single', 1, 1,-1, 1}, ... % ( 3, 640) + { 'isgt', 'single', 4, 4,-1, 1}, ... % ( 1, 641) + { 'isgt', 'double', 1, 1,-1, 1}, ... % ( 3, 644) + { 'isgt', 'double', 4, 4,-1, 1}, ... % ( 1, 645) + { 'islt', 'logical', 1, 1,-1, 1}, ... % ( 1, 646) + { 'islt', 'logical', 4, 4,-1, 1}, ... % ( 1, 647) + { 'islt', 'int8', 1, 1,-1, 1}, ... % ( 3, 650) + { 'islt', 'int8', 4, 4,-1, 1}, ... % ( 1, 651) + { 'islt', 'int16', 1, 1,-1, 1}, ... % ( 3, 654) + { 'islt', 'int16', 4, 4,-1, 1}, ... % ( 1, 655) + { 'islt', 'int32', 1, 1,-1, 1}, ... % ( 3, 658) + { 'islt', 'int32', 4, 4,-1, 1}, ... % ( 1, 659) + { 'islt', 'int64', 1, 1,-1, 1}, ... % ( 3, 662) + { 'islt', 'int64', 4, 4,-1, 1}, ... % ( 1, 663) + { 'islt', 'uint8', 1, 1,-1, 1}, ... % ( 3, 666) + { 'islt', 'uint8', 4, 4,-1, 1}, ... % ( 1, 667) + { 'islt', 'uint16', 1, 1,-1, 1}, ... % ( 3, 670) + { 'islt', 'uint16', 4, 4,-1, 1}, ... % ( 1, 671) + { 'islt', 'uint32', 1, 1,-1, 1}, ... % ( 3, 674) + { 'islt', 'uint32', 4, 4,-1, 1}, ... % ( 1, 675) + { 'islt', 'uint64', 1, 1,-1, 1}, ... % ( 3, 678) + { 'islt', 'uint64', 4, 4,-1, 1}, ... % ( 1, 679) + { 'islt', 'single', 1, 1,-1, 1}, ... % ( 3, 682) + { 'islt', 'single', 4, 4,-1, 1}, ... % ( 1, 683) + { 'islt', 'double', 1, 1,-1, 1}, ... % ( 3, 686) + { 'islt', 'double', 4, 4,-1, 1}, ... % ( 1, 687) + { 'isge', 'int8', 1, 1,-1, 1}, ... % ( 3, 690) + { 'isge', 'int8', 4, 4,-1, 1}, ... % ( 1, 691) + { 'isge', 'int16', 1, 1,-1, 1}, ... % ( 3, 694) + { 'isge', 'int16', 4, 4,-1, 1}, ... % ( 1, 695) + { 'isge', 'int32', 1, 1,-1, 1}, ... % ( 3, 698) + { 'isge', 'int32', 4, 4,-1, 1}, ... % ( 1, 699) + { 'isge', 'int64', 1, 1,-1, 1}, ... % ( 3, 702) + { 'isge', 'int64', 4, 4,-1, 1}, ... % ( 1, 703) + { 'isge', 'uint8', 1, 1,-1, 1}, ... % ( 3, 706) + { 'isge', 'uint8', 4, 4,-1, 1}, ... % ( 1, 707) + { 'isge', 'uint16', 1, 1,-1, 1}, ... % ( 3, 710) + { 'isge', 'uint16', 4, 4,-1, 1}, ... % ( 1, 711) + { 'isge', 'uint32', 1, 1,-1, 1}, ... % ( 3, 714) + { 'isge', 'uint32', 4, 4,-1, 1}, ... % ( 1, 715) + { 'isge', 'uint64', 1, 1,-1, 1}, ... % ( 3, 718) + { 'isge', 'uint64', 4, 4,-1, 1}, ... % ( 1, 719) + { 'isge', 'single', 1, 1,-1, 1}, ... % ( 3, 722) + { 'isge', 'single', 4, 4,-1, 1}, ... % ( 1, 723) + { 'isge', 'double', 1, 1,-1, 1}, ... % ( 3, 726) + { 'isge', 'double', 4, 4,-1, 1}, ... % ( 1, 727) + { 'isle', 'logical', 1, 1,-1, 1}, ... % ( 1, 728) + { 'isle', 'logical', 4, 4,-1, 1}, ... % ( 1, 729) + { 'isle', 'int8', 1, 1,-1, 1}, ... % ( 3, 732) + { 'isle', 'int8', 4, 4,-1, 1}, ... % ( 1, 733) + { 'isle', 'int16', 1, 1,-1, 1}, ... % ( 3, 736) + { 'isle', 'int16', 4, 4,-1, 1}, ... % ( 1, 737) + { 'isle', 'int32', 1, 1,-1, 1}, ... % ( 3, 740) + { 'isle', 'int32', 4, 4,-1, 1}, ... % ( 1, 741) + { 'isle', 'int64', 1, 1,-1, 1}, ... % ( 3, 744) + { 'isle', 'int64', 4, 4,-1, 1}, ... % ( 1, 745) + { 'isle', 'uint8', 1, 1,-1, 1}, ... % ( 3, 748) + { 'isle', 'uint8', 4, 4,-1, 1}, ... % ( 1, 749) + { 'isle', 'uint16', 1, 1,-1, 1}, ... % ( 3, 752) + { 'isle', 'uint16', 4, 4,-1, 1}, ... % ( 1, 753) + { 'isle', 'uint32', 1, 1,-1, 1}, ... % ( 3, 756) + { 'isle', 'uint32', 4, 4,-1, 1}, ... % ( 1, 757) + { 'isle', 'uint64', 1, 1,-1, 1}, ... % ( 3, 760) + { 'isle', 'uint64', 4, 4,-1, 1}, ... % ( 1, 761) + { 'isle', 'single', 1, 1,-1, 1}, ... % ( 3, 764) + { 'isle', 'single', 4, 4,-1, 1}, ... % ( 1, 765) + { 'isle', 'double', 1, 1,-1, 1}, ... % ( 3, 768) + { 'isle', 'double', 4, 4,-1, 1}, ... % ( 1, 769) + { 'gt', 'int8', 1, 1,-1, 1}, ... % ( 1, 770) + { 'gt', 'int8', 4, 4,-1, 1}, ... % ( 1, 771) + { 'gt', 'int16', 1, 1,-1, 1}, ... % ( 1, 772) + { 'gt', 'int16', 4, 4,-1, 1}, ... % ( 1, 773) + { 'gt', 'int32', 1, 1,-1, 1}, ... % ( 1, 774) + { 'gt', 'int32', 4, 4,-1, 1}, ... % ( 1, 775) + { 'gt', 'int64', 1, 1,-1, 1}, ... % ( 1, 776) + { 'gt', 'int64', 4, 4,-1, 1}, ... % ( 1, 777) + { 'gt', 'uint8', 1, 1,-1, 1}, ... % ( 1, 778) + { 'gt', 'uint8', 4, 4,-1, 1}, ... % ( 1, 779) + { 'gt', 'uint16', 1, 1,-1, 1}, ... % ( 1, 780) + { 'gt', 'uint16', 4, 4,-1, 1}, ... % ( 1, 781) + { 'gt', 'uint32', 1, 1,-1, 1}, ... % ( 1, 782) + { 'gt', 'uint32', 4, 4,-1, 1}, ... % ( 1, 783) + { 'gt', 'uint64', 1, 1,-1, 1}, ... % ( 1, 784) + { 'gt', 'uint64', 4, 4,-1, 1}, ... % ( 1, 785) + { 'gt', 'single', 1, 1,-1, 1}, ... % ( 1, 786) + { 'gt', 'single', 4, 4,-1, 1}, ... % ( 1, 787) + { 'gt', 'double', 1, 1,-1, 1}, ... % ( 1, 788) + { 'gt', 'double', 4, 4,-1, 1}, ... % ( 1, 789) + { 'lt', 'int8', 1, 1,-1, 1}, ... % ( 1, 790) + { 'lt', 'int8', 4, 4,-1, 1}, ... % ( 1, 791) + { 'lt', 'int16', 1, 1,-1, 1}, ... % ( 1, 792) + { 'lt', 'int16', 4, 4,-1, 1}, ... % ( 1, 793) + { 'lt', 'int32', 1, 1,-1, 1}, ... % ( 1, 794) + { 'lt', 'int32', 4, 4,-1, 1}, ... % ( 1, 795) + { 'lt', 'int64', 1, 1,-1, 1}, ... % ( 1, 796) + { 'lt', 'int64', 4, 4,-1, 1}, ... % ( 1, 797) + { 'lt', 'uint8', 1, 1,-1, 1}, ... % ( 1, 798) + { 'lt', 'uint8', 4, 4,-1, 1}, ... % ( 1, 799) + { 'lt', 'uint16', 1, 1,-1, 1}, ... % ( 1, 800) + { 'lt', 'uint16', 4, 4,-1, 1}, ... % ( 1, 801) + { 'lt', 'uint32', 1, 1,-1, 1}, ... % ( 1, 802) + { 'lt', 'uint32', 4, 4,-1, 1}, ... % ( 1, 803) + { 'lt', 'uint64', 1, 1,-1, 1}, ... % ( 1, 804) + { 'lt', 'uint64', 4, 4,-1, 1}, ... % ( 1, 805) + { 'lt', 'single', 1, 1,-1, 1}, ... % ( 1, 806) + { 'lt', 'single', 4, 4,-1, 1}, ... % ( 1, 807) + { 'lt', 'double', 1, 1,-1, 1}, ... % ( 1, 808) + { 'lt', 'double', 4, 4,-1, 1}, ... % ( 1, 809) + { 'ge', 'int8', 1, 1,-1, 1}, ... % ( 1, 810) + { 'ge', 'int8', 4, 4,-1, 1}, ... % ( 1, 811) + { 'ge', 'int16', 1, 1,-1, 1}, ... % ( 1, 812) + { 'ge', 'int16', 4, 4,-1, 1}, ... % ( 1, 813) + { 'ge', 'int32', 1, 1,-1, 1}, ... % ( 1, 814) + { 'ge', 'int32', 4, 4,-1, 1}, ... % ( 1, 815) + { 'ge', 'int64', 1, 1,-1, 1}, ... % ( 1, 816) + { 'ge', 'int64', 4, 4,-1, 1}, ... % ( 1, 817) + { 'ge', 'uint8', 1, 1,-1, 1}, ... % ( 1, 818) + { 'ge', 'uint8', 4, 4,-1, 1}, ... % ( 1, 819) + { 'ge', 'uint16', 1, 1,-1, 1}, ... % ( 1, 820) + { 'ge', 'uint16', 4, 4,-1, 1}, ... % ( 1, 821) + { 'ge', 'uint32', 1, 1,-1, 1}, ... % ( 1, 822) + { 'ge', 'uint32', 4, 4,-1, 1}, ... % ( 1, 823) + { 'ge', 'uint64', 1, 1,-1, 1}, ... % ( 1, 824) + { 'ge', 'uint64', 4, 4,-1, 1}, ... % ( 1, 825) + { 'ge', 'single', 1, 1,-1, 1}, ... % ( 1, 826) + { 'ge', 'single', 4, 4,-1, 1}, ... % ( 1, 827) + { 'ge', 'double', 1, 1,-1, 1}, ... % ( 1, 828) + { 'ge', 'double', 4, 4,-1, 1}, ... % ( 1, 829) + { 'le', 'int8', 1, 1,-1, 1}, ... % ( 1, 830) + { 'le', 'int8', 4, 4,-1, 1}, ... % ( 1, 831) + { 'le', 'int16', 1, 1,-1, 1}, ... % ( 1, 832) + { 'le', 'int16', 4, 4,-1, 1}, ... % ( 1, 833) + { 'le', 'int32', 1, 1,-1, 1}, ... % ( 1, 834) + { 'le', 'int32', 4, 4,-1, 1}, ... % ( 1, 835) + { 'le', 'int64', 1, 1,-1, 1}, ... % ( 1, 836) + { 'le', 'int64', 4, 4,-1, 1}, ... % ( 1, 837) + { 'le', 'uint8', 1, 1,-1, 1}, ... % ( 1, 838) + { 'le', 'uint8', 4, 4,-1, 1}, ... % ( 1, 839) + { 'le', 'uint16', 1, 1,-1, 1}, ... % ( 1, 840) + { 'le', 'uint16', 4, 4,-1, 1}, ... % ( 1, 841) + { 'le', 'uint32', 1, 1,-1, 1}, ... % ( 1, 842) + { 'le', 'uint32', 4, 4,-1, 1}, ... % ( 1, 843) + { 'le', 'uint64', 1, 1,-1, 1}, ... % ( 1, 844) + { 'le', 'uint64', 4, 4,-1, 1}, ... % ( 1, 845) + { 'le', 'single', 1, 1,-1, 1}, ... % ( 1, 846) + { 'le', 'single', 4, 4,-1, 1}, ... % ( 1, 847) + { 'le', 'double', 1, 1,-1, 1}, ... % ( 1, 848) + { 'le', 'double', 4, 4,-1, 1}, ... % ( 1, 849) + { 'or', 'int8', 1, 1,-1, 1}, ... % ( 3, 852) + { 'or', 'int8', 4, 4,-1, 1}, ... % ( 1, 853) + { 'or', 'int16', 1, 1,-1, 1}, ... % ( 3, 856) + { 'or', 'int16', 4, 4,-1, 1}, ... % ( 1, 857) + { 'or', 'int32', 1, 1,-1, 1}, ... % ( 3, 860) + { 'or', 'int32', 4, 4,-1, 1}, ... % ( 1, 861) + { 'or', 'int64', 1, 1,-1, 1}, ... % ( 3, 864) + { 'or', 'int64', 4, 4,-1, 1}, ... % ( 1, 865) + { 'or', 'uint8', 1, 1,-1, 1}, ... % ( 3, 868) + { 'or', 'uint8', 4, 4,-1, 1}, ... % ( 1, 869) + { 'or', 'uint16', 1, 1,-1, 1}, ... % ( 3, 872) + { 'or', 'uint16', 4, 4,-1, 1}, ... % ( 1, 873) + { 'or', 'uint32', 1, 1,-1, 1}, ... % ( 3, 876) + { 'or', 'uint32', 4, 4,-1, 1}, ... % ( 1, 877) + { 'or', 'uint64', 1, 1,-1, 1}, ... % ( 3, 880) + { 'or', 'uint64', 4, 4,-1, 1}, ... % ( 1, 881) + { 'or', 'single', 1, 1,-1, 1}, ... % ( 3, 884) + { 'or', 'single', 4, 4,-1, 1}, ... % ( 1, 885) + { 'or', 'double', 1, 1,-1, 1}, ... % ( 3, 888) + { 'or', 'double', 4, 4,-1, 1}, ... % ( 1, 889) + { 'and', 'int8', 1, 1,-1, 1}, ... % ( 3, 892) + { 'and', 'int8', 4, 4,-1, 1}, ... % ( 1, 893) + { 'and', 'int16', 1, 1,-1, 1}, ... % ( 3, 896) + { 'and', 'int16', 4, 4,-1, 1}, ... % ( 1, 897) + { 'and', 'int32', 1, 1,-1, 1}, ... % ( 3, 900) + { 'and', 'int32', 4, 4,-1, 1}, ... % ( 1, 901) + { 'and', 'int64', 1, 1,-1, 1}, ... % ( 3, 904) + { 'and', 'int64', 4, 4,-1, 1}, ... % ( 1, 905) + { 'and', 'uint8', 1, 1,-1, 1}, ... % ( 3, 908) + { 'and', 'uint8', 4, 4,-1, 1}, ... % ( 1, 909) + { 'and', 'uint16', 1, 1,-1, 1}, ... % ( 3, 912) + { 'and', 'uint16', 4, 4,-1, 1}, ... % ( 1, 913) + { 'and', 'uint32', 1, 1,-1, 1}, ... % ( 3, 916) + { 'and', 'uint32', 4, 4,-1, 1}, ... % ( 1, 917) + { 'and', 'uint64', 1, 1,-1, 1}, ... % ( 3, 920) + { 'and', 'uint64', 4, 4,-1, 1}, ... % ( 1, 921) + { 'and', 'single', 1, 1,-1, 1}, ... % ( 3, 924) + { 'and', 'single', 4, 4,-1, 1}, ... % ( 1, 925) + { 'and', 'double', 1, 1,-1, 1}, ... % ( 3, 928) + { 'and', 'double', 4, 4,-1, 1}, ... % ( 1, 929) + { 'xor', 'int8', 1, 1,-1, 1}, ... % ( 3, 932) + { 'xor', 'int8', 4, 4,-1, 1}, ... % ( 1, 933) + { 'xor', 'int16', 1, 1,-1, 1}, ... % ( 3, 936) + { 'xor', 'int16', 4, 4,-1, 1}, ... % ( 1, 937) + { 'xor', 'int32', 1, 1,-1, 1}, ... % ( 3, 940) + { 'xor', 'int32', 4, 4,-1, 1}, ... % ( 1, 941) + { 'xor', 'int64', 1, 1,-1, 1}, ... % ( 3, 944) + { 'xor', 'int64', 4, 4,-1, 1}, ... % ( 1, 945) + { 'xor', 'uint8', 1, 1,-1, 1}, ... % ( 3, 948) + { 'xor', 'uint8', 4, 4,-1, 1}, ... % ( 1, 949) + { 'xor', 'uint16', 1, 1,-1, 1}, ... % ( 3, 952) + { 'xor', 'uint16', 4, 4,-1, 1}, ... % ( 1, 953) + { 'xor', 'uint32', 1, 1,-1, 1}, ... % ( 3, 956) + { 'xor', 'uint32', 4, 4,-1, 1}, ... % ( 1, 957) + { 'xor', 'uint64', 1, 1,-1, 1}, ... % ( 3, 960) + { 'xor', 'uint64', 4, 4,-1, 1}, ... % ( 1, 961) + { 'xor', 'single', 1, 1,-1, 1}, ... % ( 3, 964) + { 'xor', 'single', 4, 4,-1, 1}, ... % ( 1, 965) + { 'xor', 'double', 1, 1,-1, 1}, ... % ( 3, 968) + { 'xor', 'double', 4, 4,-1, 1}, ... % ( 1, 969) + { 'bor', 'int8', 1, 1,-1, 1}, ... % ( 3, 972) + { 'bor', 'int8', 4, 4,-1, 1}, ... % ( 1, 973) + { 'bor', 'int16', 1, 1,-1, 1}, ... % ( 3, 976) + { 'bor', 'int16', 4, 4,-1, 1}, ... % ( 1, 977) + { 'bor', 'int32', 1, 1,-1, 1}, ... % ( 3, 980) + { 'bor', 'int32', 4, 4,-1, 1}, ... % ( 1, 981) + { 'bor', 'int64', 1, 1,-1, 1}, ... % ( 3, 984) + { 'bor', 'int64', 4, 4,-1, 1}, ... % ( 1, 985) + { 'bor', 'uint8', 1, 1,-1, 1}, ... % ( 3, 988) + { 'bor', 'uint8', 4, 4,-1, 1}, ... % ( 1, 989) + { 'bor', 'uint16', 1, 1,-1, 1}, ... % ( 3, 992) + { 'bor', 'uint16', 4, 4,-1, 1}, ... % ( 1, 993) + { 'bor', 'uint32', 1, 1,-1, 1}, ... % ( 3, 996) + { 'bor', 'uint32', 4, 4,-1, 1}, ... % ( 1, 997) + { 'bor', 'uint64', 1, 1,-1, 1}, ... % ( 3, 1000) + { 'bor', 'uint64', 4, 4,-1, 1}, ... % ( 1, 1001) + { 'band', 'int8', 1, 1,-1, 1}, ... % ( 3, 1004) + { 'band', 'int8', 4, 4,-1, 1}, ... % ( 1, 1005) + { 'band', 'int16', 1, 1,-1, 1}, ... % ( 3, 1008) + { 'band', 'int16', 4, 4,-1, 1}, ... % ( 1, 1009) + { 'band', 'int32', 1, 1,-1, 1}, ... % ( 3, 1012) + { 'band', 'int32', 4, 4,-1, 1}, ... % ( 1, 1013) + { 'band', 'int64', 1, 1,-1, 1}, ... % ( 3, 1016) + { 'band', 'int64', 4, 4,-1, 1}, ... % ( 1, 1017) + { 'band', 'uint8', 1, 1,-1, 1}, ... % ( 3, 1020) + { 'band', 'uint8', 4, 4,-1, 1}, ... % ( 1, 1021) + { 'band', 'uint16', 1, 1,-1, 1}, ... % ( 3, 1024) + { 'band', 'uint16', 4, 4,-1, 1}, ... % ( 1, 1025) + { 'band', 'uint32', 1, 1,-1, 1}, ... % ( 3, 1028) + { 'band', 'uint32', 4, 4,-1, 1}, ... % ( 1, 1029) + { 'band', 'uint64', 1, 1,-1, 1}, ... % ( 3, 1032) + { 'band', 'uint64', 4, 4,-1, 1}, ... % ( 1, 1033) + { 'bxor', 'int8', 1, 1,-1, 1}, ... % ( 3, 1036) + { 'bxor', 'int8', 4, 4,-1, 1}, ... % ( 1, 1037) + { 'bxor', 'int16', 1, 1,-1, 1}, ... % ( 3, 1040) + { 'bxor', 'int16', 4, 4,-1, 1}, ... % ( 1, 1041) + { 'bxor', 'int32', 1, 1,-1, 1}, ... % ( 3, 1044) + { 'bxor', 'int32', 4, 4,-1, 1}, ... % ( 1, 1045) + { 'bxor', 'int64', 1, 1,-1, 1}, ... % ( 3, 1048) + { 'bxor', 'int64', 4, 4,-1, 1}, ... % ( 1, 1049) + { 'bxor', 'uint8', 1, 1,-1, 1}, ... % ( 3, 1052) + { 'bxor', 'uint8', 4, 4,-1, 1}, ... % ( 1, 1053) + { 'bxor', 'uint16', 1, 1,-1, 1}, ... % ( 3, 1056) + { 'bxor', 'uint16', 4, 4,-1, 1}, ... % ( 1, 1057) + { 'bxor', 'uint32', 1, 1,-1, 1}, ... % ( 3, 1060) + { 'bxor', 'uint32', 4, 4,-1, 1}, ... % ( 1, 1061) + { 'bxor', 'uint64', 1, 1,-1, 1}, ... % ( 3, 1064) + { 'bxor', 'uint64', 4, 4,-1, 1}, ... % ( 1, 1065) + { 'bxnor', 'int8', 1, 1,-1, 1}, ... % ( 3, 1068) + { 'bxnor', 'int8', 4, 4,-1, 1}, ... % ( 1, 1069) + { 'bxnor', 'int16', 1, 1,-1, 1}, ... % ( 3, 1072) + { 'bxnor', 'int16', 4, 4,-1, 1}, ... % ( 1, 1073) + { 'bxnor', 'int32', 1, 1,-1, 1}, ... % ( 3, 1076) + { 'bxnor', 'int32', 4, 4,-1, 1}, ... % ( 1, 1077) + { 'bxnor', 'int64', 1, 1,-1, 1}, ... % ( 3, 1080) + { 'bxnor', 'int64', 4, 4,-1, 1}, ... % ( 1, 1081) + { 'bxnor', 'uint8', 1, 1,-1, 1}, ... % ( 3, 1084) + { 'bxnor', 'uint8', 4, 4,-1, 1}, ... % ( 1, 1085) + { 'bxnor', 'uint16', 1, 1,-1, 1}, ... % ( 3, 1088) + { 'bxnor', 'uint16', 4, 4,-1, 1}, ... % ( 1, 1089) + { 'bxnor', 'uint32', 1, 1,-1, 1}, ... % ( 3, 1092) + { 'bxnor', 'uint32', 4, 4,-1, 1}, ... % ( 1, 1093) + { 'bxnor', 'uint64', 1, 1,-1, 1}, ... % ( 3, 1096) + { 'bxnor', 'uint64', 4, 4,-1, 1}, ... % ( 1, 1097) + { 'bget', 'int8', 1, 1,-1, 1}, ... % ( 3, 1100) + { 'bget', 'int8', 4, 4,-1, 1}, ... % ( 1, 1101) + { 'bget', 'int16', 1, 1,-1, 1}, ... % ( 3, 1104) + { 'bget', 'int16', 4, 4,-1, 1}, ... % ( 1, 1105) + { 'bget', 'int32', 1, 1,-1, 1}, ... % ( 3, 1108) + { 'bget', 'int32', 4, 4,-1, 1}, ... % ( 1, 1109) + { 'bget', 'int64', 1, 1,-1, 1}, ... % ( 3, 1112) + { 'bget', 'int64', 4, 4,-1, 1}, ... % ( 1, 1113) + { 'bget', 'uint8', 1, 1,-1, 1}, ... % ( 3, 1116) + { 'bget', 'uint8', 4, 4,-1, 1}, ... % ( 1, 1117) + { 'bget', 'uint16', 1, 1,-1, 1}, ... % ( 3, 1120) + { 'bget', 'uint16', 4, 4,-1, 1}, ... % ( 1, 1121) + { 'bget', 'uint32', 1, 1,-1, 1}, ... % ( 3, 1124) + { 'bget', 'uint32', 4, 4,-1, 1}, ... % ( 1, 1125) + { 'bget', 'uint64', 1, 1,-1, 1}, ... % ( 3, 1128) + { 'bget', 'uint64', 4, 4,-1, 1}, ... % ( 1, 1129) + { 'bset', 'int8', 1, 1,-1, 1}, ... % ( 3, 1132) + { 'bset', 'int8', 4, 4,-1, 1}, ... % ( 1, 1133) + { 'bset', 'int16', 1, 1,-1, 1}, ... % ( 3, 1136) + { 'bset', 'int16', 4, 4,-1, 1}, ... % ( 1, 1137) + { 'bset', 'int32', 1, 1,-1, 1}, ... % ( 3, 1140) + { 'bset', 'int32', 4, 4,-1, 1}, ... % ( 1, 1141) + { 'bset', 'int64', 1, 1,-1, 1}, ... % ( 3, 1144) + { 'bset', 'int64', 4, 4,-1, 1}, ... % ( 1, 1145) + { 'bset', 'uint8', 1, 1,-1, 1}, ... % ( 3, 1148) + { 'bset', 'uint8', 4, 4,-1, 1}, ... % ( 1, 1149) + { 'bset', 'uint16', 1, 1,-1, 1}, ... % ( 3, 1152) + { 'bset', 'uint16', 4, 4,-1, 1}, ... % ( 1, 1153) + { 'bset', 'uint32', 1, 1,-1, 1}, ... % ( 3, 1156) + { 'bset', 'uint32', 4, 4,-1, 1}, ... % ( 1, 1157) + { 'bset', 'uint64', 1, 1,-1, 1}, ... % ( 3, 1160) + { 'bset', 'uint64', 4, 4,-1, 1}, ... % ( 1, 1161) + { 'bclr', 'int8', 1, 1,-1, 1}, ... % ( 3, 1164) + { 'bclr', 'int8', 4, 4,-1, 1}, ... % ( 1, 1165) + { 'bclr', 'int16', 1, 1,-1, 1}, ... % ( 3, 1168) + { 'bclr', 'int16', 4, 4,-1, 1}, ... % ( 1, 1169) + { 'bclr', 'int32', 1, 1,-1, 1}, ... % ( 3, 1172) + { 'bclr', 'int32', 4, 4,-1, 1}, ... % ( 1, 1173) + { 'bclr', 'int64', 1, 1,-1, 1}, ... % ( 3, 1176) + { 'bclr', 'int64', 4, 4,-1, 1}, ... % ( 1, 1177) + { 'bclr', 'uint8', 1, 1,-1, 1}, ... % ( 3, 1180) + { 'bclr', 'uint8', 4, 4,-1, 1}, ... % ( 1, 1181) + { 'bclr', 'uint16', 1, 1,-1, 1}, ... % ( 3, 1184) + { 'bclr', 'uint16', 4, 4,-1, 1}, ... % ( 1, 1185) + { 'bclr', 'uint32', 1, 1,-1, 1}, ... % ( 3, 1188) + { 'bclr', 'uint32', 4, 4,-1, 1}, ... % ( 1, 1189) + { 'bclr', 'uint64', 1, 1,-1, 1}, ... % ( 3, 1192) + { 'bclr', 'uint64', 4, 4,-1, 1}, ... % ( 1, 1193) + { 'bshift', 'int8', 1, 1,-1, 1}, ... % ( 3, 1196) + { 'bshift', 'int8', 4, 4,-1, 1}, ... % ( 1, 1197) + { 'bshift', 'int16', 1, 1,-1, 1}, ... % ( 3, 1200) + { 'bshift', 'int16', 4, 4,-1, 1}, ... % ( 1, 1201) + { 'bshift', 'int32', 1, 1,-1, 1}, ... % ( 3, 1204) + { 'bshift', 'int32', 4, 4,-1, 1}, ... % ( 1, 1205) + { 'bshift', 'int64', 1, 1,-1, 1}, ... % ( 3, 1208) + { 'bshift', 'int64', 4, 4,-1, 1}, ... % ( 1, 1209) + { 'bshift', 'uint8', 1, 1,-1, 1}, ... % ( 3, 1212) + { 'bshift', 'uint8', 4, 4,-1, 1}, ... % ( 1, 1213) + { 'bshift', 'uint16', 1, 1,-1, 1}, ... % ( 3, 1216) + { 'bshift', 'uint16', 4, 4,-1, 1}, ... % ( 1, 1217) + { 'bshift', 'uint32', 1, 1,-1, 1}, ... % ( 3, 1220) + { 'bshift', 'uint32', 4, 4,-1, 1}, ... % ( 1, 1221) + { 'bshift', 'uint64', 1, 1,-1, 1}, ... % ( 3, 1224) + { 'bshift', 'uint64', 4, 4,-1, 1}, ... % ( 1, 1225) + { 'atan2', 'single', 1, 1,-1, 1}, ... % ( 3, 1228) + { 'atan2', 'single', 4, 4,-1, 1}, ... % ( 1, 1229) + { 'atan2', 'double', 1, 1,-1, 1}, ... % ( 3, 1232) + { 'atan2', 'double', 4, 4,-1, 1}, ... % ( 1, 1233) + { 'hypot', 'single', 1, 1,-1, 1}, ... % ( 3, 1236) + { 'hypot', 'single', 4, 4,-1, 1}, ... % ( 1, 1237) + { 'hypot', 'double', 1, 1,-1, 1}, ... % ( 3, 1240) + { 'hypot', 'double', 4, 4,-1, 1}, ... % ( 1, 1241) + { 'fmod', 'single', 1, 1,-1, 1}, ... % ( 3, 1244) + { 'fmod', 'single', 4, 4,-1, 1}, ... % ( 1, 1245) + { 'fmod', 'double', 1, 1,-1, 1}, ... % ( 3, 1248) + { 'fmod', 'double', 4, 4,-1, 1}, ... % ( 1, 1249) + {'remainder', 'single', 1, 1,-1, 1}, ... % ( 3, 1252) + {'remainder', 'single', 4, 4,-1, 1}, ... % ( 1, 1253) + {'remainder', 'double', 1, 1,-1, 1}, ... % ( 3, 1256) + {'remainder', 'double', 4, 4,-1, 1}, ... % ( 1, 1257) + { 'ldexp', 'single', 1, 1,-1, 1}, ... % ( 3, 1260) + { 'ldexp', 'single', 4, 4,-1, 1}, ... % ( 1, 1261) + { 'ldexp', 'double', 1, 1,-1, 1}, ... % ( 3, 1264) + { 'ldexp', 'double', 4, 4,-1, 1}, ... % ( 1, 1265) + { 'copysign', 'single', 1, 1,-1, 1}, ... % ( 3, 1268) + { 'copysign', 'single', 4, 4,-1, 1}, ... % ( 1, 1269) + { 'copysign', 'double', 1, 1,-1, 1}, ... % ( 3, 1272) + { 'copysign', 'double', 4, 4,-1, 1}, ... % ( 1, 1273) + { 'cmplx', 'single', 1, 1,-1, 1}, ... % ( 3, 1276) + { 'cmplx', 'single', 4, 4,-1, 1}, ... % ( 1, 1277) + { 'cmplx', 'double', 1, 1,-1, 1}, ... % ( 3, 1280) + { 'cmplx', 'double', 4, 4,-1, 1}, ... % ( 1, 1281) + { 'firsti', 'int32', 1, 1,-1, 1}, ... % ( 5, 1286) + { 'firsti1', 'int32', 1, 1,-1, 1}, ... % ( 4, 1290) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end fprintf ('\n--- testing apply with binaryop and scalar binding\n') ; -rng ('default') ; % the right approach for apply_bind1st and apply_bind2nd desc0.inp0 = 'tran' ; desc1.inp1 = 'tran' ; @@ -17,13 +742,29 @@ desc.inp0 = 'tran' ; desc.inp1 = 'tran' ; -n_operators = 0 ; -for k2 = 1:length(ops) - mulop = ops {k2} ; - fprintf ('\n%-10s ', mulop) ; +% create test matrices +rng ('default') ; +for m = [1 4] + for n = [1 4] + AA_matrices {m,n} = sprand (m, n, 0.8) ; + AS_matrices {m,n} = sprand (m, n, 0.5) ; + BB_matrices {m,n} = sprand (m, n, 0.8) ; + BS_matrices {m,n} = sprand (m, n, 0.5) ; + xx_matrix = sparse (rand (1)) ; + xs_matrix = sparse (rand (1)) ; + yy_matrix = sparse (rand (1)) ; + ys_matrix = sparse (rand (1)) ; + end +end - for k1 = 1:length (types) - type = types {k1} ; +for kk = 1:length(tasks) + task = tasks {kk} ; + mulop = task {1} ; + type = task {2} ; + m = task {3} ; + n = task {4} ; + lo = task {5} ; + hi = task {6} ; % create the op clear op @@ -35,7 +776,6 @@ catch continue ; end - n_operators = n_operators + 1 ; switch (mulop) case { 'pow' } @@ -57,18 +797,12 @@ tol = 0 ; end - fprintf ('.') ; + Amat = (hi*AA_matrices{m,n}-lo) .* AS_matrices{m,n} ; + Bmat = (hi*BB_matrices{m,n}-lo) .* BS_matrices{m,n} ; + xmat = (hi*xx_matrix-lo) .* xs_matrix ; + ymat = (hi*yy_matrix-lo) .* ys_matrix ; - for m = [1 4] % [ 1 10 ]% 100] - for n = [1 4] % [1 10 ]% 100] - for hi = [1 5] % [-1:2:5 ] - for lo = [-1 0] % [-3:2:5 ] - Amat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; - Bmat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; - xmat = (hi*sparse (rand(1))-lo) .* sparse (rand(1)) ; - ymat = (hi*sparse (rand(1))-lo) .* sparse (rand(1)) ; Cmat = sparse (m, n) ; - if (~isempty (xlimits)) Amat = max (Amat, xlimits (1)) ; Amat = min (Amat, xlimits (2)) ; @@ -113,67 +847,80 @@ Y.matrix = ymat .* spones (Amat) ; Y.class = ytype ; - op_ewise_bind1st = op ; - op_ewise_bind2nd = op ; + op_bind1 = op ; + op_bind2 = op ; if (isequal (op.opname, 'any')) - op_ewise_bind1st.opname = 'first' ; - op_ewise_bind2nd.opname = 'second' ; + op_bind1.opname = 'first' ; + op_bind2.opname = 'second' ; end C1 = GB_mex_apply1 (C, [ ], [ ], op, 0, x, B) ; - C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind1st, X, B, [ ]) ; + C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_bind1, X, B, [ ]) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply1 (C, [ ], [ ], op, 1, x, B) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply1 (CT, [ ], [ ], op, 0, x, B, desc1) ; - C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind1st, X, B, desc) ; + C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_bind1, X, B, desc) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply1 (CT, [ ], [ ], op, 1, x, B, desc1) ; GB_spec_compare (C1, C2, 0, tol) ; for csc = 0:1 - A.is_csc = csc ; C.is_csc = csc ; CT.is_csc = csc ; C1 = GB_mex_apply2 (C, [ ], [ ], op, 0, A, y) ; - C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind2nd, A, Y, [ ]) ; + C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_bind2, A, Y, [ ]) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply2 (C, [ ], [ ], op, 1, A, y) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply2 (CT, [ ], [ ], op, 0, A, y, desc0) ; - C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind2nd, A, Y, desc) ; + C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_bind2, A, Y, desc) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply2 (CT, [ ], [ ], op, 1, A, y, desc0) ; GB_spec_compare (C1, C2, 0, tol) ; end + A.is_csc = 1 ; + C.is_csc = 1 ; + CT.is_csc = 1 ; + y.class = 'double' ; Y.class = 'double' ; C1 = GB_mex_apply2 (C, [ ], [ ], op, 0, A, y) ; - C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind2nd, A, Y, [ ]) ; + C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_bind2, A, Y, [ ]) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply2 (C, [ ], [ ], op, 1, A, y) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply2 (CT, [ ], [ ], op, 0, A, y, desc0) ; - C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind2nd, A, Y, desc) ; + C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_bind2, A, Y, desc) ; GB_spec_compare (C1, C2, 0, tol) ; C1 = GB_mex_apply2 (CT, [ ], [ ], op, 1, A, y, desc0) ; GB_spec_compare (C1, C2, 0, tol) ; -end -end -end -end -end + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + mm = sprintf ('''%s''', mulop) ; + tt = sprintf ('''%s''', type) ; + fprintf (... + '{%11s, %16s, %2d,%2d,%2d,%2d}, ... ', ... + mm, tt, m, n, lo, hi) ; + fprintf ('%% (%3d, %4d)\n', d, c - cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + end -fprintf ('\nNumber of built-in GraphBLAS operators: %d\n', n_operators) ; fprintf ('\ntest154: all tests passed\n') ; diff --git a/Test/test154b.m b/Test/test154b.m new file mode 100644 index 0000000000..81f2faa29d --- /dev/null +++ b/Test/test154b.m @@ -0,0 +1,20 @@ +function test154b(tasks) +%TEST154B test GrB_apply with scalar binding + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 'plus', 'int16', 1, 1,-1, 1}, ... % ( 1, 1) + { 'plus', 'int16', 4, 4,-1, 1}, ... % ( 1, 2) + } ; +end + +test154 (tasks) ; + + diff --git a/Test/test160.m b/Test/test160.m index d23aec3868..b99ae16739 100644 --- a/Test/test160.m +++ b/Test/test160.m @@ -9,7 +9,8 @@ n = 100 ; Mask.matrix = (rand (n) > 0.5) ; Mask.pattern = true (n) ; -mtypes = { 'int8', 'int16', 'int32', 'int64', 'double complex' } ; +% mtypes = { 'int8', 'int16', 'int32', 'int64', 'double complex' } ; +mtypes = { 'int8', 'int16', 'int32', 'double complex' } ; Mask2 = GB_spec_random (n, n, 1, 0.01, 'logical') ; Mask2.matrix = logical (Mask2.matrix) ; @@ -68,10 +69,9 @@ maskz.class = 'logical' ; cinz = sparse (1000, 1) ; - for k = 1:length (mtypes) - fprintf ('%s ', mtypes {k}) ; + fprintf ('%s\n', mtypes {k}) ; Mask.class = mtypes {k} ; Mask2.class = mtypes {k} ; mask.class = mtypes {k} ; @@ -81,61 +81,65 @@ C2 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dnn) ; GB_spec_compare (C1, C2) ; - % C = A*B - C1 = GB_spec_mxm (Cin, Mask, [ ], semiring, A, B, dnn_struct) ; - C2 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dnn_struct) ; - GB_spec_compare (C1, C2) ; +% % C = A*B +% C1 = GB_spec_mxm (Cin, Mask, [ ], semiring, A, B, dnn_struct) ; +% C2 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dnn_struct) ; +% GB_spec_compare (C1, C2) ; - % C = A*B - C1 = GB_spec_mxm (Cin, Mask, [ ], semiring, A, B, dnn_notM_struct) ; - C2 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dnn_notM_struct) ; - GB_spec_compare (C1, C2) ; +% % C = A*B +% C1 = GB_spec_mxm (Cin, Mask, [ ], semiring, A, B, dnn_notM_struct) ; +% C2 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dnn_notM_struct) ; +% GB_spec_compare (C1, C2) ; % C = A*B C1 = GB_spec_mxm (Cin, Mask, [ ], semiring, A, B, dnn_notM) ; C2 = GB_mex_mxm (Cin, Mask, [ ], semiring, A, B, dnn_notM) ; GB_spec_compare (C1, C2) ; - % C = G*b - C1 = GB_spec_mxm (cin, mask, [ ], semiring, G, b, dnn) ; - C2 = GB_mex_mxm (cin, mask, [ ], semiring, G, b, dnn) ; - GB_spec_compare (C1, C2) ; +% % C = G*b +% C1 = GB_spec_mxm (cin, mask, [ ], semiring, G, b, dnn) ; +% C2 = GB_mex_mxm (cin, mask, [ ], semiring, G, b, dnn) ; +% GB_spec_compare (C1, C2) ; - % C = G*b - C1 = GB_spec_mxm (cin, mask, [ ], semiring, G, b, dnn_notM) ; - C2 = GB_mex_mxm (cin, mask, [ ], semiring, G, b, dnn_notM) ; - GB_spec_compare (C1, C2) ; +% % C = G*b +% C1 = GB_spec_mxm (cin, mask, [ ], semiring, G, b, dnn_notM) ; +% C2 = GB_mex_mxm (cin, mask, [ ], semiring, G, b, dnn_notM) ; +% GB_spec_compare (C1, C2) ; - % C = A*B - C1 = GB_spec_mxm (cin, mask, [ ], semiring, G, b, dnn_notM_struct) ; - C2 = GB_mex_mxm (cin, mask, [ ], semiring, G, b, dnn_notM_struct) ; - GB_spec_compare (C1, C2) ; +% % C = A*B +% C1 = GB_spec_mxm (cin, mask, [ ], semiring, G, b, dnn_notM_struct) ; +% C2 = GB_mex_mxm (cin, mask, [ ], semiring, G, b, dnn_notM_struct) ; +% GB_spec_compare (C1, C2) ; - % C = A*B - C1 = GB_spec_mxm (Cin, Mask2, [ ], semiring, A, B, dnn_notM) ; - C2 = GB_mex_mxm (Cin, Mask2, [ ], semiring, A, B, dnn_notM) ; - GB_spec_compare (C1, C2) ; +% % C = A*B +% C1 = GB_spec_mxm (Cin, Mask2, [ ], semiring, A, B, dnn_notM) ; +% C2 = GB_mex_mxm (Cin, Mask2, [ ], semiring, A, B, dnn_notM) ; +% GB_spec_compare (C1, C2) ; % C = G*B + if (k == 1) C1 = GB_spec_mxm (Cin, Mask2, [ ], semiring, G, B, dnn_notM) ; C2 = GB_mex_mxm (Cin, Mask2, [ ], semiring, G, B, dnn_notM) ; GB_spec_compare (C1, C2) ; + end - % C = H*x - C1 = GB_spec_mxm (cin, mask2, [ ], semiring, H, x, dnn_notM) ; - C2 = GB_mex_mxm (cin, mask2, [ ], semiring, H, x, dnn_notM) ; - GB_spec_compare (C1, C2) ; +% % C = H*x +% C1 = GB_spec_mxm (cin, mask2, [ ], semiring, H, x, dnn_notM) ; +% C2 = GB_mex_mxm (cin, mask2, [ ], semiring, H, x, dnn_notM) ; +% GB_spec_compare (C1, C2) ; - % C = G*x - C1 = GB_spec_mxm (cin, mask2, [ ], semiring, G, x, dnn_notM_hash) ; - C2 = GB_mex_mxm (cin, mask2, [ ], semiring, G, x, dnn_notM_hash) ; - GB_spec_compare (C1, C2) ; +% % C = G*x +% C1 = GB_spec_mxm (cin, mask2, [ ], semiring, G, x, dnn_notM_hash) ; +% C2 = GB_mex_mxm (cin, mask2, [ ], semiring, G, x, dnn_notM_hash) ; +% GB_spec_compare (C1, C2) ; % C = K*z z.sparsity = 4 ; + if (k == 1) C1 = GB_spec_mxm (cinz, maskz, [ ], semiring, K, z, dnn_notM_hash) ; C2 = GB_mex_mxm (cinz, maskz, [ ], semiring, K, z, dnn_notM_hash) ; GB_spec_compare (C1, C2) ; + end end @@ -156,3 +160,4 @@ GB_spec_compare (C1, C3) ; fprintf ('\ntest160: all tests passed\n') ; + diff --git a/Test/test18.m b/Test/test18.m index 0f9ed648ea..b02f838612 100644 --- a/Test/test18.m +++ b/Test/test18.m @@ -1,76 +1,44 @@ -function test18(fulltest) +function test18 %TEST18 test GrB_eWiseAdd, GxB_eWiseUnion, and GrB_eWiseMult -% 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 [binops, ~, ~, types, ~, ~] = GB_spec_opsall ; bin_ops = binops.all ; types = types.all ; -if (nargin < 1) - fulltest = 0 ; -end - -if (fulltest == 2) - fprintf ('test18 --------lengthy tests of GrB_eWiseAdd, eWiseUnion, eWiseMult\n') ; - k1test = 1:length(types) ; - k4test = randi([0,length(bin_ops)]) - k6list = [false true] ; - k7list = [false true] ; - k8list = 0:1 ; -elseif (fulltest == 1) - fprintf ('test18 ------------tests of GrB_eWiseAdd, eWiseUnion, and eWiseMult\n') ; - % k1test = [1 2 4 10 11] ; - k1test = [ 1 2 11 ] ; - k4test = randi([0,length(bin_ops)]) - k6list = [false true] ; - k7list = [false true] ; - k8list = 0:1 ; -else - fprintf ('test18 ------quick tests of GrB_eWiseAdd, eWiseUnion, and eWiseMult\n') ; - k1test = [ 1 2 11 12 13] ; - k4test = 0 ; - k6list = [false] ; - k7list = [false] ; - k8list = 1 ; -end - -% mlist = [1 5 10] ; -% nlist = [1 5 10] ; - mlist = [10] ; - nlist = [10] ; +fprintf ('test18 ------quick tests of GrB_eWiseAdd, eWiseUnion, and eWiseMult\n') ; rng ('default') ; +m = [10] ; +n = [10] ; dnn = struct ; dtn = struct ( 'inp0', 'tran' ) ; dnt = struct ( 'inp1', 'tran' ) ; dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; -n_semirings = 0 ; -for k1 = k1test % 1:length (types) - type = types {k1} ; - - fprintf ('\n\n========================================= %s:\n', type) ; +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; +end - k2test = 1:length(bin_ops) ; +for k1 = [1 2 11 12 13] + type = types {k1} ; - for k2 = k2test % 1:length(bin_ops) + for k2 = 1:length(bin_ops) binop = bin_ops {k2} ; - - fprintf ('\n%s', binop) ; - op.opname = binop ; op.optype = type ; - try GB_spec_operator (op) ; catch continue end - fprintf (' binary op: [ %s %s ] ', binop, type) ; if (test_contains (type, 'single')) tol = 1e-5 ; elseif (test_contains (type, 'double')) @@ -79,453 +47,404 @@ function test18(fulltest) tol = 0 ; end - % try some matrices - for m = mlist - for n = nlist - - % avoid creating nans for testing pow - if (isequal (binop, 'pow')) - scale = 2 ; - else - scale = 100 ; - end + % avoid creating nans when testing pow + if (isequal (binop, 'pow')) + scale = 2 ; + else + scale = 100 ; + end - Amat = sparse (scale * sprandn (m,n, 0.2)) ; - Bmat = sparse (scale * sprandn (m,n, 0.2)) ; - Cmat = sparse (scale * sprandn (m,n, 0.2)) ; - w = sparse (scale * sprandn (m,1, 0.2)) ; - uvec = sparse (scale * sprandn (m,1, 0.2)) ; - vvec = sparse (scale * sprandn (m,1, 0.2)) ; - - % these tests do not convert real A and B into complex C for C - % = A.^B. So ensure the test matrices are all positive. - if (isequal (binop, 'pow')) - Amat = abs (Amat) ; - Bmat = abs (Bmat) ; - Cmat = abs (Cmat) ; - w = abs (w) ; - uvec = abs (uvec) ; - vvec = abs (vvec) ; - end + Amat = sparse (scale * sprandn (m,n, 0.2)) ; + Bmat = sparse (scale * sprandn (m,n, 0.2)) ; + Cmat = sparse (scale * sprandn (m,n, 0.2)) ; + w = sparse (scale * sprandn (m,1, 0.2)) ; + uvec = sparse (scale * sprandn (m,1, 0.2)) ; + vvec = sparse (scale * sprandn (m,1, 0.2)) ; + + % these tests do not convert real A and B into complex C + % when C = A.^B. So ensure the test matrices are all positive. + if (isequal (binop, 'pow')) + Amat = abs (Amat) ; + Bmat = abs (Bmat) ; + Cmat = abs (Cmat) ; + w = abs (w) ; + uvec = abs (uvec) ; + vvec = abs (vvec) ; + end - Maskmat = sprandn (m,n,0.2) ~= 0 ; - maskvec = sprandn (m,1,0.2) ~= 0 ; + Maskmat = sprandn (m,n,0.2) ~= 0 ; + maskvec = sprandn (m,1,0.2) ~= 0 ; - % create a very sparse matrix mask - Maskmat2 = sparse (m,n) ; - T = Amat .* Bmat ; - [i j x] = find (T) ; - if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; - end - T = (Amat ~= 0) & (Bmat == 0) ; - [i j x] = find (T) ; - if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; - end - T = (Amat == 0) & (Bmat ~= 0) ; - [i j x] = find (T) ; - if (length (i) > 0) - Maskmat2 (i(1), j(1)) = 1 ; - end - clear T i j x - - % create a very sparse vector mask - maskvec2 = sparse (m,1) ; - T = uvec .* vvec ; - [i j x] = find (T) ; - if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; - end - T = (uvec ~= 0) & (vvec == 0) ; - [i j x] = find (T) ; - if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; - end - T = (uvec == 0) & (vvec ~= 0) ; - [i j x] = find (T) ; - if (length (i) > 0) - maskvec2 (i(1), j(1)) = 1 ; - end - clear T i j x + accum = '' ; + ntypes = 1 ; + % k5 is unused, but required to get the right random + % test matrices above. + k5 = randi ([1 ntypes]) ; - ATmat = Amat' ; - BTmat = Bmat' ; + % skip all but these operators: + if (((isequal (binop, 'first')) && isequal (type, 'logical')) || ... + ((isequal (binop, 'second')) && isequal (type, 'logical')) || ... + ((isequal (binop, 'pair')) && isequal (type, 'logical')) || ... + ((isequal (binop, 'plus')) && isequal (type, 'double'))) + else + continue + end - for k4 = k4test + fprintf ('\n[ %s %s ] ', binop, type) ; - clear accum - if (k4 == 0) - accum = '' ; - ntypes = 1 ; + % create a very sparse matrix mask + Maskmat2 = sparse (m,n) ; + T = Amat .* Bmat ; + [i j x] = find (T) ; + if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; + end + T = (Amat ~= 0) & (Bmat == 0) ; + [i j x] = find (T) ; + if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; + end + T = (Amat == 0) & (Bmat ~= 0) ; + [i j x] = find (T) ; + if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; + end + clear T i j x + + % create a very sparse vector mask + maskvec2 = sparse (m,1) ; + T = uvec .* vvec ; + [i j x] = find (T) ; + if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; + end + T = (uvec ~= 0) & (vvec == 0) ; + [i j x] = find (T) ; + if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; + end + T = (uvec == 0) & (vvec ~= 0) ; + [i j x] = find (T) ; + if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; + end + clear T i j x + + ATmat = Amat' ; + BTmat = Bmat' ; + + dnn.mask = 'default' ; + dtn.mask = 'default' ; + dnt.mask = 'default' ; + dtt.mask = 'default' ; + + dnn.outp = 'default' ; + dtn.outp = 'default' ; + dnt.outp = 'default' ; + dtt.outp = 'default' ; + + for A_is_hyper = 0:1 + for A_is_csc = 0:1 + for B_is_hyper = 0:1 + for B_is_csc = 0:1 + + clear A + A.matrix = Amat ; + A.is_hyper = A_is_hyper ; + A.is_csc = A_is_csc ; + A.class = op.optype ; + + clear AT + AT.matrix = ATmat ; + AT.is_hyper = A_is_hyper ; + AT.is_csc = A_is_csc ; + AT.class = op.optype ; + + clear B + B.matrix = Bmat ; + B.is_hyper = B_is_hyper ; + B.is_csc = B_is_csc ; + B.class = op.optype ; + + clear BT + BT.matrix = BTmat ; + BT.is_hyper = B_is_hyper ; + BT.is_csc = B_is_csc ; + BT.class = op.optype ; + + clear C + C.matrix = Cmat ; + C.is_hyper = 0 ; + C.is_csc = 0 ; + + clear u + u.matrix = uvec ; + u.is_csc = true ; + u.class = op.optype ; + + clear v + v.matrix = vvec ; + v.is_csc = true ; + v.class = op.optype ; + + %--------------------------------------- + % A+B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd ... + (C, [ ], accum, op, A, B, dnn); + C1 = GB_mex_Matrix_eWiseAdd ... + (C, [ ], accum, op, A, B, dnn); + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseAdd ... + (w, [ ], accum, op, u, v, dnn); + w1 = GB_mex_Vector_eWiseAdd ... + (w, [ ], accum, op, u, v, dnn); + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A+B with eWiseUnion + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseUnion ... + (C, [ ], accum, op, A, 3, B, 2, dnn); + C1 = GB_mex_Matrix_eWiseUnion ... + (C, [ ], accum, op, A, 3, B, 2, dnn); + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseUnion ... + (w, [ ], accum, op, u, 3, v, 2, dnn); + w1 = GB_mex_Vector_eWiseUnion ... + (w, [ ], accum, op, u, 3, v, 2, dnn); + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A'+B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd ... + (C, [ ], accum, op, AT, B, dtn); + C1 = GB_mex_Matrix_eWiseAdd ... + (C, [ ], accum, op, AT, B, dtn); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A+B' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd ... + (C, [ ], accum, op, A, BT, dnt); + C1 = GB_mex_Matrix_eWiseAdd ... + (C, [ ], accum, op, A, BT, dnt); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A'+B' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd ... + (C, [ ], accum, op, AT, BT, dtt); + C1 = GB_mex_Matrix_eWiseAdd ... + (C, [ ], accum, op, AT, BT, dtt); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult ... + (C, [ ], accum, op, A, B, dnn); + C1 = GB_mex_Matrix_eWiseMult ... + (C, [ ], accum, op, A, B, dnn); + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseMult ... + (w, [ ], accum, op, u, v, dnn); + w1 = GB_mex_Vector_eWiseMult ... + (w, [ ], accum, op, u, v, dnn); + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A'.*B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult ... + (C, [ ], accum, op, AT, B, dtn); + C1 = GB_mex_Matrix_eWiseMult ... + (C, [ ], accum, op, AT, B, dtn); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult ... + (C, [ ], accum, op, A, BT, dnt); + C1 = GB_mex_Matrix_eWiseMult ... + (C, [ ], accum, op, A, BT, dnt); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A'.*B' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult ... + (C, [ ], accum, op, AT, BT, dtt); + C1 = GB_mex_Matrix_eWiseMult ... + (C, [ ], accum, op, AT, BT, dtt); + GB_spec_compare (C0, C1, 0, tol) ; + + %----------------------------------------------- + % with mask + %----------------------------------------------- + + for M_is_very_sparse = 0:1 + for M_is_hyper = 0:1 + for M_is_csc = 0:1 + + clear Mask mask + if (M_is_very_sparse) + Mask.matrix = Maskmat2 ; + mask.matrix = maskvec2 ; + else + Mask.matrix = Maskmat ; + mask.matrix = maskvec ; + end + Mask.is_hyper = M_is_hyper ; + Mask.is_csc = M_is_csc ; + mask.is_csc = true ; + + %--------------------------------------- + % A+B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd ... + (C, Mask, accum, op, A, B, dnn); + C1 = GB_mex_Matrix_eWiseAdd ... + (C, Mask, accum, op, A, B, dnn); + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseAdd ... + (w, mask, accum, op, u, v, dnn); + w1 = GB_mex_Vector_eWiseAdd ... + (w, mask, accum, op, u, v, dnn); + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A+B, with mask, eWiseUnion + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseUnion ... + (C, Mask, accum, op, A, 1, B, 2, dnn); + C1 = GB_mex_Matrix_eWiseUnion ... + (C, Mask, accum, op, A, 1, B, 2, dnn); + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseUnion ... + (w, mask, accum, op, u, 1, v, 2, dnn); + w1 = GB_mex_Vector_eWiseUnion ... + (w, mask, accum, op, u, 1, v, 2, dnn); + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A'+B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd ... + (C, Mask, accum, op, AT, B, dtn); + C1 = GB_mex_Matrix_eWiseAdd ... + (C, Mask, accum, op, AT, B, dtn); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A+B', with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd ... + (C, Mask, accum, op, A, BT, dnt); + C1 = GB_mex_Matrix_eWiseAdd ... + (C, Mask, accum, op, A, BT, dnt); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A'+B', with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd ... + (C, Mask, accum, op, AT, BT, dtt); + C1 = GB_mex_Matrix_eWiseAdd ... + (C, Mask, accum, op, AT, BT, dtt); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult ... + (C, Mask, accum, op, A, B, dnn); + C1 = GB_mex_Matrix_eWiseMult ... + (C, Mask, accum, op, A, B, dnn); + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseMult ... + (w, mask, accum, op, u, v, dnn); + w1 = GB_mex_Vector_eWiseMult ... + (w, mask, accum, op, u, v, dnn); + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A'.*B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult ... + (C, Mask, accum, op, AT, B, dtn); + C1 = GB_mex_Matrix_eWiseMult ... + (C, Mask, accum, op, AT, B, dtn); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B', with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult ... + (C, Mask, accum, op, A, BT, dnt); + C1 = GB_mex_Matrix_eWiseMult ... + (C, Mask, accum, op, A, BT, dnt); + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A'.*B', with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult ... + (C, Mask, accum, op, AT, BT, dtt); + C1 = GB_mex_Matrix_eWiseMult ... + (C, Mask, accum, op, AT, BT, dtt); + GB_spec_compare (C0, C1, 0, tol) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d == 0) + fprintf ('.', d) ; else - accum.opname = bin_ops {k4} ; - ntypes = length (types) ; - fprintf ('accum: %s ', accum.opname) ; - end - - if (GB_spec_is_positional (accum)) - continue - end - - for k5 = randi ([1 ntypes]) % ntypes - - if (k4 > 0) - accum.optype = types {k5} ; - - try - GB_spec_operator (accum) ; - catch - continue - end - - fprintf ('%s\n', accum.optype) ; - else - fprintf ('\n') ; - end - - for Mask_complement = k6list - - if (Mask_complement) - dnn.mask = 'complement' ; - dtn.mask = 'complement' ; - dnt.mask = 'complement' ; - dtt.mask = 'complement' ; - else - dnn.mask = 'default' ; - dtn.mask = 'default' ; - dnt.mask = 'default' ; - dtt.mask = 'default' ; - end - - for C_replace = k7list - - if (C_replace) - dnn.outp = 'replace' ; - dtn.outp = 'replace' ; - dnt.outp = 'replace' ; - dtt.outp = 'replace' ; - else - dnn.outp = 'default' ; - dtn.outp = 'default' ; - dnt.outp = 'default' ; - dtt.outp = 'default' ; - end - - for A_is_hyper = 0:1 - for A_is_csc = 0:1 - for B_is_hyper = 0:1 - for B_is_csc = 0:1 - fprintf ('.') ; - for C_is_hyper = 0 % 0:1 - for C_is_csc = 0 % 0:1 - - for native = k8list - - clear A - A.matrix = Amat ; - A.is_hyper = A_is_hyper ; - A.is_csc = A_is_csc ; - if (native) - A.class = op.optype ; - end - - clear AT - AT.matrix = ATmat ; - AT.is_hyper = A_is_hyper ; - AT.is_csc = A_is_csc ; - if (native) - AT.class = op.optype ; - end - - clear B - B.matrix = Bmat ; - B.is_hyper = B_is_hyper ; - B.is_csc = B_is_csc ; - if (native) - B.class = op.optype ; - end - - clear BT - BT.matrix = BTmat ; - BT.is_hyper = B_is_hyper ; - BT.is_csc = B_is_csc ; - if (native) - BT.class = op.optype ; - end - - clear C - C.matrix = Cmat ; - C.is_hyper = C_is_hyper ; - C.is_csc = C_is_csc ; - - clear u - u.matrix = uvec ; - u.is_csc = true ; - if (native) - u.class = op.optype ; - end - - clear v - v.matrix = vvec ; - v.is_csc = true ; - if (native) - v.class = op.optype ; - end - - %--------------------------------------- - % A+B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd ... - (C, [ ], accum, op, A, B, dnn); - C1 = GB_mex_Matrix_eWiseAdd ... - (C, [ ], accum, op, A, B, dnn); - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseAdd ... - (w, [ ], accum, op, u, v, dnn); - w1 = GB_mex_Vector_eWiseAdd ... - (w, [ ], accum, op, u, v, dnn); - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A+B with eWiseUnion - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseUnion ... - (C, [ ], accum, op, A, 3, B, 2, dnn); - C1 = GB_mex_Matrix_eWiseUnion ... - (C, [ ], accum, op, A, 3, B, 2, dnn); - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseUnion ... - (w, [ ], accum, op, u, 3, v, 2, dnn); - w1 = GB_mex_Vector_eWiseUnion ... - (w, [ ], accum, op, u, 3, v, 2, dnn); - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'+B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd ... - (C, [ ], accum, op, AT, B, dtn); - C1 = GB_mex_Matrix_eWiseAdd ... - (C, [ ], accum, op, AT, B, dtn); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A+B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd ... - (C, [ ], accum, op, A, BT, dnt); - C1 = GB_mex_Matrix_eWiseAdd ... - (C, [ ], accum, op, A, BT, dnt); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'+B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd ... - (C, [ ], accum, op, AT, BT, dtt); - C1 = GB_mex_Matrix_eWiseAdd ... - (C, [ ], accum, op, AT, BT, dtt); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult ... - (C, [ ], accum, op, A, B, dnn); - C1 = GB_mex_Matrix_eWiseMult ... - (C, [ ], accum, op, A, B, dnn); - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseMult ... - (w, [ ], accum, op, u, v, dnn); - w1 = GB_mex_Vector_eWiseMult ... - (w, [ ], accum, op, u, v, dnn); - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'.*B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult ... - (C, [ ], accum, op, AT, B, dtn); - C1 = GB_mex_Matrix_eWiseMult ... - (C, [ ], accum, op, AT, B, dtn); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult ... - (C, [ ], accum, op, A, BT, dnt); - C1 = GB_mex_Matrix_eWiseMult ... - (C, [ ], accum, op, A, BT, dnt); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'.*B' - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult ... - (C, [ ], accum, op, AT, BT, dtt); - C1 = GB_mex_Matrix_eWiseMult ... - (C, [ ], accum, op, AT, BT, dtt); - GB_spec_compare (C0, C1, 0, tol) ; - - %----------------------------------------------- - % with mask - %----------------------------------------------- - - for M_is_very_sparse = 0:1 - for M_is_hyper = 0:1 - for M_is_csc = 0:1 - - clear Mask mask - if (M_is_very_sparse) - Mask.matrix = Maskmat2 ; - mask.matrix = maskvec2 ; - else - Mask.matrix = Maskmat ; - mask.matrix = maskvec ; - end - Mask.is_hyper = M_is_hyper ; - Mask.is_csc = M_is_csc ; - mask.is_csc = true ; - - %--------------------------------------- - % A+B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd ... - (C, Mask, accum, op, A, B, dnn); - C1 = GB_mex_Matrix_eWiseAdd ... - (C, Mask, accum, op, A, B, dnn); - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseAdd ... - (w, mask, accum, op, u, v, dnn); - w1 = GB_mex_Vector_eWiseAdd ... - (w, mask, accum, op, u, v, dnn); - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A+B, with mask, eWiseUnion - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseUnion ... - (C, Mask, accum, op, A, 1, B, 2, dnn); - C1 = GB_mex_Matrix_eWiseUnion ... - (C, Mask, accum, op, A, 1, B, 2, dnn); - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseUnion ... - (w, mask, accum, op, u, 1, v, 2, dnn); - w1 = GB_mex_Vector_eWiseUnion ... - (w, mask, accum, op, u, 1, v, 2, dnn); - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'+B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd ... - (C, Mask, accum, op, AT, B, dtn); - C1 = GB_mex_Matrix_eWiseAdd ... - (C, Mask, accum, op, AT, B, dtn); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A+B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd ... - (C, Mask, accum, op, A, BT, dnt); - C1 = GB_mex_Matrix_eWiseAdd ... - (C, Mask, accum, op, A, BT, dnt); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'+B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseAdd ... - (C, Mask, accum, op, AT, BT, dtt); - C1 = GB_mex_Matrix_eWiseAdd ... - (C, Mask, accum, op, AT, BT, dtt); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult ... - (C, Mask, accum, op, A, B, dnn); - C1 = GB_mex_Matrix_eWiseMult ... - (C, Mask, accum, op, A, B, dnn); - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseMult ... - (w, mask, accum, op, u, v, dnn); - w1 = GB_mex_Vector_eWiseMult ... - (w, mask, accum, op, u, v, dnn); - GB_spec_compare (w0, w1, 0, tol) ; - - %--------------------------------------- - % A'.*B, with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult ... - (C, Mask, accum, op, AT, B, dtn); - C1 = GB_mex_Matrix_eWiseMult ... - (C, Mask, accum, op, AT, B, dtn); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A.*B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult ... - (C, Mask, accum, op, A, BT, dnt); - C1 = GB_mex_Matrix_eWiseMult ... - (C, Mask, accum, op, A, BT, dnt); - GB_spec_compare (C0, C1, 0, tol) ; - - %--------------------------------------- - % A'.*B', with mask - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseMult ... - (C, Mask, accum, op, AT, BT, dtt); - C1 = GB_mex_Matrix_eWiseMult ... - (C, Mask, accum, op, AT, BT, dtt); - GB_spec_compare (C0, C1, 0, tol) ; - - end - end - end - end - end - end - end - end - end - end - - end - end + fprintf ('[%d]', d) ; end + clast = c ; + else + fprintf ('.') ; end + + end end + end + + end end + end + end + end end diff --git a/Test/test185.m b/Test/test185.m index 6b71f2bb5c..a8a7058668 100644 --- a/Test/test185.m +++ b/Test/test185.m @@ -1,4 +1,4 @@ -function test185 +function test185(tasks) %TEST185 test dot4 for all sparsity formats % GB_AxB_dot4 computes C+=A'*B when C is dense. @@ -7,8 +7,26 @@ fprintf ('test185 -------------------- C+=A''*B when C is dense\n') ; +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + {1, 3, 1, 1}, ... % ( 3, 3) + {3, 1, 1, 1}, ... % ( 3, 6) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + rng ('default') ; -GB_mex_burble (0) ; semiring.add = 'plus' ; semiring.multiply = 'times' ; @@ -30,16 +48,38 @@ M = sparse (rand (n, n) > 0.5) ; -for da = [0.01 0.1 .5 0.9 inf] - A = GB_spec_random (n, n, da, 1, 'double') ; +densities = [0.01 0.1 .5 0.9 inf] ; - for db = [0.01 0.1 .5 0.9 inf] +% create the test matrices +for ka = 1:length(densities) + da = densities (ka) ; + A = GB_spec_random (n, n, da, 1, 'double') ; + AA {ka} = A ; + for kb = 1:length(densities) + db = densities (kb) ; B = GB_spec_random (n, n, db, 1, 'double') ; + BB {ka,kb} = B ; + end +end + +% run the tests +for kk = 1:length(tasks) + task = tasks {kk} ; + ka = task {1} ; + kb = task {2} ; + A_sparsity = task {3} ; + B_sparsity = task {4} ; + +% end +% for ka = 1:length(densities) + A = AA {ka} ; +% for kb = 1:length(densities) + B = BB {ka,kb} ; - for A_sparsity = [1 2 4 8] - fprintf ('.') ; +% for A_sparsity = [1 2 4 8] + % fprintf ('.') ; - for B_sparsity = [1 2 4 8] +% for B_sparsity = [1 2 4 8] A.sparsity = A_sparsity ; B.sparsity = B_sparsity ; @@ -87,13 +127,26 @@ err = norm (C3 - C2.matrix, 1) ; maxerr = max (maxerr, err) ; assert (err < 1e-12) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf (' {%d, %d, %d, %d},', ... + ka, kb, A_sparsity, B_sparsity) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; + end + clast = c ; + else + fprintf ('.') ; end - end - end + +% end +% end +% end end fprintf ('\n') ; -GB_mex_burble (0) ; fprintf ('maxerr: %g\n', maxerr) ; fprintf ('test185: all tests passed\n') ; diff --git a/Test/test188.m b/Test/test188.m index 8aa1696e05..344bf74373 100644 --- a/Test/test188.m +++ b/Test/test188.m @@ -1,75 +1,307 @@ -function test188 +function test188(tasks) %TEST188 test concat -% 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 +% NOTE: the test coverage requires the JIT cache to be empty first, +% for full coverage. + fprintf ('test188 ----------- C = concat (Tiles)\n') ; -[~, ~, ~, types, ~, ~] = GB_spec_opsall ; -types = types.all ; +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 'logical', 'logical', 1, 0, 1, 0, 0}, ... % (2, 2) + { 'logical', 'double', 1, 0, 1, 0, 0}, ... % (4, 6) + { 'logical', 'double', 1, 0, 1, 0, 1}, ... % (3, 9) + { 'int8', 'double', 1, 0, 1, 0, 1}, ... % (1, 10) + { 'int16', 'double', 1, 0, 1, 0, 1}, ... % (2, 12) + { 'int32', 'double', 1, 0, 1, 0, 1}, ... % (2, 14) + { 'int64', 'double', 1, 0, 1, 0, 1}, ... % (2, 16) + { 'uint8', 'double', 1, 0, 1, 0, 1}, ... % (1, 17) + { 'uint16', 'double', 1, 0, 1, 0, 1}, ... % (1, 18) + { 'uint32', 'double', 1, 0, 1, 0, 1}, ... % (1, 19) + { 'uint64', 'double', 1, 0, 1, 0, 1}, ... % (1, 20) + {'single complex', 'double', 1, 0, 1, 0, 1}, ... % (1, 21) + {'double complex', 'double', 1, 0, 1, 0, 1}, ... % (2, 23) + { 'logical', 'double', 1, 0, 1, 1, 0}, ... % (1, 24) + { 'logical', 'double', 1, 0, 4, 0, 0}, ... % (1, 25) + { 'int8', 'logical', 2, 0, 4, 0, 1}, ... % (1, 26) + { 'int16', 'logical', 2, 0, 4, 0, 1}, ... % (1, 27) + { 'int32', 'logical', 2, 0, 4, 0, 1}, ... % (1, 28) + { 'int64', 'logical', 2, 0, 4, 0, 1}, ... % (1, 29) + { 'uint8', 'logical', 2, 0, 4, 0, 1}, ... % (1, 30) + { 'uint16', 'logical', 2, 0, 4, 0, 1}, ... % (1, 31) + { 'uint32', 'logical', 2, 0, 4, 0, 1}, ... % (1, 32) + { 'uint64', 'logical', 2, 0, 4, 0, 1}, ... % (1, 33) + { 'single', 'logical', 2, 0, 4, 0, 1}, ... % (1, 34) + { 'double', 'logical', 2, 0, 4, 0, 1}, ... % (1, 35) + {'single complex', 'logical', 2, 0, 4, 0, 1}, ... % (1, 36) + {'double complex', 'logical', 2, 0, 4, 0, 1}, ... % (1, 37) + { 'logical', 'int8', 2, 0, 4, 0, 1}, ... % (1, 38) + { 'int16', 'int8', 2, 0, 4, 0, 1}, ... % (1, 39) + { 'int32', 'int8', 2, 0, 4, 0, 1}, ... % (1, 40) + { 'int64', 'int8', 2, 0, 4, 0, 1}, ... % (1, 41) + { 'uint8', 'int8', 2, 0, 4, 0, 1}, ... % (1, 42) + { 'uint16', 'int8', 2, 0, 4, 0, 1}, ... % (1, 43) + { 'uint32', 'int8', 2, 0, 4, 0, 1}, ... % (1, 44) + { 'uint64', 'int8', 2, 0, 4, 0, 1}, ... % (1, 45) + { 'single', 'int8', 2, 0, 4, 0, 1}, ... % (1, 46) + { 'double', 'int8', 2, 0, 4, 0, 1}, ... % (1, 47) + {'single complex', 'int8', 2, 0, 4, 0, 1}, ... % (1, 48) + {'double complex', 'int8', 2, 0, 4, 0, 1}, ... % (1, 49) + { 'logical', 'int16', 2, 0, 4, 0, 1}, ... % (1, 50) + { 'int8', 'int16', 2, 0, 4, 0, 1}, ... % (1, 51) + { 'int32', 'int16', 2, 0, 4, 0, 1}, ... % (1, 52) + { 'int64', 'int16', 2, 0, 4, 0, 1}, ... % (1, 53) + { 'uint8', 'int16', 2, 0, 4, 0, 1}, ... % (1, 54) + { 'uint16', 'int16', 2, 0, 4, 0, 1}, ... % (1, 55) + { 'uint32', 'int16', 2, 0, 4, 0, 1}, ... % (1, 56) + { 'uint64', 'int16', 2, 0, 4, 0, 1}, ... % (1, 57) + { 'single', 'int16', 2, 0, 4, 0, 1}, ... % (1, 58) + { 'double', 'int16', 2, 0, 4, 0, 1}, ... % (1, 59) + {'single complex', 'int16', 2, 0, 4, 0, 1}, ... % (1, 60) + {'double complex', 'int16', 2, 0, 4, 0, 1}, ... % (1, 61) + { 'logical', 'int32', 2, 0, 4, 0, 1}, ... % (1, 62) + { 'int8', 'int32', 2, 0, 4, 0, 1}, ... % (1, 63) + { 'int16', 'int32', 2, 0, 4, 0, 1}, ... % (1, 64) + { 'int64', 'int32', 2, 0, 4, 0, 1}, ... % (1, 65) + { 'uint8', 'int32', 2, 0, 4, 0, 1}, ... % (1, 66) + { 'uint16', 'int32', 2, 0, 4, 0, 1}, ... % (1, 67) + { 'uint32', 'int32', 2, 0, 4, 0, 1}, ... % (1, 68) + { 'uint64', 'int32', 2, 0, 4, 0, 1}, ... % (1, 69) + { 'single', 'int32', 2, 0, 4, 0, 1}, ... % (1, 70) + { 'double', 'int32', 2, 0, 4, 0, 1}, ... % (1, 71) + {'single complex', 'int32', 2, 0, 4, 0, 1}, ... % (1, 72) + {'double complex', 'int32', 2, 0, 4, 0, 1}, ... % (1, 73) + { 'logical', 'int64', 2, 0, 4, 0, 1}, ... % (1, 74) + { 'int8', 'int64', 2, 0, 4, 0, 1}, ... % (1, 75) + { 'int16', 'int64', 2, 0, 4, 0, 1}, ... % (1, 76) + { 'int32', 'int64', 2, 0, 4, 0, 1}, ... % (1, 77) + { 'uint8', 'int64', 2, 0, 4, 0, 1}, ... % (1, 78) + { 'uint16', 'int64', 2, 0, 4, 0, 1}, ... % (1, 79) + { 'uint32', 'int64', 2, 0, 4, 0, 1}, ... % (1, 80) + { 'uint64', 'int64', 2, 0, 4, 0, 1}, ... % (1, 81) + { 'single', 'int64', 2, 0, 4, 0, 1}, ... % (1, 82) + { 'double', 'int64', 2, 0, 4, 0, 1}, ... % (1, 83) + {'single complex', 'int64', 2, 0, 4, 0, 1}, ... % (1, 84) + {'double complex', 'int64', 2, 0, 4, 0, 1}, ... % (1, 85) + { 'logical', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 86) + { 'int8', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 87) + { 'int16', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 88) + { 'int32', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 89) + { 'int64', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 90) + { 'uint16', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 91) + { 'uint32', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 92) + { 'uint64', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 93) + { 'single', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 94) + { 'double', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 95) + {'single complex', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 96) + {'double complex', 'uint8', 2, 0, 4, 0, 1}, ... % (1, 97) + { 'logical', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 98) + { 'int8', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 99) + { 'int16', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 100) + { 'int32', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 101) + { 'int64', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 102) + { 'uint8', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 103) + { 'uint32', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 104) + { 'uint64', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 105) + { 'single', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 106) + { 'double', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 107) + {'single complex', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 108) + {'double complex', 'uint16', 2, 0, 4, 0, 1}, ... % (1, 109) + { 'logical', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 110) + { 'int8', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 111) + { 'int16', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 112) + { 'int32', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 113) + { 'int64', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 114) + { 'uint8', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 115) + { 'uint16', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 116) + { 'uint64', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 117) + { 'single', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 118) + { 'double', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 119) + {'single complex', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 120) + {'double complex', 'uint32', 2, 0, 4, 0, 1}, ... % (1, 121) + { 'logical', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 122) + { 'int8', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 123) + { 'int16', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 124) + { 'int32', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 125) + { 'int64', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 126) + { 'uint8', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 127) + { 'uint16', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 128) + { 'uint32', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 129) + { 'single', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 130) + { 'double', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 131) + {'single complex', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 132) + {'double complex', 'uint64', 2, 0, 4, 0, 1}, ... % (1, 133) + { 'int8', 'single', 2, 0, 1, 0, 0}, ... % (1, 134) + { 'int32', 'single', 2, 0, 1, 0, 0}, ... % (1, 135) + { 'int64', 'single', 2, 0, 1, 0, 0}, ... % (1, 136) + { 'uint8', 'single', 2, 0, 1, 0, 0}, ... % (1, 137) + { 'uint32', 'single', 2, 0, 1, 0, 0}, ... % (1, 138) + { 'uint64', 'single', 2, 0, 1, 0, 0}, ... % (1, 139) + { 'logical', 'single', 2, 0, 4, 0, 1}, ... % (1, 140) + { 'int8', 'single', 2, 0, 4, 0, 1}, ... % (1, 141) + { 'int16', 'single', 2, 0, 4, 0, 1}, ... % (1, 142) + { 'int32', 'single', 2, 0, 4, 0, 1}, ... % (1, 143) + { 'int64', 'single', 2, 0, 4, 0, 1}, ... % (1, 144) + { 'uint8', 'single', 2, 0, 4, 0, 1}, ... % (1, 145) + { 'uint16', 'single', 2, 0, 4, 0, 1}, ... % (1, 146) + { 'uint32', 'single', 2, 0, 4, 0, 1}, ... % (1, 147) + { 'uint64', 'single', 2, 0, 4, 0, 1}, ... % (1, 148) + {'single complex', 'single', 2, 0, 4, 0, 1}, ... % (1, 149) + {'double complex', 'single', 2, 0, 4, 0, 1}, ... % (1, 150) + { 'logical', 'single complex', 2, 0, 1, 0, 0}, ... % (1, 151) + { 'logical', 'single complex', 2, 0, 1, 0, 1}, ... % (2, 153) + { 'int8', 'single complex', 2, 0, 1, 0, 0}, ... % (1, 154) + { 'int8', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 155) + { 'int16', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 156) + { 'int32', 'single complex', 2, 0, 1, 0, 0}, ... % (1, 157) + { 'int32', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 158) + { 'int64', 'single complex', 2, 0, 1, 0, 0}, ... % (1, 159) + { 'int64', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 160) + { 'uint8', 'single complex', 2, 0, 1, 0, 0}, ... % (1, 161) + { 'uint8', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 162) + { 'uint16', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 163) + { 'uint32', 'single complex', 2, 0, 1, 0, 0}, ... % (1, 164) + { 'uint32', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 165) + { 'uint64', 'single complex', 2, 0, 1, 0, 0}, ... % (1, 166) + { 'uint64', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 167) + { 'single', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 168) + { 'double', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 169) + {'double complex', 'single complex', 2, 0, 1, 0, 1}, ... % (1, 170) + { 'logical', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 171) + { 'int8', 'double complex', 2, 0, 1, 0, 0}, ... % (1, 172) + { 'int8', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 173) + { 'int16', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 174) + { 'int32', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 175) + { 'int64', 'double complex', 2, 0, 1, 0, 0}, ... % (1, 176) + { 'int64', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 177) + { 'uint8', 'double complex', 2, 0, 1, 0, 0}, ... % (1, 178) + { 'uint8', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 179) + { 'uint16', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 180) + { 'uint32', 'double complex', 2, 0, 1, 0, 0}, ... % (1, 181) + { 'uint32', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 182) + { 'uint64', 'double complex', 2, 0, 1, 0, 0}, ... % (1, 183) + { 'uint64', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 184) + { 'single', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 185) + { 'double', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 186) + {'single complex', 'double complex', 2, 0, 1, 0, 1}, ... % (1, 187) + { 'logical', 'double', 3, 0, 1, 0, 0}, ... % (2, 189) + { 'logical', 'double', 3, 0, 1, 0, 1}, ... % (4, 193) + { 'int16', 'double', 3, 0, 1, 0, 1}, ... % (1, 194) + { 'int32', 'double', 3, 0, 1, 0, 1}, ... % (1, 195) + { 'int64', 'double', 3, 0, 1, 0, 1}, ... % (1, 196) + {'double complex', 'double', 3, 0, 1, 0, 1}, ... % (1, 197) + { 'logical', 'logical', 4, 0, 8, 0, 0}, ... % (4, 201) + { 'logical', 'logical', 4, 0, 8, 0, 1}, ... % (1, 202) + { 'int16', 'logical', 4, 0, 8, 0, 1}, ... % (1, 203) + { 'int32', 'logical', 4, 0, 8, 0, 1}, ... % (1, 204) + { 'int64', 'logical', 4, 0, 8, 0, 1}, ... % (1, 205) + {'double complex', 'logical', 4, 0, 8, 0, 1}} ; % (1, 206) +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end rng ('default') ; n1 = 20 ; n2 = 4 ; +k1_last = 0 ; +atype_last = '' ; + +densities = [1e-4 0.01 0.2 inf] ; + +for ktask = 1:length (tasks) + task = tasks {ktask} ; + ctype = task {1} ; + atype = task {2} ; + k1 = task {3} ; + iso = task {4} ; + sparsity_control = task {5} ; + is_csc = task {6} ; + fmt = task {7} ; -for d = [1e-4 0.01 0.2 0.8 inf] - fprintf ('\nd = %g\n', d) ; - for ka = 1:length (types) - atype = types {ka} ; - A1 = GB_spec_random (n1, n1, d, 128, atype) ; - A2 = GB_spec_random (n1, n2, d, 128, atype) ; - A3 = GB_spec_random (n2, n1, d, 128, atype) ; - if (ka == 11) + density = densities (k1) ; + + if (k1 ~= k1_last || ~isequal (atype, atype_last)) + % create the test matrices; note the tasks are sorted by density and + % atype. If new tasks are added, this sorting order should be + % preserved and no new matrices should be created in the list of + % existing tasks. Append new matrices at the end. Otherwise, the + % matrices for the existing tasks will differ, and the coverage might + % change. + A1 = GB_spec_random (n1, n1, density, 128, atype) ; + A2 = GB_spec_random (n1, n2, density, 128, atype) ; + A3 = GB_spec_random (n2, n1, density, 128, atype) ; + if (isequal (atype, 'double')) A4 = GB_spec_random (n2, n2, inf, 128, atype) ; else - A4 = GB_spec_random (n2, n2, d, 128, atype) ; + A4 = GB_spec_random (n2, n2, density, 128, atype) ; end + end + + k1_last = k1 ; + atype_last = atype ; + + % test iso case + A1.iso = iso ; + A2.iso = iso ; + A3.iso = iso ; + A4.iso = iso ; + + A1.sparsity = sparsity_control ; + A2.sparsity = sparsity_control ; + A3.sparsity = sparsity_control ; + if (isequal (atype, 'double')) + A4.sparsity = 8 ; + else + A4.sparsity = sparsity_control ; + end + + A1.is_csc = is_csc ; + A2.is_csc = is_csc ; + A3.is_csc = is_csc ; + A4.is_csc = is_csc ; + Tiles = cell (2,2) ; + Tiles {1,1} = A1 ; + Tiles {1,2} = A2 ; + Tiles {2,1} = A3 ; + Tiles {2,2} = A4 ; + + C1 = GB_mex_concat (Tiles, ctype, fmt) ; + C2 = GB_spec_concat (Tiles, ctype) ; + GB_spec_compare (C1, C2) ; - for iso = 0:1 - - % test iso case - A1.iso = iso ; - A2.iso = iso ; - A3.iso = iso ; - A4.iso = iso ; - - for sparsity_control = [1 2 4 8] - fprintf ('.') ; - A1.sparsity = sparsity_control ; - A2.sparsity = sparsity_control ; - A3.sparsity = sparsity_control ; - if (ka == 11) - A4.sparsity = 8 ; - else - A4.sparsity = sparsity_control ; - end - for is_csc = [0 1] - A1.is_csc = is_csc ; - A2.is_csc = is_csc ; - A3.is_csc = is_csc ; - A4.is_csc = is_csc ; - Tiles = cell (2,2) ; - Tiles {1,1} = A1 ; - Tiles {1,2} = A2 ; - Tiles {2,1} = A3 ; - Tiles {2,2} = A4 ; - for kc = 1:length (types) - ctype = types {kc} ; - for fmt = 0:1 - C1 = GB_mex_concat (Tiles, ctype, fmt) ; - C2 = GB_spec_concat (Tiles, ctype) ; - GB_spec_compare (C1, C2) ; - end - end - end - end + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + cc = sprintf ('''%s''', ctype) ; + aa = sprintf ('''%s''', atype) ; + fprintf (... + '{%16s, %16s, %d, %d, %d, %d, %d},', ... + cc, aa, k1, iso, sparsity_control, ... + is_csc, fmt) ; + fprintf (' ... %% (%d, %d)\n', ... + d, c-cfirst) ; end + clast = c ; + else + fprintf ('.') ; end end fprintf ('\n') ; -GB_mex_burble (0) ; fprintf ('test188: all tests passed\n') ; diff --git a/Test/test188b.m b/Test/test188b.m new file mode 100644 index 0000000000..fbe0c9fafe --- /dev/null +++ b/Test/test188b.m @@ -0,0 +1,25 @@ +function test188b(tasks) +%TEST188B test concat + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +% NOTE: the test coverage requires the JIT cache to be empty first, +% for full coverage. + +fprintf ('test188b ----------- C = concat (Tiles)\n') ; + +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 'logical', 'double', 1, 0, 1, 0, 0}, ... % (1, 1) + { 'logical', 'double', 2, 0, 1, 0, 0}, ... % (0, 1) + { 'logical', 'double', 3, 0, 1, 0, 0}, ... % (1, 2) + { 'int8', 'logical', 4, 0, 8, 0, 0}} ; % (1, 3) +end + +test188 (tasks) ; + diff --git a/Test/test191.m b/Test/test191.m index 80453e2e54..63830be34b 100644 --- a/Test/test191.m +++ b/Test/test191.m @@ -1,11 +1,42 @@ -function test191 +function test191(tasks) %TEST191 test split -% 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 fprintf ('test191 ----------- Tiles = split (A)\n') ; +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + {1, 'logical', 1, 0}, ... % ( 3, 3) + {1, 'logical', 4, 0}, ... % ( 2, 5) + {1, 'int16', 1, 0}, ... % ( 1, 6) + {1, 'int16', 4, 0}, ... % ( 1, 7) + {1, 'int32', 1, 0}, ... % ( 1, 8) + {1, 'int32', 4, 0}, ... % ( 1, 9) + {1, 'int64', 4, 0}, ... % ( 1, 10) + {1, 'double complex', 1, 0}, ... % ( 1, 11) + {1, 'double complex', 4, 0}, ... % ( 1, 12) + {2, 'logical', 8, 0}, ... % ( 3, 15) + {2, 'int16', 8, 0}, ... % ( 1, 16) + {2, 'int32', 8, 0}, ... % ( 1, 17) + {2, 'int64', 8, 0}, ... % ( 1, 18) + {2, 'double complex', 8, 0}, ... % ( 1, 19) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + [~, ~, ~, types, ~, ~] = GB_spec_opsall ; types = types.all ; @@ -16,15 +47,38 @@ ms = [10 1 89] ; ns = [1 4 50 45 10] ; -for d = [1e-4 0.01 0.2 0.8 inf] - fprintf ('\nd = %g\n', d) ; - for ka = 1:length (types) - atype = types {ka} ; - A = GB_spec_random (m, n, d, 128, atype) ; - for sparsity_control = [1 2 4 8] - fprintf ('.') ; +% densities = [1e-4 0.01 0.2 0.8 inf] ; +densities = [0.01 inf] ; + +% create the test matrices +for kd = 1:length(densities) + dd = densities (kd) ; + AA {kd} = GB_spec_random (m, n, dd, 128) ; +end + +for kk = 1:length(tasks) + task = tasks {kk} ; + kd = task {1} ; + atype = task {2} ; + sparsity_control = task {3} ; + is_csc = task {4} ; + +% for kd = 1:length(densities) +% dd = densities (kd) ; +% fprintf ('\nd = %g\n', dd) ; + A = AA {kd} ; + +% for ka = 1:length (types) +% atype = types {ka} ; +% A = GB_spec_random (m, n, dd, 128, atype) ; + A.class = atype ; + +% for sparsity_control = [1 2 4 8] +% fprintf ('.') ; A.sparsity = sparsity_control ; - for is_csc = [0 1] + +% for is_csc = [0 1] + A.is_csc = is_csc ; C2 = GB_spec_split (A, ms, ns) ; C1 = GB_mex_split (A, ms, ns) ; @@ -47,9 +101,24 @@ end end end - end - end - end + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + aa = sprintf ('''%s''', atype) ; + fprintf ('{%d, %16s, %d, %d},', ... + kd, aa, sparsity_control, is_csc) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + +% end +% end +% end end fprintf ('\n') ; diff --git a/Test/test194.m b/Test/test194.m index 11d49c58be..a9fcbc0aee 100644 --- a/Test/test194.m +++ b/Test/test194.m @@ -1,4 +1,4 @@ -function test194 +function test194(tasks) %TEST194 test GxB_Vector_diag % SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. @@ -6,39 +6,75 @@ fprintf ('test194 ----------- V = diag (A,k)\n') ; -[~, ~, ~, types, ~, ~] = GB_spec_opsall ; -types = types.all ; +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 'logical', 'logical', 10, 4, 0.5, 1, 1, -10}, ... % ( 2, 2) + { 'logical', 'logical', 10, 4, 0.5, 1, 1, -2}, ... % ( 1, 3) + { 'logical', 'int8', 10, 4, 0.5, 1, 1, -10}, ... % ( 1, 4) + { 'logical', 'logical', 10, 4, 0.5, 1, 0, -10}, ... % ( 1, 5) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end rng ('default') ; GB_builtin_complex_set (true) ; -ms = [10 20] ; -ns = [4 10] ; - -for d = [1e-4 0.1 0.8 inf] - fprintf ('\nd = %g\n', d) ; - for ka = 1:length (types) - atype = types {ka} ; - for m = ms - for n = ns - A = GB_spec_random (m, n, d, 128, atype) ; - for sparsity_control = [1 2 4 8] - fprintf ('.') ; - A.sparsity = sparsity_control ; - for csc = [1 0] - A.is_csc = csc ; - for kc = 1:length (types) - vtype = types {kc} ; - for k = [-10 -2 0 3 ] - V2 = GB_spec_vdiag (A, k, vtype) ; - V1 = GB_mex_vdiag (A, k, vtype) ; - GB_spec_compare (V1, V2) ; - end - end - end - end - end +atype_last = '' ; +m_last = -1 ; +n_last = -1 ; +dd_last = -1 ; +A = [ ] ; + +for kk = 1:length(tasks) + task = tasks {kk} ; + atype = task {1} ; + vtype = task {2} ; + m = task {3} ; + n = task {4} ; + dd = task {5} ; + sparsity_control = task {6} ; + csc = task {7} ; + k = task {8} ; + + if (~(isequal (atype, atype_last) && m == m_last && n == n_last && ... + dd == dd_last)) + A = GB_spec_random (m, n, dd, 128, atype) ; + atype_last = atype ; + m_last = m ; + n_last = n ; + dd_last = dd ; + end + + A.sparsity = sparsity_control ; + A.is_csc = csc ; + V2 = GB_spec_vdiag (A, k, vtype) ; + V1 = GB_mex_vdiag (A, k, vtype) ; + GB_spec_compare (V1, V2) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + aa = sprintf ('''%s''', atype) ; + vv = sprintf ('''%s''', vtype) ; + fprintf ('{%16s, %16s, %d, %d, %g, %d, %d, %3d},', ... + aa, vv, m, n, dd, sparsity_control, csc, k) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; end + clast = c ; + else + fprintf ('.') ; end end diff --git a/Test/test195.m b/Test/test195.m index d1b1d955fb..d11042af01 100644 --- a/Test/test195.m +++ b/Test/test195.m @@ -4,6 +4,43 @@ function test195 (dohack) % SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 +fprintf ('test195 -------------- saxpy3 variants\n') ; + +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + {1, 1, 1, 1, 1, 1, 1}, ... % ( 2, 2) + {1, 1, 4, 1, 1, 1, 1}, ... % ( 2, 4) + {1, 4, 1, 1, 1, 1, 1}, ... % ( 3, 7) + {2, 4, 1, 1, 1, 1, 1}, ... % ( 3, 10) + {4, 1, 1, 1, 1, 1, 1}, ... % ( 1, 11) + {4, 2, 1, 1, 1, 1, 1}, ... % ( 2, 13) + {4, 4, 1, 1, 1, 1, 1}, ... % ( 1, 14) + {1, 1, 1, 1, 2, 1, 1}, ... % ( 2, 16) + {1, 1, 4, 1, 2, 1, 65536}, ... % ( 2, 18) + {4, 2, 8, 1, 2, 3, 1}, ... % ( 1, 19) + {1, 8, 1, 1, 3, 1, 1}, ... % ( 3, 22) + {2, 8, 1, 1, 3, 1, 1}, ... % ( 2, 24) + {1, 4, 4, 2, 1, 1, 1}, ... % ( 1, 25) + {1, 1, 1, 2, 3, 1, 1}, ... % ( 1, 26) + {1, 8, 1, 2, 3, 1, 1}, ... % ( 1, 27) + {8, 1, 1, 3, 1, 1, 1}, ... % ( 2, 29) + {8, 2, 1, 3, 1, 1, 1}, ... % ( 1, 30) + {8, 4, 1, 3, 1, 1, 1}, ... % ( 1, 31) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + rng ('default') ; [nthreads_orig chunk_orig] = nthreads_get ; @@ -28,80 +65,105 @@ function test195 (dohack) semiring.add = 'plus' ; semiring.class = 'double' ; -for asparsity = [1 2 4 8] - fprintf ('\nA: %s ', GB_sparsity (asparsity)) ; - for bsparsity = [1 2 4 8] - fprintf ('\n B: %s ', GB_sparsity (bsparsity)) ; - for msparsity = [1 2 4 8] - fprintf ('\n M: %s ', GB_sparsity (msparsity)) ; - for da = [0.01 .1 inf] - A = GB_spec_random (m, k, da) ; A.sparsity = asparsity ; - for db = [0.01 .1 inf] - B = GB_spec_random (k, n, db) ; B.sparsity = bsparsity ; - for dm = [0.01 .1 inf] - fprintf ('.') ; - M = GB_spec_random (m, n, dm) ; M.sparsity = msparsity ; - M.matrix = spones (M.matrix) ; - - % C = A*B - C0 = A.matrix * B.matrix ; - C1 = GB_spec_mxm (C0, [ ], [ ], semiring, A, B, desc) ; - C2 = GB_mex_mxm (C0, [ ], [ ], semiring, A, B, desc) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - if (msparsity == 4) - chunks = unique ([1 chunk_orig 65536]) ; - else - chunks = chunk_orig ; - end - - for chunk = chunks - nthreads_set (nthreads_orig, chunk) ; - - % C = A*B - C0 = (A.matrix * B.matrix) .* M.matrix ; - C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, desc) ; - C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, desc) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - % C = A*B - C0 = (A.matrix * B.matrix) .* (1 - M.matrix) ; - C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, dnot) ; - C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, dnot) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - % C = A*B - C0 = (A.matrix * B.matrix) .* M.matrix ; - C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, desc_s) ; - C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, desc_s) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - % C = A*B - C0 = (A.matrix * B.matrix) .* (1 - M.matrix) ; - C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, dnot_s) ; - C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, dnot_s) ; - GB_spec_compare (C1, C2, 0, 1e-12) ; - err = norm (C0 - C2.matrix, 1) ; - assert (err < 1e-12) ; - - end - end - end - end +densities = [0.01 .1 inf] ; + +% generate the test matrices + +for ka = 1:3 + da = densities (ka) ; + AA {ka} = GB_spec_random (m, k, da) ; +end + +for kb = 1:3 + db = densities (kb) ; + BB {kb} = GB_spec_random (k, n, db) ; +end + +for km = 1:3 + dm = densities (km) ; + M = GB_spec_random (m, n, dm) ; + M.matrix = spones (M.matrix) ; + MM {km} = M ; +end + +% run the tests + +for kk = 1:length(tasks) + task = tasks {kk} ; + asparsity = task {1} ; + bsparsity = task {2} ; + msparsity = task {3} ; + ka = task {4} ; + kb = task {5} ; + km = task {6} ; + chunk = task {7} ; + + A = AA {ka} ; + B = BB {kb} ; + M = MM {km} ; + A.sparsity = asparsity ; + B.sparsity = bsparsity ; + M.sparsity = msparsity ; + + nthreads_set (nthreads_orig, chunk_orig) ; + + % C = A*B + C0 = A.matrix * B.matrix ; + C1 = GB_spec_mxm (C0, [ ], [ ], semiring, A, B, desc) ; + C2 = GB_mex_mxm (C0, [ ], [ ], semiring, A, B, desc) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + nthreads_set (nthreads_orig, chunk) ; + + % C = A*B + C0 = (A.matrix * B.matrix) .* M.matrix ; + C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, desc) ; + C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, desc) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + % C = A*B + C0 = (A.matrix * B.matrix) .* (1 - M.matrix) ; + C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, dnot) ; + C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, dnot) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + % C = A*B + C0 = (A.matrix * B.matrix) .* M.matrix ; + C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, desc_s) ; + C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, desc_s) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + % C = A*B + C0 = (A.matrix * B.matrix) .* (1 - M.matrix) ; + C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, dnot_s) ; + C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, dnot_s) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf ('{%d, %d, %d, %d, %d, %d, %6d},', ... + asparsity, bsparsity, msparsity, ka, kb, km, chunk) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; end + clast = c ; + else + fprintf ('.') ; end end % restore global settings -GB_mex_burble (0) ; GB_mex_hack (save_hack) ; nthreads_set (nthreads_orig, chunk_orig) ; diff --git a/Test/test21b.m b/Test/test21b.m index eedbe83adf..b143e3073e 100644 --- a/Test/test21b.m +++ b/Test/test21b.m @@ -1,7 +1,7 @@ function test21b (fulltest) %TEST21B test GrB_assign -% 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 if (nargin < 1) diff --git a/Test/test227.m b/Test/test227.m index e097f663ee..47550ee23d 100644 --- a/Test/test227.m +++ b/Test/test227.m @@ -112,5 +112,18 @@ end end +% test the empty case +clear op +op.opname = 'times' ; +op.optype = 'double' ; +clear A C +A.matrix = sparse (10,10) ; +A.pattern = zeros (10) ; +C.matrix = sparse (100,100) ; +C.pattern = zeros (100) ; +C0 = GB_spec_kron (C, [ ], [ ], op, A, A, dnn) ; +C1 = GB_mex_kron (C, [ ], [ ], op, A, A, dnn) ; +GB_spec_compare (C0, C1) ; + fprintf ('\ntest227: all tests passed\n') ; diff --git a/Test/test230.m b/Test/test230.m index 32e20f1c6d..0a6d96e786 100644 --- a/Test/test230.m +++ b/Test/test230.m @@ -14,7 +14,6 @@ defaults = [ ] ; desc.inp0 = 'tran' ; -n_operators = 0 ; for k2 = 1:length(ops) opname = ops {k2} ; fprintf ('\n%-10s ', opname) ; @@ -33,14 +32,15 @@ end fprintf ('.') ; - n_operators = n_operators + 1 ; for m = [1 4] % [ 1 10 ]% 100] for n = [1 4] % [1 10 ]% 100] for hi = [1 5] % [-1:2:5 ] for lo = [-1 0] % [-3:2:5 ] + Amat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; Bmat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; + Cmat = sparse (m, n) ; C.matrix = Cmat ; @@ -52,11 +52,11 @@ A.matrix = Amat ; A.class = type ; - for ythunk = -3:3 + for ythunk = -3 % -3:3 y.matrix = ythunk ; y.class = type ; - for how = 0:1 + for how = 0 % 0:1 for csc = 0:1 A.is_csc = csc ; @@ -71,8 +71,7 @@ C2 = GB_spec_apply (CT, [ ], [ ], op, A, desc , y) ; GB_spec_compare (C1, C2) ; - end - +end end end end @@ -82,6 +81,5 @@ end end -fprintf ('\nNumber of built-in GraphBLAS idxunops: %d\n', n_operators) ; fprintf ('\ntest230: all tests passed\n') ; diff --git a/Test/test231.m b/Test/test231.m index 18787d02e3..e34f702643 100644 --- a/Test/test231.m +++ b/Test/test231.m @@ -1,97 +1,137 @@ function test231 %TEST231 test GrB_select with idxunp -% 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 [~, ~, ~, types, ~, ~, idxunops] = GB_spec_opsall ; ops = idxunops ; -types = types.all ; +types_all = types.all ; fprintf ('\n--- testing select with idxunops\n') ; rng ('default') ; -desc.inp0 = 'tran' ; +ds.inp0 = 'tran' ; + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + +% create test matrices +m = 4 ; +n = 5 ; +G {1} = sprand (m, n, 0.8) ; +S {1} = sprand (m, n, 0.5) ; +G {2} = sprand (m, 1, 0.8) ; +S {2} = sprand (m, 1, 0.5) ; +hi = 5 ; +lo = -1 ; n_operators = 0 ; for k2 = 1:length(ops) opname = ops {k2} ; - fprintf ('\n%-10s ', opname) ; - - for k1 = 1:length (types) - type = types {k1} ; - - % create the op - clear op - op.opname = opname ; - op.optype = type ; - [is_idxunop, ztype] = GB_spec_is_idxunop (opname, type) ; - if (~is_idxunop) - continue ; + % fprintf ('\n%-10s ', opname) ; + + if (test_contains (opname, 'value')) + types = types_all ; + ythunks = 1 ; + sparsities = 1 ; + cscs = 1 ; + else + types = {'int64'} ; + ythunks = [-3 0 1] ; + sparsities = [1 4] ; + cscs = [0 1] ; end - n_operators = n_operators + 1 ; - - for m = [1 4] % [ 1 10 ]% 100] - for n = [1 4] % [1 10 ]% 100] - for hi = [1 5] % [-1:2:5 ] - for lo = [-1 0] % [-3:2:5 ] - Amat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; - Cmat = sparse (m, n) ; - fprintf ('.') ; - - C.matrix = Cmat ; - C.class = ztype ; - - CT.matrix = Cmat' ; - CT.class = ztype ; - - A.matrix = Amat ; - A.class = type ; - - B.matrix = spones (Amat) ; - B.class = type ; - B.iso = true ; - - for ythunk = -3:3 - y.matrix = ythunk ; - y.class = type ; - - for how = 0:1 - for csc = 0:1 - - A.is_csc = csc ; - C.is_csc = csc ; - CT.is_csc = csc ; - - for sparsity = [1 2 4] - A.sparsity = sparsity ; - - C1 = GB_mex_select_idxunop (C, [ ], [ ], op, how, A, y, [ ]) ; - C2 = GB_spec_select_idxunop (C, [ ], [ ], op, A, y, [ ]) ; - GB_spec_compare (C1, C2) ; - - C1 = GB_mex_select_idxunop (C, [ ], [ ], op, how, B, y, [ ]) ; - C2 = GB_spec_select_idxunop (C, [ ], [ ], op, B, y, [ ]) ; - GB_spec_compare (C1, C2) ; - - C1 = GB_mex_select_idxunop (CT, [ ], [ ], op, how, A, y, desc) ; - C2 = GB_spec_select_idxunop (CT, [ ], [ ], op, A, y, desc) ; - GB_spec_compare (C1, C2) ; - - end + if (isequal (opname, 'rowindex')) + nmat = 2 ; + else + nmat = 1 ; end -end -end -end -end -end -end -end + for k1 = 1:length (types) + type = types {k1} ; + + % create the op + clear op + op.opname = opname ; + op.optype = type ; + [is_idxunop, ztype] = GB_spec_is_idxunop (opname, type) ; + if (~is_idxunop) + continue ; + end + + for kmat = 1:nmat + + % create the test matrix + Amat = (hi*G{kmat}-lo) .* S{kmat} ; + [m n] = size (Amat) ; + Cmat = sparse (m, n) ; + + C.matrix = Cmat ; + C.class = ztype ; + + CT.matrix = Cmat' ; + CT.class = ztype ; + + A.matrix = Amat ; + A.class = type ; + + B.matrix = spones (Amat) ; + B.class = type ; + B.iso = true ; + + for ythunk = ythunks + y.matrix = ythunk ; + y.class = type ; + + for csc = cscs + A.is_csc = csc ; + C.is_csc = csc ; + CT.is_csc = csc ; + + for sparsity = sparsities % [1 4] + A.sparsity = sparsity ; + + C1 = GB_mex_select_idxunop (C, [],[], op,0, A, y, []) ; + C2 = GB_spec_select_idxunop (C, [],[], op, A, y, []) ; + GB_spec_compare (C1, C2) ; + + C1 = GB_mex_select_idxunop (C, [],[], op,0, B, y, []) ; + C2 = GB_spec_select_idxunop (C, [],[], op, B, y, []) ; + GB_spec_compare (C1, C2) ; + + C1 = GB_mex_select_idxunop (CT,[],[], op,0, A, y, ds) ; + C2 = GB_spec_select_idxunop (CT,[],[], op, A, y, ds) ; + GB_spec_compare (C1, C2) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf (... + '[%10s, %15s, %2d,%2d,%2d,%2d]', ... + opname, type, kmat, ythunk, ... + csc, sparsity) ; + fprintf (' (%d, %d)\n', d, c - cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + + end + end + end + end + end end -fprintf ('\nNumber of built-in GraphBLAS idxunops: %d\n', n_operators) ; fprintf ('\ntest231: all tests passed\n') ; diff --git a/Test/test234.m b/Test/test234.m index d37b0ef9a2..b2d8a53662 100644 --- a/Test/test234.m +++ b/Test/test234.m @@ -1,16 +1,388 @@ -function test234 +function test234(tasks) %TEST234 test GxB_eWiseUnion -% 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 -% derived from test127 - -[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; -binops = binops.all ; -types = types.all ; +if (nargin < 1) + tasks = [ ] ; +end +if (isempty (tasks)) + tasks = { + {'logical','first', 0,0,0,0 }, ... % 5 5 + {'logical','first', 0,0,0,1 }, ... % 6 11 + {'logical','first', 0,1,0,0 }, ... % 2 13 + {'logical','first', 0,1,0,1 }, ... % 1 14 + {'logical','first', 1,0,0,0 }, ... % 2 16 + {'logical','first', 1,1,0,0 }, ... % 2 18 + {'logical','first', 1,1,0,1 }, ... % 1 19 + {'logical','second', 0,0,0,0 }, ... % 1 20 + {'logical','pair', 0,0,0,0 }, ... % 1 21 + {'logical','plus', 0,0,0,0 }, ... % 1 22 + {'logical','minus', 0,0,0,0 }, ... % 1 23 + {'logical','times', 0,0,0,0 }, ... % 1 24 + {'logical','iseq', 0,0,0,0 }, ... % 1 25 + {'logical','pow', 0,0,0,0 }, ... % 1 26 + {'logical','pow', 0,0,0,1 }, ... % 3 29 + {'logical','isgt', 0,0,0,0 }, ... % 1 30 + {'logical','islt', 0,0,0,0 }, ... % 1 31 + {'logical','isle', 0,0,0,0 }, ... % 1 32 + {'int8','first', 0,0,0,0 }, ... % 1 33 + {'int8','second', 0,0,0,0 }, ... % 1 34 + {'int8','plus', 0,0,0,0 }, ... % 1 35 + {'int8','minus', 0,0,0,0 }, ... % 1 36 + {'int8','rminus', 0,0,0,0 }, ... % 1 37 + {'int8','times', 0,0,0,0 }, ... % 1 38 + {'int8','div', 0,0,0,0 }, ... % 1 39 + {'int8','rdiv', 0,0,0,0 }, ... % 1 40 + {'int8','iseq', 0,0,0,0 }, ... % 1 41 + {'int8','isne', 0,0,0,0 }, ... % 1 42 + {'int8','eq', 0,0,0,0 }, ... % 1 43 + {'int8','ne', 0,0,0,0 }, ... % 1 44 + {'int8','pow', 0,0,0,0 }, ... % 1 45 + {'int8','min', 0,0,0,0 }, ... % 1 46 + {'int8','max', 0,0,0,0 }, ... % 1 47 + {'int8','isgt', 0,0,0,0 }, ... % 1 48 + {'int8','islt', 0,0,0,0 }, ... % 1 49 + {'int8','isge', 0,0,0,0 }, ... % 1 50 + {'int8','isle', 0,0,0,0 }, ... % 1 51 + {'int8','gt', 0,0,0,0 }, ... % 1 52 + {'int8','lt', 0,0,0,0 }, ... % 1 53 + {'int8','ge', 0,0,0,0 }, ... % 1 54 + {'int8','le', 0,0,0,0 }, ... % 1 55 + {'int8','or', 0,0,0,0 }, ... % 1 56 + {'int8','and', 0,0,0,0 }, ... % 1 57 + {'int8','xor', 0,0,0,0 }, ... % 1 58 + {'int8','bor', 0,0,0,0 }, ... % 1 59 + {'int8','band', 0,0,0,0 }, ... % 1 60 + {'int8','bxor', 0,0,0,0 }, ... % 1 61 + {'int8','bxnor', 0,0,0,0 }, ... % 1 62 + {'int8','bget', 0,0,0,0 }, ... % 1 63 + {'int8','bset', 0,0,0,0 }, ... % 1 64 + {'int8','bclr', 0,0,0,0 }, ... % 1 65 + {'int16','first', 0,0,0,0 }, ... % 1 66 + {'int16','second', 0,0,0,0 }, ... % 1 67 + {'int16','plus', 0,0,0,0 }, ... % 1 68 + {'int16','minus', 0,0,0,0 }, ... % 1 69 + {'int16','rminus', 0,0,0,0 }, ... % 1 70 + {'int16','times', 0,0,0,0 }, ... % 1 71 + {'int16','div', 0,0,0,0 }, ... % 1 72 + {'int16','rdiv', 0,0,0,0 }, ... % 1 73 + {'int16','iseq', 0,0,0,0 }, ... % 1 74 + {'int16','isne', 0,0,0,0 }, ... % 1 75 + {'int16','eq', 0,0,0,0 }, ... % 1 76 + {'int16','ne', 0,0,0,0 }, ... % 1 77 + {'int16','pow', 0,0,0,0 }, ... % 1 78 + {'int16','min', 0,0,0,0 }, ... % 1 79 + {'int16','max', 0,0,0,0 }, ... % 1 80 + {'int16','isgt', 0,0,0,0 }, ... % 1 81 + {'int16','islt', 0,0,0,0 }, ... % 1 82 + {'int16','isge', 0,0,0,0 }, ... % 1 83 + {'int16','isle', 0,0,0,0 }, ... % 1 84 + {'int16','gt', 0,0,0,0 }, ... % 1 85 + {'int16','lt', 0,0,0,0 }, ... % 1 86 + {'int16','ge', 0,0,0,0 }, ... % 1 87 + {'int16','le', 0,0,0,0 }, ... % 1 88 + {'int16','or', 0,0,0,0 }, ... % 1 89 + {'int16','and', 0,0,0,0 }, ... % 1 90 + {'int16','xor', 0,0,0,0 }, ... % 1 91 + {'int16','bor', 0,0,0,0 }, ... % 1 92 + {'int16','band', 0,0,0,0 }, ... % 1 93 + {'int16','bxor', 0,0,0,0 }, ... % 1 94 + {'int16','bxnor', 0,0,0,0 }, ... % 1 95 + {'int16','bget', 0,0,0,0 }, ... % 1 96 + {'int16','bset', 0,0,0,0 }, ... % 1 97 + {'int16','bclr', 0,0,0,0 }, ... % 1 98 + {'int32','first', 0,0,0,0 }, ... % 1 99 + {'int32','second', 0,0,0,0 }, ... % 1 100 + {'int32','plus', 0,0,0,0 }, ... % 1 101 + {'int32','minus', 0,0,0,0 }, ... % 1 102 + {'int32','rminus', 0,0,0,0 }, ... % 1 103 + {'int32','times', 0,0,0,0 }, ... % 1 104 + {'int32','div', 0,0,0,0 }, ... % 1 105 + {'int32','rdiv', 0,0,0,0 }, ... % 1 106 + {'int32','iseq', 0,0,0,0 }, ... % 1 107 + {'int32','isne', 0,0,0,0 }, ... % 1 108 + {'int32','eq', 0,0,0,0 }, ... % 1 109 + {'int32','ne', 0,0,0,0 }, ... % 1 110 + {'int32','pow', 0,0,0,0 }, ... % 1 111 + {'int32','min', 0,0,0,0 }, ... % 1 112 + {'int32','max', 0,0,0,0 }, ... % 1 113 + {'int32','isgt', 0,0,0,0 }, ... % 1 114 + {'int32','islt', 0,0,0,0 }, ... % 1 115 + {'int32','isge', 0,0,0,0 }, ... % 1 116 + {'int32','isle', 0,0,0,0 }, ... % 1 117 + {'int32','gt', 0,0,0,0 }, ... % 1 118 + {'int32','lt', 0,0,0,0 }, ... % 1 119 + {'int32','ge', 0,0,0,0 }, ... % 1 120 + {'int32','le', 0,0,0,0 }, ... % 1 121 + {'int32','or', 0,0,0,0 }, ... % 1 122 + {'int32','and', 0,0,0,0 }, ... % 1 123 + {'int32','xor', 0,0,0,0 }, ... % 1 124 + {'int32','bor', 0,0,0,0 }, ... % 1 125 + {'int32','band', 0,0,0,0 }, ... % 1 126 + {'int32','bxor', 0,0,0,0 }, ... % 1 127 + {'int32','bxnor', 0,0,0,0 }, ... % 1 128 + {'int32','bget', 0,0,0,0 }, ... % 1 129 + {'int32','bset', 0,0,0,0 }, ... % 1 130 + {'int32','bclr', 0,0,0,0 }, ... % 1 131 + {'int32','firsti', 0,0,0,0 }, ... % 1 132 + {'int64','first', 0,0,0,0 }, ... % 1 133 + {'int64','second', 0,0,0,0 }, ... % 1 134 + {'int64','plus', 0,0,0,0 }, ... % 1 135 + {'int64','minus', 0,0,0,0 }, ... % 1 136 + {'int64','rminus', 0,0,0,0 }, ... % 1 137 + {'int64','times', 0,0,0,0 }, ... % 1 138 + {'int64','div', 0,0,0,0 }, ... % 1 139 + {'int64','rdiv', 0,0,0,0 }, ... % 1 140 + {'int64','iseq', 0,0,0,0 }, ... % 1 141 + {'int64','isne', 0,0,0,0 }, ... % 1 142 + {'int64','eq', 0,0,0,0 }, ... % 1 143 + {'int64','ne', 0,0,0,0 }, ... % 1 144 + {'int64','pow', 0,0,0,0 }, ... % 1 145 + {'int64','min', 0,0,0,0 }, ... % 1 146 + {'int64','max', 0,0,0,0 }, ... % 1 147 + {'int64','isgt', 0,0,0,0 }, ... % 1 148 + {'int64','islt', 0,0,0,0 }, ... % 1 149 + {'int64','isge', 0,0,0,0 }, ... % 1 150 + {'int64','isle', 0,0,0,0 }, ... % 1 151 + {'int64','gt', 0,0,0,0 }, ... % 1 152 + {'int64','lt', 0,0,0,0 }, ... % 1 153 + {'int64','ge', 0,0,0,0 }, ... % 1 154 + {'int64','le', 0,0,0,0 }, ... % 1 155 + {'int64','or', 0,0,0,0 }, ... % 1 156 + {'int64','and', 0,0,0,0 }, ... % 1 157 + {'int64','xor', 0,0,0,0 }, ... % 1 158 + {'int64','bor', 0,0,0,0 }, ... % 1 159 + {'int64','band', 0,0,0,0 }, ... % 1 160 + {'int64','bxor', 0,0,0,0 }, ... % 1 161 + {'int64','bxnor', 0,0,0,0 }, ... % 1 162 + {'int64','bget', 0,0,0,0 }, ... % 1 163 + {'int64','bset', 0,0,0,0 }, ... % 1 164 + {'int64','bclr', 0,0,0,0 }, ... % 1 165 + {'uint8','first', 0,0,0,0 }, ... % 1 166 + {'uint8','second', 0,0,0,0 }, ... % 1 167 + {'uint8','plus', 0,0,0,0 }, ... % 1 168 + {'uint8','minus', 0,0,0,0 }, ... % 1 169 + {'uint8','rminus', 0,0,0,0 }, ... % 1 170 + {'uint8','times', 0,0,0,0 }, ... % 1 171 + {'uint8','div', 0,0,0,0 }, ... % 1 172 + {'uint8','rdiv', 0,0,0,0 }, ... % 1 173 + {'uint8','iseq', 0,0,0,0 }, ... % 1 174 + {'uint8','isne', 0,0,0,0 }, ... % 1 175 + {'uint8','eq', 0,0,0,0 }, ... % 1 176 + {'uint8','ne', 0,0,0,0 }, ... % 1 177 + {'uint8','pow', 0,0,0,0 }, ... % 1 178 + {'uint8','min', 0,0,0,0 }, ... % 1 179 + {'uint8','max', 0,0,0,0 }, ... % 1 180 + {'uint8','isgt', 0,0,0,0 }, ... % 1 181 + {'uint8','islt', 0,0,0,0 }, ... % 1 182 + {'uint8','isge', 0,0,0,0 }, ... % 1 183 + {'uint8','isle', 0,0,0,0 }, ... % 1 184 + {'uint8','gt', 0,0,0,0 }, ... % 1 185 + {'uint8','lt', 0,0,0,0 }, ... % 1 186 + {'uint8','ge', 0,0,0,0 }, ... % 1 187 + {'uint8','le', 0,0,0,0 }, ... % 1 188 + {'uint8','or', 0,0,0,0 }, ... % 1 189 + {'uint8','and', 0,0,0,0 }, ... % 1 190 + {'uint8','xor', 0,0,0,0 }, ... % 1 191 + {'uint8','bor', 0,0,0,0 }, ... % 1 192 + {'uint8','band', 0,0,0,0 }, ... % 1 193 + {'uint8','bxor', 0,0,0,0 }, ... % 1 194 + {'uint8','bxnor', 0,0,0,0 }, ... % 1 195 + {'uint8','bget', 0,0,0,0 }, ... % 1 196 + {'uint8','bset', 0,0,0,0 }, ... % 1 197 + {'uint8','bclr', 0,0,0,0 }, ... % 1 198 + {'uint16','first', 0,0,0,0 }, ... % 1 199 + {'uint16','second', 0,0,0,0 }, ... % 1 200 + {'uint16','plus', 0,0,0,0 }, ... % 1 201 + {'uint16','minus', 0,0,0,0 }, ... % 1 202 + {'uint16','rminus', 0,0,0,0 }, ... % 1 203 + {'uint16','times', 0,0,0,0 }, ... % 1 204 + {'uint16','div', 0,0,0,0 }, ... % 1 205 + {'uint16','rdiv', 0,0,0,0 }, ... % 1 206 + {'uint16','iseq', 0,0,0,0 }, ... % 1 207 + {'uint16','isne', 0,0,0,0 }, ... % 1 208 + {'uint16','eq', 0,0,0,0 }, ... % 1 209 + {'uint16','ne', 0,0,0,0 }, ... % 1 210 + {'uint16','pow', 0,0,0,0 }, ... % 1 211 + {'uint16','min', 0,0,0,0 }, ... % 1 212 + {'uint16','max', 0,0,0,0 }, ... % 1 213 + {'uint16','isgt', 0,0,0,0 }, ... % 1 214 + {'uint16','islt', 0,0,0,0 }, ... % 1 215 + {'uint16','isge', 0,0,0,0 }, ... % 1 216 + {'uint16','isle', 0,0,0,0 }, ... % 1 217 + {'uint16','gt', 0,0,0,0 }, ... % 1 218 + {'uint16','lt', 0,0,0,0 }, ... % 1 219 + {'uint16','ge', 0,0,0,0 }, ... % 1 220 + {'uint16','le', 0,0,0,0 }, ... % 1 221 + {'uint16','or', 0,0,0,0 }, ... % 1 222 + {'uint16','and', 0,0,0,0 }, ... % 1 223 + {'uint16','xor', 0,0,0,0 }, ... % 1 224 + {'uint16','bor', 0,0,0,0 }, ... % 1 225 + {'uint16','band', 0,0,0,0 }, ... % 1 226 + {'uint16','bxor', 0,0,0,0 }, ... % 1 227 + {'uint16','bxnor', 0,0,0,0 }, ... % 1 228 + {'uint16','bget', 0,0,0,0 }, ... % 1 229 + {'uint16','bset', 0,0,0,0 }, ... % 1 230 + {'uint16','bclr', 0,0,0,0 }, ... % 1 231 + {'uint32','first', 0,0,0,0 }, ... % 1 232 + {'uint32','second', 0,0,0,0 }, ... % 1 233 + {'uint32','plus', 0,0,0,0 }, ... % 1 234 + {'uint32','minus', 0,0,0,0 }, ... % 1 235 + {'uint32','rminus', 0,0,0,0 }, ... % 1 236 + {'uint32','times', 0,0,0,0 }, ... % 1 237 + {'uint32','div', 0,0,0,0 }, ... % 1 238 + {'uint32','rdiv', 0,0,0,0 }, ... % 1 239 + {'uint32','iseq', 0,0,0,0 }, ... % 1 240 + {'uint32','isne', 0,0,0,0 }, ... % 1 241 + {'uint32','eq', 0,0,0,0 }, ... % 1 242 + {'uint32','ne', 0,0,0,0 }, ... % 1 243 + {'uint32','pow', 0,0,0,0 }, ... % 1 244 + {'uint32','min', 0,0,0,0 }, ... % 1 245 + {'uint32','max', 0,0,0,0 }, ... % 1 246 + {'uint32','isgt', 0,0,0,0 }, ... % 1 247 + {'uint32','islt', 0,0,0,0 }, ... % 1 248 + {'uint32','isge', 0,0,0,0 }, ... % 1 249 + {'uint32','isle', 0,0,0,0 }, ... % 1 250 + {'uint32','gt', 0,0,0,0 }, ... % 1 251 + {'uint32','lt', 0,0,0,0 }, ... % 1 252 + {'uint32','ge', 0,0,0,0 }, ... % 1 253 + {'uint32','le', 0,0,0,0 }, ... % 1 254 + {'uint32','or', 0,0,0,0 }, ... % 1 255 + {'uint32','and', 0,0,0,0 }, ... % 1 256 + {'uint32','xor', 0,0,0,0 }, ... % 1 257 + {'uint32','bor', 0,0,0,0 }, ... % 1 258 + {'uint32','band', 0,0,0,0 }, ... % 1 259 + {'uint32','bxor', 0,0,0,0 }, ... % 1 260 + {'uint32','bxnor', 0,0,0,0 }, ... % 1 261 + {'uint32','bget', 0,0,0,0 }, ... % 1 262 + {'uint32','bset', 0,0,0,0 }, ... % 1 263 + {'uint32','bclr', 0,0,0,0 }, ... % 1 264 + {'uint64','first', 0,0,0,0 }, ... % 1 265 + {'uint64','second', 0,0,0,0 }, ... % 1 266 + {'uint64','plus', 0,0,0,0 }, ... % 1 267 + {'uint64','minus', 0,0,0,0 }, ... % 1 268 + {'uint64','rminus', 0,0,0,0 }, ... % 1 269 + {'uint64','times', 0,0,0,0 }, ... % 1 270 + {'uint64','div', 0,0,0,0 }, ... % 1 271 + {'uint64','rdiv', 0,0,0,0 }, ... % 1 272 + {'uint64','iseq', 0,0,0,0 }, ... % 1 273 + {'uint64','isne', 0,0,0,0 }, ... % 1 274 + {'uint64','eq', 0,0,0,0 }, ... % 1 275 + {'uint64','ne', 0,0,0,0 }, ... % 1 276 + {'uint64','pow', 0,0,0,0 }, ... % 1 277 + {'uint64','min', 0,0,0,0 }, ... % 1 278 + {'uint64','max', 0,0,0,0 }, ... % 1 279 + {'uint64','isgt', 0,0,0,0 }, ... % 1 280 + {'uint64','islt', 0,0,0,0 }, ... % 1 281 + {'uint64','isge', 0,0,0,0 }, ... % 1 282 + {'uint64','isle', 0,0,0,0 }, ... % 1 283 + {'uint64','gt', 0,0,0,0 }, ... % 1 284 + {'uint64','lt', 0,0,0,0 }, ... % 1 285 + {'uint64','ge', 0,0,0,0 }, ... % 1 286 + {'uint64','le', 0,0,0,0 }, ... % 1 287 + {'uint64','or', 0,0,0,0 }, ... % 1 288 + {'uint64','and', 0,0,0,0 }, ... % 1 289 + {'uint64','xor', 0,0,0,0 }, ... % 1 290 + {'uint64','bor', 0,0,0,0 }, ... % 1 291 + {'uint64','band', 0,0,0,0 }, ... % 1 292 + {'uint64','bxor', 0,0,0,0 }, ... % 1 293 + {'uint64','bxnor', 0,0,0,0 }, ... % 1 294 + {'uint64','bget', 0,0,0,0 }, ... % 1 295 + {'uint64','bset', 0,0,0,0 }, ... % 1 296 + {'uint64','bclr', 0,0,0,0 }, ... % 1 297 + {'single','first', 0,0,0,0 }, ... % 1 298 + {'single','second', 0,0,0,0 }, ... % 1 299 + {'single','plus', 0,0,0,0 }, ... % 1 300 + {'single','minus', 0,0,0,0 }, ... % 1 301 + {'single','rminus', 0,0,0,0 }, ... % 1 302 + {'single','times', 0,0,0,0 }, ... % 1 303 + {'single','div', 0,0,0,0 }, ... % 1 304 + {'single','rdiv', 0,0,0,0 }, ... % 1 305 + {'single','iseq', 0,0,0,0 }, ... % 1 306 + {'single','isne', 0,0,0,0 }, ... % 1 307 + {'single','eq', 0,0,0,0 }, ... % 1 308 + {'single','ne', 0,0,0,0 }, ... % 1 309 + {'single','pow', 0,0,0,0 }, ... % 1 310 + {'single','min', 0,0,0,0 }, ... % 1 311 + {'single','max', 0,0,0,0 }, ... % 1 312 + {'single','isgt', 0,0,0,0 }, ... % 1 313 + {'single','islt', 0,0,0,0 }, ... % 1 314 + {'single','isge', 0,0,0,0 }, ... % 1 315 + {'single','isle', 0,0,0,0 }, ... % 1 316 + {'single','gt', 0,0,0,0 }, ... % 1 317 + {'single','lt', 0,0,0,0 }, ... % 1 318 + {'single','ge', 0,0,0,0 }, ... % 1 319 + {'single','le', 0,0,0,0 }, ... % 1 320 + {'single','or', 0,0,0,0 }, ... % 1 321 + {'single','and', 0,0,0,0 }, ... % 1 322 + {'single','xor', 0,0,0,0 }, ... % 1 323 + {'single','atan2', 0,0,0,0 }, ... % 1 324 + {'single','hypot', 0,0,0,0 }, ... % 1 325 + {'single','fmod', 0,0,0,0 }, ... % 1 326 + {'single','remainder', 0,0,0,0 }, ... % 1 327 + {'single','ldexp', 0,0,0,0 }, ... % 1 328 + {'single','copysign', 0,0,0,0 }, ... % 1 329 + {'single','cmplx', 0,0,0,0 }, ... % 1 330 + {'double','minus', 0,0,0,0 }, ... % 1 331 + {'double','rminus', 0,0,0,0 }, ... % 1 332 + {'double','times', 0,0,0,0 }, ... % 1 333 + {'double','div', 0,0,0,0 }, ... % 1 334 + {'double','rdiv', 0,0,0,0 }, ... % 1 335 + {'double','iseq', 0,0,0,0 }, ... % 1 336 + {'double','isne', 0,0,0,0 }, ... % 1 337 + {'double','eq', 0,0,0,0 }, ... % 1 338 + {'double','ne', 0,0,0,0 }, ... % 1 339 + {'double','pow', 0,0,0,0 }, ... % 1 340 + {'double','min', 0,0,0,0 }, ... % 1 341 + {'double','max', 0,0,0,0 }, ... % 1 342 + {'double','isgt', 0,0,0,0 }, ... % 1 343 + {'double','islt', 0,0,0,0 }, ... % 1 344 + {'double','isge', 0,0,0,0 }, ... % 1 345 + {'double','isle', 0,0,0,0 }, ... % 1 346 + {'double','gt', 0,0,0,0 }, ... % 1 347 + {'double','lt', 0,0,0,0 }, ... % 1 348 + {'double','ge', 0,0,0,0 }, ... % 1 349 + {'double','le', 0,0,0,0 }, ... % 1 350 + {'double','or', 0,0,0,0 }, ... % 1 351 + {'double','and', 0,0,0,0 }, ... % 1 352 + {'double','xor', 0,0,0,0 }, ... % 1 353 + {'double','atan2', 0,0,0,0 }, ... % 1 354 + {'double','hypot', 0,0,0,0 }, ... % 1 355 + {'double','fmod', 0,0,0,0 }, ... % 1 356 + {'double','remainder', 0,0,0,0 }, ... % 1 357 + {'double','ldexp', 0,0,0,0 }, ... % 1 358 + {'double','copysign', 0,0,0,0 }, ... % 1 359 + {'double','cmplx', 0,0,0,0 }, ... % 1 360 + {'single complex','plus', 0,0,0,0 }, ... % 1 361 + {'single complex','minus', 0,0,0,0 }, ... % 1 362 + {'single complex','rminus', 0,0,0,0 }, ... % 1 363 + {'single complex','times', 0,0,0,0 }, ... % 1 364 + {'single complex','div', 0,0,0,0 }, ... % 1 365 + {'single complex','rdiv', 0,0,0,0 }, ... % 1 366 + {'single complex','iseq', 0,0,0,0 }, ... % 1 367 + {'single complex','isne', 0,0,0,0 }, ... % 1 368 + {'single complex','eq', 0,0,0,0 }, ... % 1 369 + {'single complex','ne', 0,0,0,0 }, ... % 1 370 + {'single complex','pow', 0,0,0,0 }, ... % 1 371 + {'double complex','first', 0,0,0,0 }, ... % 1 372 + {'double complex','second', 0,0,0,0 }, ... % 1 373 + {'double complex','plus', 0,0,0,0 }, ... % 1 374 + {'double complex','minus', 0,0,0,0 }, ... % 1 375 + {'double complex','rminus', 0,0,0,0 }, ... % 1 376 + {'double complex','times', 0,0,0,0 }, ... % 1 377 + {'double complex','div', 0,0,0,0 }, ... % 1 378 + {'double complex','rdiv', 0,0,0,0 }, ... % 1 379 + {'double complex','iseq', 0,0,0,0 }, ... % 1 380 + {'double complex','isne', 0,0,0,0 }, ... % 1 381 + {'double complex','eq', 0,0,0,0 }, ... % 1 382 + {'double complex','ne', 0,0,0,0 }, ... % 1 383 + {'double complex','pow', 0,0,0,0 }} ; % 1 384 +end -fprintf ('test234 -----------tests of GxB_eWiseUnion (all ops)\n') ; +ntasks = length (tasks) ; +fprintf ('test234 -----------tests of GxB_eWiseUnion (tasks: %d)\n', ntasks) ; m = 5 ; n = 5 ; @@ -75,192 +447,186 @@ end clear T i j x -for k1 = 1:length (types) - type = types {k1} ; - fprintf ('\n\n%-8s : ', type) ; - - for k2 = 1:length(binops) - binop = binops {k2} ; - - op.opname = binop ; - op.optype = type ; - - if (test_contains (type, 'single')) - tol = 1e-5 ; - elseif (test_contains (type, 'double')) - tol = 1e-12 ; - else - tol = 0 ; - end - - try - GB_spec_operator (op) ; - catch - continue ; - end - - fprintf (' %s', binop) ; - - for A_sparsity_control = 0:1 - for A_is_csc = 0 % 0:1 - for B_sparsity_control = 0:1 - for B_is_csc = 0 % 0:1 - for C_sparsity_control = 0:1 - for C_is_csc = 0 % 0:1 - - if (A_sparsity_control == 0) - A_is_hyper = 0 ; % not hyper - A_sparsity = 1 ; % sparse - else - A_is_hyper = 0 ; % not hyper - A_sparsity = 4 ; % bitmap - end +A_is_csc = 0 ; +B_is_csc = 0 ; +C_is_csc = 0 ; - if (B_sparsity_control == 0) - B_is_hyper = 0 ; % not hyper - B_sparsity = 1 ; % sparse - else - B_is_hyper = 0 ; % not hyper - B_sparsity = 4 ; % bitmap - end +M_is_very_sparse = 0 ; +M_is_csc = 0 ; - if (C_sparsity_control == 0) - C_is_hyper = 0 ; % not hyper - C_sparsity = 1 ; % sparse - else - C_is_hyper = 0 ; % not hyper - C_sparsity = 4 ; % bitmap - end - - for native = 1 % 0:1 - - clear A B C u v - - if (isequal (binop, 'pow')) - A.matrix = Amat2 ; - B.matrix = Bmat2 ; - C.matrix = Cmat2 ; - u.matrix = uvec2 ; - v.matrix = vvec2 ; - else - A.matrix = Amat ; - B.matrix = Bmat ; - C.matrix = Cmat ; - u.matrix = uvec ; - v.matrix = vvec ; - end - - A.is_hyper = A_is_hyper ; - A.is_csc = A_is_csc ; - A.sparsity = A_sparsity ; - if (native) - A.class = op.optype ; - end - a0 = GB_mex_cast (1, op.optype) ; - - B.is_hyper = B_is_hyper ; - B.sparsity = B_sparsity ; - B.is_csc = B_is_csc ; - if (native) - B.class = op.optype ; - end - b0 = GB_mex_cast (2, op.optype) ; - - C.is_hyper = C_is_hyper ; - C.is_csc = C_is_csc ; - C.sparsity = C_sparsity ; - - u.is_csc = true ; - if (native) - u.class = op.optype ; - end - u0 = GB_mex_cast (1, op.optype) ; - - v.is_csc = true ; - if (native) - v.class = op.optype ; - end - v0 = GB_mex_cast (2, op.optype) ; - - %--------------------------------------- - % A+B - %--------------------------------------- - - C0 = GB_spec_Matrix_eWiseUnion (C, [ ], [ ], op, A, a0, B, b0, dnn) ; - C1 = GB_mex_Matrix_eWiseUnion (C, [ ], [ ], op, A, a0, B, b0, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; - - w0 = GB_spec_Vector_eWiseUnion (w, [ ], [ ], op, u, u0, v, v0, dnn) ; - w1 = GB_mex_Vector_eWiseUnion (w, [ ], [ ], op, u, u0, v, v0, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; - - %----------------------------------------------- - % with mask - %----------------------------------------------- - - for M_is_very_sparse = 0 % 0:1 - % for M_is_hyper = 0 % 0:1 - for M_sparsity_control = 0:1 - for M_is_csc = 0 % 0:1 - - clear Mask mask - if (M_is_very_sparse) - Mask.matrix = Maskmat2 ; - mask.matrix = maskvec2 ; - else - Mask.matrix = Maskmat ; - mask.matrix = maskvec ; - end - - if (M_sparsity_control == 0) - M_is_hyper = 0 ; % not hyper - M_sparsity = 1 ; % sparse - else - M_is_hyper = 0 ; % not hyper - M_sparsity = 4 ; % bitmap - end +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end - Mask.is_hyper = M_is_hyper ; - Mask.sparsity = M_sparsity ; - Mask.is_csc = M_is_csc ; - mask.is_csc = true ; +for k1 = 1:ntasks + task = tasks {k1} ; + type = task {1} ; + binop = task {2} ; + A_sparsity_control = task {3} ; + B_sparsity_control = task {4} ; + C_sparsity_control = task {5} ; + M_sparsity_control = task {6} ; + + op.opname = binop ; + op.optype = type ; + + if (test_contains (type, 'single')) + tol = 1e-5 ; + elseif (test_contains (type, 'double')) + tol = 1e-12 ; + else + tol = 0 ; + end - %--------------------------------------- - % A+B, with mask - %--------------------------------------- + try + GB_spec_operator (op) ; + catch + continue ; + end - C0 = GB_spec_Matrix_eWiseUnion (C, Mask, [ ], op, A, a0, B, b0, dnn) ; - C1 = GB_mex_Matrix_eWiseUnion (C, Mask, [ ], op, A, a0, B, b0, dnn) ; - GB_spec_compare (C0, C1, 0, tol) ; + if (A_sparsity_control == 0) + A_is_hyper = 0 ; % not hyper + A_sparsity = 1 ; % sparse + else + A_is_hyper = 0 ; % not hyper + A_sparsity = 4 ; % bitmap + end - w0 = GB_spec_Vector_eWiseUnion (w, mask, [ ], op, u, u0, v, v0, dnn) ; - w1 = GB_mex_Vector_eWiseUnion (w, mask, [ ], op, u, u0, v, v0, dnn) ; - GB_spec_compare (w0, w1, 0, tol) ; + if (B_sparsity_control == 0) + B_is_hyper = 0 ; % not hyper + B_sparsity = 1 ; % sparse + else + B_is_hyper = 0 ; % not hyper + B_sparsity = 4 ; % bitmap + end - %--------------------------------------- - % A+B, with mask complemented - %--------------------------------------- + if (C_sparsity_control == 0) + C_is_hyper = 0 ; % not hyper + C_sparsity = 1 ; % sparse + else + C_is_hyper = 0 ; % not hyper + C_sparsity = 4 ; % bitmap + end - C0 = GB_spec_Matrix_eWiseUnion (C, Mask, [ ], op, A, a0, B, b0, dnn_notM) ; - C1 = GB_mex_Matrix_eWiseUnion (C, Mask, [ ], op, A, a0, B, b0, dnn_notM) ; - GB_spec_compare (C0, C1, 0, tol) ; + clear A B C u v + + if (isequal (binop, 'pow')) + A.matrix = Amat2 ; + B.matrix = Bmat2 ; + C.matrix = Cmat2 ; + u.matrix = uvec2 ; + v.matrix = vvec2 ; + else + A.matrix = Amat ; + B.matrix = Bmat ; + C.matrix = Cmat ; + u.matrix = uvec ; + v.matrix = vvec ; + end - w0 = GB_spec_Vector_eWiseUnion (w, mask, [ ], op, u, u0, v, v0, dnn_notM) ; - w1 = GB_mex_Vector_eWiseUnion (w, mask, [ ], op, u, u0, v, v0, dnn_notM) ; - GB_spec_compare (w0, w1, 0, tol) ; + A.is_hyper = A_is_hyper ; + A.is_csc = A_is_csc ; + A.sparsity = A_sparsity ; + A.class = op.optype ; + a0 = GB_mex_cast (1, op.optype) ; + + B.is_hyper = B_is_hyper ; + B.sparsity = B_sparsity ; + B.is_csc = B_is_csc ; + B.class = op.optype ; + b0 = GB_mex_cast (2, op.optype) ; + + C.is_hyper = C_is_hyper ; + C.is_csc = C_is_csc ; + C.sparsity = C_sparsity ; + + u.is_csc = true ; + u.class = op.optype ; + u0 = GB_mex_cast (1, op.optype) ; + + v.is_csc = true ; + v.class = op.optype ; + v0 = GB_mex_cast (2, op.optype) ; + + %--------------------------------------- + % A+B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseUnion (C, [ ], [ ], op, A, a0, B, b0, dnn) ; + C1 = GB_mex_Matrix_eWiseUnion (C, [ ], [ ], op, A, a0, B, b0, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseUnion (w, [ ], [ ], op, u, u0, v, v0, dnn) ; + w1 = GB_mex_Vector_eWiseUnion (w, [ ], [ ], op, u, u0, v, v0, dnn) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %----------------------------------------------- + % with mask + %----------------------------------------------- + + clear Mask mask + if (M_is_very_sparse) + Mask.matrix = Maskmat2 ; + mask.matrix = maskvec2 ; + else + Mask.matrix = Maskmat ; + mask.matrix = maskvec ; + end + if (M_sparsity_control == 0) + M_is_hyper = 0 ; % not hyper + M_sparsity = 1 ; % sparse + else + M_is_hyper = 0 ; % not hyper + M_sparsity = 4 ; % bitmap + end + Mask.is_hyper = M_is_hyper ; + Mask.sparsity = M_sparsity ; + Mask.is_csc = M_is_csc ; + mask.is_csc = true ; + + %--------------------------------------- + % A+B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseUnion (C, Mask, [ ], op, A, a0, B, b0, dnn) ; + C1 = GB_mex_Matrix_eWiseUnion (C, Mask, [ ], op, A, a0, B, b0, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseUnion (w, mask, [ ], op, u, u0, v, v0, dnn) ; + w1 = GB_mex_Vector_eWiseUnion (w, mask, [ ], op, u, u0, v, v0, dnn) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A+B, with mask complemented + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseUnion (C, Mask, [ ], op, A, a0, B, b0, dnn_notM) ; + C1 = GB_mex_Matrix_eWiseUnion (C, Mask, [ ], op, A, a0, B, b0, dnn_notM) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseUnion (w, mask, [ ], op, u, u0, v, v0, dnn_notM) ; + w1 = GB_mex_Vector_eWiseUnion (w, mask, [ ], op, u, u0, v, v0, dnn_notM) ; + GB_spec_compare (w0, w1, 0, tol) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf ('{''%s'',''%s'', %d,%d,%d,%d }, ... %% %d %d\n', ... + type, binop, A_sparsity_control, B_sparsity_control, ... + C_sparsity_control, M_sparsity_control, d, c-cfirst) ; end - end - end - end - end - end - end - end - end - end + clast = c ; + else + fprintf ('.') ; end + end fprintf ('\ntest234: all tests passed\n') ; diff --git a/Test/test236.m b/Test/test236.m index 475977344a..9d79314c52 100644 --- a/Test/test236.m +++ b/Test/test236.m @@ -70,6 +70,11 @@ GB_spec_compare (C1, C2) ; GB_spec_compare (P1, P2) ; + [C1,P1] = GB_mex_Matrix_sort (lt, A, desc, -1) ; + [C2,P2] = GB_spec_Matrix_sort (lt, A, desc) ; + GB_spec_compare (C1, C2) ; + GB_spec_compare (P1, P2) ; + [C1,P1] = GB_mex_Matrix_sort (gt, A, desc) ; [C2,P2] = GB_spec_Matrix_sort (gt, A, desc) ; GB_spec_compare (C1, C2) ; @@ -146,19 +151,37 @@ fprintf (' typecast') ; lt.optype = 'single' ; gt.optype = 'single' ; -A = GB_spec_random (m, n, 0.3, 100, 'double', is_csc) ; -fprintf ('.') ; -[C1,P1] = GB_mex_Matrix_sort (lt, A) ; -[C2,P2] = GB_spec_Matrix_sort (lt, A, [ ]) ; -GB_spec_compare (C1, C2) ; -GB_spec_compare (P1, P2) ; + A = GB_spec_random (m, n, 0.3, 100, 'double', is_csc) ; -fprintf ('.') ; -[C1,P1] = GB_mex_Matrix_sort (gt, A) ; -[C2,P2] = GB_spec_Matrix_sort (gt, A, [ ]) ; -GB_spec_compare (C1, C2) ; -GB_spec_compare (P1, P2) ; + fprintf ('.') ; + [C1,P1] = GB_mex_Matrix_sort (lt, A) ; + [C2,P2] = GB_spec_Matrix_sort (lt, A, [ ]) ; + GB_spec_compare (C1, C2) ; + GB_spec_compare (P1, P2) ; + + fprintf ('.') ; + [C1,P1] = GB_mex_Matrix_sort (gt, A) ; + [C2,P2] = GB_spec_Matrix_sort (gt, A, [ ]) ; + GB_spec_compare (C1, C2) ; + GB_spec_compare (P1, P2) ; + +% with typecasing, to bool +lt.optype = 'bool' ; + + A.matrix = double (A.matrix > 0) ; + A.pattern = logical (spones (A.matrix)) ; + + fprintf ('.') ; + [C1,P1] = GB_mex_Matrix_sort (lt, A) ; + [C2,P2] = GB_spec_Matrix_sort (lt, A, [ ]) ; + GB_spec_compare (C1, C2) ; + GB_spec_compare (P1, P2) ; + +lt.opname = 'lt' ; +gt.opname = 'gt' ; +lt.optype = 'double' ; +gt.optype = 'double' ; % matrix with large vectors fprintf (' large') ; @@ -166,7 +189,6 @@ n = 2 ; A = sparse (rand (m, n)) ; A (:,2) = sprand (m, 1, 0.02) ; -lt.optype = 'double' ; fprintf ('.') ; [C1,P1] = GB_mex_Matrix_sort (lt, A, desc) ; diff --git a/Test/test238.m b/Test/test238.m index fc75a5b201..0ca4581762 100644 --- a/Test/test238.m +++ b/Test/test238.m @@ -1,49 +1,118 @@ -function test238 +function test238(tasks) %TEST238 test GrB_mxm (dot4 and dot2) -% 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 +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 1, 1, 1, 2}, ... % ( 5, 5) + { 1, 1, 1, 3}, ... % ( 2, 7) + { 1, 1, 1, 4}, ... % ( 2, 9) + { 1, 1, 1, 5}, ... % ( 1, 10) + { 1, 1, 4, 1}, ... % ( 1, 11) + { 1, 1, 4, 2}, ... % ( 2, 13) + { 1, 1, 4, 4}, ... % ( 1, 14) + { 1, 1, 8, 1}, ... % ( 1, 15) + { 1, 1, 8, 2}, ... % ( 2, 17) + { 1, 1, 8, 4}, ... % ( 2, 19) + { 1, 4, 1, 2}, ... % ( 2, 21) + { 1, 4, 1, 4}, ... % ( 1, 22) + { 1, 4, 4, 2}, ... % ( 2, 24) + { 1, 4, 4, 4}, ... % ( 1, 25) + { 1, 4, 8, 2}, ... % ( 2, 27) + { 1, 4, 8, 4}, ... % ( 2, 29) + { 1, 8, 1, 1}, ... % ( 1, 30) + { 1, 8, 1, 2}, ... % ( 2, 32) + { 1, 8, 1, 4}, ... % ( 2, 34) + { 1, 8, 4, 2}, ... % ( 2, 36) + { 1, 8, 4, 4}, ... % ( 2, 38) + { 1, 8, 8, 1}, ... % ( 1, 39) + { 1, 8, 8, 2}, ... % ( 2, 41) + { 1, 8, 8, 4}, ... % ( 2, 43) + { 4, 1, 1, 2}, ... % ( 1, 44) + { 4, 1, 1, 3}, ... % ( 1, 45) + { 4, 1, 1, 4}, ... % ( 1, 46) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; + orig = GraphBLAS_grbcov ; +end + rng ('default') ; desc.inp0 = 'tran' ; n = 8 ; -for k = [1 2 4 8 32] - fprintf ('\n%2d', k) ; - for iso = [0 1] +% create the test matrices +AA {1} = GB_spec_random (n, n, inf) ; +AA {2} = GB_spec_random (n, n, 0.3) ; +for k = [1 2 4] % [1 2 4 8 32] + FF {k} = GB_spec_random (n, k, inf) ; + BB {k,1} = GB_spec_random (n, k, inf) ; + BB {k,2} = GB_spec_random (n, k, 0.3) ; +end + +iso = 0 ; + +for kk = 1:length(tasks) + task = tasks {kk} ; + k = task {1} ; + A_sparsity = task {2} ; + B_sparsity = task {3} ; + trial = task {4} ; +% end + +% for k = [1 2 4] % [1 2 4 8 32] + C0 = sparse (n,k) ; +% fprintf ('\n%2d', k) ; +% for iso = 0 % [0 1] clear F if (iso) F.matrix = pi * ones (n,k) ; else - F = GB_spec_random (n, k, inf) ; + F = FF {k} ; +% F = GB_spec_random (n, k, inf) ; end F.sparsity = 8 ; % full F.iso = iso ; - C0 = sparse (n,k) ; - for A_sparsity = [1 2 4 8] - for B_sparsity = [1 2 4 8] +% for A_sparsity = [1 2 4 8] +% for B_sparsity = [1 2 4 8] - fprintf ('.') ; +% fprintf ('.') ; clear A B if (A_sparsity == 8) - A = GB_spec_random (n, n, inf) ; + A = AA {1} ; +% A = GB_spec_random (n, n, inf) ; else - A = GB_spec_random (n, n, 0.3) ; + A = AA {2} ; +% A = GB_spec_random (n, n, 0.3) ; end A.sparsity = A_sparsity ; if (B_sparsity == 8) - B = GB_spec_random (n, k, inf) ; + B = BB {k,1} ; +% B = GB_spec_random (n, k, inf) ; else - B = GB_spec_random (n, k, 0.3) ; + B = BB {k,2} ; +% B = GB_spec_random (n, k, 0.3) ; end B.sparsity = B_sparsity ; - for trial = 1:5 +% for trial = 1:5 if (trial == 1) % plus_times_double @@ -69,15 +138,37 @@ F.class = 'int64' ; elseif (trial == 3) % max_firstj1_int64 + accum.opname = 'max' ; + accum.optype = 'int64' ; semiring.multiply = 'firstj1' ; + semiring.add = 'max' ; + semiring.class = 'int64' ; + tol = 0 ; + A.class = 'int64' ; + B.class = 'int64' ; + F.class = 'int64' ; elseif (trial == 4) % min_firstj_int64 accum.opname = 'min' ; + accum.optype = 'int64' ; semiring.add = 'min' ; semiring.multiply = 'firstj' ; + semiring.class = 'int64' ; + tol = 0 ; + A.class = 'int64' ; + B.class = 'int64' ; + F.class = 'int64' ; else % min_firstj1_int64 + accum.opname = 'min' ; + accum.optype = 'int64' ; semiring.multiply = 'firstj1' ; + semiring.add = 'min' ; + semiring.class = 'int64' ; + tol = 0 ; + A.class = 'int64' ; + B.class = 'int64' ; + F.class = 'int64' ; end % C = F ; C += A'*B, using dot4 @@ -90,11 +181,35 @@ C2 = GB_spec_mxm (C0, [ ], [ ], semiring, A, B, desc) ; GB_spec_compare (C1, C2, tol) ; - end - end - end - end + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf (' {%2d, %d, %d, %d},', ... + k, A_sparsity, B_sparsity, trial) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + +% end +% end +% end +% end end +%{ +fini = GraphBLAS_grbcov ; +o = find (orig > 0) ; +f = find (fini > 0) ; +% setdiff (f,o)' +% save t2 orig fini +tt = load ('t2.mat') ; +fgood = find (tt.fini > 0) ; +setdiff (fgood, f)' + 1 +%} + fprintf ('\ntest238: all tests passed\n') ; diff --git a/Test/test238b.m b/Test/test238b.m new file mode 100644 index 0000000000..bf030385fe --- /dev/null +++ b/Test/test238b.m @@ -0,0 +1,23 @@ +function test238b(tasks) +%TEST238B test GrB_mxm (dot4 and dot2) + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 1, 1, 1, 2}, ... % ( 8, 8) + { 1, 1, 1, 3}, ... % ( 3, 11) + { 1, 1, 1, 4}, ... % ( 1, 12) + } ; +end + +test238 (tasks) ; + +fprintf ('\ntest238: all tests passed\n') ; + + diff --git a/Test/test244.m b/Test/test244.m index ff12caebec..68883f7692 100644 --- a/Test/test244.m +++ b/Test/test244.m @@ -1,39 +1,80 @@ -function test244 +function test244(tasks) %TEST244 test reshape -% 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 +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 'double', 6, 6, 1, 1, 0, 0}, ... % ( 15, 15) + { 'double', 6, 6, 1, 4, 0, 0}, ... % ( 2, 17) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + rng ('default') [~, ~, ~, types, ~, ~] = GB_spec_opsall ; types = types.all ; -for k1 = 1:length(types) - type = types {k1} ; - fprintf ('\n%-14s ', type) ; +% create the test matrices +densities = [0.3 inf] ; +for m = 6 % [1 2 6] % 1:6 + for n = 6 % [1 2 6] % 1:6 + for kd = 1:2 + AA {m,n,kd} = GB_spec_random (m, n, densities (kd), 99) ; + end + end +end + +for kk = 1:length(tasks) + task = tasks {kk} ; + type = task {1} ; + m = task {2} ; + m = task {3} ; + kd = task {4} ; + sparsity = task {5} ; + is_csc = task {6} ; + iso = task {7} ; +% end - for m = [1 2 6] % 1:6 - for n = [1 2 6] % 1:6 +% for k1 = 1:length(types) +% type = types {k1} ; +% fprintf ('\n%-14s ', type) ; + +% for m = 6 % [1 2 6] % 1:6 +% for n = 6 % [1 2 6] % 1:6 mn = m*n ; f = factor (mn) ; - for d = [0.3 inf] - A = GB_spec_random (m, n, d, 99, type) ; - fprintf ('.') ; - for sparsity = [1 2 4 8] + +% for d = [0.3 inf] +% for kd = 1:2 + + A = AA {m,n,kd} ; % GB_spec_random (m, n, d, 99, type) ; +% fprintf ('.') ; +% for sparsity = [1 2 4 8] A.sparsity = sparsity ; - for is_csc = [0 1] +% for is_csc = [0 1] A.is_csc = is_csc ; - for iso = [false true] +% for iso = [false true] A.iso = iso ; for k = 1:length (f) S = nchoosek (f, k) ; for i = 1:size(S,1) - m2 = prod (S (i,:)) ; n2 = mn / m2 ; - % reshape by column C1 = A ; x = 1 ; @@ -43,13 +84,11 @@ end C1.matrix = reshape (C1.matrix, m2, n2) ; C1.pattern = reshape (C1.pattern, m2, n2) ; - for inplace = [false true] C2 = GB_mex_reshape (A, m2, n2, ... true, inplace) ; GB_spec_compare (C1, C2, 0) ; end - % reshape by row C1 = A ; if (iso) @@ -64,12 +103,27 @@ end end end - end - end - end - end + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + tt = sprintf ('''%s''', type) ; + fprintf ('{%16s, %2d, %2d, %d, %d, %d, %d},', ... + tt, m, n, kd, sparsity, is_csc, iso) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; end + clast = c ; + else + fprintf ('.') ; end + +% end +% end +% end +% end +% end +% end end fprintf ('\ntest244: all tests passed\n') ; diff --git a/Test/test246.m b/Test/test246.m index aee856a046..fe2214b54a 100644 --- a/Test/test246.m +++ b/Test/test246.m @@ -1,9 +1,16 @@ function test246 (dohack) -%TEST246 test GrB_mxm with different kinds of parallelism - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +%TEST246 test GrB_mxm (for GB_AxB_saxpy3_fineHash_phase2.c) +% +% This tests the "if (hf == i_unlocked) // f == 2" case in the last block of +% code in GB_AxB_saxpy3_fineHash_phase2.c. The test is nondeterministic so +% it the test coverage might vary, or even be zero. See also test247.m. +% It is thus run for many trials below. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 +fprintf ('test246: testing of GB_AxB_saxpy3_fineHash_phase2.c\n') ; + rng ('default') ; n = 1000 ; @@ -21,7 +28,6 @@ function test246 (dohack) end hack (1) = dohack ; % modify "very_costly" in GxB_AxB_saxpy3_slice_balanced GB_mex_hack (hack) ; -GB_mex_burble (0) ; semiring.multiply = 'times' ; semiring.add = 'plus' ; @@ -61,6 +67,8 @@ function test246 (dohack) nthreads_set (threads, 1) ; fprintf ('.') ; + for trial = 1:5 + % no mask C1 = A*B ; C2 = GB_mex_mxm (S, [ ], [ ], semiring, A, B, desc) ; @@ -78,6 +86,7 @@ function test246 (dohack) err = norm (C1 - C2.matrix, 1) / max (1, norm (C1, 1)) ; assert (err < 1e-12) + end end end end @@ -85,7 +94,6 @@ function test246 (dohack) end % restore global settings -GB_mex_burble (0) ; nthreads_set (nthreads_save, chunk_save) ; GB_mex_hack (save) ; diff --git a/Test/test247.m b/Test/test247.m index 5b9afcac3e..ca0ce96433 100644 --- a/Test/test247.m +++ b/Test/test247.m @@ -1,35 +1,44 @@ function test247 -%TEST247 test saxpy3 fine-hash method - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +%TEST247 test GrB_mxm (for GB_AxB_saxpy3_fineHash_phase2.c) +% +% This tests the "if (hf == i_unlocked) // f == 2" case in the last block of +% code in GB_AxB_saxpy3_fineHash_phase2.c. The test is nondeterministic so +% it the test coverage might vary, or even be zero. See also test246.m. +% It is thus run many times. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 rng ('default') ; -n = 1000000 ; -A.matrix = sparse (n, n) ; -B.matrix = sprand (n, 1, 0.01) ; -A.matrix (1:100, 1:100) = sprand (100, 100, 0.4) ; -S = sparse (n, 1) ; +fprintf ('test247: testing of GB_AxB_saxpy3_fineHash_phase2.c\n') ; + +for trial = 1:40 + + n = 1000000 ; + A.matrix = sparse (n, n) ; + B.matrix = sprand (n, 1, 0.01) ; + A.matrix (1:100, 1:100) = sprand (100, 100, 0.4) ; + S = sparse (n, 1) ; + + semiring.multiply = 'times' ; + semiring.add = 'plus' ; + semiring.class = 'double' ; -semiring.multiply = 'times' ; -semiring.add = 'plus' ; -semiring.class = 'double' ; + [nth chk] = nthreads_get ; -[nth chk] = nthreads_get ; + desc.axb = 'hash' ; + nthreads_set (16, 1) ; + C1 = GB_mex_mxm (S, [ ], [ ], semiring, A, B, desc) ; -desc.axb = 'hash' ; -nthreads_set (16, 1) ; -GB_mex_burble (1) ; -C1 = GB_mex_mxm (S, [ ], [ ], semiring, A, B, desc) ; -GB_mex_burble (0) ; + C2 = A.matrix * B.matrix ; + err = norm (C1.matrix - C2, 1) ; + assert (err < 1e-12) ; -C2 = A.matrix * B.matrix ; -err = norm (C1.matrix - C2, 1) ; -fprintf ('err: %g\n', err) ; -assert (err < 1e-12) ; + nthreads_set (nth, chk) ; -nthreads_set (nth, chk) ; + fprintf ('.') ; +end fprintf ('\ntest247: all tests passed\n') ; diff --git a/Test/test251.m b/Test/test251.m index d22753085a..60fa7b1274 100644 --- a/Test/test251.m +++ b/Test/test251.m @@ -1,14 +1,110 @@ -function test251 +function test251(tasks) %TEST251 test dot4 for plus-pair semirings % GB_AxB_dot4 computes C+=A'*B when C is dense. -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 +% NOTE: test coverage should start with an empty JIT cache. + fprintf ('test251 ------------ C+=A''*B when C is dense (plus-pair)\n') ; +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 0, 1, 1}, ... % ( 98, 98) + { 1, 1, 1}, ... % ( 22, 120) + { 2, 1, 1}, ... % ( 13, 133) + { 3, 1, 1}, ... % ( 31, 164) + { 4, 1, 1}, ... % ( 11, 175) + { 5, 1, 1}, ... % ( 11, 186) + { 6, 1, 1}, ... % ( 13, 199) + { 7, 1, 1}, ... % ( 18, 217) + { 8, 1, 1}, ... % ( 13, 230) + { 9, 1, 1}, ... % ( 9, 239) + {10, 1, 1}, ... % ( 9, 248) + {11, 1, 1}, ... % ( 4, 252) + {12, 1, 1}, ... % ( 16, 268) + {13, 1, 1}, ... % ( 17, 285) + { 0, 1, 2}, ... % ( 7, 292) + { 0, 1, 4}, ... % ( 16, 308) + { 1, 1, 4}, ... % ( 2, 310) + { 2, 1, 4}, ... % ( 1, 311) + { 3, 1, 4}, ... % ( 1, 312) + { 4, 1, 4}, ... % ( 1, 313) + { 5, 1, 4}, ... % ( 1, 314) + { 6, 1, 4}, ... % ( 1, 315) + { 7, 1, 4}, ... % ( 1, 316) + { 8, 1, 4}, ... % ( 1, 317) + { 9, 1, 4}, ... % ( 1, 318) + {10, 1, 4}, ... % ( 1, 319) + {11, 1, 4}, ... % ( 1, 320) + {12, 1, 4}, ... % ( 1, 321) + {13, 1, 4}, ... % ( 1, 322) + { 0, 1, 8}, ... % ( 5, 327) + { 1, 1, 8}, ... % ( 1, 328) + { 2, 1, 8}, ... % ( 2, 330) + { 4, 1, 8}, ... % ( 2, 332) + { 5, 1, 8}, ... % ( 2, 334) + { 0, 2, 1}, ... % ( 5, 339) + { 0, 2, 2}, ... % ( 1, 340) + { 0, 4, 1}, ... % ( 8, 348) + { 1, 4, 1}, ... % ( 3, 351) + { 2, 4, 1}, ... % ( 1, 352) + { 3, 4, 1}, ... % ( 1, 353) + { 4, 4, 1}, ... % ( 1, 354) + { 5, 4, 1}, ... % ( 1, 355) + { 6, 4, 1}, ... % ( 1, 356) + { 7, 4, 1}, ... % ( 1, 357) + { 8, 4, 1}, ... % ( 1, 358) + { 9, 4, 1}, ... % ( 1, 359) + {10, 4, 1}, ... % ( 1, 360) + {11, 4, 1}, ... % ( 1, 361) + {12, 4, 1}, ... % ( 1, 362) + {13, 4, 1}, ... % ( 1, 363) + { 1, 4, 2}, ... % ( 2, 365) + { 0, 4, 4}, ... % ( 14, 379) + { 2, 4, 4}, ... % ( 1, 380) + { 3, 4, 4}, ... % ( 1, 381) + { 4, 4, 4}, ... % ( 1, 382) + { 5, 4, 4}, ... % ( 1, 383) + { 6, 4, 4}, ... % ( 1, 384) + { 7, 4, 4}, ... % ( 1, 385) + { 8, 4, 4}, ... % ( 1, 386) + { 9, 4, 4}, ... % ( 1, 387) + {10, 4, 4}, ... % ( 1, 388) + {11, 4, 4}, ... % ( 1, 389) + {12, 4, 4}, ... % ( 1, 390) + {13, 4, 4}, ... % ( 1, 391) + { 0, 4, 8}, ... % ( 3, 394) + { 0, 8, 1}, ... % ( 5, 399) + { 1, 8, 1}, ... % ( 4, 403) + { 2, 8, 1}, ... % ( 2, 405) + { 4, 8, 1}, ... % ( 2, 407) + { 5, 8, 1}, ... % ( 2, 409) + { 0, 8, 2}, ... % ( 1, 410) + { 1, 8, 2}, ... % ( 1, 411) + { 0, 8, 4}, ... % ( 3, 414) + { 0, 8, 8}, ... % ( 3, 417) + { 1, 8, 8}, ... % ( 1, 418) + { 2, 8, 8}, ... % ( 2, 420) + { 4, 8, 8}, ... % ( 2, 422) + { 5, 8, 8}, ... % ( 2, 424) + } ; +end + +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + rng ('default') ; -GB_mex_burble (0) ; plus_pair.add = 'plus' ; plus_pair.multiply = 'oneb' ; % same as pair @@ -24,74 +120,90 @@ C.sparsity = 8 ; C0.matrix = sparse (n, n) ; +% create the test matrices +A_matrices = cell (8) ; +B_matrices = cell (8,8) ; for A_sparsity = [1 2 4 8] if (A_sparsity == 8) A = GB_spec_random (n, n, inf, 100, 'double') ; else A = GB_spec_random (n, n, 0.1, 100, 'double') ; end - A.sparsity = A_sparsity ; - + A_matrices {A_sparsity} = A ; for B_sparsity = [1 2 4 8] if (B_sparsity == 8) B = GB_spec_random (n, n, inf, 100, 'double') ; else B = GB_spec_random (n, n, 0.1, 100, 'double') ; end - B.sparsity = B_sparsity ; - - for k = 0:length(types) - if (k == 0) - type = 'logical' ; - add_op.opname = 'xor' ; - plus_pair.add = 'xor' ; - else - type = types {k} ; - add_op.opname = 'plus' ; - plus_pair.add = 'plus' ; - end - plus_pair.class = type ; - add_op.optype = type ; - if (test_contains (type, 'single')) - tol = 1e-5 ; - else - tol = 1e-10 ; - end - fprintf ('.') ; - - for k2 = 1 % 1:2 - if (k2 == 1) - A.class = type ; - B.class = type ; - C0.class = type ; - C.class = type ; - else - A.class = 'double' ; - B.class = 'double' ; - C0.class = 'double' ; - C.class = 'double' ; - end - - % X = C + A'*B using dot4 - X2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; - X1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; - GB_spec_compare (X1, X2, 0, tol) ; - - % X = A'*B using dot2/dot3 - X2 = GB_mex_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; - X1 = GB_spec_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; - GB_spec_compare (X1, X2, 0, tol) ; - - % X = C + A'*B using saxpy - X2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_sax) ; - X1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_sax) ; - GB_spec_compare (X1, X2) ; - end + B_matrices {A_sparsity,B_sparsity} = B ; + end +end + +for kk = 1:length(tasks) + task = tasks {kk} ; + k = task {1} ; + A_sparsity = task {2} ; + B_sparsity = task {3} ; + + A = A_matrices {A_sparsity} ; + A.sparsity = A_sparsity ; + + B = B_matrices {A_sparsity,B_sparsity} ; + B.sparsity = B_sparsity ; + + if (k == 0) + type = 'logical' ; + add_op.opname = 'xor' ; + plus_pair.add = 'xor' ; + else + type = types {k} ; + add_op.opname = 'plus' ; + plus_pair.add = 'plus' ; + end + plus_pair.class = type ; + add_op.optype = type ; + if (test_contains (type, 'single')) + tol = 1e-5 ; + else + tol = 1e-10 ; + end + + A.class = type ; + B.class = type ; + C0.class = type ; + C.class = type ; + + % X = C + A'*B using dot4 + X2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; + X1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; + GB_spec_compare (X1, X2, 0, tol) ; + + % X = A'*B using dot2/dot3 + X2 = GB_mex_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; + X1 = GB_spec_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; + GB_spec_compare (X1, X2, 0, tol) ; + + % X = C + A'*B using saxpy + X2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_sax) ; + X1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_sax) ; + GB_spec_compare (X1, X2) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf ('{%2d, %d, %d},', ... + k, A_sparsity, B_sparsity) ; + fprintf (' ... %% (%3d, %3d)\n', d, c-cfirst) ; end + clast = c ; + else + fprintf ('.') ; end + end fprintf ('\n') ; -GB_mex_burble (0) ; fprintf ('test251: all tests passed\n') ; diff --git a/Test/test251b.m b/Test/test251b.m new file mode 100644 index 0000000000..afa80c14f3 --- /dev/null +++ b/Test/test251b.m @@ -0,0 +1,33 @@ +function test251b(tasks) +%TEST251B test dot4 for plus-pair semirings +% GB_AxB_dot4 computes C+=A'*B when C is dense. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +% NOTE: test coverage should start with an empty JIT cache. + +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + { 0, 1, 1}, ... % ( 32, 32) + { 1, 1, 1}, ... % ( 4, 36) + { 2, 1, 1}, ... % ( 9, 45) + { 4, 1, 1}, ... % ( 4, 49) + { 5, 1, 1}, ... % ( 8, 57) + { 6, 1, 1}, ... % ( 4, 61) + { 8, 1, 1}, ... % ( 4, 65) + { 9, 1, 1}, ... % ( 4, 69) + { 7, 2, 1}, ... % ( 2, 71) + } ; +end + +test251 (tasks) ; + +fprintf ('\n') ; +fprintf ('test251b: all tests passed\n') ; + + diff --git a/Test/test280.m b/Test/test280.m index 1d911a84bb..31d7e21568 100644 --- a/Test/test280.m +++ b/Test/test280.m @@ -1,21 +1,38 @@ -function test280 +function test280(quick) %TEST280 subassign method 26 % SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 +if (nargin < 1) + quick = 1 ; +end + +rng ('default') ; + +tic load west0479 GB_mex_grow (west0479) ; +toc +tic n = 10000 ; nz = 10e6 ; A = sprand (n, n, nz/n^2) ; GB_mex_grow (A) ; +toc -n = 2e6 ; -nz = 10e6 ; +tic +if (quick) + n = 1e6 ; + nz = 1e5 ; +else + n = 2e6 ; + nz = 10e6 ; +end A = sprand (n, n, nz/n^2) ; GB_mex_grow (A) ; +toc fprintf ('test280 all tests passed.\n') ; diff --git a/Test/test282.m b/Test/test282.m new file mode 100644 index 0000000000..ed15ba93b1 --- /dev/null +++ b/Test/test282.m @@ -0,0 +1,27 @@ +function test282 +%TEST282 test argmax with index binary op + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('\n--- testing argmax with user-defined index binary op\n') ; +rng ('default') ; + +n = 100 ; +d = 0.1 ; +A = sprand (n, n, d) ; +A = A + pi * speye (n) ; + +for jit = 0:1 + [x1, p1] = GB_mex_argmax (A, 1, 1, jit) ; + [x2, p2] = max (A, [ ], 1) ; + assert (isequal (x1, x2')) ; + assert (isequal (p1, p2')) ; + [x1, p1] = GB_mex_argmax (A, 2, 0, jit) ; + [x2, p2] = max (A, [ ], 2) ; + assert (isequal (x1, x2)) ; + assert (isequal (p1, p2)) ; +end + +fprintf ('\ntest282: all tests passed\n') ; + diff --git a/Test/test283.m b/Test/test283.m new file mode 100644 index 0000000000..c7322f756e --- /dev/null +++ b/Test/test283.m @@ -0,0 +1,13 @@ +function test283 +%TEST283 test index binary op + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('\n--- testing ewise with user-defined index binary op\n') ; +rng ('default') ; + +GB_mex_test37 + +fprintf ('\ntest283: all tests passed\n') ; + diff --git a/Test/test284.m b/Test/test284.m new file mode 100644 index 0000000000..7038eaa960 --- /dev/null +++ b/Test/test284.m @@ -0,0 +1,129 @@ +function test284 +%TEST284 test GrB_mxm using indexop-based semirings + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('\ntest284: GrB_mxm with indexop-based semirings\n') ; + +rng ('default') ; + +n = 10 ; +A = GB_spec_random (n, n, 0.3, 100, 'double') ; +B = GB_spec_random (n, n, 0.3, 100, 'double') ; +D = speye (n) ; + +% all variations: +adds = {'min', 'max', 'plus', 'times' } ; +mults = {'firsti', 'firsti1', 'firstj', 'firstj1', ... + 'secondi', 'secondi1', 'secondj', 'secondj1' } ; + +% just a few: +adds = {'min', 'plus' } ; +mults = {'firsti1', 'secondi1', 'secondj' } ; + +for A_is_csc = 0:1 + A.is_csc = A_is_csc ; + + for B_is_csc = 0:1 + B.is_csc = A_is_csc ; + + for C_is_csc = 0:1 + + for A_sparsity = [1 2 4] + if (A_sparsity == 0) + A.is_hyper = 0 ; + A.is_bitmap = 0 ; + A.sparsity = 2 ; % sparse + elseif (A_sparsity == 1) + A.is_hyper = 1 ; + A.is_bitmap = 0 ; + A.sparsity = 1 ; % hypersparse + else + A.is_hyper = 0 ; + A.is_bitmap = 1 ; + A.sparsity = 4 ; % bitmap + end + + for B_sparsity = [1 2 4] + if (B_sparsity == 0) + B.is_hyper = 0 ; + B.is_bitmap = 0 ; + B.sparsity = 2 ; % sparse + elseif (B_sparsity == 1) + B.is_hyper = 1 ; + B.is_bitmap = 0 ; + B.sparsity = 1 ; % hypersparse + else + B.is_hyper = 0 ; + B.is_bitmap = 1 ; + B.sparsity = 4 ; % bitmap + end + + for at = 0:1 + for bt = 0:1 + for method = [0 7081 7083 7084 7085] + % C = A*B, A'*B, A*B', or A'*B' + for k1 = 1:length (adds) + add = adds {k1} ; + for k2 = 1:length (mults) + mult = mults {k2} ; +% fprintf ('\n(%s,%s,%d,%d):\n', ... +% add, mult, at, bt) ; + C1 = GB_mex_AxB_idx (A, B, at, bt, ... + method, C_is_csc, 1, add, mult) ; + C2 = GB_mex_AxB_idx (A, B, at, bt, ... + method, C_is_csc, 0, add, mult) ; + GB_spec_compare (C1, C2) ; + end + end + end + fprintf ('.') ; + end + end + + for at = 0:1 + % C = A*D, A'*D + for k1 = 1:length (adds) + add = adds {k1} ; + for k2 = 1:length (mults) + mult = mults {k2} ; +% fprintf ('\n(%s,%s,%d): D*B\n', ... +% add, mult, at) ; + C1 = GB_mex_AxB_idx (A, D, at, 0, ... + 0, C_is_csc, 1, add, mult) ; + C2 = GB_mex_AxB_idx (A, D, at, 0, ... + 0, C_is_csc, 0, add, mult) ; + GB_spec_compare (C1, C2) ; + end + end + end + fprintf ('.') ; + + for bt = 0:1 + % C = D*B, D*B' + for k1 = 1:length (adds) + add = adds {k1} ; + for k2 = 1:length (mults) + mult = mults {k2} ; +% fprintf ('\n(%s,%s,%d): D*B\n', ... +% add, mult, bt) ; + C1 = GB_mex_AxB_idx (D, B, 0, bt, ... + 0, C_is_csc, 1, add, mult) ; + C2 = GB_mex_AxB_idx (D, B, 0, bt, ... + 0, C_is_csc, 0, add, mult) ; + GB_spec_compare (C1, C2) ; +% fprintf ('.') ; + end + end + end + fprintf ('.') ; + + end + end + end + end +end + +fprintf ('\ntest284: all tests passed\n') ; + diff --git a/Test/test285.m b/Test/test285.m new file mode 100644 index 0000000000..74669843cd --- /dev/null +++ b/Test/test285.m @@ -0,0 +1,68 @@ +function test285 +%TEST285 test GrB_assign (bitmap case, C+=A, whole matrix) + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +% tests GB_bitmap_assign_7_whole + +rng ('default') ; + +desc.mask = 'complement' ; + +accum.opname = 'plus' ; +accum.optype = 'double' ; + +% I = ":" +I = [ ] ; +I0 = uint64 (I-1) ; + +% J = ":" +J = [ ] ; +J0 = uint64 (I-1) ; + +A = GB_spec_random (10, 10, 0.2) ; +A.sparsity = 1 ; % sparse + +C = GB_spec_random (10, 10, 0.2) ; +C.sparsity = 4 ; % bitmap + +M = GB_spec_random (10, 10, 0.2) ; +M.sparsity = 1 ; % sparse + +% C(I,J) = accum (C (I,J),A) +C0 = GB_spec_assign (C, M, accum, A, I, J, desc, false) ; +GrB.burble (1) ; +C1 = GB_mex_assign (C, M, accum, A, I0, J0, desc) ; +GrB.burble (0) ; +GB_spec_compare (C0, C1) ; + +% C(I,J) = accum (C (I,J),A), with int16 mask matrix M +M.matrix = ceil (M.matrix) ; +M.class = 'int16' ; +C0 = GB_spec_assign (C, M, accum, A, I, J, desc, false) ; +GrB.burble (1) ; +C1 = GB_mex_assign (C, M, accum, A, I0, J0, desc) ; +GrB.burble (0) ; +GB_spec_compare (C0, C1) ; + +% C(I,J) = accum (C (I,J),A), with int32 mask matrix M +M.matrix = ceil (M.matrix) ; +M.class = 'int32' ; +C0 = GB_spec_assign (C, M, accum, A, I, J, desc, false) ; +GrB.burble (1) ; +C1 = GB_mex_assign (C, M, accum, A, I0, J0, desc) ; +GrB.burble (0) ; +GB_spec_compare (C0, C1) ; + +% C(I,J) = accum (C (I,J),A), with double complex mask matrix M +M.class = 'double complex' ; +C0 = GB_spec_assign (C, M, accum, A, I, J, desc, false) ; +GrB.burble (1) ; +C1 = GB_mex_assign (C, M, accum, A, I0, J0, desc) ; +GrB.burble (0) ; +GB_spec_compare (C0, C1) ; + +fprintf ('\ntest285: all tests passed\n') ; + + diff --git a/Test/test286.m b/Test/test286.m new file mode 100644 index 0000000000..eec70b6c7c --- /dev/null +++ b/Test/test286.m @@ -0,0 +1,23 @@ +function test286 +%TEST286 test kron with idxop + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +rng ('default') ; +A = sprand (2, 3, 0.5) ; +B = sprand (3, 4, 0.5) ; +for atrans = 0:1 + for btrans = 0:1 + C2 = GB_spec_kron_idx (A, B, atrans, btrans) ; + for csc = 0:1 +% GrB.burble (1) ; + C = GB_mex_kron_idx (A, B, atrans, btrans, csc) ; +% GrB.burble (0) ; + assert (isequal (C, C2)) ; + end + end +end + +fprintf ('\ntest286: all tests passed\n') ; + diff --git a/Test/test53.m b/Test/test53.m index e90097416f..fe966b50cb 100644 --- a/Test/test53.m +++ b/Test/test53.m @@ -114,6 +114,18 @@ function test53(fulltests) assert (isequal (C.matrix .* Mask, (A.matrix).*Mask)) ; end + if (isequal (atype, 'double') && isequal (C.class, 'double')) + % C = A (:,:) with user-defined types + C = GB_mex_Matrix_extract_UDT (Cempty, Mask, [ ], A, ... + [ ], [ ], [ ], true) ; + assert (GB_spok (C.matrix*1) == 1) ; + S = GB_spec_Matrix_extract (Cempty, Mask, [ ], A, [ ], [ ], [ ]) ; + assert (isequal (C.class, A.class)) ; + assert (isequal (C.class, S.class)) ; + assert (isequal (full (double (C.matrix)), double (S.matrix))) ; + assert (isequal (C.matrix .* Mask, (A.matrix).*Mask)) ; + end + % C = A (:,:)' clear D D = struct ('inp0', 'tran') ; diff --git a/Test/test74.m b/Test/test74.m index 570af3200e..fe842e55c4 100644 --- a/Test/test74.m +++ b/Test/test74.m @@ -20,22 +20,31 @@ ntrials = 0 ; -rng ('default') ; GB_builtin_complex_set (true) ; -m_list = [ 1 2 9 ] ; -n_list = [ 1 2 10 ] ; -k_list = [ 20 100 12 ] ; -d_list = [0.3 0.3 0.3 ] ; +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = (~isempty (GraphBLAS_grbcov)) ; + clast = sum (GraphBLAS_grbcov > 0) ; +end + +rng ('default') ; + +m_list = [ 1 2 9 ] ; +n_list = [ 1 2 10 ] ; +k_list = [ 20 100 12 ] ; +d_list = [0.3 0.3 0.3] ; +n_semirings = 0 ; for k0 = 1:size(m_list,2) + jit_reset m = m_list (k0) ; n = n_list (k0) ; k = k_list (k0) ; density = d_list (k0) ; - n_semirings = 0 ; A = GB_spec_random (m,k,density,100,'none') ; B = GB_spec_random (k,n,density,100,'none') ; C = GB_spec_random (m,n,density,100,'none') ; @@ -56,165 +65,252 @@ AT = A ; AT.matrix = A.matrix.' ; AT.pattern = A.pattern' ; - fprintf ('\nm %d n %d k %d: \n', m, n, k) ; + fprintf ('\n\nm %d n %d k %d: \n', m, n, k) ; for k2 = 1:length(add_ops) addop = add_ops {k2} ; + + if (k0 == 1 || k0 == 3) + % only use the min monoid for the 1st and 3rd matrices + if (~isequal (addop, 'min')) + continue + end + end + for k4 = 1:length (types) monoid.opname = addop ; monoid.optype = types {k4} ; + try identity = GB_spec_identity (monoid) ; catch continue ; end - fprintf ('\n%-14s: ', [monoid.opname '.' monoid.optype]) ; - jit_reset + % jit_reset + + % skip these monoids; not needed for test coverage + if (isequal (monoid.optype, 'logical')) + if (isequal (addop, 'plus') || ... + isequal (addop, 'times') || ... + isequal (addop, 'or') || ... + isequal (addop, 'and')) + continue + end + end + + fprintf ('\n%d %-14s: ', k0, [addop '.' monoid.optype]) ; + if (track_coverage) + fprintf ('\n') ; + end for k1 = 1:length(mult_ops) mulop = mult_ops {k1} ; - for k3 = 1:length (types) - semiring_type = types {k3} ; - semiring.multiply = mulop ; - semiring.add = monoid ; - semiring.class = semiring_type ; - - % create the semiring. some are not valid because the - % or,and,xor monoids can only be used when z is boolean for - % z=mult(x,y). - try - [mult_op add_op id] = GB_spec_semiring (semiring) ; - [mult_opname mult_optype ztype xtype ytype] = ... - GB_spec_operator (mult_op); - [ add_opname add_optype] = GB_spec_operator (add_op) ; - identity = GB_spec_identity (semiring.add) ; - catch me - continue - end - - n_semirings = n_semirings + 1 ; - fprintf ('.') ; -% if (test_contains (mulop, 'firsti')) -% fprintf ('[%s.%s.%s]', addop, mulop, semiring_type) ; -% end - - AT.class = semiring_type ; - A.class = semiring_type ; - B.class = semiring_type ; - C.class = monoid.optype ; - A_bitmap.class = semiring_type ; - B_bitmap.class = semiring_type ; - F.class = monoid.optype ; - Afull.class = semiring_type ; - Bfull.class = semiring_type ; - - % C = A'*B, with Mask, no typecasting - C1 = GB_mex_mxm (C, M, [ ], semiring, AT, B, dtn) ; - C0 = GB_spec_mxm (C, M, [ ], semiring, AT, B, dtn) ; - GB_spec_compare (C0, C1, identity) ; - - % C = A'*B, no Mask, no typecasting - C1 = GB_mex_mxm (C, [ ], [ ], semiring, AT, B, dtn) ; - C0 = GB_spec_mxm (C, [ ], [ ], semiring, AT, B, dtn) ; - GB_spec_compare (C0, C1, identity) ; - - % C = A*B, no Mask, no typecasting, Gustavson - C1 = GB_mex_mxm (C, [ ], [ ], semiring, A, B, dnn_Gus) ; - C0 = GB_spec_mxm (C, [ ], [ ], semiring, A, B, dnn_Gus) ; - GB_spec_compare (C0, C1, identity) ; - - % C = A*B, no Mask, no typecasting, Hash - C1 = GB_mex_mxm (C, [ ], [ ], semiring, A, B, dnn_hash) ; - GB_spec_compare (C0, C1, identity) ; - - % C = A_bitmap * B - C1 = GB_mex_mxm (C, [ ], [ ], semiring, A_bitmap, B, [ ]) ; - GB_spec_compare (C0, C1, identity) ; - - % C = A * B_bitmap - C1 = GB_mex_mxm (C, [ ], [ ], semiring, A, B_bitmap, [ ]) ; - GB_spec_compare (C0, C1, identity) ; - - % C = A_bitmap * B_bitmap - C1 = GB_mex_mxm (C, [ ], [ ], semiring, A_bitmap, B_bitmap,[]); - GB_spec_compare (C0, C1, identity) ; - - % F += A * B_bitmap - C1 = GB_mex_mxm (F, [ ], monoid, semiring, A, B_bitmap, [ ]) ; - C0 = GB_spec_mxm (F, [ ], monoid, semiring, A, B, [ ]) ; - GB_spec_compare (C0, C1, identity) ; - - if (isequal (monoid.opname, 'times')) - - F2 = F ; - F2.matrix = F2.matrix / max (F2.matrix, [ ], 'all') ; - A2 = A ; - A2.matrix = A2.matrix / max (A2.matrix, [ ], 'all') ; - B2 = B ; - B2.matrix = B2.matrix / max (B2.matrix, [ ], 'all') ; - A3 = Afull ; - A3.matrix = A3.matrix / max (A3.matrix, [ ], 'all') ; - B3 = Bfull ; - B3.matrix = B3.matrix / max (B3.matrix, [ ], 'all') ; - A4 = AT ; - A4.matrix = A4.matrix / max (A4.matrix, [ ], 'all') ; - - % F2 += A * B - C1 = GB_mex_mxm_update (F2, semiring, A2, B2, [ ]) ; - C0 = GB_spec_mxm (F2, [ ], monoid, semiring, A2, B2, [ ]) ; - GB_spec_compare (C0, C1, identity) ; - % F2 += A3 * B - C1 = GB_mex_mxm_update (F2, semiring, A3, B2, [ ]) ; - C0 = GB_spec_mxm (F2, [ ], monoid, semiring, A3, B2, [ ]) ; - GB_spec_compare (C0, C1, identity) ; - % F2 += A2 * B3 - C1 = GB_mex_mxm_update (F2, semiring, A2, B3, [ ]) ; - C0 = GB_spec_mxm (F2, [ ], monoid, semiring, A2, B3, [ ]) ; + for k3 = 1:length (types) + semiring_type = types {k3} ; + semiring.multiply = mulop ; + semiring.add = monoid ; + semiring.class = semiring_type ; + + %----------------------------------------------------------- + % skip these semirings; not needed for test coverage: + %----------------------------------------------------------- + + if (k0 == 3) + if (isequal (addop, 'min') && ... + isequal (mulop, 'first') && ... + isequal (semiring_type, 'int32')) + % only do min.first.int32 with the 3rd matrix + else + % fprintf ('skip\n') ; + continue + end + end + + if (k0 == 1) + if (isequal (addop, 'min') && ... + isequal (mulop, 'first')) + % only do min.first.* with the 1st matrix + else + % fprintf ('skip\n') ; + continue + end + end + + if (isequal (mulop, 'oneb')) + continue + end + + if ((isequal (addop, 'any') || isequal (addop, 'times')) ... + && ... + (isequal (mulop, 'and') || isequal (mulop, 'or') || ... + isequal (mulop, 'pair')|| isequal (mulop, 'xor'))) + continue + end + + if ((isequal (addop, 'min') || isequal (addop, 'max')) ... + && ... + (isequal (mulop, 'and') || isequal (mulop, 'xor') || ... + isequal (mulop, 'or'))) + continue + end + + if (isequal (mulop (1:2), 'is')) + if (isequal (semiring_type, 'logical')) + % *.is*.logical: do this but no other type + else + continue + end + end + + %----------------------------------------------------------- + % create the semiring. some are not valid because the + % or,and,xor monoids can only be used when z is boolean for + % z=mult(x,y). + try + [mult_op add_op id] = GB_spec_semiring (semiring) ; + [mult_opname mult_optype ztype xtype ytype] = ... + GB_spec_operator (mult_op); + [ add_opname add_optype] = GB_spec_operator (add_op) ; + identity = GB_spec_identity (semiring.add) ; + catch me + continue + end + + if (track_coverage) + fprintf ('[%s.%s.%s] ', addop, mulop, semiring_type) ; + end + n_semirings = n_semirings + 1 ; + + AT.class = semiring_type ; + A.class = semiring_type ; + B.class = semiring_type ; + C.class = monoid.optype ; + A_bitmap.class = semiring_type ; + B_bitmap.class = semiring_type ; + F.class = monoid.optype ; + Afull.class = semiring_type ; + Bfull.class = semiring_type ; + + % C = A'*B, with Mask, no typecasting + C1 = GB_mex_mxm (C, M, [ ], semiring, AT, B, dtn) ; + C0 = GB_spec_mxm (C, M, [ ], semiring, AT, B, dtn) ; GB_spec_compare (C0, C1, identity) ; - % F2 += A4'*B3, no Mask, no typecasting - C1 = GB_mex_mxm_update (F2, semiring, A4, B3, dtn) ; - C0 = GB_spec_mxm (F2,[ ], monoid, semiring, A4, B3, dtn); + % C = A'*B, no Mask, no typecasting + C1 = GB_mex_mxm (C, [ ], [ ], semiring, AT, B, dtn) ; + C0 = GB_spec_mxm (C, [ ], [ ], semiring, AT, B, dtn) ; GB_spec_compare (C0, C1, identity) ; - else - - % F += A * B - C1 = GB_mex_mxm_update (F, semiring, A, B, [ ]) ; - C0 = GB_spec_mxm (F, [ ], monoid, semiring, A, B, [ ]) ; + % C = A*B, no Mask, no typecasting, Gustavson + C1 = GB_mex_mxm (C, [ ], [ ], semiring, A, B, dnn_Gus) ; + C0 = GB_spec_mxm (C, [ ], [ ], semiring, A, B, dnn_Gus) ; GB_spec_compare (C0, C1, identity) ; - % F += Afull * B - C1 = GB_mex_mxm_update (F, semiring, Afull, B, [ ]) ; - C0 = GB_spec_mxm (F, [ ], monoid, semiring, Afull, B, [ ]) ; + + % C = A*B, no Mask, no typecasting, Hash + C1 = GB_mex_mxm (C, [ ], [ ], semiring, A, B, dnn_hash) ; GB_spec_compare (C0, C1, identity) ; - % F += A * Bfull - C1 = GB_mex_mxm_update (F, semiring, A, Bfull, [ ]) ; - C0 = GB_spec_mxm (F, [ ], monoid, semiring, A, Bfull, [ ]) ; + + % C = A_bitmap * B + C1 = GB_mex_mxm (C, [ ], [ ], semiring, A_bitmap, B, [ ]) ; GB_spec_compare (C0, C1, identity) ; - % F += A'*Bfull, no Mask, no typecasting - C1 = GB_mex_mxm_update (F, semiring, AT, Bfull, dtn) ; - C0 = GB_spec_mxm (F, [ ], monoid, semiring, AT, Bfull, dtn); + % C = A * B_bitmap + C1 = GB_mex_mxm (C, [ ], [ ], semiring, A, B_bitmap, [ ]) ; GB_spec_compare (C0, C1, identity) ; - % F += A_iso_full * B - Afull.iso = true ; - C1 = GB_mex_mxm_update (F, semiring, Afull, B, [ ]) ; - C0 = GB_spec_mxm (F, [ ], monoid, semiring, Afull, B, [ ]) ; + % C = A_bitmap * B_bitmap + C1 = GB_mex_mxm (C, [ ], [ ], semiring, A_bitmap, B_bitmap,[]); GB_spec_compare (C0, C1, identity) ; - Afull.iso = false ; - % F += A_iso_bitmap * B - % A_bitmap.iso = true ; - C1 = GB_mex_mxm_update (F, semiring, A_bitmap, B, [ ]) ; - C0 = GB_spec_mxm (F, [], monoid, semiring, A_bitmap, B, []); + % F += A * B_bitmap + C1 = GB_mex_mxm (F, [ ], monoid, semiring, A, B_bitmap, [ ]) ; + C0 = GB_spec_mxm (F, [ ], monoid, semiring, A, B, [ ]) ; GB_spec_compare (C0, C1, identity) ; - % A_bitmap.iso = false ; - end + if (isequal (monoid.opname, 'times')) + + F2 = F ; + F2.matrix = F2.matrix / max (F2.matrix, [ ], 'all') ; + A2 = A ; + A2.matrix = A2.matrix / max (A2.matrix, [ ], 'all') ; + B2 = B ; + B2.matrix = B2.matrix / max (B2.matrix, [ ], 'all') ; + A3 = Afull ; + A3.matrix = A3.matrix / max (A3.matrix, [ ], 'all') ; + B3 = Bfull ; + B3.matrix = B3.matrix / max (B3.matrix, [ ], 'all') ; + A4 = AT ; + A4.matrix = A4.matrix / max (A4.matrix, [ ], 'all') ; + + % F2 += A * B + C1 = GB_mex_mxm_update (F2, semiring, A2, B2, [ ]) ; + C0 = GB_spec_mxm (F2, [ ], monoid, semiring, A2, B2, [ ]) ; + GB_spec_compare (C0, C1, identity) ; + % F2 += A3 * B + C1 = GB_mex_mxm_update (F2, semiring, A3, B2, [ ]) ; + C0 = GB_spec_mxm (F2, [ ], monoid, semiring, A3, B2, [ ]) ; + GB_spec_compare (C0, C1, identity) ; + % F2 += A2 * B3 + C1 = GB_mex_mxm_update (F2, semiring, A2, B3, [ ]) ; + C0 = GB_spec_mxm (F2, [ ], monoid, semiring, A2, B3, [ ]) ; + GB_spec_compare (C0, C1, identity) ; + + % F2 += A4'*B3, no Mask, no typecasting + C1 = GB_mex_mxm_update (F2, semiring, A4, B3, dtn) ; + C0 = GB_spec_mxm (F2,[ ], monoid, semiring, A4, B3, dtn); + GB_spec_compare (C0, C1, identity) ; + + else + + % F += A * B + C1 = GB_mex_mxm_update (F, semiring, A, B, [ ]) ; + C0 = GB_spec_mxm (F, [ ], monoid, semiring, A, B, [ ]) ; + GB_spec_compare (C0, C1, identity) ; + % F += Afull * B + C1 = GB_mex_mxm_update (F, semiring, Afull, B, [ ]) ; + C0 = GB_spec_mxm (F, [ ], monoid, semiring, Afull, B, [ ]) ; + GB_spec_compare (C0, C1, identity) ; + % F += A * Bfull + C1 = GB_mex_mxm_update (F, semiring, A, Bfull, [ ]) ; + C0 = GB_spec_mxm (F, [ ], monoid, semiring, A, Bfull, [ ]) ; + GB_spec_compare (C0, C1, identity) ; + + % F += A'*Bfull, no Mask, no typecasting + C1 = GB_mex_mxm_update (F, semiring, AT, Bfull, dtn) ; + C0 = GB_spec_mxm (F, [ ], monoid, semiring, AT, Bfull, dtn); + GB_spec_compare (C0, C1, identity) ; + + % F += A_iso_full * B + Afull.iso = true ; + C1 = GB_mex_mxm_update (F, semiring, Afull, B, [ ]) ; + C0 = GB_spec_mxm (F, [ ], monoid, semiring, Afull, B, [ ]) ; + GB_spec_compare (C0, C1, identity) ; + Afull.iso = false ; + + % F += A_iso_bitmap * B + % A_bitmap.iso = true ; + C1 = GB_mex_mxm_update (F, semiring, A_bitmap, B, [ ]) ; + C0 = GB_spec_mxm (F, [], monoid, semiring, A_bitmap, B, []); + GB_spec_compare (C0, C1, identity) ; + % A_bitmap.iso = false ; + + end + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf ('[%d %d] %d\n', d, c, k0) ; + else + fprintf (' [-] %d\n', k0) ; + end + clast = c ; + else + fprintf ('.') ; + end - end + end end end end diff --git a/Test/test75b.m b/Test/test75b.m index 1d364260f2..2dc67b3f95 100644 --- a/Test/test75b.m +++ b/Test/test75b.m @@ -4,16 +4,11 @@ % SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. % SPDX-License-Identifier: Apache-2.0 -fprintf ('test75b: test mxm and vxm on all semirings\n') ; +fprintf ('test75b: test mxm and vxm\n') ; [binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; -% mult_ops = binops.positional mult_ops = binops.all ; types = types.all ; -% cstart = grb_get_coverage ; -% fprintf ('coverage start: %d\n', cstart) ; -% cc = zeros (15,1) ; - rng ('default') ; m = 200 ; @@ -64,8 +59,6 @@ Y.class = 'see below' ; Y.pattern = logical (spones (y_sparse)) ; -fprintf ('\n-------------- GrB_mxm, vxm (dot product) on all semirings\n') ; - Cin = sparse (n, n) ; Din = 10 * sparse (rand (n, n)) ; @@ -85,66 +78,230 @@ dnt = struct ( 'inp1', 'tran' ) ; dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; -n_semirings = 0 ; - -% ccall = zeros (1,15) ; +track_coverage = false ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end -for k1 = 1:length(mult_ops) - mulop = mult_ops {k1} ; - fprintf ('\n%-10s ', mulop) ; +% testing just 154 semirings +semirings = { + { 'min', 'first', 'logical' }, + { 'min', 'first', 'int8' }, + { 'min', 'first', 'int16' }, + { 'min', 'first', 'uint8' }, + { 'min', 'first', 'uint16' }, + { 'min', 'first', 'uint32' }, + { 'min', 'first', 'uint64' }, + { 'min', 'first', 'single' }, + { 'min', 'first', 'double' }, + { 'plus', 'first', 'single complex' }, + { 'plus', 'first', 'double complex' }, + { 'min', 'second', 'logical' }, + { 'min', 'second', 'int8' }, + { 'min', 'second', 'int16' }, + { 'min', 'second', 'uint8' }, + { 'min', 'second', 'uint16' }, + { 'min', 'second', 'uint32' }, + { 'min', 'second', 'uint64' }, + { 'min', 'second', 'single' }, + { 'min', 'second', 'double' }, + { 'plus', 'second', 'single complex' }, + { 'plus', 'second', 'double complex' }, + { 'min', 'minus', 'int8' }, + { 'min', 'minus', 'int16' }, + { 'min', 'minus', 'int32' }, + { 'min', 'minus', 'int64' }, + { 'min', 'minus', 'uint8' }, + { 'min', 'minus', 'uint16' }, + { 'min', 'minus', 'uint32' }, + { 'min', 'minus', 'uint64' }, + { 'min', 'minus', 'single' }, + { 'min', 'minus', 'double' }, + { 'plus', 'minus', 'single complex' }, + { 'plus', 'minus', 'double complex' }, + { 'min', 'rminus', 'int8' }, + { 'min', 'rminus', 'int16' }, + { 'min', 'rminus', 'int32' }, + { 'min', 'rminus', 'int64' }, + { 'min', 'rminus', 'uint8' }, + { 'min', 'rminus', 'uint16' }, + { 'min', 'rminus', 'uint32' }, + { 'min', 'rminus', 'uint64' }, + { 'min', 'rminus', 'single' }, + { 'min', 'rminus', 'double' }, + { 'plus', 'rminus', 'single complex' }, + { 'plus', 'rminus', 'double complex' }, + { 'min', 'div', 'int8' }, + { 'min', 'div', 'int16' }, + { 'min', 'div', 'uint8' }, + { 'min', 'div', 'uint16' }, + { 'min', 'div', 'uint32' }, + { 'min', 'div', 'uint64' }, + { 'min', 'div', 'single' }, + { 'plus', 'div', 'single complex' }, + { 'plus', 'div', 'double complex' }, + { 'min', 'rdiv', 'int8' }, + { 'min', 'rdiv', 'int16' }, + { 'min', 'rdiv', 'int32' }, + { 'min', 'rdiv', 'int64' }, + { 'min', 'rdiv', 'uint8' }, + { 'min', 'rdiv', 'uint16' }, + { 'min', 'rdiv', 'uint32' }, + { 'min', 'rdiv', 'uint64' }, + { 'min', 'rdiv', 'single' }, + { 'min', 'rdiv', 'double' }, + { 'plus', 'rdiv', 'single complex' }, + { 'plus', 'rdiv', 'double complex' }, + { 'min', 'pow', 'logical' }, + { 'min', 'isgt', 'logical' }, + { 'min', 'isgt', 'int8' }, + { 'min', 'isgt', 'int16' }, + { 'min', 'isgt', 'int32' }, + { 'min', 'isgt', 'int64' }, + { 'min', 'isgt', 'uint8' }, + { 'min', 'isgt', 'uint16' }, + { 'min', 'isgt', 'uint32' }, + { 'min', 'isgt', 'uint64' }, + { 'min', 'isgt', 'single' }, + { 'min', 'isgt', 'double' }, + { 'min', 'islt', 'logical' }, + { 'min', 'islt', 'int8' }, + { 'min', 'islt', 'int16' }, + { 'min', 'islt', 'int32' }, + { 'min', 'islt', 'int64' }, + { 'min', 'islt', 'uint8' }, + { 'min', 'islt', 'uint16' }, + { 'min', 'islt', 'uint32' }, + { 'min', 'islt', 'uint64' }, + { 'min', 'islt', 'single' }, + { 'min', 'islt', 'double' }, + { 'min', 'isge', 'int8' }, + { 'min', 'isge', 'int16' }, + { 'min', 'isge', 'int32' }, + { 'min', 'isge', 'int64' }, + { 'min', 'isge', 'uint8' }, + { 'min', 'isge', 'uint16' }, + { 'min', 'isge', 'uint32' }, + { 'min', 'isge', 'uint64' }, + { 'min', 'isge', 'single' }, + { 'min', 'isge', 'double' }, + { 'min', 'isle', 'logical' }, + { 'min', 'isle', 'int8' }, + { 'min', 'isle', 'int16' }, + { 'min', 'isle', 'int32' }, + { 'min', 'isle', 'int64' }, + { 'min', 'isle', 'uint8' }, + { 'min', 'isle', 'uint16' }, + { 'min', 'isle', 'uint32' }, + { 'min', 'isle', 'uint64' }, + { 'min', 'isle', 'single' }, + { 'min', 'isle', 'double' }, + { 'min', 'gt', 'int8' }, + { 'min', 'gt', 'int16' }, + { 'min', 'gt', 'int32' }, + { 'min', 'gt', 'int64' }, + { 'min', 'gt', 'uint8' }, + { 'min', 'gt', 'uint16' }, + { 'min', 'gt', 'uint32' }, + { 'min', 'gt', 'uint64' }, + { 'min', 'gt', 'single' }, + { 'min', 'gt', 'double' }, + { 'min', 'lt', 'int8' }, + { 'min', 'lt', 'int16' }, + { 'min', 'lt', 'int32' }, + { 'min', 'lt', 'int64' }, + { 'min', 'lt', 'uint8' }, + { 'min', 'lt', 'uint16' }, + { 'min', 'lt', 'uint32' }, + { 'min', 'lt', 'uint64' }, + { 'min', 'lt', 'single' }, + { 'min', 'lt', 'double' }, + { 'min', 'ge', 'int8' }, + { 'min', 'ge', 'int16' }, + { 'min', 'ge', 'int32' }, + { 'min', 'ge', 'int64' }, + { 'min', 'ge', 'uint8' }, + { 'min', 'ge', 'uint16' }, + { 'min', 'ge', 'uint32' }, + { 'min', 'ge', 'uint64' }, + { 'min', 'ge', 'single' }, + { 'min', 'ge', 'double' }, + { 'min', 'le', 'int8' }, + { 'min', 'le', 'int16' }, + { 'min', 'le', 'int32' }, + { 'min', 'le', 'int64' }, + { 'min', 'le', 'uint8' }, + { 'min', 'le', 'uint16' }, + { 'min', 'le', 'uint32' }, + { 'min', 'le', 'uint64' }, + { 'min', 'le', 'single' }, + { 'min', 'le', 'double' }, + { 'min', 'firsti', 'int32' }, + { 'min', 'firsti', 'int64' }, + { 'min', 'firsti1', 'int32' }} ; + +fprintf ('\n') ; + +for k1 = 1:length(semirings) + sr = semirings {k1} ; + addop = sr {1} ; + mulop = sr {2} ; + type = sr {3} ; GB_mex_finalize ; - for k2 = 1:length(add_ops) - addop = add_ops {k2} ; - - for k3 = 1:length (types) - type = types {k3} ; - - semiring.multiply = mulop ; - semiring.add = addop ; - semiring.class = type ; - - % create the semiring. some are not valid because the or,and,xor,eq - % monoids can only be used when z is boolean for z=mult(x,y). - try - [mult_op add_op id] = GB_spec_semiring (semiring) ; - [mult_opname mult_optype ztype xtype ytype] = GB_spec_operator (mult_op) ; - [ add_opname add_optype] = GB_spec_operator (add_op) ; - identity = GB_spec_identity (semiring.add, add_optype) ; - catch - continue - end - - A.class = type ; - B.class = type ; - X.class = type ; - Y.class = type ; - D.class = add_op.optype ; - - n_semirings = n_semirings + 1 ; - fprintf ('.') ; - - % C += A'*B, C dense, typecasting of C - % (test coverage: 96) - C1 = GB_mex_mxm (Din, [ ], add_op, semiring, A, B, dtn_dot) ; - C2 = GB_spec_mxm (Din, [ ], add_op, semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - - % C += A'*B, C sparse, no typecasting of C - % (test coverage: 1,234) - C1 = GB_mex_mxm (D, [ ], add_op, semiring, A, B, dtn_dot) ; - C2 = GB_spec_mxm (D, [ ], add_op, semiring, A, B, dtn) ; - GB_spec_compare (C1, C2, id) ; - - % X = u*A, with mask (test coverage: 12) - C1 = GB_mex_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; - C2 = GB_spec_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; - GB_spec_compare (C1, C2, id) ; + semiring.multiply = mulop ; + semiring.add = addop ; + semiring.class = type ; + + % create the semiring. some are not valid because the or,and,xor,eq + % monoids can only be used when z is boolean with z=mult(x,y). + try + [mult_op add_op id] = GB_spec_semiring (semiring) ; + [mult_opname mult_optype ztype xtype ytype] = ... + GB_spec_operator (mult_op) ; + [ add_opname add_optype] = GB_spec_operator (add_op) ; + identity = GB_spec_identity (semiring.add, add_optype) ; + catch + continue + end + A.class = type ; + B.class = type ; + X.class = type ; + Y.class = type ; + D.class = add_op.optype ; + + % C += A'*B, C dense, typecasting of C + C1 = GB_mex_mxm (Din, [ ], add_op, semiring, A, B, dtn_dot) ; + C2 = GB_spec_mxm (Din, [ ], add_op, semiring, A, B, dtn) ; + GB_spec_compare (C1, C2, id) ; + + % C += A'*B, C sparse, no typecasting of C + C1 = GB_mex_mxm (D, [ ], add_op, semiring, A, B, dtn_dot) ; + C2 = GB_spec_mxm (D, [ ], add_op, semiring, A, B, dtn) ; + GB_spec_compare (C1, C2, id) ; + + % X = u*A, with mask + C1 = GB_mex_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; + C2 = GB_spec_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; + GB_spec_compare (C1, C2, id) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf ('[%s.%s.%s %d %d]\n', addop, mulop, type, d, c-cfirst) ; end + clast = c ; + else + fprintf ('.') ; end + end -fprintf ('\nsemirings tested: %d\n', n_semirings) ; fprintf ('\ntest75b: all tests passed\n') ; + diff --git a/Test/test78.m b/Test/test78.m new file mode 100644 index 0000000000..5525fb7c1f --- /dev/null +++ b/Test/test78.m @@ -0,0 +1,45 @@ +function test78 +%TEST78 test subref + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +n = 500 ; +I = speye (n) ; +X = sparse (rand (n)) ; +A = [X I ; I I] ; + +I = 1:n ; +I0 = uint64 (I-1) ; + +C1 = A(I,I) ; +C2 = GB_mex_Matrix_subref (A, I0, I0) ; +assert (isequal (C1, C2)) ; + +Ahyper.matrix = A ; +Ahyper.is_hyper = true ; +% this requires a hyper realloc for C2 +C2 = GB_mex_Matrix_subref (Ahyper, I0, I0) ; +assert (isequal (C1, C2)) ; + +% C and A bitmap, with GB_J_KIND = GB_LIST (for JIT kernel, GB_macrofy_subref) +A0.matrix = sparse (A) ; +A0.sparsity = 4 ; +I = randperm (n) ; +I0 = uint64 (I-1) ; +C1 = A(I,I) ; +C2 = GB_mex_Matrix_subref (A0, I0, I0) ; +assert (isequal (C1, C2)) ; + +% C and A bitmap, with GB_J_KIND = GB_STRIDE (for JIT kernel, GB_macrofy_subref) +clear I1 +I1.begin = 0 ; +I1.inc = 2 ; +I1.end = n-1 ; +I = 1:2:n ; +C1 = A(I,I) ; +C2 = GB_mex_Matrix_subref (A0, I1, I1) ; +assert (isequal (C1, C2)) ; + +fprintf ('\ntest78: all tests passed\n') ; + diff --git a/Test/test81.m b/Test/test81.m index e6c1aba162..42e981eabb 100644 --- a/Test/test81.m +++ b/Test/test81.m @@ -16,10 +16,14 @@ Ahyper.is_hyper = true ; Ahyper.is_csc = true ; -for ilo = 1:2:n - for ihi = 1:2:n - fprintf ('#') ; - for i_inc = [-n:n inf] +for jlen = 1:2:n + JJ {jlen} = randperm (n) ; +end + +for ilo = 1 % 1:2:n + for ihi = 4 % 1:2:n +% fprintf ('\n#') ; + for i_inc = [-10 2 inf] % [-n:n inf] clear I I.begin = ilo-1 ; I.end = ihi-1 ; @@ -30,10 +34,11 @@ iinc = 1 ; end - fprintf (':') ; +% fprintf (':') ; for jlen = [1:2:n] clear J - J = randperm (n) ; +% J = randperm (n) ; + J = JJ {jlen} ; J = J (1:jlen) ; J0 = uint64 (J) - 1 ; C1 = A (ilo:iinc:ihi, J) ; @@ -46,7 +51,7 @@ assert (isequal (C1, C3.matrix)) ; end - fprintf ('.') ; +% fprintf ('.') ; for jlo = 1:2:n for jhi = 1:2:n for j_inc = [-n:n inf] @@ -75,7 +80,6 @@ end end end - end end end diff --git a/Test/testall.m b/Test/testall.m index 609858a875..d1ab9dd6dc 100644 --- a/Test/testall.m +++ b/Test/testall.m @@ -1,28 +1,23 @@ -function testall (threads,longtests) +function testall (threads, mdebug) %TESTALL run all GraphBLAS tests % % Usage: -% testall ; % runs just the shorter tests (about 30 minutes) % +% testall ; % runs just the shorter tests % testall(threads) ; % run with specific list of threads and chunk sizes -% testall([ ],1) ; % run all longer tests, with default # of threads +% testall(threads,1) ; % runs with malloc debugging enabled % % threads is a cell array. Each entry is 2-by-1, with the first value being % the # of threads to use and the 2nd being the chunk size. The default is -% {[4 1]} if empty or not present. +% {[4 1]} if threads is empty or not present. -% 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 GrB.init ; GB_mex_init ; testall_time = tic ; -if (nargin < 2) - % run the shorter tests by default - longtests = 0 ; -end - if (nargin < 1) threads = [ ] ; end @@ -31,13 +26,18 @@ function testall (threads,longtests) end t = threads ; +if (nargin < 2) + mdebug = false ; +end + % single thread s {1} = [1 1] ; - % clear the statement coverage counts clear global GraphBLAS_grbcov +global GraphBLAS_debug GraphBLAS_grbcov + % use built-in complex data types by default GB_builtin_complex_set (true) ; @@ -56,321 +56,321 @@ function testall (threads,longtests) logstat ; % start the log.txt hack = GB_mex_hack ; -% JIT and factory controls - -% default -j404 = {4,0,4} ; % JIT on, off, on -f110 = {1,1,0} ; % factory on, on , off +% start with the Werk stack enabled +hack (2) = 0 ; GB_mex_hack (hack) ; -% run once, both on -j4 = {4} ; % JIT on -f1 = {1} ; % factory on +% save the current malloc debug status +debug_save = stat ; -% run once, both off -j0 = {0} ; % JIT off -f0 = {0} ; % factory off +% run once +J4 = {4} ; % JIT on +F1 = {1} ; % factory on +J0 = {0} ; % JIT off +F0 = {0} ; % factory off % run twice -j44 = {4,4} ; % JIT on, on -f10 = {1,0} ; % factory on, off -f00 = {0,0} ; % factory off, off +J44 = {4,4} ; % JIT on, on +J40 = {4,0} ; % JIT on, off +F10 = {1,0} ; % factory on, off +F11 = {1,1} ; % factory on, on +J42 = {4,2} ; % JIT on, pause +F00 = {0,0} ; +J00 = {0,0} ; + +% 3 runs +J404 = {4,0,4} ; % JIT on, off, on +F110 = {1,1,0} ; % factory on, on , off +J440 = {4,4,0} ; +J400 = {4,0,0} ; +F100 = {4,4,0} ; + +% 4 runs: +J4040 = {4,0,4,0} ; +F1100 = {1,1,0,0} ; + +%{ +J4 = {4,0} ; % JIT on +F1 = {1,0} ; % factory on +J0 = {0,0} ; % JIT off +F0 = {0,0} ; % factory off % run twice -j04 = {0,4} ; % JIT off, off -j40 = {4,0} ; % JIT on, off -f11 = {1,1} ; % factory on, on +J44 = {4,4,0} ; % JIT on, on +J40 = {4,0,0} ; % JIT on, off +F10 = {1,0,0} ; % factory on, off +F11 = {1,1,0} ; % factory on, on +J42 = {4,2,0} ; % JIT on, pause +F00 = {0,0,0} ; +J00 = {0,0,0} ; % 3 runs -j040 = {0,4,0} ; % JIT off, on , off -j440 = {4,4,0} ; % JIT on, on , off -f100 = {1,0,0} ; % factory on, off, off +J404 = {4,0,4,0} ; % JIT on, off, on +F110 = {1,1,0,0} ; % factory on, on , off +J440 = {4,4,0,0} ; +J400 = {4,0,0,0} ; +F100 = {4,4,0,0} ; +%} -% start with the Werk stack enabled -hack (2) = 0 ; GB_mex_hack (hack) ; +%=============================================================================== +% quick tests (< 1 sec) +%=============================================================================== -malloc_debugging = stat ; +% < 1 second: debug_off +set_malloc_debug (mdebug, 0) ; +logstat ('test286' ,t, J40 , F00 ) ; % kron with index binary op +logstat ('test78' ,t, J40 , F00 ) ; % subref +logstat ('test285' ,t, J40 , F00 ) ; % GB_mex_assign (bitmap, 7_whole) +logstat ('test247' ,t, J40 , F10 ) ; % GrB_mxm: fine Hash method +logstat ('test109' ,t, J4040, F1100) ; % terminal monoid with user-defn type +logstat ('test138' ,s, J40 , F10 ) ; % assign, coarse-only in IxJ slice +logstat ('test139' ,s, J4 , F1 ) ; % merge sort, special cases +logstat ('test172' ,t, J40 , F10 ) ; % eWiseMult with M bitmap/full +logstat ('test155' ,t, J40 , F10 ) ; % setElement, removeElement +logstat ('test174' ,t, J40 , F10 ) ; % GrB_assign C=A +logstat ('test203' ,t, J4 , F1 ) ; % iso subref +logstat ('test213' ,t, J40 , F10 ) ; % iso assign (method 05d) +logstat ('test216' ,t, J4 , F1 ) ; % C=A, iso case +logstat ('test225' ,t, J40 , F10 ) ; % mask operations (GB_masker) +logstat ('test226' ,t, J40 , F10 ) ; % kron with iso matrices +logstat ('test235' ,t, J40 , F10 ) ; % GxB_eWiseUnion, GrB_eWiseAdd +logstat ('test252' ,t, J4 , F1 ) ; % basic tests +logstat ('test253' ,t, J4 , F1 ) ; % basic JIT tests +logstat ('test255' ,t, J4 , F1 ) ; % flip binop +logstat ('test257' ,t, J40 , F00 ) ; % JIT error handling +logstat ('test260' ,t, J4 , F0 ) ; % demacrofy name +logstat ('test261' ,t, J4 , F0 ) ; % serialize/deserialize errors +logstat ('test262' ,t, J0 , F1 ) ; % GB_mask +logstat ('test263' ,t, J40 , F00 ) ; % JIT tests +logstat ('test264' ,t, J4 , F0 ) ; % enumify / macrofy tests +logstat ('test265' ,t, J40 , F00 ) ; % reduce to scalar with user types +logstat ('test267' ,t, J4 , F0 ) ; % JIT error handling +logstat ('test269' ,t, J0 , F1 ) ; % get/set for type, scalar, vec, mtx +logstat ('test271' ,t, J0 , F1 ) ; % binary op get/set +logstat ('test272' ,t, J0 , F1 ) ; % misc simple tests +logstat ('test273' ,t, J0 , F1 ) ; % Global get/set +logstat ('test274' ,t, J0 , F1 ) ; % index unary op get/set +logstat ('test276' ,t, J0 , F1 ) ; % semiring get/set +logstat ('test277' ,t, J0 , F1 ) ; % context get/set +logstat ('test279' ,t, J0 , F1 ) ; % blob get/set +logstat ('test281' ,t, J4 , F1 ) ; % user-defined idx unop, no JIT +logstat ('test268' ,t, J40 , F10 ) ; % C=Z sparse masker +logstat ('test207' ,t, J4 , F1 ) ; % iso subref +logstat ('test211' ,t, J40 , F10 ) ; % iso assign +logstat ('test183' ,s, J4 , F1 ) ; % eWiseMult w/hypersparse mask +logstat ('test212' ,t, J40 , F10 ) ; % iso mask all zero +logstat ('test219' ,s, J40 , F10 ) ; % reduce to scalar (1 thread) + +% < 1 second: debug_on +set_malloc_debug (mdebug, 1) ; +logstat ('test244' ,t, J4 , F1 ) ; % GxB_Matrix_reshape* +logstat ('test194' ,t, J4 , F1 ) ; % GxB_Vector_diag +logstat ('test09' ,t, J40 , F10 ) ; % duplicate I,J in GB_mex_subassign +logstat ('test108' ,t, J40 , F10 ) ; % boolean monoids +logstat ('test137' ,s, J400 , F110 ) ; % GrB_eWiseMult, FIRST and SECOND +logstat ('test124' ,t, J4 , F1 ) ; % GrB_extract, case 6 +logstat ('test133' ,t, J40 , F10 ) ; % mask operations (GB_masker) +logstat ('test176' ,t, J40 , F10 ) ; % GrB_assign, method 09, 11 +logstat ('test197' ,t, J40 , F10 ) ; % large sparse split +logstat ('test201' ,t, J4 , F1 ) ; % iso reduce to vector, scalar +logstat ('test208' ,t, J4 , F1 ) ; % iso apply, bind 1st and 2nd +logstat ('test214' ,t, J40 , F10 ) ; % C=A'*B (tricount) +logstat ('test223' ,t, J40 , F10 ) ; % matrix multiply, C=A*B +logstat ('test241' ,t, J40 , F10 ) ; % GrB_mxm, trigger swap_rule +logstat ('test270' ,t, J0 , F1 ) ; % unary op get/set +logstat ('test199' ,t, J4 , F1 ) ; % dot2 with hypersparse +logstat ('test210' ,t, J40 , F10 ) ; % iso assign25: C=A +logstat ('test165' ,t, J4 , F1 ) ; % C=A*B', A diagonal, B bitmap +logstat ('test221' ,t, J40 , F10 ) ; % C += A, C bitmap, A full +logstat ('test278' ,t, J0 , F1 ) ; % descriptor get/set +logstat ('test162' ,t, J40 , F10 ) ; % C=A*B with very sparse M +logstat ('test275' ,t, J0 , F1 ) ; % monoid get/set +logstat ('test220' ,t, J4 , F1 ) ; % mask C=Z, iso case, kron +logstat ('test83' ,t, J40 , F10 ) ; % GrB_assign, C_replace and empty J +logstat ('test04' ,t, J40 , F10 ) ; % simple mask and transpose test +logstat ('test132' ,t, J4 , F1 ) ; % setElement +logstat ('test82' ,t, J4 , F1 ) ; % GrB_extract, index range (hyper) +logstat ('test202' ,t, J400 , F110 ) ; % iso add and emult +logstat ('test222' ,t, J4 , F1 ) ; % user selectop, iso matrices +logstat ('test204' ,t, J4 , F1 ) ; % iso diag +logstat ('test258' ,t, J40 , F00 ) ; % reduce-to-vector for UDT +logstat ('test136' ,s, J40 , F10 ) ; % subassignment special cases +logstat ('test128' ,t, J40 , F10 ) ; % eWiseMult, eWiseAdd, eWiseUnion +logstat ('test144' ,t, J4 , F1 ) ; % cumsum %=============================================================================== -% statement coverage test, with malloc debugging +% 1 to 10 seconds %=============================================================================== -%---------------------------------------- -% tests with high rates (over 100/sec) -%---------------------------------------- - -logstat ('test281' ,t, j4 , f1 ) ; % test user-defined idx unop, no JIT -logstat ('test201' ,t, j4 , f1 ) ; % test iso reduce to vector and scalar -logstat ('test169' ,t, j0 , f1 ) ; % C=A+B with many formats -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} ; -logstat ('test145' ,t, jall, fall) ; % dot4 for C += A'*B - -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack - -logstat ('test240' ,t, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 -logstat ('test240' ,s, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 (1 task) -logstat ('test237' ,t, j440, f100) ; % test GrB_mxm (saxpy4) -logstat ('test237' ,s, j40 , f10 ) ; % test GrB_mxm (saxpy4) (1 task) - -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -logstat ('test267' ,t, j40 , f00 ) ; % 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 -logstat ('test262' ,t, j0 , f1 ) ; % GB_mask -logstat ('test261' ,t, j4 , f0 ) ; % serialize/deserialize error handling -logstat ('test260' ,t, j4 , f0 ) ; % demacrofy name -logstat ('test259' ,t, j4 , f0 ) ; % plus_plus_fp32 semiring -logstat ('test258' ,t, j4 , f0 ) ; % reduce-to-vector for UDT -logstat ('test257' ,t, j4 , f0 ) ; % JIT error handling -logstat ('test255' ,t, j4 , f1 ) ; % flip binop -logstat ('test254' ,t, j440, f100) ; %% mask types -logstat ('test253' ,t, j4 , f1 ) ; % basic JIT tests -logstat ('test252' ,t, j4 , f1 ) ; % basic tests -logstat ('test280' ,t, j4 , f1 ) ; % subassign method 26 -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, 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 -logstat ('test210' ,t, j4 , f1 ) ; % iso assign25: C=A -logstat ('test165' ,t, j4 , f1 ) ; % test C=A*B', A is diagonal, B bitmap -logstat ('test219' ,s, j44 , f10 ) ; % test reduce to scalar (1 thread) -logstat ('test241' ,t, j4 , f1 ) ; % test GrB_mxm, trigger the swap_rule -logstat ('test220' ,t, j4 , f1 ) ; % test mask C=Z, iso case -logstat ('test211' ,t, j4 , f1 ) ; % test iso assign -logstat ('test202' ,t, j40 , f11 ) ; % test iso add and emult -logstat ('test152' ,t, j404, f110) ; % test binops C=A+B, all matrices dense -logstat ('test222' ,t, j4 , f1 ) ; % test user selectop for iso matrices - -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack - -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, j0 , f0 ) ; %% mxm zombies, typecasting (dot3,saxpy) - -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -logstat ('test239' ,t, j44 , f10 ) ; % test GxB_eWiseUnion -logstat ('test235' ,t, j4 , f1 ) ; % test GxB_eWiseUnion and GrB_eWiseAdd -logstat ('test226' ,t, j4 , f1 ) ; % test kron with iso matrices -logstat ('test223' ,t, j4 , f1 ) ; % test matrix multiply, C=A*B -logstat ('test204' ,t, j4 , f1 ) ; % test iso diag -logstat ('test203' ,t, j4 , f1 ) ; % test iso subref -logstat ('test183' ,s, j4 , f1 ) ; % test eWiseMult with hypersparse mask -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 ('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 -logstat ('test04' ,t, j4 , f1 ) ; % simple mask and transpose test -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, 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, 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) -logstat ('test206' ,t, j44 , f10 ) ; % test iso select -logstat ('test212' ,t, j44 , f10 ) ; % test iso mask all zero -logstat ('test128' ,t, j4 , f1 ) ; % eWiseMult, eWiseAdd, eWiseUnion cases -logstat ('test82' ,t, j4 , f1 ) ; % GrB_extract with index range (hyper) - -%---------------------------------------- -% tests with good rates (30 to 100/sec) -%---------------------------------------- - -logstat ('test229' ,t, j40 , f11 ) ; % test setElement -logstat ('test144' ,t, j4 , f1 ) ; % cumsum - -%---------------------------------------- -% tests with decent rates (20 to 30/sec) -%---------------------------------------- - -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack - -logstat ('test14' ,t, j44 , f10 ) ; % GrB_reduce -logstat ('test180' ,s, j4 , f1 ) ; % test assign and subassign (1 thread) -logstat ('test236' ,t, j4 , f1 ) ; % test GxB_Matrix_sort, GxB_Vector_sort - -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -%---------------------------------------- -% tests with decent rates (10 to 20/sec) -%---------------------------------------- - -logstat ('test232' ,t, j4 , f1 ) ; % test assign with GrB_Scalar -logstat ('test228' ,t, j4 , f1 ) ; % test serialize/deserialize - -%---------------------------------------- -% tests with low coverage/sec rates (1/sec to 10/sec) -%---------------------------------------- - -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack - -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, 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 - -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -logstat ('test224' ,t, j4 , f1 ) ; % test unpack/pack -logstat ('test196' ,t, j4 , f1 ) ; % test hypersparse concat -logstat ('test209' ,t, j4 , f1 ) ; % test iso build -logstat ('test104' ,t, j4 , f1 ) ; % export/import - -%---------------------------------------- -% tests with very low coverage/sec rates (< 1/sec) -%---------------------------------------- - -logstat ('test189' ,t, j4 , f1 ) ; % test large assign -logstat ('test194' ,t, j4 , f1 ) ; % test GxB_Vector_diag -logstat ('test76' ,s, j4 , f1 ) ; % GxB_resize (single threaded) -logstat ('test244' ,t, j4 , f1 ) ; % test GxB_Matrix_reshape* +% 1 to 10 seconds: debug_off +set_malloc_debug (mdebug, 0) ; +logstat ('test81' ,t, J4 , F1 ) ; % extract stride, range, backwards +logstat ('testc2(0,0)',t, J0 , F1 ) ; % A'*B, A+B, A*B, user-defn complex +logstat ('test239' ,t, J44 , F10 ) ; % GxB_eWiseUnion +logstat ('test245' ,t, J40 , F11 ) ; % complex row/col scale +logstat ('test159' ,t, J0 , F0 ) ; % A*B +logstat ('test259' ,t, J40 , F00 ) ; % plus_plus_fp32 semiring +logstat ('testc4(0)' ,t, J4 , F1 ) ; % extractElement, setElement, udt +logstat ('test157' ,t, J40 , F10 ) ; % sparsity formats +logstat ('test182' ,s, J40 , F10 ) ; % for internal wait +logstat ('test195' ,t, J4 , F1 ) ; % saxpy3 slice_balanced +logstat ('test173' ,t, J40 , F10 ) ; % GrB_assign C=A +logstat ('test135' ,t, J4 , F1 ) ; % reduce to scalar +logstat ('test84' ,t, J40 , F10 ) ; % GrB_assign (row/col w/ C CSR/CSC) +logstat ('test215' ,t, J4 , F1 ) ; % C=A'*B (dot2, ANY_PAIR) +logstat ('test80' ,t, J4 , F1 ) ; % GrB_mxm on all semirings +logstat ('test200' ,t, J4 , F1 ) ; % iso full matrix multiply +logstat ('test283' ,t, J4 , F1 ) ; % index binary op +logstat ('test254' ,t, J44 , F10 ) ; % mask types +logstat ('test142b' ,t, J40 , F00 ) ; % GrB_assign with accum +logstat ('test142' ,t, J40 , F11 ) ; % GrB_assign with accum +logstat ('test54' ,t, J40 , F10 ) ; % assign, extract with begin:inc:end +logstat ('testcc(1)' ,t, J40 , F10 ) ; % transpose, builtin complex +logstat ('testc2(1,1)',t, J44 , F10 ) ; % complex tests (quick case, builtin) +logstat ('test227' ,t, J4 , F1 ) ; % kron +logstat ('test141' ,t, J0 , F1 ) ; % eWiseAdd with dense matrices +logstat ('test179' ,t, J44 , F10 ) ; % bitmap select + +% 1 to 10 seconds, no Werk, debug_off +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test188b' ,t, J0 , F1 ) ; % concat +logstat ('test185' ,s, J4 , F1 ) ; % dot4, saxpy for all sparsity +logstat ('test256' ,t, J40 , F00 ) ; % JIT error handling +logstat ('test238b' ,t, J4 , F0 ) ; % GrB_mxm (dot4 and dot2) +logstat ('test238' ,t, J4 , F1 ) ; % GrB_mxm (dot4 and dot2) + +% Note that test186 can sometimes non-deterministically miss this block of code +% in GB_AxB_saxbit_A_sparse_B_bitmap_template.c, about line 352, so it is run +% 3 times: +% ... +% else if (cb == keep) +% { <----- HERE +% // C(i,j) is already present +% #if !GB_IS_ANY_MONOID +% GB_MULT_A_ik_B_kj ; // t = A(i,k)*B(k,j) +% GB_Z_ATOMIC_UPDATE_HX (i, t) ; // C(i,j) += t +% #endif +% } +% GB_ATOMIC_WRITE +% Cb [pC] = cb ; // unlock the entry +% ... +logstat ('test186' ,t, J4 , F1 ) ; % saxpy, all formats (slice_balanced) +logstat ('test186' ,t, J4 , F1 ) ; % saxpy, all formats (slice_balanced) +logstat ('test186' ,t, J4 , F1 ) ; % saxpy, all formats (slice_balanced) + +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +% 1 to 10 seconds: debug_on +set_malloc_debug (mdebug, 1) ; +logstat ('testca(1)' ,t, J40 , F10 ) ; % complex mxm, mxv, and vxm +logstat ('test130' ,t, J40 , F10 ) ; % GrB_apply, hypersparse cases +logstat ('test148' ,t, J40 , F10 ) ; % ewise with alias +logstat ('test231' ,t, J40 , F10 ) ; % GrB_select with idxunp +logstat ('test129' ,t, J4 , F1 ) ; % GxB_select (tril, nonz, hyper) +logstat ('test69' ,t, J40 , F10 ) ; % assign and subassign with alias +logstat ('test29' ,t, J00 , F10 ) ; % reduce with zombies +logstat ('test282' ,t, J4 , F1 ) ; % argmax, index binary op +logstat ('test249' ,t, J40 , F10 ) ; % GxB_Context object +logstat ('test196' ,t, J4 , F1 ) ; % hypersparse concat +logstat ('test250' ,t, J44 , F10 ) ; % JIT tests, set/get, other tests +logstat ('test145' ,t, J42 , F11 ) ; % dot4 for C += A'*B +logstat ('test229' ,t, J4 , F1 ) ; % setElement +logstat ('test209' ,t, J4 , F1 ) ; % iso build +logstat ('test224' ,t, J4 , F1 ) ; % unpack/pack + +% 1 to 10 seconds, no Werk, debug_on +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test191' ,t, J40 , F10 ) ; % split +logstat ('test150' ,t, J0 , F0 ) ; % mxm zombies, typecasting +logstat ('test240' ,t, J40 , F10 ) ; % dot4, saxpy4, and saxpy5 +logstat ('test237' ,t, J40 , F10 ) ; % GrB_mxm (saxpy4) +logstat ('test237' ,s, J40 , F10 ) ; % GrB_mxm (saxpy4) (1 task) +logstat ('test184' ,t, J4 , F1 ) ; % special cases: mxm, transp, build +logstat ('test236' ,t, J4 , F1 ) ; % GxB_*_sort +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack %=============================================================================== -% tests with no malloc debugging +% 10 to 100 seconds %=============================================================================== -% Turn off malloc debugging -if (malloc_debugging) - debug_off - fprintf ('[malloc debugging turned off]\n') ; - fp = fopen ('log.txt', 'a') ; - fprintf (fp, '[malloc debugging turned off]\n') ; - fclose (fp) ; -end +% 10 to 100 seconds: debug_off +set_malloc_debug (mdebug, 0) ; +logstat ('test230' ,t, J40 , F10 ) ; % apply with idxunops +logstat ('test18' ,t, J40 , F10 ) ; % GrB_eWiseAdd and eWiseMult +logstat ('testc7(0)' ,t, J40 , F10 ) ; % assign, builtin complex +logstat ('test193' ,t, J4 , F1 ) ; % GxB_Matrix_diag +logstat ('test127' ,t, J0 , F1 ) ; % eWiseAdd, eWiseMult +logstat ('test23' ,t, J0 , F1 ) ; % quick test of GB_*_build +logstat ('test243' ,t, J4 , F1 ) ; % GxB_Vector_Iterator +logstat ('test53' ,t, J40 , F10 ) ; % GB_mex_Matrix_extract +logstat ('test242' ,t, J4 , F1 ) ; % GxB_Iterator for matrices +logstat ('test17' ,t, J4 , F1 ) ; % quick test of GrB_*_extractElement +logstat ('test246' ,t, J4 , F1 ) ; % GrB_mxm: fine Hash, parallelism +logstat ('test206' ,t, J44 , F10 ) ; % iso select +logstat ('test251b' ,t, J4 , F0 ) ; % dot4, dot2, with plus_pair +logstat ('test251' ,t, J4 , F1 ) ; % dot4, dot2, with plus_pair +logstat ('test152' ,t, J44 , F10 ) ; % binops C=A+B, all dense +logstat ('test160' ,s, J0 , F1 ) ; % A*B, single threaded +logstat ('test232' ,t, J40 , F10 ) ; % assign with GrB_Scalar +logstat ('test19' ,t, J40 , F10 ) ; % GxB_subassign, many pending ops +logstat ('test19b' ,s, J40 , F10 ) ; % GrB_assign, many pending operators + +% 10 to 100 seconds, no Werk, debug_off +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test192' ,t, J4 , F1 ) ; % C=scalar +logstat ('test181' ,s, J40 , F10 ) ; % transpose with 0's in mask +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +% 10 to 100 seconds: debug_on +set_malloc_debug (mdebug, 1) ; +logstat ('test02' ,t, J4 , F1 ) ; % matrix copy and dup tests +logstat ('test11' ,t, J4 , F1 ) ; % GrB_extractTuples +logstat ('test187' ,t, J40 , F10 ) ; % dup/assign for all formats +logstat ('test189' ,t, J4 , F1 ) ; % large assign +logstat ('test169' ,t, J0 , F1 ) ; % C=A+B with many formats +logstat ('test76' ,s, J4 , F1 ) ; % GxB_resize (single threaded) +logstat ('test01' ,t, J40 , F10 ) ; % error handling +logstat ('test228' ,t, J4 , F1 ) ; % serialize/deserialize +logstat ('test104' ,t, J4 , F1 ) ; % export/import +logstat ('test284' ,t, J40 , F11 ) ; % semirings w/ index binary ops + +% 10 to 100 seconds, no Werk, debug_on +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test180' ,s, J40 , F10 ) ; % assign and subassign (1 thread) +logstat ('test188' ,t, J4 , F1 ) ; % concat +logstat ('test151b' ,t, J40 , F10 ) ; % bshift operator +logstat ('test14b' ,t, J4 , F0 ) ; % GrB_reduce +logstat ('test14' ,t, J4 , F1 ) ; % GrB_reduce +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack -%---------------------------------------- -% tests with good rates (30 to 100/sec) -%---------------------------------------- - -logstat ('test225' ,t, j4 , f1 ) ; % test mask operations (GB_masker) -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, 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 -logstat ('test148' ,t, j4 , f1 ) ; % ewise with alias - -%---------------------------------------- -% tests with decent rates (20 to 30/sec) -%---------------------------------------- - -logstat ('test157' ,t, j4 , f1 ) ; % test sparsity formats -logstat ('test182' ,s, j4 , f1 ) ; % test for internal wait - -%---------------------------------------- -% tests with decent rates (10 to 20/sec) -%---------------------------------------- - -logstat ('test108' ,t, j40 , f10 ) ; % boolean monoids -logstat ('test130' ,t, j4 , f1 ) ; % GrB_apply, hypersparse cases -logstat ('test124' ,t, j4 , f1 ) ; % GrB_extract, case 6 -logstat ('test138' ,s, j4 , f1 ) ; % assign, coarse-only tasks in IxJ slice -logstat ('test227' ,t, j4 , f1 ) ; % test kron -logstat ('test125' ,t, j4 , f1 ) ; % test GrB_mxm: row and column scaling - -%---------------------------------------- -% 1 to 10/sec -%---------------------------------------- - -logstat ('test234' ,t, j40 , f11 ) ; % test GxB_eWiseUnion -logstat ('test242' ,t, j4 , f1 ) ; % test GxB_Iterator for matrices -logstat ('test173' ,t, j4 , f1 ) ; % test GrB_assign C=A -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' ,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 ('test23' ,t, j0 , f1 ) ; % quick test of GB_*_build -logstat ('test135' ,t, j4 , f1 ) ; % reduce to scalar -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, j0 , f1 ) ; % test GrB_mxm on all semirings -logstat ('test127' ,t, j0 , f1 ) ; % test eWiseAdd, eWiseMult -logstat ('test19' ,t, j4 , f1 ) ; % GxB_subassign, many pending operators - -%---------------------------------------- -% < 1 per sec -%---------------------------------------- - -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 -logstat ('test195' ,t, j4 , f1 ) ; % all variants of saxpy3 slice_balanced -logstat ('test243' ,t, j4 , f1 ) ; % test GxB_Vector_Iterator -logstat ('test29' ,t, j0 , f1 ) ; % reduce with zombies - -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 - -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack - -logstat ('test187' ,t, j4 , f1 ) ; % test dup/assign for all formats -logstat ('test192' ,t, j4 , f1 ) ; % test C=scalar -logstat ('test181' ,s, j4 , f1 ) ; % transpose with explicit zeros in mask -logstat ('test185' ,s, j4 , f1 ) ; % test dot4, saxpy for all sparsity - -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -logstat ('test53' ,t, j4 , f1 ) ; % quick test of GB_mex_Matrix_extract -logstat ('test17' ,t, j4 , f1 ) ; % quick test of GrB_*_extractElement -logstat ('test231' ,t, j4 , f1 ) ; % test GrB_select with idxunp - -%---------------------------------------- -% longer tests (200 seconds to 600 seconds, or low rate of coverage) -%---------------------------------------- - -logstat ('test10' ,t, j4 , f1 ) ; % GrB_apply -logstat ('test75b' ,t, j4 , f1 ) ; % test GrB_mxm A'*B -logstat ('test21b' ,t, j4 , f1 ) ; % quick test of GB_mex_assign -logstat ('testca(1)' ,t, j4 , f1 ) ; % test complex mxm, mxv, and vxm -logstat ('test81' ,t, j4 , f1 ) ; % extract with stride, range, backwards -logstat ('test18' ,t, j4 , f1 ) ; % GrB_eWiseAdd and eWiseMult - -if (malloc_debugging) - debug_on - fprintf ('[malloc debugging turned back on]\n') ; - fp = fopen ('log.txt', 'a') ; - fprintf (fp, '[malloc debugging turned back on]\n') ; - fclose (fp) ; -end +%=============================================================================== +% > 100 seconds +%=============================================================================== + +% > 100 seconds, debug_off +set_malloc_debug (mdebug, 0) ; +logstat ('test125' ,t, J4 , F1 ) ; % GrB_mxm: row and column scaling +logstat ('test10' ,t, J4 , F1 ) ; % GrB_apply +logstat ('test75b' ,t, J4 , F1 ) ; % GrB_mxm A'*B +logstat ('test74' ,t, J0 , F1 ) ; % GrB_mxm on all semirings +logstat ('test234' ,t, J4 , F1 ) ; % GxB_eWiseUnion + +% > 100 seconds, no Werk, debug_on +set_malloc_debug (mdebug, 1) ; +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test154b' ,t, J0 , F1 ) ; % apply with binop and scalar binding +logstat ('test154' ,t, J4 , F1 ) ; % apply with binop and scalar binding +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +% > 100 seconds, debug_off +logstat ('test280' ,t, J4 , F1 ) ; % subassign method 26 +logstat ('test21b' ,t, J0 , F0 ) ; % GB_mex_assign + +%=============================================================================== +% finalize +%=============================================================================== +% restore the original malloc debug state +set_malloc_debug (mdebug, debug_save) ; t = toc (testall_time) ; fprintf ('\ntestall: all tests passed, total time %0.4g minutes\n', t / 60) ; diff --git a/Test/testca.m b/Test/testca.m index aa474353d9..60f21889d9 100644 --- a/Test/testca.m +++ b/Test/testca.m @@ -18,27 +18,29 @@ function testca(use_builtin) algos = {'auto', 'gustavson', 'dot', 'hash', 'saxpy'} ; -for kk = 1:length(algos) +semiring.add = 'plus' ; +semiring.multiply = 'times' ; +semiring.class = 'double complex' ; + +kk = 1 ; % 1:length(algos) dnn.algo = algos {kk} ; dnt.algo = algos {kk} ; dtn.algo = algos {kk} ; dtt.algo = algos {kk} ; -semiring.add = 'plus' ; -semiring.multiply = 'times' ; -semiring.class = 'double complex' ; - seed = 1 ; -for m = [1 5 10 100] +for m = [1 5] % [ 10 100] for n = [1 5 10 100] for k = [1 5 10 100] - fprintf ('.') ; - for trial = 1:31 - A = GB_mex_random (m, k, 10*(m+k), 1, seed) ; seed = seed + 1 ; - B = GB_mex_random (k, n, 10*(k+n), 1, seed) ; seed = seed + 1 ; + % fprintf ('.') ; + for trial = 1:30 % 1:31 + + A = GB_mex_random (m, k, 10*(m+k), 1, seed ) ; + B = GB_mex_random (k, n, 10*(k+n), 1, seed+1) ; S = GB_mex_complex (sparse (m,n)) ; - D = GB_mex_random (m, n, 10*(m+n), 1, seed) ; seed = seed + 1 ; + D = GB_mex_random (m, n, 10*(m+n), 1, seed+2) ; + seed = seed + 3 ; if (trial == 31) A (:,1) = 1i * rand (m,1) ; @@ -100,11 +102,11 @@ function testca(use_builtin) C = (A*B) .* M ; assert (isequal_roundoff (C, C2.matrix)) ; - end - end + end + fprintf ('.') ; + end end end -end fprintf ('\ntestca: all complex mxm, mxv, vxm tests passed\n') ; diff --git a/Test/testmake.m b/Test/testmake.m index 2268154875..83e4e92a28 100644 --- a/Test/testmake.m +++ b/Test/testmake.m @@ -1,5 +1,5 @@ function testmake (what) -%MAKE compiles the test interface to GraphBLAS +%TESTMAKE compiles the test interface to GraphBLAS % and dynamically links it with the libraries in ../build/libgraphblas. % % This @GrB interface to GraphBLAS is meant for testing and development, @@ -228,3 +228,4 @@ function testmake (what) end + diff --git a/Tcov/grbuniq.m b/Test/unused/grbuniq.m similarity index 100% rename from Tcov/grbuniq.m rename to Test/unused/grbuniq.m diff --git a/Test/unused/save_test75b.m b/Test/unused/save_test75b.m new file mode 100644 index 0000000000..d271a1d8b4 --- /dev/null +++ b/Test/unused/save_test75b.m @@ -0,0 +1,165 @@ +function test75b +%TEST75B GrB_mxm and GrB_vxm on all semirings (shorter test than test75) + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test75b: test mxm and vxm on all semirings\n') ; +[binops, ~, add_ops, types, ~, ~] = GB_spec_opsall ; +mult_ops = binops.all ; +types = types.all ; + +rng ('default') ; + +m = 200 ; +n = 5 ; +A_sparse = sprandn (m, n, 0.1) ; +A_sparse (:,3) = 0 ; +A_sparse (2,3) = 1.7 ; +A_sparse (18,3) = 2.2 ; +A_sparse (:,1:2) = sparse (rand (m,2)) ; +A_sparse (1,1) = 0; +A_sparse (18,1) = 0; +A_sparse (:,5) = 0 ; +A_sparse (1,5) = 11 ; +A_sparse (2,5) = 23 ; +A_sparse (18,5) = 33 ; + +B_sparse = sprandn (m, n, 0.1) ; +B_sparse (:,1) = 0 ; +B_sparse (1,1) = 3 ; +B_sparse (18,1) = 2 ; +B_sparse (:,[2 n]) = sparse (rand (m,2)) ; +B_sparse (3,2) = 0 ; +B_sparse (18,2) = 0 ; +A_sparse (:,3) = 0 ; +B_sparse (2,1) = 7 ; +B_sparse (18,1) = 8 ; +B_sparse (19,1) = 9 ; + +x_sparse = sparse (rand (m,1)) ; +x_sparse (99) = 0 ; + +y_sparse = sparse (zeros (m,1)) ; +y_sparse (99) = 1 ; + +A.matrix = A_sparse ; +A.class = 'see below' ; +A.pattern = logical (spones (A_sparse)) ; + +B.matrix = B_sparse ; +B.class = 'see below' ; +B.pattern = logical (spones (B_sparse)) ; + +X.matrix = x_sparse ; +X.class = 'see below' ; +X.pattern = logical (spones (x_sparse)) ; + +Y.matrix = y_sparse ; +Y.class = 'see below' ; +Y.pattern = logical (spones (y_sparse)) ; + +fprintf ('\n-------------- GrB_mxm, vxm (dot product) on many semirings\n') ; + +Cin = sparse (n, n) ; + +Din = 10 * sparse (rand (n, n)) ; +D.matrix = Din ; +D.class = 'see below' ; +D.pattern = true (n,n) ; + +Xin = sparse (n, 1) ; + +Mask = sparse (ones (n,n)) ; +mask = sparse (ones (n,1)) ; + +dnn = struct ; +dtn = struct ( 'inp0', 'tran' ) ; +dtn_dot = struct ( 'inp0', 'tran', 'axb', 'dot' ) ; +dtn_saxpy = struct ( 'inp0', 'tran', 'axb', 'saxpy' ) ; +dnt = struct ( 'inp1', 'tran' ) ; +dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; + +n_semirings = 0 ; + +track_coverage = true ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + +for k1 = 1:length(mult_ops) + mulop = mult_ops {k1} ; + fprintf ('\n%-10s ', mulop) ; + if (track_coverage) + fprintf ('\n') ; + end + GB_mex_finalize ; + + for k2 = 1:length(add_ops) + addop = add_ops {k2} ; + + for k3 = 1:length (types) + type = types {k3} ; + + semiring.multiply = mulop ; + semiring.add = addop ; + semiring.class = type ; + + % create the semiring. some are not valid because the or,and,xor,eq + % monoids can only be used when z is boolean with z=mult(x,y). + try + [mult_op add_op id] = GB_spec_semiring (semiring) ; + [mult_opname mult_optype ztype xtype ytype] = ... + GB_spec_operator (mult_op) ; + [ add_opname add_optype] = GB_spec_operator (add_op) ; + identity = GB_spec_identity (semiring.add, add_optype) ; + catch + continue + end + + A.class = type ; + B.class = type ; + X.class = type ; + Y.class = type ; + D.class = add_op.optype ; + + n_semirings = n_semirings + 1 ; + + % C += A'*B, C dense, typecasting of C + % (test coverage: 96) + C1 = GB_mex_mxm (Din, [ ], add_op, semiring, A, B, dtn_dot) ; + C2 = GB_spec_mxm (Din, [ ], add_op, semiring, A, B, dtn) ; + GB_spec_compare (C1, C2, id) ; + + % C += A'*B, C sparse, no typecasting of C + % (test coverage: 1,234) + C1 = GB_mex_mxm (D, [ ], add_op, semiring, A, B, dtn_dot) ; + C2 = GB_spec_mxm (D, [ ], add_op, semiring, A, B, dtn) ; + GB_spec_compare (C1, C2, id) ; + + % X = u*A, with mask (test coverage: 12) + C1 = GB_mex_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; + C2 = GB_spec_vxm (Xin, mask, [ ], semiring, X, A, [ ]) ; + GB_spec_compare (C1, C2, id) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf ('[%s.%s.%s %d %d]\n', addop, mulop, type, d, c-cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + + end + end +end + +fprintf ('\nsemirings tested: %d\n', n_semirings) ; +fprintf ('\ntest75b: all tests passed\n') ; + diff --git a/Test/unused/test127.m b/Test/unused/test127.m new file mode 100644 index 0000000000..0541858bbd --- /dev/null +++ b/Test/unused/test127.m @@ -0,0 +1,428 @@ +function test127 +%TEST127 test GrB_eWiseAdd and GrB_eWiseMult (all types and operators) + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; +binops = binops.all ; +types = types.all ; + +fprintf ('test127 -----------tests of GrB_eWiseAdd and eWiseMult (all ops)\n') ; + +m = 5 ; +n = 5 ; + +rng ('default') ; + +dnn = struct ; +dtn = struct ( 'inp0', 'tran' ) ; +dnt = struct ( 'inp1', 'tran' ) ; +dtt = struct ( 'inp0', 'tran', 'inp1', 'tran' ) ; +dnn_notM = struct ('mask', 'complement') ; + +Amat2 = sparse (2 * sprand (m,n, 0.8)) ; +Bmat2 = sparse (2 * sprand (m,n, 0.8)) ; +Cmat2 = sparse (2 * sprand (m,n, 0.8)) ; +w2 = sparse (2 * sprand (m,1, 0.8)) ; +uvec2 = sparse (2 * sprand (m,1, 0.8)) ; +vvec2 = sparse (2 * sprand (m,1, 0.8)) ; + +Amat = sparse (100 * sprandn (m,n, 0.8)) ; +Bmat = sparse (100 * sprandn (m,n, 0.8)) ; +Cmat = sparse (100 * sprandn (m,n, 0.8)) ; +w = sparse (100 * sprandn (m,1, 0.8)) ; +uvec = sparse (100 * sprandn (m,1, 0.8)) ; +vvec = sparse (100 * sprandn (m,1, 0.8)) ; + +Maskmat = sprandn (m,n,0.9) ~= 0 ; +maskvec = sprandn (m,1,0.9) ~= 0 ; + +% create a very sparse matrix mask +Maskmat2 = sparse (m,n) ; +T = Amat .* Bmat ; +[i j x] = find (T) ; +if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; +end +T = (Amat ~= 0) & (Bmat == 0) ; +[i j x] = find (T) ; +if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; +end +T = (Amat == 0) & (Bmat ~= 0) ; +[i j x] = find (T) ; +if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; +end +clear T i j x + +% create a very sparse vector mask +maskvec2 = sparse (m,1) ; +T = uvec .* vvec ; +[i j x] = find (T) ; +if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; +end +T = (uvec ~= 0) & (vvec == 0) ; +[i j x] = find (T) ; +if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; +end +T = (uvec == 0) & (vvec ~= 0) ; +[i j x] = find (T) ; +if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; +end +clear T i j x + +ATmat = Amat' ; +BTmat = Bmat' ; + +ATmat2 = Amat2.' ; +BTmat2 = Bmat2.' ; + +for k1 = 1:length (types) + type = types {k1} ; + fprintf ('\n\n%-8s : ', type) ; + + for k2 = 1:length(binops) + binop = binops {k2} ; + + op.opname = binop ; + op.optype = type ; + + if (test_contains (type, 'single')) + tol = 1e-5 ; + elseif (test_contains (type, 'double')) + tol = 1e-12 ; + else + tol = 0 ; + end + + try + GB_spec_operator (op) ; + catch + continue ; + end + + fprintf (' %s', binop) ; + + for A_sparsity_control = 0:1 + for A_is_csc = 0 % 0:1 + for B_sparsity_control = 0:1 + for B_is_csc = 0 % 0:1 + for C_sparsity_control = 0:1 + for C_is_csc = 0 % 0:1 + + if (A_sparsity_control == 0) + A_is_hyper = 0 ; % not hyper + A_sparsity = 1 ; % sparse + else + A_is_hyper = 0 ; % not hyper + A_sparsity = 4 ; % bitmap + end + + if (B_sparsity_control == 0) + B_is_hyper = 0 ; % not hyper + B_sparsity = 1 ; % sparse + else + B_is_hyper = 0 ; % not hyper + B_sparsity = 4 ; % bitmap + end + + if (C_sparsity_control == 0) + C_is_hyper = 0 ; % not hyper + C_sparsity = 1 ; % sparse + else + C_is_hyper = 0 ; % not hyper + C_sparsity = 4 ; % bitmap + end + + for native = 1 % 0:1 + + clear A AT B BT C u v + + if (isequal (binop, 'pow')) + A.matrix = Amat2 ; + AT.matrix = ATmat2 ; + B.matrix = Bmat2 ; + BT.matrix = BTmat2 ; + C.matrix = Cmat2 ; + u.matrix = uvec2 ; + v.matrix = vvec2 ; + else + A.matrix = Amat ; + AT.matrix = ATmat ; + B.matrix = Bmat ; + BT.matrix = BTmat ; + C.matrix = Cmat ; + u.matrix = uvec ; + v.matrix = vvec ; + end + + A.is_hyper = A_is_hyper ; + A.is_csc = A_is_csc ; + A.sparsity = A_sparsity ; + if (native) + A.class = op.optype ; + end + + AT.is_hyper = A_is_hyper ; + AT.sparsity = A_sparsity ; + AT.is_csc = A_is_csc ; + if (native) + AT.class = op.optype ; + end + + B.is_hyper = B_is_hyper ; + B.sparsity = B_sparsity ; + B.is_csc = B_is_csc ; + if (native) + B.class = op.optype ; + end + + BT.is_hyper = B_is_hyper ; + BT.sparsity = B_sparsity ; + BT.is_csc = B_is_csc ; + if (native) + BT.class = op.optype ; + end + + C.is_hyper = C_is_hyper ; + C.is_csc = C_is_csc ; + C.sparsity = C_sparsity ; + + u.is_csc = true ; + if (native) + u.class = op.optype ; + end + + v.is_csc = true ; + if (native) + v.class = op.optype ; + end + + %--------------------------------------- + % A+B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, A, B, dnn) ; + C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, A, B, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseAdd (w, [ ], [ ], op, u, v, dnn) ; + w1 = GB_mex_Vector_eWiseAdd (w, [ ], [ ], op, u, v, dnn) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A'+B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, AT, B, dtn) ; + C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, AT, B, dtn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A+B' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, A, BT, dnt) ; + C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, A, BT, dnt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A'+B' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, [ ], [ ], op, AT, BT, dtt) ; + C1 = GB_mex_Matrix_eWiseAdd (C, [ ], [ ], op, AT, BT, dtt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, A, B, dnn) ; + C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, A, B, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseMult (w, [ ], [ ], op, u, v, dnn) ; + w1 = GB_mex_Vector_eWiseMult (w, [ ], [ ], op, u, v, dnn) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A'.*B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, AT, B, dtn) ; + C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, AT, B, dtn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % B.*A' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, B, AT, dnt) ; + C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, B, AT, dnt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, A, BT, dnt) ; + C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, A, BT, dnt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A'.*B' + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op, AT, BT, dtt) ; + C1 = GB_mex_Matrix_eWiseMult (C, [ ], [ ], op, AT, BT, dtt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %----------------------------------------------- + % with mask + %----------------------------------------------- + + for M_is_very_sparse = 0 % 0:1 + % for M_is_hyper = 0 % 0:1 + for M_sparsity_control = 0:1 + for M_is_csc = 0 % 0:1 + + clear Mask mask + if (M_is_very_sparse) + Mask.matrix = Maskmat2 ; + mask.matrix = maskvec2 ; + else + Mask.matrix = Maskmat ; + mask.matrix = maskvec ; + end + + if (M_sparsity_control == 0) + M_is_hyper = 0 ; % not hyper + M_sparsity = 1 ; % sparse + else + M_is_hyper = 0 ; % not hyper + M_sparsity = 4 ; % bitmap + end + + Mask.is_hyper = M_is_hyper ; + Mask.sparsity = M_sparsity ; + Mask.is_csc = M_is_csc ; + mask.is_csc = true ; + + %--------------------------------------- + % A+B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn) ; + C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn) ; + w1 = GB_mex_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A+B, with mask complemented + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn_notM) ; + C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, B, dnn_notM) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn_notM) ; + w1 = GB_mex_Vector_eWiseAdd (w, mask, [ ], op, u, v, dnn_notM) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A'+B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, AT, B, dtn) ; + C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, AT, B, dtn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A+B', with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, A, BT, dnt) ; + C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, A, BT, dnt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A'+B', with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseAdd (C, Mask, [ ], op, AT, BT, dtt) ; + C1 = GB_mex_Matrix_eWiseAdd (C, Mask, [ ], op, AT, BT, dtt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn) ; + C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn) ; + w1 = GB_mex_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A'.*B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, AT, B, dtn) ; + C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, AT, B, dtn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B', with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, BT, dnt) ; + C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, BT, dnt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A'.*B', with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, AT, BT, dtt) ; + C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, AT, BT, dtt) ; + GB_spec_compare (C0, C1, 0, tol) ; + + %--------------------------------------- + % A.*B, with mask complemented + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn_notM) ; + C1 = GB_mex_Matrix_eWiseMult (C, Mask, [ ], op, A, B, dnn_notM) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn_notM) ; + w1 = GB_mex_Vector_eWiseMult (w, mask, [ ], op, u, v, dnn_notM) ; + GB_spec_compare (w0, w1, 0, tol) ; + + + end + end + end + end + end + end + end + end + end + end + end +end + +fprintf ('\ntest127: all tests passed\n') ; + diff --git a/Test/unused/test14.m b/Test/unused/test14.m new file mode 100644 index 0000000000..65333c7f62 --- /dev/null +++ b/Test/unused/test14.m @@ -0,0 +1,250 @@ +function test14 +%TEST14 test GrB_reduce + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('\ntest14: reduce to column and scalar\n') ; + +[~, ~, add_ops, types, ~, ~] = GB_spec_opsall ; +types = types.all ; + +rng ('default') ; + +m = 8 ; +n = 4 ; +dt = struct ('inp0', 'tran') ; + +for k1 = 1:length(types) + atype = types {k1} ; + fprintf ('.') ; + A = GB_spec_random (m, n, 0.3, 100, atype) ; + B = GB_spec_random (n, m, 0.3, 100, atype) ; + w = GB_spec_random (m, 1, 0.3, 100, atype) ; + cin = GB_mex_cast (0, atype) ; + + clear S_input + S_input.matrix = cin ; + S_input.pattern = true ; + S_input.class = atype ; + + clear E_input + E_input.matrix = sparse (0) ; + E_input.pattern = false ; + E_input.class = atype ; + + mask = GB_random_mask (m, 1, 0.5, true, false) ; + + if (isequal (atype, 'logical')) + ops = {'or', 'and', 'xor', 'eq', 'any'} ; + else + ops = {'min', 'max', 'plus', 'times', 'any'} ; + end + + if (isequal (atype, 'double')) + hrange = [0 1] ; + crange = [0 1] ; + else + hrange = 0 ; + crange = 1 ; + end + + is_float = test_contains (atype, 'single') || test_contains (atype, 'double') ; + + for A_is_hyper = 0:1 + for A_is_csc = 0:1 + + A.is_csc = A_is_csc ; A.is_hyper = A_is_hyper ; + B.is_csc = A_is_csc ; B.is_hyper = A_is_hyper ; + + for k2 = 1:length(add_ops) + op = add_ops {k2} ; + + if (isequal (op, 'any')) + tol = [ ] ; + elseif (test_contains (atype, 'single')) + tol = 1e-5 ; + elseif (test_contains (atype, 'double')) + tol = 1e-12 ; + else + tol = 0 ; + end + + try + GB_spec_operator (op, atype) ; + identity = GB_spec_identity (op, atype) ; + catch + continue + end + + % no mask + w1 = GB_spec_reduce_to_vector (w, [], [], op, A, []) ; + w2 = GB_mex_reduce_to_vector (w, [], [], op, A, []) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % no mask, with accum + w1 = GB_spec_reduce_to_vector (w, [], 'plus', op, A, []) ; + w2 = GB_mex_reduce_to_vector (w, [], 'plus', op, A, []) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % with mask + w1 = GB_spec_reduce_to_vector (w, mask, [], op, A, []) ; + w2 = GB_mex_reduce_to_vector (w, mask, [], op, A, []) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % with mask and accum + w1 = GB_spec_reduce_to_vector (w, mask, 'plus', op, A, []) ; + w2 = GB_mex_reduce_to_vector (w, mask, 'plus', op, A, []) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % no mask, transpose + w1 = GB_spec_reduce_to_vector (w, [], [], op, B, dt) ; + w2 = GB_mex_reduce_to_vector (w, [], [], op, B, dt) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % no mask, with accum, transpose + w1 = GB_spec_reduce_to_vector (w, [], 'plus', op, B, dt) ; + w2 = GB_mex_reduce_to_vector (w, [], 'plus', op, B, dt) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % with mask, transpose + w1 = GB_spec_reduce_to_vector (w, mask, [], op, B, dt) ; + w2 = GB_mex_reduce_to_vector (w, mask, [], op, B, dt) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % with mask and accum, transpose + w1 = GB_spec_reduce_to_vector (w, mask, 'plus', op, B, dt) ; + w2 = GB_mex_reduce_to_vector (w, mask, 'plus', op, B, dt) ; + GB_spec_compare (w1, w2, identity, tol) ; + + % GB_spec_reduce_to_scalar always operates column-wise, but GrB_reduce + % operates in whatever order it is given: by column if CSC or by row if + % CSR. The result can vary slightly because of different round off + % errors. A_flip causes GB_spec_reduce_to_scalar to operate in the + % same order as GrB_reduce. + + A_flip = A ; + if (~A.is_csc && is_float) + A_flip.matrix = A_flip.matrix.' ; + A_flip.pattern = A_flip.pattern' ; + A_flip.is_csc = true ; + end + + % Parallel reduction leads to different roundoff. So even with A_flip, + % c1 and c2 can only be compared to within round-off error. + + % to scalar + c2 = GB_mex_reduce_to_scalar (cin, [ ], op, A) ; + if (isequal (op, 'any')) + X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; + assert (any (X == c2)) ; + else + c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; + end + end + + % to GrB_Scalar + S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], op, A) ; + c2 = S.matrix ; + if (isequal (op, 'any')) + X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; + assert (any (X == c2)) ; + else + c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; + end + end + + % to GrB_Scalar + S = GB_mex_reduce_to_GrB_Scalar (E_input, [ ], op, A) ; + c2 = S.matrix ; + if (isequal (op, 'any')) + X = GB_mex_cast (full (A.matrix (A.pattern)), A.class) ; + assert (any (X == c2)) ; + else + c1 = GB_spec_reduce_to_scalar (cin, [ ], op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; + end + end + + % vector to GrB_Scalar + S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], op, w) ; + c2 = S.matrix ; + if (isequal (op, 'any')) + X = GB_mex_cast (full (w.matrix (w.pattern)), w.class) ; + assert (any (X == c2)) ; + else + c1 = GB_spec_reduce_to_scalar (cin, [ ], op, w) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; + end + end + + % to scalar, with accum + c2 = GB_mex_reduce_to_scalar (cin, 'plus', op, A) ; + if (~isequal (op, 'any')) + c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; + end + end + + % to GrB_Scalar, with accum + S = GB_mex_reduce_to_GrB_Scalar (S_input, 'plus', op, A) ; + c2 = S.matrix ; + if (~isequal (op, 'any')) + c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, A_flip) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; + end + end + + % vector to GrB_Scalar, with accum + S = GB_mex_reduce_to_GrB_Scalar (S_input, 'plus', op, w) ; + c2 = S.matrix ; + if (~isequal (op, 'any')) + c1 = GB_spec_reduce_to_scalar (cin, 'plus', op, w) ; + if (is_float) + assert (abs (c1-c2) < tol * (abs(c1) + 1)) + else + assert (isequal (c1, c2)) ; + end + end + + end + end + end +end + +clear A +A.matrix = sparse (4,5) ; +A.pattern = false (4,5) ; +A.class = 'double' ; + +clear S_input +S_input.matrix = 1 ; +S_input.pattern = true ; +S_input.class = 'double' ; + +% empty matrix to GrB_Scalar +S = GB_mex_reduce_to_GrB_Scalar (S_input, [ ], 'plus', A) ; +assert (nnz (S.matrix) == 0) ; + +fprintf ('\ntest14: all tests passed\n') ; + diff --git a/Test/unused/test142.m b/Test/unused/test142.m new file mode 100644 index 0000000000..25a0f00e26 --- /dev/null +++ b/Test/unused/test142.m @@ -0,0 +1,217 @@ +function test142 +%TEST142 test GrB_assign for dense matrices + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; +binops = binops.all ; +types = types.all ; + +fprintf ('test142 ------------ GrB_assign with dense matrices\n') ; + +m = 10 ; +n = 12 ; + +rng ('default') ; + +M = sprand (m, n, 0.5) ; + +Amat2 = sparse (2 * rand (m,n)) ; +Bmat2 = sparse (2 * sprand (m,n, 0.5)) ; +Cmat2 = sparse (2 * rand (m,n)) ; + +Amat = 50 * Amat2 ; +Bmat = 50 * Bmat2 ; +Cmat = 50 * Cmat2 ; + +Smat = sparse (m,n) ; +Xmat = sparse (pi) ; +desc.mask = 'structural' ; +drep.outp = 'replace' ; + +A.matrix = Amat ; A.class = 'see below' ; +B.matrix = Bmat ; B.class = 'see below' ; +C.matrix = Cmat ; C.class = 'see below' ; +S.matrix = Smat ; S.class = 'see below' ; +X.matrix = Xmat ; X.class = 'see below' ; +Bmask = logical (Bmat) ; +A.sparsity = 8 ; +C.sparsity = 8 ; +X.sparsity = 8 ; + +for k1 = 1:length (types) + type = types {k1} ; + fprintf ('%s ', type) ; + + A.class = type ; + id = test_cast (0, type) ; + A_iso = A ; + A_iso.iso = true ; + + for k3 = 1:3 + + if (k3 == 1) + X.class = type ; + B.class = type ; + C.class = 'logical' ; + S.class = 'logical' ; + elseif (k3 == 2) + X.class = type ; + B.class = type ; + C.class = type ; + S.class = type ; + else + X.class = 'int8' ; + B.class = 'int8' ; + C.class = type ; + S.class = type ; + end + + %--------------------------------------- + % C = A where A is dense + %--------------------------------------- + + C0 = GB_spec_assign (C, M, [ ], A, [ ], [ ], [ ], false) ; + C1 = GB_mex_assign (C, M, [ ], A, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % C = B where B is sparse + %--------------------------------------- + + C0 = GB_spec_assign (C, M, [ ], B, [ ], [ ], [ ], false) ; + C1 = GB_mex_assign (C, M, [ ], B, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % C = A where A is dense and C starts empty + %--------------------------------------- + + C0 = GB_spec_assign (S, M, [ ], A, [ ], [ ], desc, false) ; + C1 = GB_mex_assign (S, M, [ ], A, [ ], [ ], desc) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % C = A where A is iso full and C starts empty + %--------------------------------------- + + C0 = GB_spec_assign (S, M, [ ], A_iso, [ ], [ ], desc, false) ; + C1 = GB_mex_assign (S, M, [ ], A_iso, [ ], [ ], desc) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % C = B where B is sparse + %--------------------------------------- + + C0 = GB_spec_assign (C, Bmask, [ ], B, [ ], [ ], desc, false) ; + C1 = GB_mex_assign_alias_mask (C, B, desc) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % C = x where C is dense + %--------------------------------------- + + C0 = GB_spec_assign (C, M, [ ], X, [ ], [ ], [ ], true) ; + C1 = GB_mex_assign (C, M, [ ], X, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % C = x where C is dense + %--------------------------------------- + + C0 = GB_spec_assign (C, M, [ ], X, [ ], [ ], desc, true) ; + C1 = GB_mex_assign (C, M, [ ], X, [ ], [ ], desc) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % C = x + %--------------------------------------- + + C0 = GB_spec_assign (S, M, [ ], X, [ ], [ ], desc, true) ; + C1 = GB_mex_assign (S, M, [ ], X, [ ], [ ], desc) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % C = x + %--------------------------------------- + + C0 = GB_spec_assign (S, [ ], [ ], X, [ ], [ ], [ ], true) ; + C1 = GB_mex_assign (S, [ ], [ ], X, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1) ; + + %--------------------------------------- + % with accum operators + %--------------------------------------- + + for k2 = 1:length(binops) + binop = binops {k2} ; + + tol = [ ] ; + switch (binop) + case { 'pow', 'atan2', 'hypot', 'remainder' } + A.matrix = Amat2 ; + B.matrix = Bmat2 ; + C.matrix = Cmat2 ; + if (test_contains (type, 'single')) + tol = 1e-5 ; + elseif (test_contains (type, 'double')) + tol = 1e-12 ; + end + otherwise + A.matrix = Amat ; + B.matrix = Bmat ; + C.matrix = Cmat ; + end + + accum.opname = binop ; + accum.optype = type ; + + try + GB_spec_operator (accum) ; + catch + continue + end + + if (GB_spec_is_positional (accum)) + continue ; + end + + %--------------------------------------- + % C += A where A is dense + %--------------------------------------- + + C0 = GB_spec_assign (C, [ ], accum, A, [ ], [ ], [ ], false) ; + C1 = GB_mex_assign (C, [ ], accum, A, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1, id, tol) ; + + %--------------------------------------- + % C += B where B is sparse + %--------------------------------------- + + C0 = GB_spec_assign (C, [ ], accum, B, [ ], [ ], [ ], false) ; + C1 = GB_mex_assign (C, [ ], accum, B, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1, id, tol) ; + + %--------------------------------------- + % C += x + %--------------------------------------- + + C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], [ ], true) ; + C1 = GB_mex_assign (C, [ ], accum, X, [ ], [ ], [ ]) ; + GB_spec_compare (C0, C1, id, tol) ; + + %--------------------------------------- + % C += x + %--------------------------------------- + + C0 = GB_spec_assign (C, [ ], accum, X, [ ], [ ], drep, true) ; + C1 = GB_mex_subassign (C, [ ], accum, X, [ ], [ ], drep) ; + GB_spec_compare (C0, C1, id, tol) ; + + end + end +end + +fprintf ('\ntest142: all tests passed\n') ; + diff --git a/Test/unused/test154.m b/Test/unused/test154.m new file mode 100644 index 0000000000..822a3f6311 --- /dev/null +++ b/Test/unused/test154.m @@ -0,0 +1,179 @@ +function test154 +%TEST154 test GrB_apply with scalar binding + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; +ops = binops.all ; +types = types.all ; + +fprintf ('\n--- testing apply with binaryop and scalar binding\n') ; +rng ('default') ; +% the right approach for apply_bind1st and apply_bind2nd +desc0.inp0 = 'tran' ; +desc1.inp1 = 'tran' ; +% shotgun approach for eWiseMult +desc.inp0 = 'tran' ; +desc.inp1 = 'tran' ; + +n_operators = 0 ; +for k2 = 1:length(ops) + mulop = ops {k2} ; + fprintf ('\n%-10s ', mulop) ; + + for k1 = 1:length (types) + type = types {k1} ; + + % create the op + clear op + op.opname = mulop ; + op.optype = type ; + + try + [oname ot ztype xtype ytype] = GB_spec_operator (op) ; + catch + continue ; + end + n_operators = n_operators + 1 ; + + switch (mulop) + case { 'pow' } + xlimits = [0, 5] ; + ylimits = [0, 5] ; + case { 'ldexp' } + xlimits = [-5, 5] ; + ylimits = [-5, 5] ; + otherwise + xlimits = [ ] ; + ylimits = [ ] ; + end + + if (test_contains (type, 'single')) + tol = 1e-5 ; + elseif (test_contains (type, 'double')) + tol = 1e-12 ; + else + tol = 0 ; + end + + fprintf ('.') ; + + for m = [1 4] % [ 1 10 ]% 100] + for n = [1 4] % [1 10 ]% 100] + for hi = [1 5] % [-1:2:5 ] + for lo = [-1 0] % [-3:2:5 ] + Amat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; + Bmat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; + xmat = (hi*sparse (rand(1))-lo) .* sparse (rand(1)) ; + ymat = (hi*sparse (rand(1))-lo) .* sparse (rand(1)) ; + Cmat = sparse (m, n) ; + + if (~isempty (xlimits)) + Amat = max (Amat, xlimits (1)) ; + Amat = min (Amat, xlimits (2)) ; + xmat = max (xmat, xlimits (1)) ; + xmat = min (xmat, xlimits (2)) ; + end + if (xmat == 0) + xmat = sparse (0.5) ; + end + + if (~isempty (ylimits)) + Bmat = max (Bmat, ylimits (1)) ; + Bmat = min (Bmat, ylimits (2)) ; + ymat = max (ymat, ylimits (1)) ; + ymat = min (ymat, ylimits (2)) ; + end + if (ymat == 0) + ymat = sparse (0.5) ; + end + + C.matrix = Cmat ; + C.class = ztype ; + + CT.matrix = Cmat' ; + CT.class = ztype ; + + A.matrix = Amat ; + A.class = xtype ; + + B.matrix = Bmat ; + B.class = ytype ; + + x.matrix = xmat ; + x.class = xtype ; + + y.matrix = ymat ; + y.class = ytype ; + + X.matrix = xmat .* spones (Bmat) ; + X.class = xtype ; + + Y.matrix = ymat .* spones (Amat) ; + Y.class = ytype ; + + op_ewise_bind1st = op ; + op_ewise_bind2nd = op ; + if (isequal (op.opname, 'any')) + op_ewise_bind1st.opname = 'first' ; + op_ewise_bind2nd.opname = 'second' ; + end + + C1 = GB_mex_apply1 (C, [ ], [ ], op, 0, x, B) ; + C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind1st, X, B, [ ]) ; + GB_spec_compare (C1, C2, 0, tol) ; + C1 = GB_mex_apply1 (C, [ ], [ ], op, 1, x, B) ; + GB_spec_compare (C1, C2, 0, tol) ; + + C1 = GB_mex_apply1 (CT, [ ], [ ], op, 0, x, B, desc1) ; + C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind1st, X, B, desc) ; + GB_spec_compare (C1, C2, 0, tol) ; + C1 = GB_mex_apply1 (CT, [ ], [ ], op, 1, x, B, desc1) ; + GB_spec_compare (C1, C2, 0, tol) ; + + for csc = 0:1 + + A.is_csc = csc ; + C.is_csc = csc ; + CT.is_csc = csc ; + + C1 = GB_mex_apply2 (C, [ ], [ ], op, 0, A, y) ; + C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind2nd, A, Y, [ ]) ; + GB_spec_compare (C1, C2, 0, tol) ; + C1 = GB_mex_apply2 (C, [ ], [ ], op, 1, A, y) ; + GB_spec_compare (C1, C2, 0, tol) ; + + C1 = GB_mex_apply2 (CT, [ ], [ ], op, 0, A, y, desc0) ; + C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind2nd, A, Y, desc) ; + GB_spec_compare (C1, C2, 0, tol) ; + C1 = GB_mex_apply2 (CT, [ ], [ ], op, 1, A, y, desc0) ; + GB_spec_compare (C1, C2, 0, tol) ; + end + + y.class = 'double' ; + Y.class = 'double' ; + + C1 = GB_mex_apply2 (C, [ ], [ ], op, 0, A, y) ; + C2 = GB_spec_Matrix_eWiseMult (C, [ ], [ ], op_ewise_bind2nd, A, Y, [ ]) ; + GB_spec_compare (C1, C2, 0, tol) ; + + C1 = GB_mex_apply2 (C, [ ], [ ], op, 1, A, y) ; + GB_spec_compare (C1, C2, 0, tol) ; + + C1 = GB_mex_apply2 (CT, [ ], [ ], op, 0, A, y, desc0) ; + C2 = GB_spec_Matrix_eWiseMult (CT, [ ], [ ], op_ewise_bind2nd, A, Y, desc) ; + GB_spec_compare (C1, C2, 0, tol) ; + C1 = GB_mex_apply2 (CT, [ ], [ ], op, 1, A, y, desc0) ; + GB_spec_compare (C1, C2, 0, tol) ; + +end +end +end +end +end +end + +fprintf ('\nNumber of built-in GraphBLAS operators: %d\n', n_operators) ; +fprintf ('\ntest154: all tests passed\n') ; + diff --git a/Test/unused/test185.m b/Test/unused/test185.m new file mode 100644 index 0000000000..6b71f2bb5c --- /dev/null +++ b/Test/unused/test185.m @@ -0,0 +1,99 @@ +function test185 +%TEST185 test dot4 for all sparsity formats +% GB_AxB_dot4 computes C+=A'*B when C is dense. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test185 -------------------- C+=A''*B when C is dense\n') ; + +rng ('default') ; +GB_mex_burble (0) ; + +semiring.add = 'plus' ; +semiring.multiply = 'times' ; +semiring.class = 'double' ; + +plus_pair.add = 'plus' ; +plus_pair.multiply = 'oneb' ; % same as pair +plus_pair.class = 'double' ; + +add_op = 'plus' ; +dtn_dot = struct ('axb', 'dot', 'inp0', 'tran') ; +dtn_sax = struct ('axb', 'saxpy', 'inp0', 'tran') ; + +n = 20 ; +C = GB_spec_random (n, n, inf, 1, 'double') ; +C.sparsity = 8 ; +C0 = sparse (n, n) ; +maxerr = 0 ; + +M = sparse (rand (n, n) > 0.5) ; + +for da = [0.01 0.1 .5 0.9 inf] + A = GB_spec_random (n, n, da, 1, 'double') ; + + for db = [0.01 0.1 .5 0.9 inf] + B = GB_spec_random (n, n, db, 1, 'double') ; + + for A_sparsity = [1 2 4 8] + fprintf ('.') ; + + for B_sparsity = [1 2 4 8] + A.sparsity = A_sparsity ; + B.sparsity = B_sparsity ; + + % C2 = C + A'*B using dot4 + C2 = GB_mex_mxm (C, [ ], add_op, semiring, A, B, dtn_dot) ; + C1 = GB_spec_mxm (C, [ ], add_op, semiring, A, B, dtn_dot) ; + GB_spec_compare (C1, C2) ; + C3 = C.matrix + (A.matrix)'*B.matrix ; + err = norm (C3 - C2.matrix, 1) ; + maxerr = max (maxerr, err) ; + assert (err < 1e-12) ; + + % C2 = A'*B using dot2/dot3 + C2 = GB_mex_mxm (C0, [ ], [ ], semiring, A, B, dtn_dot) ; + C1 = GB_spec_mxm (C0, [ ], [ ], semiring, A, B, dtn_dot) ; + GB_spec_compare (C1, C2) ; + C3 = (A.matrix)'*B.matrix ; + err = norm (C3 - C2.matrix, 1) ; + maxerr = max (maxerr, err) ; + assert (err < 1e-12) ; + + % C2 = C + A'*B using saxpy + C2 = GB_mex_mxm (C, [ ], add_op, semiring, A, B, dtn_sax) ; + C1 = GB_spec_mxm (C, [ ], add_op, semiring, A, B, dtn_sax) ; + GB_spec_compare (C1, C2) ; + C3 = C.matrix + (A.matrix)'*B.matrix ; + err = norm (C3 - C2.matrix, 1) ; + maxerr = max (maxerr, err) ; + assert (err < 1e-12) ; + + % C2 = C + spones(A)'*spones(B) using dot4 + C2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; + C1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; + GB_spec_compare (C1, C2) ; + C3 = C.matrix + spones (A.matrix)' * spones (B.matrix) ; + err = norm (C3 - C2.matrix, 1) ; + maxerr = max (maxerr, err) ; + assert (err < 1e-12) ; + + % C2 = spones(A)'*spones(B) using dot2/dot3 + C2 = GB_mex_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; + C1 = GB_spec_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; + GB_spec_compare (C1, C2) ; + C3 = spones (A.matrix)' * spones (B.matrix) ; + err = norm (C3 - C2.matrix, 1) ; + maxerr = max (maxerr, err) ; + assert (err < 1e-12) ; + end + end + end +end + +fprintf ('\n') ; +GB_mex_burble (0) ; +fprintf ('maxerr: %g\n', maxerr) ; +fprintf ('test185: all tests passed\n') ; + diff --git a/Test/unused/test188.m b/Test/unused/test188.m new file mode 100644 index 0000000000..0db3e2ae72 --- /dev/null +++ b/Test/unused/test188.m @@ -0,0 +1,105 @@ +function test188 +%TEST188 test concat + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test188 ----------- C = concat (Tiles)\n') ; + +[~, ~, ~, types, ~, ~] = GB_spec_opsall ; +types = types.all ; + +track_coverage = true ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; + cstart = find (GraphBLAS_grbcov > 0) ; +end + +rng ('default') ; + +n1 = 20 ; +n2 = 4 ; + +densities = [1e-4 0.01 0.2 0.8 inf] ; +for k1 = 1:length(densities) + density = densities (k1) ; + % fprintf ('\nd = %g\n', density) ; + + for ka = 1:length (types) + atype = types {ka} ; + + A1 = GB_spec_random (n1, n1, density, 128, atype) ; + A2 = GB_spec_random (n1, n2, density, 128, atype) ; + A3 = GB_spec_random (n2, n1, density, 128, atype) ; + + if (ka == 11) + A4 = GB_spec_random (n2, n2, inf, 128, atype) ; + else + A4 = GB_spec_random (n2, n2, density, 128, atype) ; + end + + for iso = 0:1 + + % test iso case + A1.iso = iso ; + A2.iso = iso ; + A3.iso = iso ; + A4.iso = iso ; + + for sparsity_control = [1 2 4 8] + A1.sparsity = sparsity_control ; + A2.sparsity = sparsity_control ; + A3.sparsity = sparsity_control ; + if (ka == 11) + A4.sparsity = 8 ; + else + A4.sparsity = sparsity_control ; + end + for is_csc = [0 1] + A1.is_csc = is_csc ; + A2.is_csc = is_csc ; + A3.is_csc = is_csc ; + A4.is_csc = is_csc ; + Tiles = cell (2,2) ; + Tiles {1,1} = A1 ; + Tiles {1,2} = A2 ; + Tiles {2,1} = A3 ; + Tiles {2,2} = A4 ; + for kc = 1:length (types) + ctype = types {kc} ; + for fmt = 0:1 + C1 = GB_mex_concat (Tiles, ctype, fmt) ; + C2 = GB_spec_concat (Tiles, ctype) ; + GB_spec_compare (C1, C2) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf (... + '[%15s, %15s, %d, %d, %d, %d, %d]', ... + ctype, atype, ... + k1, iso, sparsity_control, ... + is_csc, fmt) ; + fprintf (' (%d, %d)\n', d, c - cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + + end + end + end + end + end + end +end + +fprintf ('\n') ; +GB_mex_burble (0) ; +fprintf ('test188: all tests passed\n') ; + diff --git a/Test/unused/test191.m b/Test/unused/test191.m new file mode 100644 index 0000000000..80453e2e54 --- /dev/null +++ b/Test/unused/test191.m @@ -0,0 +1,57 @@ +function test191 +%TEST191 test split + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test191 ----------- Tiles = split (A)\n') ; + +[~, ~, ~, types, ~, ~] = GB_spec_opsall ; +types = types.all ; + +rng ('default') ; + +m = 100 ; +n = 110 ; +ms = [10 1 89] ; +ns = [1 4 50 45 10] ; + +for d = [1e-4 0.01 0.2 0.8 inf] + fprintf ('\nd = %g\n', d) ; + for ka = 1:length (types) + atype = types {ka} ; + A = GB_spec_random (m, n, d, 128, atype) ; + for sparsity_control = [1 2 4 8] + fprintf ('.') ; + A.sparsity = sparsity_control ; + for is_csc = [0 1] + A.is_csc = is_csc ; + C2 = GB_spec_split (A, ms, ns) ; + C1 = GB_mex_split (A, ms, ns) ; + for i = 1:length(ms) + for j = 1:length(ns) + GB_spec_compare (C1 {i,j}, C2 {i,j}) ; + end + end + + if (nnz (A.matrix) > 0) + % also try the iso case + B = A ; + B.matrix = spones (A.matrix) * pi ; + B.iso = true ; + C2 = GB_spec_split (B, ms, ns) ; + C1 = GB_mex_split (B, ms, ns) ; + for i = 1:length(ms) + for j = 1:length(ns) + GB_spec_compare (C1 {i,j}, C2 {i,j}) ; + end + end + end + end + end + end +end + +fprintf ('\n') ; +fprintf ('test191: all tests passed\n') ; + diff --git a/Test/unused/test191b.m b/Test/unused/test191b.m new file mode 100644 index 0000000000..52628fa1fa --- /dev/null +++ b/Test/unused/test191b.m @@ -0,0 +1,22 @@ +function test191b(tasks) +%TEST191B test split + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test191 ----------- Tiles = split (A)\n') ; + +if (nargin < 1) + tasks = [ ] ; +end + +if (isempty (tasks)) + tasks = { + {1, 'logical', 1, 0}, ... % ( 1, 1) + {1, 'logical', 4, 0}, ... % ( 1, 2) + {2, 'logical', 8, 0}, ... % ( 1, 3) + } ; +end + +test191 (tasks) ; + diff --git a/Test/unused/test194.m b/Test/unused/test194.m new file mode 100644 index 0000000000..11d49c58be --- /dev/null +++ b/Test/unused/test194.m @@ -0,0 +1,47 @@ +function test194 +%TEST194 test GxB_Vector_diag + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test194 ----------- V = diag (A,k)\n') ; + +[~, ~, ~, types, ~, ~] = GB_spec_opsall ; +types = types.all ; + +rng ('default') ; +GB_builtin_complex_set (true) ; + +ms = [10 20] ; +ns = [4 10] ; + +for d = [1e-4 0.1 0.8 inf] + fprintf ('\nd = %g\n', d) ; + for ka = 1:length (types) + atype = types {ka} ; + for m = ms + for n = ns + A = GB_spec_random (m, n, d, 128, atype) ; + for sparsity_control = [1 2 4 8] + fprintf ('.') ; + A.sparsity = sparsity_control ; + for csc = [1 0] + A.is_csc = csc ; + for kc = 1:length (types) + vtype = types {kc} ; + for k = [-10 -2 0 3 ] + V2 = GB_spec_vdiag (A, k, vtype) ; + V1 = GB_mex_vdiag (A, k, vtype) ; + GB_spec_compare (V1, V2) ; + end + end + end + end + end + end + end +end + +fprintf ('\n') ; +fprintf ('test194: all tests passed\n') ; + diff --git a/Test/unused/test195.m b/Test/unused/test195.m new file mode 100644 index 0000000000..d1b1d955fb --- /dev/null +++ b/Test/unused/test195.m @@ -0,0 +1,109 @@ +function test195 (dohack) +%TEST195 test all variants of saxpy3 + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +rng ('default') ; +[nthreads_orig chunk_orig] = nthreads_get ; + +% save current global settings, then modify them +save_hack = GB_mex_hack ; +hack = save_hack ; +if (nargin < 1) + dohack = 2 ; +end +hack (1) = dohack ; % modify "very_costly" in GxB_AxB_saxpy3_slice_balanced +GB_mex_hack (hack) ; + +k = 3 ; +n = 4 ; +m = 200 ; +desc.axb = 'hash' ; +desc_s.axb = 'hash' ; desc_s.mask = 'structural' ; +dnot.axb = 'hash' ; dnot.mask = 'complement' ; +dnot_s.axb = 'hash' ; dnot_s.mask = 'structural complement' ; + +semiring.multiply = 'times' ; +semiring.add = 'plus' ; +semiring.class = 'double' ; + +for asparsity = [1 2 4 8] + fprintf ('\nA: %s ', GB_sparsity (asparsity)) ; + for bsparsity = [1 2 4 8] + fprintf ('\n B: %s ', GB_sparsity (bsparsity)) ; + for msparsity = [1 2 4 8] + fprintf ('\n M: %s ', GB_sparsity (msparsity)) ; + for da = [0.01 .1 inf] + A = GB_spec_random (m, k, da) ; A.sparsity = asparsity ; + for db = [0.01 .1 inf] + B = GB_spec_random (k, n, db) ; B.sparsity = bsparsity ; + for dm = [0.01 .1 inf] + fprintf ('.') ; + M = GB_spec_random (m, n, dm) ; M.sparsity = msparsity ; + M.matrix = spones (M.matrix) ; + + % C = A*B + C0 = A.matrix * B.matrix ; + C1 = GB_spec_mxm (C0, [ ], [ ], semiring, A, B, desc) ; + C2 = GB_mex_mxm (C0, [ ], [ ], semiring, A, B, desc) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + if (msparsity == 4) + chunks = unique ([1 chunk_orig 65536]) ; + else + chunks = chunk_orig ; + end + + for chunk = chunks + nthreads_set (nthreads_orig, chunk) ; + + % C = A*B + C0 = (A.matrix * B.matrix) .* M.matrix ; + C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, desc) ; + C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, desc) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + % C = A*B + C0 = (A.matrix * B.matrix) .* (1 - M.matrix) ; + C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, dnot) ; + C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, dnot) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + % C = A*B + C0 = (A.matrix * B.matrix) .* M.matrix ; + C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, desc_s) ; + C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, desc_s) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + % C = A*B + C0 = (A.matrix * B.matrix) .* (1 - M.matrix) ; + C1 = GB_spec_mxm (C0, M, [ ], semiring, A, B, dnot_s) ; + C2 = GB_mex_mxm (C0, M, [ ], semiring, A, B, dnot_s) ; + GB_spec_compare (C1, C2, 0, 1e-12) ; + err = norm (C0 - C2.matrix, 1) ; + assert (err < 1e-12) ; + + end + end + end + end + end + end +end + +% restore global settings +GB_mex_burble (0) ; +GB_mex_hack (save_hack) ; +nthreads_set (nthreads_orig, chunk_orig) ; + +fprintf ('\ntest195: all tests passed\n') ; + diff --git a/Test/unused/test231.m b/Test/unused/test231.m new file mode 100644 index 0000000000..18787d02e3 --- /dev/null +++ b/Test/unused/test231.m @@ -0,0 +1,97 @@ +function test231 +%TEST231 test GrB_select with idxunp + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +[~, ~, ~, types, ~, ~, idxunops] = GB_spec_opsall ; +ops = idxunops ; +types = types.all ; + +fprintf ('\n--- testing select with idxunops\n') ; +rng ('default') ; + +desc.inp0 = 'tran' ; + +n_operators = 0 ; +for k2 = 1:length(ops) + opname = ops {k2} ; + fprintf ('\n%-10s ', opname) ; + + for k1 = 1:length (types) + type = types {k1} ; + + % create the op + clear op + op.opname = opname ; + op.optype = type ; + + [is_idxunop, ztype] = GB_spec_is_idxunop (opname, type) ; + if (~is_idxunop) + continue ; + end + + n_operators = n_operators + 1 ; + + for m = [1 4] % [ 1 10 ]% 100] + for n = [1 4] % [1 10 ]% 100] + for hi = [1 5] % [-1:2:5 ] + for lo = [-1 0] % [-3:2:5 ] + Amat = (hi*sprand (m,n,0.8)-lo) .* sprand (m,n,0.5) ; + Cmat = sparse (m, n) ; + fprintf ('.') ; + + C.matrix = Cmat ; + C.class = ztype ; + + CT.matrix = Cmat' ; + CT.class = ztype ; + + A.matrix = Amat ; + A.class = type ; + + B.matrix = spones (Amat) ; + B.class = type ; + B.iso = true ; + + for ythunk = -3:3 + y.matrix = ythunk ; + y.class = type ; + + for how = 0:1 + for csc = 0:1 + + A.is_csc = csc ; + C.is_csc = csc ; + CT.is_csc = csc ; + + for sparsity = [1 2 4] + A.sparsity = sparsity ; + + C1 = GB_mex_select_idxunop (C, [ ], [ ], op, how, A, y, [ ]) ; + C2 = GB_spec_select_idxunop (C, [ ], [ ], op, A, y, [ ]) ; + GB_spec_compare (C1, C2) ; + + C1 = GB_mex_select_idxunop (C, [ ], [ ], op, how, B, y, [ ]) ; + C2 = GB_spec_select_idxunop (C, [ ], [ ], op, B, y, [ ]) ; + GB_spec_compare (C1, C2) ; + + C1 = GB_mex_select_idxunop (CT, [ ], [ ], op, how, A, y, desc) ; + C2 = GB_spec_select_idxunop (CT, [ ], [ ], op, A, y, desc) ; + GB_spec_compare (C1, C2) ; + + end + end + +end +end +end +end +end +end +end +end + +fprintf ('\nNumber of built-in GraphBLAS idxunops: %d\n', n_operators) ; +fprintf ('\ntest231: all tests passed\n') ; + diff --git a/Test/unused/test234.m b/Test/unused/test234.m new file mode 100644 index 0000000000..e063693c60 --- /dev/null +++ b/Test/unused/test234.m @@ -0,0 +1,287 @@ +function test234 +%TEST234 test GxB_eWiseUnion + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +% derived from test127 + +[binops, ~, ~, types, ~, ~] = GB_spec_opsall ; +binops = binops.all ; +types = types.all ; + +fprintf ('test234 -----------tests of GxB_eWiseUnion (all ops)\n') ; + +m = 5 ; +n = 5 ; + +rng ('default') ; + +dnn = struct ; +dnn_notM = struct ('mask', 'complement') ; + +Amat2 = sparse (2 * sprand (m,n, 0.8)) ; +Bmat2 = sparse (2 * sprand (m,n, 0.8)) ; +Cmat2 = sparse (2 * sprand (m,n, 0.8)) ; +w2 = sparse (2 * sprand (m,1, 0.8)) ; +uvec2 = sparse (2 * sprand (m,1, 0.8)) ; +vvec2 = sparse (2 * sprand (m,1, 0.8)) ; + +Amat = sparse (100 * sprandn (m,n, 0.8)) ; +Bmat = sparse (100 * sprandn (m,n, 0.8)) ; +Cmat = sparse (100 * sprandn (m,n, 0.8)) ; +w = sparse (100 * sprandn (m,1, 0.8)) ; +uvec = sparse (100 * sprandn (m,1, 0.8)) ; +vvec = sparse (100 * sprandn (m,1, 0.8)) ; + +Maskmat = sprandn (m,n,0.9) ~= 0 ; +maskvec = sprandn (m,1,0.9) ~= 0 ; + +% create a very sparse matrix mask +Maskmat2 = sparse (m,n) ; +T = Amat .* Bmat ; +[i j x] = find (T) ; +if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; +end +T = (Amat ~= 0) & (Bmat == 0) ; +[i j x] = find (T) ; +if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; +end +T = (Amat == 0) & (Bmat ~= 0) ; +[i j x] = find (T) ; +if (length (i) > 0) + Maskmat2 (i(1), j(1)) = 1 ; +end +clear T i j x + +% create a very sparse vector mask +maskvec2 = sparse (m,1) ; +T = uvec .* vvec ; +[i j x] = find (T) ; +if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; +end +T = (uvec ~= 0) & (vvec == 0) ; +[i j x] = find (T) ; +if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; +end +T = (uvec == 0) & (vvec ~= 0) ; +[i j x] = find (T) ; +if (length (i) > 0) + maskvec2 (i(1), j(1)) = 1 ; +end +clear T i j x + +A_is_csc = 0 ; +B_is_csc = 0 ; +C_is_csc = 0 ; + +M_is_very_sparse = 0 ; +M_is_csc = 0 ; + +track_coverage = true ; +if (track_coverage) + global GraphBLAS_grbcov + track_coverage = ~isempty (GraphBLAS_grbcov) ; + clast = sum (GraphBLAS_grbcov > 0) ; + cfirst = clast ; +end + +for k1 = 1:length (types) + type = types {k1} ; + % fprintf ('\n\n%-8s : ', type) ; + + for k2 = 1:length(binops) + binop = binops {k2} ; + + op.opname = binop ; + op.optype = type ; + + if (test_contains (type, 'single')) + tol = 1e-5 ; + elseif (test_contains (type, 'double')) + tol = 1e-12 ; + else + tol = 0 ; + end + + try + GB_spec_operator (op) ; + catch + continue ; + end + + % fprintf (' %s', binop) ; + + for A_sparsity_control = 0:1 + for B_sparsity_control = 0:1 + for C_sparsity_control = 0:1 + + if (A_sparsity_control == 0) + A_is_hyper = 0 ; % not hyper + A_sparsity = 1 ; % sparse + else + A_is_hyper = 0 ; % not hyper + A_sparsity = 4 ; % bitmap + end + + if (B_sparsity_control == 0) + B_is_hyper = 0 ; % not hyper + B_sparsity = 1 ; % sparse + else + B_is_hyper = 0 ; % not hyper + B_sparsity = 4 ; % bitmap + end + + if (C_sparsity_control == 0) + C_is_hyper = 0 ; % not hyper + C_sparsity = 1 ; % sparse + else + C_is_hyper = 0 ; % not hyper + C_sparsity = 4 ; % bitmap + end + + clear A B C u v + + if (isequal (binop, 'pow')) + A.matrix = Amat2 ; + B.matrix = Bmat2 ; + C.matrix = Cmat2 ; + u.matrix = uvec2 ; + v.matrix = vvec2 ; + else + A.matrix = Amat ; + B.matrix = Bmat ; + C.matrix = Cmat ; + u.matrix = uvec ; + v.matrix = vvec ; + end + + A.is_hyper = A_is_hyper ; + A.is_csc = A_is_csc ; + A.sparsity = A_sparsity ; + A.class = op.optype ; + a0 = GB_mex_cast (1, op.optype) ; + + B.is_hyper = B_is_hyper ; + B.sparsity = B_sparsity ; + B.is_csc = B_is_csc ; + B.class = op.optype ; + b0 = GB_mex_cast (2, op.optype) ; + + C.is_hyper = C_is_hyper ; + C.is_csc = C_is_csc ; + C.sparsity = C_sparsity ; + + u.is_csc = true ; + u.class = op.optype ; + u0 = GB_mex_cast (1, op.optype) ; + + v.is_csc = true ; + v.class = op.optype ; + v0 = GB_mex_cast (2, op.optype) ; + + %--------------------------------------- + % A+B + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseUnion (C, ... + [ ], [ ], op, A, a0, B, b0, dnn) ; + C1 = GB_mex_Matrix_eWiseUnion (C, ... + [ ], [ ], op, A, a0, B, b0, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseUnion (w, ... + [ ], [ ], op, u, u0, v, v0, dnn) ; + w1 = GB_mex_Vector_eWiseUnion (w, ... + [ ], [ ], op, u, u0, v, v0, dnn) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %----------------------------------------------- + % with mask + %----------------------------------------------- + + for M_sparsity_control = 0:1 + + clear Mask mask + if (M_is_very_sparse) + Mask.matrix = Maskmat2 ; + mask.matrix = maskvec2 ; + else + Mask.matrix = Maskmat ; + mask.matrix = maskvec ; + end + + if (M_sparsity_control == 0) + M_is_hyper = 0 ; % not hyper + M_sparsity = 1 ; % sparse + else + M_is_hyper = 0 ; % not hyper + M_sparsity = 4 ; % bitmap + end + + Mask.is_hyper = M_is_hyper ; + Mask.sparsity = M_sparsity ; + Mask.is_csc = M_is_csc ; + mask.is_csc = true ; + + %--------------------------------------- + % A+B, with mask + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseUnion (C, Mask, ... + [ ], op, A, a0, B, b0, dnn) ; + C1 = GB_mex_Matrix_eWiseUnion (C, Mask, ... + [ ], op, A, a0, B, b0, dnn) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseUnion (w, mask, ... + [ ], op, u, u0, v, v0, dnn) ; + w1 = GB_mex_Vector_eWiseUnion (w, mask, ... + [ ], op, u, u0, v, v0, dnn) ; + GB_spec_compare (w0, w1, 0, tol) ; + + %--------------------------------------- + % A+B, with mask complemented + %--------------------------------------- + + C0 = GB_spec_Matrix_eWiseUnion (C, Mask, ... + [ ], op, A, a0, B, b0, dnn_notM) ; + C1 = GB_mex_Matrix_eWiseUnion (C, Mask, ... + [ ], op, A, a0, B, b0, dnn_notM) ; + GB_spec_compare (C0, C1, 0, tol) ; + + w0 = GB_spec_Vector_eWiseUnion (w, mask, ... + [ ], op, u, u0, v, v0, dnn_notM) ; + w1 = GB_mex_Vector_eWiseUnion (w, mask, ... + [ ], op, u, u0, v, v0, dnn_notM) ; + GB_spec_compare (w0, w1, 0, tol) ; + + if (track_coverage) + c = sum (GraphBLAS_grbcov > 0) ; + d = c - clast ; + if (d > 0) + fprintf ('{''%s'',''%s'', %d,%d,%d,%d }, ... %% %d %d\n', ... + type, binop, ... + A_sparsity_control, ... + B_sparsity_control, ... + C_sparsity_control, ... + M_sparsity_control, d, c-cfirst) ; + end + clast = c ; + else + fprintf ('.') ; + end + + end + end + end + end + end +end + +fprintf ('\ntest234: all tests passed\n') ; + diff --git a/Test/unused/test234b.m b/Test/unused/test234b.m new file mode 100644 index 0000000000..94fdea3ed0 --- /dev/null +++ b/Test/unused/test234b.m @@ -0,0 +1,11 @@ +function test234b (tasks) +%TEST234B test GxB_eWiseUnion + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +test234 ({{'int8','iseq', 0,0,0,0 }}) ; + +fprintf ('\ntest234b: all tests passed\n') ; + + diff --git a/Test/unused/test251.m b/Test/unused/test251.m new file mode 100644 index 0000000000..d22753085a --- /dev/null +++ b/Test/unused/test251.m @@ -0,0 +1,97 @@ +function test251 +%TEST251 test dot4 for plus-pair semirings +% GB_AxB_dot4 computes C+=A'*B when C is dense. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +fprintf ('test251 ------------ C+=A''*B when C is dense (plus-pair)\n') ; + +rng ('default') ; +GB_mex_burble (0) ; + +plus_pair.add = 'plus' ; +plus_pair.multiply = 'oneb' ; % same as pair +[~, ~, ~, types, ~, ~, ~,] = GB_spec_opsall ; +types = types.all ; + +add_op.opname = 'plus' ; +dtn_dot = struct ('axb', 'dot', 'inp0', 'tran') ; +dtn_sax = struct ('axb', 'saxpy', 'inp0', 'tran') ; + +n = 20 ; +C = GB_spec_random (n, n, inf, 100, 'double') ; +C.sparsity = 8 ; +C0.matrix = sparse (n, n) ; + +for A_sparsity = [1 2 4 8] + if (A_sparsity == 8) + A = GB_spec_random (n, n, inf, 100, 'double') ; + else + A = GB_spec_random (n, n, 0.1, 100, 'double') ; + end + A.sparsity = A_sparsity ; + + for B_sparsity = [1 2 4 8] + if (B_sparsity == 8) + B = GB_spec_random (n, n, inf, 100, 'double') ; + else + B = GB_spec_random (n, n, 0.1, 100, 'double') ; + end + B.sparsity = B_sparsity ; + + for k = 0:length(types) + if (k == 0) + type = 'logical' ; + add_op.opname = 'xor' ; + plus_pair.add = 'xor' ; + else + type = types {k} ; + add_op.opname = 'plus' ; + plus_pair.add = 'plus' ; + end + plus_pair.class = type ; + add_op.optype = type ; + if (test_contains (type, 'single')) + tol = 1e-5 ; + else + tol = 1e-10 ; + end + fprintf ('.') ; + + for k2 = 1 % 1:2 + if (k2 == 1) + A.class = type ; + B.class = type ; + C0.class = type ; + C.class = type ; + else + A.class = 'double' ; + B.class = 'double' ; + C0.class = 'double' ; + C.class = 'double' ; + end + + % X = C + A'*B using dot4 + X2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; + X1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_dot) ; + GB_spec_compare (X1, X2, 0, tol) ; + + % X = A'*B using dot2/dot3 + X2 = GB_mex_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; + X1 = GB_spec_mxm (C0, [ ], [ ], plus_pair, A, B, dtn_dot) ; + GB_spec_compare (X1, X2, 0, tol) ; + + % X = C + A'*B using saxpy + X2 = GB_mex_mxm (C, [ ], add_op, plus_pair, A, B, dtn_sax) ; + X1 = GB_spec_mxm (C, [ ], add_op, plus_pair, A, B, dtn_sax) ; + GB_spec_compare (X1, X2) ; + end + end + end +end + +fprintf ('\n') ; +GB_mex_burble (0) ; +fprintf ('test251: all tests passed\n') ; + diff --git a/Test/unused/test78.m b/Test/unused/test78.m deleted file mode 100644 index bd5dcc4598..0000000000 --- a/Test/unused/test78.m +++ /dev/null @@ -1,26 +0,0 @@ -function test78 -%TEST78 test subref - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -n = 500 ; -I = speye (n) ; -X = sparse (rand (n)) ; -A = [X I ; I I] ; - -I = 1:n ; -I0 = uint64 (I-1) ; - -C1 = A(I,I) ; -C2 = GB_mex_Matrix_subref (A, I0, I0) ; - -Ahyper.matrix = A ; -Ahyper.is_hyper = true ; - -% this requires a hyper realloc for C2 -C2 = GB_mex_Matrix_subref (Ahyper, I0, I0) ; - -assert (isequal (C1, C2)) ; - -fprintf ('\ntest78: all tests passed\n') ; diff --git a/Test/unused/testall_Oct9.m b/Test/unused/testall_Oct9.m new file mode 100644 index 0000000000..6d9057ca3e --- /dev/null +++ b/Test/unused/testall_Oct9.m @@ -0,0 +1,342 @@ +function testall (threads,longtests) +%TESTALL run all GraphBLAS tests +% +% Usage: +% testall ; % runs just the shorter tests (about 30 minutes) +% +% testall(threads) ; % run with specific list of threads and chunk sizes +% testall([ ],1) ; % run all longer tests, with default # of threads +% +% threads is a cell array. Each entry is 2-by-1, with the first value being +% the # of threads to use and the 2nd being the chunk size. The default is +% {[4 1]} if empty or not present. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GrB.init ; +GB_mex_init ; +testall_time = tic ; + +if (nargin < 2) + % run the shorter tests by default + longtests = 0 ; +end + +if (nargin < 1) + threads = [ ] ; +end +if (isempty (threads)) + threads {1} = [4 1] ; +end +t = threads ; + +% single thread +s {1} = [1 1] ; + +% clear the statement coverage counts +clear global GraphBLAS_grbcov + +global GraphBLAS_debug GraphBLAS_grbcov GraphBLAS_grbcovs ... + GraphBLAS_scripts GraphBLAS_times + +% use built-in complex data types by default +GB_builtin_complex_set (true) ; + +% many of the tests use spok in SuiteSparse, a copy of which is +% included here in GraphBLAS/Test/spok. +addpath ('../Test/spok') ; +try + spok (sparse (1)) ; +catch + here = pwd ; + cd ../Test/spok ; + spok_install ; + cd (here) ; +end + +logstat ; % start the log.txt +hack = GB_mex_hack ; + +% JIT and factory controls + +% run once +j4 = {4} ; % JIT on +f1 = {1} ; % factory on +j0 = {0} ; % JIT off +f0 = {0} ; % factory off + +% run twice +j44 = {4,4} ; % JIT on, on +j04 = {0,4} ; % JIT off, on +j40 = {4,0} ; % JIT on, off +f10 = {1,0} ; % factory on, off +f00 = {0,0} ; % factory off, off +f11 = {1,1} ; % factory on, on + +% 3 runs +j440 = {4,4,0} ; % JIT on, on , off +j404 = {4,0,4} ; % JIT on, off, on +f100 = {1,0,0} ; % factory on, off, off +f110 = {1,1,0} ; % factory on, on , off + +% start with the Werk stack enabled +hack (2) = 0 ; GB_mex_hack (hack) ; + +malloc_debugging = stat ; + +% lots of tests +jall = {4,3,2,1,4,2} ; +fall = {1,1,1,1,0,0} ; + +jlot = {4,3,2,1} ; +flot = {1,1,1,1} ; + +%=============================================================================== +% statement coverage test, with malloc debugging and Werk stack enabled +%=============================================================================== + +% < 1 second +logstat ('test268' ,t, j4 , f1 ) ; % C=Z sparse masker +logstat ('test247' ,t, j4 , f1 ) ; % GrB_mxm: fine Hash method +logstat ('test199' ,t, j4 , f1 ) ; % test dot2 with hypersparse +logstat ('test210' ,t, j4 , f1 ) ; % iso assign25: C=A +logstat ('test165' ,t, j4 , f1 ) ; % test C=A*B', A is diagonal, B bitmap +logstat ('test226' ,t, j4 , f1 ) ; % test kron with iso matrices +logstat ('test207' ,t, j4 , f1 ) ; % test iso subref +logstat ('test221' ,t, j4 , f1 ) ; % test C += A, C is bitmap and A is full +logstat ('test09' ,t, j4 , f1 ) ; % duplicate I,J test of GB_mex_subassign +logstat ('test214' ,t, j4 , f1 ) ; % test C=A'*B (tricount) +logstat ('test213' ,t, j4 , f1 ) ; % test iso assign (method 05d) +logstat ('test272' ,t, j0 , f1 ) ; % misc simple tests +logstat ('test279' ,t, j0 , f1 ) ; % blob get/set +logstat ('test278' ,t, j0 , f1 ) ; % descriptor get/set +logstat ('test277' ,t, j0 , f1 ) ; % context get/set +logstat ('test269' ,t, j0 , f1 ) ; % get/set for type, scalar, vec, mtx +logstat ('test264' ,t, j4 , f0 ) ; % enumify / macrofy tests +logstat ('test262' ,t, j0 , f1 ) ; % GB_mask +logstat ('test261' ,t, j4 , f0 ) ; % serialize/deserialize error handling +logstat ('test260' ,t, j4 , f0 ) ; % demacrofy name +logstat ('test211' ,t, j4 , f1 ) ; % test iso assign +logstat ('test235' ,t, j4 , f1 ) ; % test GxB_eWiseUnion and GrB_eWiseAdd +logstat ('test223' ,t, j4 , f1 ) ; % test matrix multiply, C=A*B +logstat ('test203' ,t, j4 , f1 ) ; % test iso subref +logstat ('test183' ,s, j4 , f1 ) ; % test eWiseMult with hypersparse mask +logstat ('test174' ,t, j4 , f1 ) ; % test GrB_assign C=A +logstat ('test162' ,t, j4 , f1 ) ; % test C=A*B with very sparse M +logstat ('test275' ,t, j0 , f1 ) ; % monoid get/set +logstat ('test274' ,t, j0 , f1 ) ; % index unary op get/set +logstat ('test271' ,t, j0 , f1 ) ; % binary op get/set +logstat ('test270' ,t, j0 , f1 ) ; % unary op get/set +logstat ('test212' ,t, j44 , f10 ) ; % test iso mask all zero +logstat ('test255' ,t, j4 , f1 ) ; % flip binop +logstat ('test241' ,t, j4 , f1 ) ; % test GrB_mxm, trigger the swap_rule +logstat ('test220' ,t, j4 , f1 ) ; % test mask C=Z, iso case +logstat ('test252' ,t, j4 , f1 ) ; % basic tests +logstat ('test83' ,t, j4 , f1 ) ; % GrB_assign with C_replace and empty J +logstat ('test04' ,t, j4 , f1 ) ; % simple mask and transpose test +logstat ('test132' ,t, j4 , f1 ) ; % setElement +logstat ('test82' ,t, j4 , f1 ) ; % GrB_extract with index range (hyper) +logstat ('test202' ,t, j40 , f11 ) ; % test iso add and emult +logstat ('test219' ,s, j44 , f10 ) ; % test reduce to scalar (1 thread) +logstat ('test281' ,t, j4 , f1 ) ; % test user-defined idx unop, no JIT +logstat ('test253' ,t, j4 , f1 ) ; % basic JIT tests +logstat ('test222' ,t, j4 , f1 ) ; % test user selectop for iso matrices +logstat ('test204' ,t, j4 , f1 ) ; % test iso diag +logstat ('test155' ,t, j4 , f1 ) ; % test GrB_*_setElement, removeElement +logstat ('test273' ,t, j0 , f1 ) ; % Global get/set +logstat ('test258' ,t, j4 , f0 ) ; % reduce-to-vector for UDT +logstat ('test257' ,t, j4 , f0 ) ; % JIT error handling +logstat ('test136' ,s, j4 , f1 ) ; % subassignment special cases +logstat ('test276' ,t, j0 , f1 ) ; % semiring get/set +logstat ('test201' ,t, j4 , f1 ) ; % test iso reduce to vector and scalar +logstat ('test265' ,t, j4 , f0 ) ; % reduce to scalar with user types +logstat ('test128' ,t, j4 , f1 ) ; % eWiseMult, eWiseAdd, eWiseUnion cases +logstat ('test267' ,t, j40 , f00 ) ; % JIT error handling +logstat ('test263' ,t, j4 , f0 ) ; % JIT tests +logstat ('test144' ,t, j4 , f1 ) ; % cumsum +logstat ('test109' ,t, j404, f110) ; % terminal monoid with user-defined type + +% 1 to 10 seconds: +logstat ('test245' ,t, j40 , f11 ) ; % test complex row/col scale +logstat ('test282' ,t, jlot, flot) ; % test argmax, index binary op +logstat ('test239' ,t, j44 , f10 ) ; % test GxB_eWiseUnion +logstat ('test249' ,t, j4 , f1 ) ; % GxB_Context object +logstat ('test179' ,t, j44 , f10 ) ; % test bitmap select +logstat ('test159' ,t, j0 , f0 ) ; % test A*B +logstat ('test196' ,t, j4 , f1 ) ; % test hypersparse concat +logstat ('test259' ,t, j4 , f0 ) ; % plus_plus_fp32 semiring +logstat ('test232' ,t, j4 , f1 ) ; % test assign with GrB_Scalar +logstat ('test250' ,t, j44 , f10 ) ; % JIT tests, set/get, other tests +logstat ('test145' ,t, jall, fall) ; % dot4 for C += A'*B +logstat ('test283' ,t, j4 , f1 ) ; % test index binary op +logstat ('test254' ,t, j440, f100) ; % mask types +logstat ('test229' ,t, j40 , f11 ) ; % test setElement +logstat ('test209' ,t, j4 , f1 ) ; % test iso build +logstat ('test141' ,t, j0 , f1 ) ; % eWiseAdd with dense matrices +logstat ('test224' ,t, j4 , f1 ) ; % test unpack/pack +logstat ('testc2(1,1)',t, j44 , f10 ) ; % complex tests (quick case, builtin) + +% 10 to 60 seconds: +logstat ('test189' ,t, j4 , f1 ) ; % test large assign +logstat ('test246' ,t, j4 , f1 ) ; % GrB_mxm parallelism (slice_balanced) +logstat ('test169' ,t, j0 , f1 ) ; % C=A+B with many formats +logstat ('test76' ,s, j4 , f1 ) ; % GxB_resize (single threaded) +logstat ('test01' ,t, j4 , f1 ) ; % error handling +logstat ('test228' ,t, j4 , f1 ) ; % test serialize/deserialize +logstat ('test206' ,t, j44 , f10 ) ; % test iso select +logstat ('test104' ,t, j4 , f1 ) ; % export/import +logstat ('test02' ,t, j4 , f1 ) ; % matrix copy and dup tests +logstat ('test251' ,t, j4 , f1 ) ; % dot4, dot2, with plus_pair +logstat ('test251b' ,t, j4 , f0 ) ; % dot4, dot2, with plus_pair +logstat ('test244' ,t, j4 , f1 ) ; % test GxB_Matrix_reshape* + +% about 100 seconds: +logstat ('test152' ,t, j404, f110) ; % test binops C=A+B, all matrices dense +logstat ('test194' ,t, j4 , f1 ) ; % test GxB_Vector_diag +logstat ('test280' ,t, j4 , f1 ) ; % subassign method 26 + +%=============================================================================== +% tests with Werk stack disabled, but malloc debugging enabled +%=============================================================================== + +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack + +% < 10 seconds +logstat ('test150' ,t, j0 , f0 ) ; %% mxm zombies, typecasting (dot3,saxpy) +logstat ('test256' ,t, j4 , f0 ) ; % JIT error handling +logstat ('test240' ,t, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 +logstat ('test240' ,s, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 (1 task) +logstat ('test237' ,t, j440, f100) ; % test GrB_mxm (saxpy4) +logstat ('test237' ,s, j40 , f10 ) ; % test GrB_mxm (saxpy4) (1 task) +logstat ('test184' ,t, j4 , f1 ) ; % special cases: mxm, transpose, build +logstat ('test186' ,t, j40 , f11 ) ; % saxpy, all formats (slice_balanced) +logstat ('test186(0)' ,t, j4 , f1 ) ; % repeat with default slice_balanced +logstat ('test236' ,t, j4 , f1 ) ; % test GxB_Matrix_sort, GxB_Vector_sort + +% 10 to 100 seconds +logstat ('test180' ,s, j4 , f1 ) ; % test assign and subassign (1 thread) +logstat ('test188' ,t, j4 , f1 ) ; % test concat +logstat ('test188b' ,t, j0 , f1 ) ; % test concat +logstat ('test151b' ,t, j4 , f1 ) ; % test bshift operator +logstat ('test191' ,t, j40 , f10 ) ; %% test split + +% over 100 seconds +logstat ('test238' ,t, j44 , f10 ) ; % test GrB_mxm (dot4 and dot2) +logstat ('test14' ,t, j4 , f1 ) ; % GrB_reduce +logstat ('test14b' ,t, j4 , f0 ) ; % GrB_reduce +logstat ('test154' ,t, j4 , f1 ) ; % apply with binop and scalar binding +logstat ('test154b' ,t, j0 , f1 ) ; % apply with binop and scalar binding + +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +%=============================================================================== +% tests with no malloc debugging and no Werk stack +%=============================================================================== + +% Turn off malloc debugging +if (malloc_debugging) + debug_off + fprintf ('[malloc debugging turned off]\n') ; + fp = fopen ('log.txt', 'a') ; + fprintf (fp, '[malloc debugging turned off]\n') ; + fclose (fp) ; +end + +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack + +logstat ('test187' ,t, j4 , f1 ) ; % test dup/assign for all formats +logstat ('test192' ,t, j4 , f1 ) ; % test C=scalar +logstat ('test181' ,s, j4 , f1 ) ; % transpose with explicit zeros in mask +logstat ('test185' ,s, j4 , f1 ) ; % test dot4, saxpy for all sparsity + +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +%=============================================================================== +% tests with no malloc debugging, with Werk enabled +%=============================================================================== + +% < 1 second: +logstat ('test208' ,t, j4 , f1 ) ; % test iso apply, bind 1st and 2nd +logstat ('test176' ,t, j4 , f1 ) ; % test GrB_assign, method 09, 11 +logstat ('test172' ,t, j4 , f1 ) ; % test eWiseMult with M bitmap/full +logstat ('test124' ,t, j4 , f1 ) ; % GrB_extract, case 6 +logstat ('test138' ,s, j4 , f1 ) ; % assign, coarse-only tasks in IxJ slice +logstat ('test225' ,t, j4 , f1 ) ; % test mask operations (GB_masker) +logstat ('test216' ,t, j4 , f1 ) ; % test C=A, iso case +logstat ('test197' ,t, j4 , f1 ) ; % test large sparse split +logstat ('test133' ,t, j4 , f1 ) ; % test mask operations (GB_masker) +logstat ('test137' ,s, j40 , f11 ) ; % GrB_eWiseMult, FIRST and SECOND +logstat ('test139' ,s, j4 , f1 ) ; % merge sort, special cases +logstat ('test108' ,t, j40 , f10 ) ; % boolean monoids + +% 1 to 10 seconds: +logstat ('testc4(0)' ,t, j4 , f1 ) ; % extractElement, setElement, user type +logstat ('test157' ,t, j4 , f1 ) ; % test sparsity formats +logstat ('test182' ,s, j4 , f1 ) ; % test for internal wait +logstat ('test130' ,t, j4 , f1 ) ; % GrB_apply, hypersparse cases +logstat ('test148' ,t, j4 , f1 ) ; % ewise with alias +logstat ('test231' ,t, j4 , f1 ) ; % test GrB_select with idxunp +logstat ('test129' ,t, j4 , f1 ) ; % test GxB_select (tril, nonz, hyper) +logstat ('test173' ,t, j4 , f1 ) ; % test GrB_assign C=A +logstat ('test135' ,t, j4 , f1 ) ; % reduce to scalar +logstat ('test84' ,t, j4 , f1 ) ; % GrB_assign (row/col with C CSR/CSC) +logstat ('test69' ,t, j4 , f1 ) ; % assign and subassign with alias +logstat ('test215' ,t, j4 , f1 ) ; % test C=A'*B (dot2, ANY_PAIR) +logstat ('test80' ,t, j4 , f1 ) ; % test GrB_mxm on all semirings +logstat ('test200' ,t, j4 , f1 ) ; % test iso full matrix multiply +logstat ('test11' ,t, j4 , f1 ) ; % exhaustive test of GrB_extractTuples +logstat ('test19' ,t, j4 , f1 ) ; % GxB_subassign, many pending operators +logstat ('test142' ,t, j0 , f1 ) ; %% test GrB_assign with accum +logstat ('test142b' ,t, j4 , f0 ) ; %% test GrB_assign with accum +logstat ('test54' ,t, j4 , f1 ) ; % assign and extract with begin:inc:end +logstat ('testcc(1)' ,t, j4 , f1 ) ; % transpose, builtin complex +logstat ('test29' ,t, j0 , f1 ) ; % reduce with zombies +logstat ('test227' ,t, j4 , f1 ) ; % test kron +logstat ('test19b' ,s, j4 , f1 ) ; % GrB_assign, many pending operators + +% 10 to 100 seconds: +logstat ('test18' ,t, j4 , f1 ) ; % GrB_eWiseAdd and eWiseMult +logstat ('testc7(0)' ,t, j4 , f1 ) ; % assign, builtin complex +logstat ('testc2(0,0)',t, j04, f10 ) ; % A'*B, A+B, A*B, user-defined complex +logstat ('test193' ,t, j4 , f1 ) ; % test GxB_Matrix_diag +logstat ('test23' ,t, j0 , f1 ) ; % quick test of GB_*_build +logstat ('test243' ,t, j4 , f1 ) ; % test GxB_Vector_Iterator +logstat ('test53' ,t, j4 , f1 ) ; % quick test of GB_mex_Matrix_extract +logstat ('testca(1)' ,t, j4 , f1 ) ; % test complex mxm, mxv, and vxm +logstat ('test242' ,t, j4 , f1 ) ; % test GxB_Iterator for matrices +logstat ('test17' ,t, j4 , f1 ) ; % quick test of GrB_*_extractElement +logstat ('test125' ,t, j4 , f1 ) ; % test GrB_mxm: row and column scaling + +% > 100 seconds +logstat ('test10' ,t, j4 , f1 ) ; % GrB_apply +logstat ('test160' ,s, j0 , f1 ) ; % test A*B, single threaded +logstat ('test75b' ,t, j4 , f1 ) ; % test GrB_mxm A'*B +logstat ('test81' ,t, j4 , f1 ) ; % extract with stride, range, backwards +logstat ('test230' ,t, j4 , f1 ) ; % test apply with idxunops +logstat ('test21b' ,t, j4 , f1 ) ; % quick test of GB_mex_assign +logstat ('test74' ,t, j0 , f1 ) ; % test GrB_mxm on all semirings +logstat ('test234' ,t, j4 , f1 ) ; % test GxB_eWiseUnion +logstat ('test234b' ,t, j0 , f1 ) ; % test GxB_eWiseUnion + +save test195_start GraphBLAS_grbcov +logstat ('test195' ,t, j4 , f1 ) ; % all variants of saxpy3 slice_balanced +save test127_start GraphBLAS_grbcov +logstat ('test127' ,t, j0 , f1 ) ; % test eWiseAdd, eWiseMult + +%=============================================================================== +% finalize +%=============================================================================== + +% turn malloc debugging back on +if (malloc_debugging) + debug_on + fprintf ('[malloc debugging turned back on]\n') ; + fp = fopen ('log.txt', 'a') ; + fprintf (fp, '[malloc debugging turned back on]\n') ; + fclose (fp) ; +end + +t = toc (testall_time) ; +fprintf ('\ntestall: all tests passed, total time %0.4g minutes\n', t / 60) ; + diff --git a/Test/unused/testgen.m b/Test/unused/testgen.m deleted file mode 100644 index 03d32c2b08..0000000000 --- a/Test/unused/testgen.m +++ /dev/null @@ -1,134 +0,0 @@ -function testgen (threads,longtests) -%TESTALL run all GraphBLAS tests -% -% Usage: -% testall ; % runs just the shorter tests (about 30 minutes) -% -% testall(threads) ; % run with specific list of threads and chunk sizes -% testall([ ],1) ; % run all longer tests, with default # of threads -% -% threads is a cell array. Each entry is 2-by-1, with the first value being -% the # of threads to use and the 2nd being the chunk size. The default is -% {[4 1]} if empty or not present. - -% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. -% SPDX-License-Identifier: Apache-2.0 - -GB_mex_init ; -testall_time = tic ; - -if (nargin < 2) - % run the shorter tests by default - longtests = 0 ; -end - -if (nargin < 1) - threads = [ ] ; -end -if (isempty (threads)) - threads {1} = [4 1] ; -end -t = threads ; - -% single thread -s {1} = [1 1] ; - - -% clear the statement coverage counts -clear global GraphBLAS_grbcov - -% use built-in complex data types by default -GB_builtin_complex_set (true) ; - -% many of the tests use spok in SuiteSparse, a copy of which is -% included here in GraphBLAS/Test/spok. -addpath ('../Test/spok') ; -try - spok (sparse (1)) ; -catch - here = pwd ; - cd ../Test/spok ; - spok_install ; - cd (here) ; -end - -logstat ; % start the log.txt -hack = GB_mex_hack ; - -% JIT and factory controls - -% default -j404 = {4,0,4} ; % JIT on, off, on -f110 = {1,1,0} ; % factory on, on , off - -% just one run, both JIT and factory on -j4 = {4} ; % JIT on -f1 = {1} ; % factory on - -% run twice -j44 = {4,4} ; % JIT on, on -f10 = {1,0} ; % factory on, off - -% run twice -j40 = {4,0} ; % JIT on, off -f11 = {1,1} ; % factory on, on - - -% default -j404 = {0} ; % JIT on, off, on -f110 = {0} ; % factory on, on , off - -% just one run, both JIT and factory on -j4 = {0} ; % JIT on -f1 = {0} ; % factory on - -% run twice -j44 = {0} ; % JIT on, on -f10 = {0} ; % factory on, off - -% run twice -j40 = {0} ; % JIT on, off -f11 = {0} ; % factory on, on - -j4040 = {0} ; % JIT on, off, on , off -f1100 = {0} ; % factory on, on , off, off - -% start with the Werk stack enabled -hack (2) = 0 ; GB_mex_hack (hack) ; - -malloc_debugging = stat ; - -%=============================================================================== -% statement coverage test, with malloc debugging -%=============================================================================== - -logstat ('test254' ,t, j404, f110) ; % mask types - -hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack - -logstat ('test191' ,t, j4 , f1 ) ; % test split - -hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack - -% Turn off malloc debugging -if (malloc_debugging) - debug_off - fprintf ('[malloc debugging turned off]\n') ; - fp = fopen ('log.txt', 'a') ; - fprintf (fp, '[malloc debugging turned off]\n') ; - fclose (fp) ; -end - -logstat ('test142' ,t, j4040, f1100) ; % test GrB_assign with accum -logstat ('test125' ,t, j4 , f1 ) ; % test GrB_mxm: row and column scaling - -%---- - -if (malloc_debugging) - debug_on - fprintf ('[malloc debugging turned back on]\n') ; - fp = fopen ('log.txt', 'a') ; - fprintf (fp, '[malloc debugging turned back on]\n') ; - fclose (fp) ; -end - diff --git a/Test/unused/testhack.m b/Test/unused/testhack.m new file mode 100644 index 0000000000..fc38efa838 --- /dev/null +++ b/Test/unused/testhack.m @@ -0,0 +1,334 @@ +function testall (threads, mdebug) +%TESTALL run all GraphBLAS tests +% +% Usage: +% +% testall ; % runs just the shorter tests +% testall(threads) ; % run with specific list of threads and chunk sizes +% testall(threads,1) ; % runs with malloc debugging enabled +% +% threads is a cell array. Each entry is 2-by-1, with the first value being +% the # of threads to use and the 2nd being the chunk size. The default is +% {[4 1]} if threads is empty or not present. + +% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved. +% SPDX-License-Identifier: Apache-2.0 + +GrB.init ; +GB_mex_init ; +testall_time = tic ; + +if (nargin < 1) + threads = [ ] ; +end +if (isempty (threads)) + threads {1} = [4 1] ; +end +t = threads ; + +if (nargin < 2) + mdebug = false ; +end + +% single thread +s {1} = [1 1] ; + +% clear the statement coverage counts +%% clear global GraphBLAS_grbcov + +global GraphBLAS_debug GraphBLAS_grbcov GraphBLAS_grbcovs ... + GraphBLAS_scripts GraphBLAS_times + +% use built-in complex data types by default +GB_builtin_complex_set (true) ; + +% many of the tests use spok in SuiteSparse, a copy of which is +% included here in GraphBLAS/Test/spok. +addpath ('../Test/spok') ; +try + spok (sparse (1)) ; +catch + here = pwd ; + cd ../Test/spok ; + spok_install ; + cd (here) ; +end + +logstat ; % start the log.txt +hack = GB_mex_hack ; + +% JIT and factory controls + +% run once +j4 = {4} ; % JIT on +f1 = {1} ; % factory on +j0 = {0} ; % JIT off +f0 = {0} ; % factory off + +% run twice +j44 = {4,4} ; % JIT on, on +j04 = {0,4} ; % JIT off, on +j40 = {4,0} ; % JIT on, off +f10 = {1,0} ; % factory on, off +f00 = {0,0} ; % factory off, off +f11 = {1,1} ; % factory on, on +j42 = {4,2} ; % JIT on, pause + +% 3 runs +j440 = {4,4,0} ; % JIT on, on , off +j404 = {4,0,4} ; % JIT on, off, on +f100 = {1,0,0} ; % factory on, off, off +f110 = {1,1,0} ; % factory on, on , off + +% start with the Werk stack enabled +hack (2) = 0 ; GB_mex_hack (hack) ; + +% save the current malloc debug status +debug_save = stat ; + +%=============================================================================== +% quick tests (< 1 sec) +%=============================================================================== + +% < 1 second: debug_off +set_malloc_debug (mdebug, 0) +logstat ('test109' ,t, j404, f110) ; % terminal monoid with user-defined type +logstat ('test138' ,s, j4 , f1 ) ; % assign, coarse-only tasks in IxJ slice +logstat ('test139' ,s, j4 , f1 ) ; % merge sort, special cases +logstat ('test172' ,t, j4 , f1 ) ; % test eWiseMult with M bitmap/full +logstat ('test155' ,t, j4 , f1 ) ; % test GrB_*_setElement, removeElement +logstat ('test174' ,t, j4 , f1 ) ; % test GrB_assign C=A +logstat ('test203' ,t, j4 , f1 ) ; % test iso subref +logstat ('test213' ,t, j4 , f1 ) ; % test iso assign (method 05d) +logstat ('test216' ,t, j4 , f1 ) ; % test C=A, iso case +logstat ('test225' ,t, j4 , f1 ) ; % test mask operations (GB_masker) +logstat ('test226' ,t, j4 , f1 ) ; % test kron with iso matrices +logstat ('test235' ,t, j4 , f1 ) ; % test GxB_eWiseUnion and GrB_eWiseAdd +logstat ('test252' ,t, j4 , f1 ) ; % basic tests +logstat ('test253' ,t, j4 , f1 ) ; % basic JIT tests +logstat ('test255' ,t, j4 , f1 ) ; % flip binop +logstat ('test257' ,t, j4 , f0 ) ; % JIT error handling +logstat ('test260' ,t, j4 , f0 ) ; % demacrofy name +logstat ('test261' ,t, j4 , f0 ) ; % serialize/deserialize error handling +logstat ('test262' ,t, j0 , f1 ) ; % GB_mask +logstat ('test263' ,t, j4 , f0 ) ; % JIT tests +logstat ('test264' ,t, j4 , f0 ) ; % enumify / macrofy tests +logstat ('test265' ,t, j4 , f0 ) ; % reduce to scalar with user types +logstat ('test267' ,t, j4 , f0 ) ; % JIT error handling +logstat ('test269' ,t, j0 , f1 ) ; % get/set for type, scalar, vec, mtx +logstat ('test271' ,t, j0 , f1 ) ; % binary op get/set +logstat ('test272' ,t, j0 , f1 ) ; % misc simple tests +logstat ('test273' ,t, j0 , f1 ) ; % Global get/set +logstat ('test274' ,t, j0 , f1 ) ; % index unary op get/set +logstat ('test276' ,t, j0 , f1 ) ; % semiring get/set +logstat ('test277' ,t, j0 , f1 ) ; % context get/set +logstat ('test279' ,t, j0 , f1 ) ; % blob get/set +logstat ('test281' ,t, j4 , f1 ) ; % test user-defined idx unop, no JIT +logstat ('test268' ,t, j4 , f1 ) ; % C=Z sparse masker +logstat ('test247' ,t, j4 , f1 ) ; % GrB_mxm: fine Hash method +logstat ('test207' ,t, j4 , f1 ) ; % test iso subref +logstat ('test211' ,t, j4 , f1 ) ; % test iso assign +logstat ('test183' ,s, j4 , f1 ) ; % test eWiseMult with hypersparse mask +logstat ('test212' ,t, j44 , f10 ) ; % test iso mask all zero +logstat ('test219' ,s, j44 , f10 ) ; % test reduce to scalar (1 thread) + +% < 1 second: debug_on +set_malloc_debug (mdebug, 1) +logstat ('test09' ,t, j4 , f1 ) ; % duplicate I,J test of GB_mex_subassign +logstat ('test108' ,t, j40 , f10 ) ; % boolean monoids +logstat ('test137' ,s, j40 , f11 ) ; % GrB_eWiseMult, FIRST and SECOND +logstat ('test124' ,t, j4 , f1 ) ; % GrB_extract, case 6 +logstat ('test133' ,t, j4 , f1 ) ; % test mask operations (GB_masker) +logstat ('test176' ,t, j4 , f1 ) ; % test GrB_assign, method 09, 11 +logstat ('test197' ,t, j4 , f1 ) ; % test large sparse split +logstat ('test201' ,t, j4 , f1 ) ; % test iso reduce to vector and scalar +logstat ('test208' ,t, j4 , f1 ) ; % test iso apply, bind 1st and 2nd +logstat ('test214' ,t, j4 , f1 ) ; % test C=A'*B (tricount) +logstat ('test223' ,t, j4 , f1 ) ; % test matrix multiply, C=A*B +logstat ('test241' ,t, j4 , f1 ) ; % test GrB_mxm, trigger the swap_rule +logstat ('test270' ,t, j0 , f1 ) ; % unary op get/set +logstat ('test199' ,t, j4 , f1 ) ; % test dot2 with hypersparse +logstat ('test210' ,t, j4 , f1 ) ; % iso assign25: C=A +logstat ('test165' ,t, j4 , f1 ) ; % test C=A*B', A is diagonal, B bitmap +logstat ('test221' ,t, j4 , f1 ) ; % test C += A, C is bitmap and A is full +logstat ('test278' ,t, j0 , f1 ) ; % descriptor get/set +logstat ('test162' ,t, j4 , f1 ) ; % test C=A*B with very sparse M +logstat ('test275' ,t, j0 , f1 ) ; % monoid get/set +logstat ('test220' ,t, j4 , f1 ) ; % test mask C=Z, iso case +logstat ('test83' ,t, j4 , f1 ) ; % GrB_assign with C_replace and empty J +logstat ('test04' ,t, j4 , f1 ) ; % simple mask and transpose test +logstat ('test132' ,t, j4 , f1 ) ; % setElement +logstat ('test82' ,t, j4 , f1 ) ; % GrB_extract with index range (hyper) +logstat ('test202' ,t, j40 , f11 ) ; % test iso add and emult +logstat ('test222' ,t, j4 , f1 ) ; % test user selectop for iso matrices +logstat ('test204' ,t, j4 , f1 ) ; % test iso diag +logstat ('test258' ,t, j4 , f0 ) ; % reduce-to-vector for UDT +logstat ('test136' ,s, j4 , f1 ) ; % subassignment special cases +logstat ('test128' ,t, j4 , f1 ) ; % eWiseMult, eWiseAdd, eWiseUnion cases +logstat ('test144' ,t, j4 , f1 ) ; % cumsum + +%=============================================================================== +% 1 to 10 seconds +%=============================================================================== + +% 1 to 10 seconds: debug_off +set_malloc_debug (mdebug, 0) +logstat ('testc2(0,0)',t, j0 , f1 ) ; % A'*B, A+B, A*B, user-defined complex +logstat ('test239' ,t, j44 , f10 ) ; % test GxB_eWiseUnion +logstat ('test245' ,t, j40 , f11 ) ; % test complex row/col scale +logstat ('test159' ,t, j0 , f0 ) ; % test A*B +logstat ('test259' ,t, j4 , f0 ) ; % plus_plus_fp32 semiring +logstat ('testc4(0)' ,t, j4 , f1 ) ; % extractElement, setElement, user type +logstat ('test157' ,t, j4 , f1 ) ; % test sparsity formats +logstat ('test182' ,s, j4 , f1 ) ; % test for internal wait +logstat ('test195' ,t, j4 , f1 ) ; % all variants of saxpy3 slice_balanced +logstat ('test173' ,t, j4 , f1 ) ; % test GrB_assign C=A +logstat ('test135' ,t, j4 , f1 ) ; % reduce to scalar +logstat ('test84' ,t, j4 , f1 ) ; % GrB_assign (row/col with C CSR/CSC) +logstat ('test215' ,t, j4 , f1 ) ; % test C=A'*B (dot2, ANY_PAIR) +logstat ('test80' ,t, j4 , f1 ) ; % test GrB_mxm on all semirings +logstat ('test200' ,t, j4 , f1 ) ; % test iso full matrix multiply +logstat ('test283' ,t, j4 , f1 ) ; % test index binary op +logstat ('test254' ,t, j44 , f10 ) ; % mask types +logstat ('test19' ,t, j4 , f1 ) ; % GxB_subassign, many pending operators +logstat ('test142' ,t, j0 , f1 ) ; % test GrB_assign with accum +logstat ('test142b' ,t, j4 , f0 ) ; % test GrB_assign with accum +logstat ('test54' ,t, j4 , f1 ) ; % assign and extract with begin:inc:end +logstat ('testcc(1)' ,t, j4 , f1 ) ; % transpose, builtin complex +logstat ('testc2(1,1)',t, j44 , f10 ) ; % complex tests (quick case, builtin) +logstat ('test227' ,t, j4 , f1 ) ; % test kron +logstat ('test19b' ,s, j4 , f1 ) ; % GrB_assign, many pending operators +logstat ('test141' ,t, j0 , f1 ) ; % eWiseAdd with dense matrices +logstat ('test179' ,t, j44 , f10 ) ; % test bitmap select +logstat ('test232' ,t, j4 , f1 ) ; % test assign with GrB_Scalar + +% 1 to 10 seconds, no Werk, debug_off +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test256' ,t, j4 , f0 ) ; % JIT error handling +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +% 1 to 10 seconds: debug_on +set_malloc_debug (mdebug, 1) +logstat ('test130' ,t, j4 , f1 ) ; % GrB_apply, hypersparse cases +logstat ('test148' ,t, j4 , f1 ) ; % ewise with alias +logstat ('test231' ,t, j4 , f1 ) ; % test GrB_select with idxunp +logstat ('test129' ,t, j4 , f1 ) ; % test GxB_select (tril, nonz, hyper) +logstat ('test69' ,t, j4 , f1 ) ; % assign and subassign with alias +logstat ('test11' ,t, j4 , f1 ) ; % exhaustive test of GrB_extractTuples +logstat ('test29' ,t, j0 , f1 ) ; % reduce with zombies +logstat ('test282' ,t, j42 , f11 ) ; % test argmax, index binary op +logstat ('test249' ,t, j4 , f1 ) ; % GxB_Context object +logstat ('test196' ,t, j4 , f1 ) ; % test hypersparse concat +logstat ('test250' ,t, j44 , f10 ) ; % JIT tests, set/get, other tests +logstat ('test145' ,t, j42 , f11 ) ; % dot4 for C += A'*B +logstat ('test229' ,t, j40 , f11 ) ; % test setElement +logstat ('test209' ,t, j4 , f1 ) ; % test iso build +logstat ('test224' ,t, j4 , f1 ) ; % test unpack/pack + +% 1 to 10 seconds, no Werk, debug_on +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test150' ,t, j0 , f0 ) ; % mxm zombies, typecasting (dot3,saxpy) +logstat ('test240' ,t, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 +logstat ('test240' ,s, j4 , f1 ) ; % test dot4, saxpy4, and saxpy5 (1 task) +logstat ('test237' ,t, j40 , f10 ) ; % test GrB_mxm (saxpy4) +logstat ('test237' ,s, j40 , f10 ) ; % test GrB_mxm (saxpy4) (1 task) +logstat ('test184' ,t, j4 , f1 ) ; % special cases: mxm, transpose, build +logstat ('test236' ,t, j4 , f1 ) ; % test GxB_Matrix_sort, GxB_Vector_sort +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +%=============================================================================== +% 10 to 100 seconds +%=============================================================================== + +% 10 to 100 seconds: debug_off +set_malloc_debug (mdebug, 0) +logstat ('test18' ,t, j4 , f1 ) ; % GrB_eWiseAdd and eWiseMult +logstat ('testc7(0)' ,t, j4 , f1 ) ; % assign, builtin complex +logstat ('test193' ,t, j4 , f1 ) ; % test GxB_Matrix_diag +logstat ('test127' ,t, j0 , f1 ) ; % test eWiseAdd, eWiseMult +logstat ('test23' ,t, j0 , f1 ) ; % quick test of GB_*_build +logstat ('test243' ,t, j4 , f1 ) ; % test GxB_Vector_Iterator +logstat ('test53' ,t, j4 , f1 ) ; % quick test of GB_mex_Matrix_extract +logstat ('test242' ,t, j4 , f1 ) ; % test GxB_Iterator for matrices +logstat ('test17' ,t, j4 , f1 ) ; % quick test of GrB_*_extractElement +logstat ('test246' ,t, j4 , f1 ) ; % GrB_mxm parallelism (slice_balanced) +logstat ('test206' ,t, j44 , f10 ) ; % test iso select +logstat ('test251' ,t, j4 , f1 ) ; % dot4, dot2, with plus_pair +logstat ('test251b' ,t, j4 , f0 ) ; % dot4, dot2, with plus_pair +logstat ('test152' ,t, j44 , f10 ) ; % test binops C=A+B, all matrices dense +logstat ('test160' ,s, j0 , f1 ) ; % test A*B, single threaded + +% 10 to 100 seconds, no Werk, debug_off +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test188b' ,t, j0 , f1 ) ; % test concat +logstat ('test186' ,t, j4 , f1 ) ; % saxpy, all formats (slice_balanced) +%ogstat ('test186' ,t, j40 , f11 ) ; % saxpy, all formats (slice_balanced) +%ogstat ('test186(0)' ,t, j4 , f1 ) ; % repeat with default slice_balanced +logstat ('test192' ,t, j4 , f1 ) ; % test C=scalar +logstat ('test187' ,t, j4 , f1 ) ; % test dup/assign for all formats +logstat ('test181' ,s, j4 , f1 ) ; % transpose with explicit zeros in mask +logstat ('test238' ,t, j44 , f10 ) ; % test GrB_mxm (dot4 and dot2) +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +% 10 to 100 seconds: debug_on +set_malloc_debug (mdebug, 1) +logstat ('test189' ,t, j4 , f1 ) ; % test large assign +logstat ('test169' ,t, j0 , f1 ) ; % C=A+B with many formats +logstat ('test76' ,s, j4 , f1 ) ; % GxB_resize (single threaded) +logstat ('test01' ,t, j4 , f1 ) ; % error handling +logstat ('test228' ,t, j4 , f1 ) ; % test serialize/deserialize +logstat ('test104' ,t, j4 , f1 ) ; % export/import +logstat ('test244' ,t, j4 , f1 ) ; % test GxB_Matrix_reshape* + +% 10 to 100 seconds, no Werk, debug_on +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test180' ,s, j4 , f1 ) ; % test assign and subassign (1 thread) +logstat ('test188' ,t, j4 , f1 ) ; % test concat +logstat ('test151b' ,t, j4 , f1 ) ; % test bshift operator +logstat ('test191' ,t, j40 , f10 ) ; % test split +logstat ('test14' ,t, j4 , f1 ) ; % GrB_reduce +logstat ('test14b' ,t, j4 , f0 ) ; % GrB_reduce +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +%=============================================================================== +% > 100 seconds +%=============================================================================== + +% > 100 seconds, debug_off +set_malloc_debug (mdebug, 0) +logstat ('test125' ,t, j4 , f1 ) ; % test GrB_mxm: row and column scaling +logstat ('test280' ,t, j4 , f1 ) ; % subassign method 26 +logstat ('test10' ,t, j4 , f1 ) ; % GrB_apply +logstat ('test75b' ,t, j4 , f1 ) ; % test GrB_mxm A'*B +logstat ('test81' ,t, j4 , f1 ) ; % extract with stride, range, backwards +logstat ('test230' ,t, j4 , f1 ) ; % test apply with idxunops +logstat ('test21b' ,t, j4 , f1 ) ; % quick test of GB_mex_assign +logstat ('test74' ,t, j0 , f1 ) ; % test GrB_mxm on all semirings +logstat ('test234' ,t, j4 , f1 ) ; % test GxB_eWiseUnion +logstat ('test234b' ,t, j0 , f1 ) ; % test GxB_eWiseUnion + +% > 100 seconds, no Werk, debug_off +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test185' ,s, j4 , f1 ) ; % test dot4, saxpy for all sparsity +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +% > 100 seconds, debug_on +set_malloc_debug (mdebug, 1) +logstat ('testca(1)' ,t, j4 , f1 ) ; % test complex mxm, mxv, and vxm +logstat ('test194' ,t, j4 , f1 ) ; % test GxB_Vector_diag + +% > 100 seconds, no Werk, debug_on +hack (2) = 1 ; GB_mex_hack (hack) ; % disable the Werk stack +logstat ('test154' ,t, j4 , f1 ) ; % apply with binop and scalar binding +logstat ('test154b' ,t, j0 , f1 ) ; % apply with binop and scalar binding +hack (2) = 0 ; GB_mex_hack (hack) ; % re-enable the Werk stack + +%=============================================================================== +% finalize +%=============================================================================== + +% restore the original malloc debug state +set_malloc_debug (mdebug, debug_save) +t = toc (testall_time) ; +fprintf ('\ntestall: all tests passed, total time %0.4g minutes\n', t / 60) ; + diff --git a/cmake_modules/GraphBLAS_JIT_paths.cmake b/cmake_modules/GraphBLAS_JIT_paths.cmake index 0e52da17ad..ddb88ad52e 100644 --- a/cmake_modules/GraphBLAS_JIT_paths.cmake +++ b/cmake_modules/GraphBLAS_JIT_paths.cmake @@ -40,7 +40,7 @@ endif ( ) if ( SUITESPARSE_HAS_CUDA AND GRAPHBLAS_USE_CUDA ) # FOR NOW: do not compile FactoryKernels when developing the CUDA kernels -# set ( GRAPHBLAS_COMPACT on ) # FIXME +# set ( GRAPHBLAS_COMPACT on ) # Fixme for CUDA endif ( ) include ( CheckSymbolExists ) diff --git a/cmake_modules/GraphBLAS_PreJIT.cmake b/cmake_modules/GraphBLAS_PreJIT.cmake index e9078c8b0f..388a908a16 100644 --- a/cmake_modules/GraphBLAS_PreJIT.cmake +++ b/cmake_modules/GraphBLAS_PreJIT.cmake @@ -57,6 +57,8 @@ foreach ( PSRC ${PRE1} ) list ( APPEND PREPRO "JIT_CONS (" ${F} ")\n" ) elseif ( ${F} MATCHES "^GB_jit__convert_s2b" ) list ( APPEND PREPRO "JIT_CS2B (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__convert_b2s" ) + list ( APPEND PREPRO "JIT_CB2S (" ${F} ")\n" ) elseif ( ${F} MATCHES "^GB_jit__emult_02" ) list ( APPEND PREPRO "JIT_EM2 (" ${F} ")\n" ) elseif ( ${F} MATCHES "^GB_jit__emult_03" ) @@ -89,6 +91,8 @@ foreach ( PSRC ${PRE1} ) list ( APPEND PREPRO "JIT_SPS (" ${F} ")\n" ) elseif ( ${F} MATCHES "^GB_jit__subassign" ) list ( APPEND PREPRO "JIT_SUB (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__bitmap_assign" ) + list ( APPEND PREPRO "JIT_SUB (" ${F} ")\n" ) elseif ( ${F} MATCHES "^GB_jit__trans_bind1" ) list ( APPEND PREPRO "JIT_TR1 (" ${F} ")\n" ) elseif ( ${F} MATCHES "^GB_jit__trans_bind2" ) @@ -101,6 +105,22 @@ foreach ( PSRC ${PRE1} ) list ( APPEND PREPRO "JIT_UOP (" ${F} ")\n" ) elseif ( ${F} MATCHES "^GB_jit__user_type" ) list ( APPEND PREPRO "JIT_UTYP (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__masker_phase1" ) + list ( APPEND PREPRO "JIT_MAS1 (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__masker_phase2" ) + list ( APPEND PREPRO "JIT_MAS2 (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__subref_sparse" ) + list ( APPEND PREPRO "JIT_SREF (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__subref_bitmap" ) + list ( APPEND PREPRO "JIT_BREF (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__iso_expand" ) + list ( APPEND PREPRO "JIT_ISOE (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__unjumble" ) + list ( APPEND PREPRO "JIT_UNJU (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__sort" ) + list ( APPEND PREPRO "JIT_SORT (" ${F} ")\n" ) + elseif ( ${F} MATCHES "^GB_jit__kroner" ) + list ( APPEND PREPRO "JIT_KRON (" ${F} ")\n" ) endif ( ) endforeach ( ) @@ -119,7 +139,7 @@ configure_file ( "Config/GB_prejit.c.in" # create a list of files of CUDA PreJIT kernels #------------------------------------------------------------------------------- -# FIXME: add CUDA PreJIT kernels. For example: +# Fixme for CUDA: add CUDA PreJIT kernels. For example: # ... # elseif ( ${F} MATCHES "^GB_jit__cuda_reduce" ) diff --git a/cmake_modules/GraphBLAS_version.cmake b/cmake_modules/GraphBLAS_version.cmake index a9a468e332..ffe66c08df 100644 --- a/cmake_modules/GraphBLAS_version.cmake +++ b/cmake_modules/GraphBLAS_version.cmake @@ -8,10 +8,10 @@ #------------------------------------------------------------------------------- # version of SuiteSparse:GraphBLAS -set ( GraphBLAS_DATE "Aug 12, 2024" ) +set ( GraphBLAS_DATE "Nov 18, 2024" ) set ( GraphBLAS_VERSION_MAJOR 9 CACHE STRING "" FORCE ) -set ( GraphBLAS_VERSION_MINOR 3 CACHE STRING "" FORCE ) -set ( GraphBLAS_VERSION_SUB 1 CACHE STRING "" FORCE ) +set ( GraphBLAS_VERSION_MINOR 4 CACHE STRING "" FORCE ) +set ( GraphBLAS_VERSION_SUB 2 CACHE STRING "" FORCE ) # GraphBLAS C API Specification version, at graphblas.org set ( GraphBLAS_API_DATE "Dec 22, 2023" ) diff --git a/rmm_wrap/CMakeLists.txt b/rmm_wrap/CMakeLists.txt index b34f489010..e4d3c109f9 100644 --- a/rmm_wrap/CMakeLists.txt +++ b/rmm_wrap/CMakeLists.txt @@ -25,6 +25,7 @@ if ( NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY} ) endif ( ) if ( NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY}/spdlog ) + message ( status "cloning spdlog v1.10.0" ) execute_process ( COMMAND git clone "https://github.com/gabime/spdlog.git" --branch v1.10.0 --recursive spdlog WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes ) @@ -34,6 +35,7 @@ set ( SPDLOG_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/external_includes/spdlog/in include_directories ( ${SPDLOG_INCLUDE_DIR} ) if ( NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY}/rmm ) + message ( status "cloning rmm branch-21.10" ) execute_process ( COMMAND git clone "https://github.com/rapidsai/rmm.git" --branch branch-21.10 --recursive rmm WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes ) diff --git a/rmm_wrap/rmm_wrap.cpp b/rmm_wrap/rmm_wrap.cpp index 22362b7c98..9d358d5a91 100644 --- a/rmm_wrap/rmm_wrap.cpp +++ b/rmm_wrap/rmm_wrap.cpp @@ -170,14 +170,23 @@ bool rmm_wrap_is_initialized (void) void rmm_wrap_finalize (void) { - if (rmm_wrap_context != NULL) + try { - for(int device_id = 0; device_id < devices.size(); ++device_id) { - RMM_WRAP_CHECK_CUDA(cudaStreamDestroy(rmm_wrap_context[device_id]->main_stream)); - delete rmm_wrap_context[device_id]; + if (rmm_wrap_context != NULL) + { + for (int device_id = 0; device_id < devices.size(); ++device_id) + { + RMM_WRAP_CHECK_CUDA(cudaStreamDestroy(rmm_wrap_context[device_id]->main_stream)); + delete rmm_wrap_context[device_id]; + } + delete rmm_wrap_context ; + rmm_wrap_context = NULL ; } - delete rmm_wrap_context ; - rmm_wrap_context = NULL ; + } + catch (...) + { + // something failed; just return + return ; } } @@ -187,6 +196,7 @@ void rmm_wrap_finalize (void) int get_current_device(void) { + // FIXME: return an error code if this method fails int device_id; cudaGetDevice(&device_id); return device_id; @@ -205,88 +215,96 @@ int rmm_wrap_initialize // returns -1 on error, 0 on success size_t stream_pool_size // TODO: describe. Should we default this? ) { + + try + { - //-------------------------------------------------------------------------- - // check inputs - //-------------------------------------------------------------------------- + //---------------------------------------------------------------------- + // check inputs + //---------------------------------------------------------------------- - if (rmm_wrap_context[device_id] != NULL) - { - return (-1) ; - } + if (rmm_wrap_context[device_id] != NULL) + { + return (-1) ; + } - if(stream_pool_size <= 0) - { - // std::cout << "Stream pool size must be >=0" << std::endl; - // failed to create the alloc_map - return (-1) ; - } + if(stream_pool_size <= 0) + { + // std::cout << "Stream pool size must be >=0" << std::endl; + // failed to create the alloc_map + return (-1) ; + } -// // create the RMM wrap handle and save it as a global pointer. - rmm_wrap_context [device_id] = new RMM_Wrap_Handle() ; - // FIXME: check for error? + // create the RMM wrap handle and save it as a global pointer. + rmm_wrap_context [device_id] = new RMM_Wrap_Handle() ; + // FIXME: check for error? - // std::cout<< " init called with mode "<stream_pool = make_and_set_cuda_stream_pool(stream_pool_size); - RMM_WRAP_CHECK_CUDA(cudaStreamCreate(&(rmm_wrap_context[device_id]->main_stream))); + // Set CUDA stream pool + // std::cout << "Creating rmm_wrap stream pool" << std::endl; + rmm_wrap_context[device_id]->stream_pool = make_and_set_cuda_stream_pool(stream_pool_size); + RMM_WRAP_CHECK_CUDA(cudaStreamCreate(&(rmm_wrap_context[device_id]->main_stream))); - if (mode == rmm_wrap_host ) - { - // rmm_wrap_context->host_resource = - // std::pmr::synchronized_pool_resource() ; - // // (init_pool_size, max_pool_size) ; - // rmm_wrap_context->host_resource = make_and_set_host_pool() ; - // // (init_pool_size, max_pool_size) ; - } - else if (mode == rmm_wrap_host_pinned ) - { - // rmm_wrap_context->host_resource = - // std::pmr::synchronized_pool_resource() ; - // // (init_pool_size, max_pool_size) ; - } - else if (mode == rmm_wrap_device ) - { - rmm_wrap_context[device_id]->resource = - make_and_set_device_pool( init_pool_size, max_pool_size) ; - } - else if ( mode == rmm_wrap_managed ) - { - // std::cout << "Seting managed pool" << std::endl; - rmm_wrap_context[device_id]->resource = - make_and_set_managed_pool( init_pool_size, max_pool_size); - } - else - { - // invalid mode - return (-1) ; - } + if (mode == rmm_wrap_host ) + { + // rmm_wrap_context->host_resource = + // std::pmr::synchronized_pool_resource() ; + // // (init_pool_size, max_pool_size) ; + // rmm_wrap_context->host_resource = make_and_set_host_pool() ; + // // (init_pool_size, max_pool_size) ; + } + else if (mode == rmm_wrap_host_pinned ) + { + // rmm_wrap_context->host_resource = + // std::pmr::synchronized_pool_resource() ; + // // (init_pool_size, max_pool_size) ; + } + else if (mode == rmm_wrap_device ) + { + rmm_wrap_context[device_id]->resource = + make_and_set_device_pool( init_pool_size, max_pool_size) ; + } + else if ( mode == rmm_wrap_managed ) + { + // std::cout << "Seting managed pool" << std::endl; + rmm_wrap_context[device_id]->resource = + make_and_set_managed_pool( init_pool_size, max_pool_size); + } + else + { + // invalid mode + return (-1) ; + } - // std::cout << "Setting mode for rmm_wrap context" << std::endl; - // Mark down the mode for reference later - rmm_wrap_context[device_id]->mode = mode; + // std::cout << "Setting mode for rmm_wrap context" << std::endl; + // Mark down the mode for reference later + rmm_wrap_context[device_id]->mode = mode; - //-------------------------------------------------------------------------- - // create size map to lookup size of each allocation - //-------------------------------------------------------------------------- + //---------------------------------------------------------------------- + // create size map to lookup size of each allocation + //---------------------------------------------------------------------- - // std::cout << "Setting size_map for rmm_wrap context" << std::endl; - rmm_wrap_context[device_id]->size_map = std::make_shared () ; - if (rmm_wrap_context[device_id]->size_map.get() == NULL) + // std::cout << "Setting size_map for rmm_wrap context" << std::endl; + rmm_wrap_context[device_id]->size_map = std::make_shared () ; + if (rmm_wrap_context[device_id]->size_map.get() == NULL) + { + // std::cout << "Failed to create size_map" << std::endl; + // failed to create the alloc_map + return (-1) ; + } + return (0) ; + } + catch (...) { - // std::cout << "Failed to create size_map" << std::endl; - // failed to create the alloc_map + // something failed; return an error code return (-1) ; } - - return (0) ; } //------------------------------------------------------------------------------ @@ -301,61 +319,71 @@ int rmm_wrap_initialize_all_same size_t stream_pool_size // TODO: describe. Should we default this? ) { - - if (rmm_wrap_context != NULL) + try { - return (-1); - } - - devices.clear(); - - const char* cuda_visible_devices = std::getenv("CUDA_VISIBLE_DEVICES"); - /** - * Start with "CUDA_VISIBLE_DEVICES" var if it's defined. - */ - if(cuda_visible_devices != nullptr) { - std::stringstream check1; - check1 << cuda_visible_devices; - std::string intermediate; - while(getline(check1, intermediate, ',')) + if (rmm_wrap_context != NULL) { + return (-1); + } - intermediate.erase(std::remove_if(intermediate.begin(), intermediate.end(), ::isspace), intermediate.end()); - uint32_t device_id = static_cast(stoi(intermediate)); - // std::cout << "Found device_id " << device_id << std::endl; - devices.push_back(device_id); + devices.clear(); + + const char* cuda_visible_devices = std::getenv("CUDA_VISIBLE_DEVICES"); + + /** + * Start with "CUDA_VISIBLE_DEVICES" var if it's defined. + */ + if(cuda_visible_devices != nullptr) { + std::stringstream check1; + check1 << cuda_visible_devices; + std::string intermediate; + while(getline(check1, intermediate, ',')) + { + + intermediate.erase(std::remove_if(intermediate.begin(), intermediate.end(), ::isspace), intermediate.end()); + uint32_t device_id = static_cast(stoi(intermediate)); + // std::cout << "Found device_id " << device_id << std::endl; + devices.push_back(device_id); + } + /** + * If CUDA_VISIBLE_DEVICES not explicitly specified, + * default to device 0. + */ + } else { + devices.push_back(0); + // std::cout << "Using default device_id 0" << std::endl; } - /** - * If CUDA_VISIBLE_DEVICES not explicitly specified, - * default to device 0. - */ - } else { - devices.push_back(0); - // std::cout << "Using default device_id 0" << std::endl; - } - // Allocate rmm_wrap_contexts - rmm_wrap_context = (RMM_Wrap_Handle**)malloc(devices.size() * sizeof(RMM_Wrap_Handle*)); - for(int i = 0; i < devices.size(); ++i) { - rmm_wrap_context[i] = NULL; - uint32_t device_id = devices[i]; - // std::cout << "Creating rmm_wrap_context for device_id " << device_id << std::endl; - int ret = rmm_wrap_initialize(device_id, mode, init_pool_size, max_pool_size, stream_pool_size); - if(ret < 0) { - return ret; + // Allocate rmm_wrap_contexts + rmm_wrap_context = (RMM_Wrap_Handle**)malloc(devices.size() * sizeof(RMM_Wrap_Handle*)); + for(int i = 0; i < devices.size(); ++i) { + rmm_wrap_context[i] = NULL; + uint32_t device_id = devices[i]; + // std::cout << "Creating rmm_wrap_context for device_id " << device_id << std::endl; + int ret = rmm_wrap_initialize(device_id, mode, init_pool_size, max_pool_size, stream_pool_size); + if(ret < 0) { + return ret; + } } - } - return 0; + return 0; + } + catch (...) + { + // something failed; return an error state + return (-1) ; + } } //------------------------------------------------------------------------------ -// rmm_wrap_get_next_stream_from_pool: return the next available stream from the pool -// Output is cudaStream_t +// rmm_wrap_get_next_stream_from_pool: return the next available stream from +// the pool Output is cudaStream_t //------------------------------------------------------------------------------ + void* rmm_wrap_get_next_stream_from_pool(void) { + // FIXME: check for errors return rmm_wrap_context[get_current_device()]->stream_pool->get_stream(); } @@ -363,8 +391,10 @@ void* rmm_wrap_get_next_stream_from_pool(void) // rmm_wrap_get_stream_from_pool: return specific stream from the pool // Output is cudaStream_t //------------------------------------------------------------------------------ + void* rmm_wrap_get_stream_from_pool(std::size_t stream_id) { + // FIXME: check for errors return rmm_wrap_context[get_current_device()]->stream_pool->get_stream(stream_id); } @@ -374,6 +404,7 @@ void* rmm_wrap_get_stream_from_pool(std::size_t stream_id) //------------------------------------------------------------------------------ void* rmm_wrap_get_main_stream(void) { + // FIXME: check for errors return rmm_wrap_context[get_current_device()]->main_stream; } //------------------------------------------------------------------------------ @@ -402,7 +433,10 @@ void *rmm_wrap_calloc (std::size_t n, std::size_t size) // NOTE: this is single-threaded on the CPU. If you want a faster method, // malloc the space and use cudaMemset for the GPU or GB_memset on the CPU. // The GraphBLAS GB_calloc_memory method uses malloc and GB_memset. - memset (p, 0, s) ; + if (p != NULL) + { + memset (p, 0, s) ; + } return (p) ; } @@ -415,58 +449,67 @@ void *rmm_wrap_calloc (std::size_t n, std::size_t size) void *rmm_wrap_realloc (void *p, std::size_t newsize) { - if (p == NULL) + try { - // allocate a new block. This is OK. - return (rmm_wrap_allocate (&newsize)) ; - } + if (p == NULL) + { + // allocate a new block. This is OK. + return (rmm_wrap_allocate (&newsize)) ; + } - if (newsize == 0) - { - // free the block. This OK. - rmm_wrap_deallocate (p, 0) ; - return (NULL) ; - } + if (newsize == 0) + { + // free the block. This OK. + rmm_wrap_deallocate (p, 0) ; + return (NULL) ; + } - uint32_t device_id = get_current_device(); + uint32_t device_id = get_current_device(); - alloc_map *am = rmm_wrap_context[device_id]->size_map.get() ; - std::size_t oldsize = am->at( (std::size_t)(p) ) ; + alloc_map *am = rmm_wrap_context[device_id]->size_map.get() ; + std::size_t oldsize = am->at( (std::size_t)(p) ) ; - if (oldsize == 0) - { - // the block is not in the hashmap; cannot realloc it. - // This is a failure. - return (NULL) ; - } + if (oldsize == 0) + { + // the block is not in the hashmap; cannot realloc it. + // This is a failure. + return (NULL) ; + } - // check for quick return - if (newsize >= oldsize/2 && newsize <= oldsize) - { - // Be lazy. If the block does not change, or is shrinking but only by a - // small amount, then leave the block as-is. - return (p) ; - } + // check for quick return + if (newsize >= oldsize/2 && newsize <= oldsize) + { + // Be lazy. If the block does not change, or is shrinking but only + // by a small amount, then leave the block as-is. + return (p) ; + } - // allocate the new space - void *pnew = rmm_wrap_allocate (&newsize) ; - if (pnew == NULL) - { - // old block is not modified. This is a failure, but the old block is - // still in the hashmap. - return (NULL) ; - } + // allocate the new space + void *pnew = rmm_wrap_allocate (&newsize) ; + if (pnew == NULL) + { + // old block is not modified. This is a failure, but the old block + // is still in the hashmap. + return (NULL) ; + } + + // copy the old space into the new space + std::size_t s = (oldsize < newsize) ? oldsize : newsize ; + // FIXME: query the pointer if it's on the GPU. + memcpy (pnew, p, s) ; // NOTE: single-thread CPU, not GPU. Slow! - // copy the old space into the new space - std::size_t s = (oldsize < newsize) ? oldsize : newsize ; - // FIXME: query the pointer if it's on the GPU. - memcpy (pnew, p, s) ; // NOTE: single-thread CPU, not GPU. Slow! + // free the old space + rmm_wrap_deallocate (p, oldsize) ; - // free the old space - rmm_wrap_deallocate (p, oldsize) ; + // return the new space + return (pnew) ; - // return the new space - return (pnew) ; + } + catch (...) + { + // something failed; just return NULL + return (NULL) ; + } } //------------------------------------------------------------------------------ @@ -487,46 +530,58 @@ void rmm_wrap_free (void *p) void *rmm_wrap_allocate( std::size_t *size) { - if (rmm_wrap_context == NULL) + try { - return (NULL) ; - } + void *p = NULL ; - uint32_t device_id = get_current_device(); + if (rmm_wrap_context == NULL) + { + return (NULL) ; + } - alloc_map *am = rmm_wrap_context[device_id]->size_map.get() ; - if (am == NULL) - { - // PANIC! - // std::cout<< "Uh oh, can't allocate before initializing RMM" - // << std::endl; - return (NULL) ; - } + // FIXME: check for failure of get_current_device + uint32_t device_id = get_current_device(); - // ensure size is nonzero - if (*size == 0) *size = 256 ; - // round-up the allocation to a multiple of 256 - std::size_t aligned = (*size) % 256 ; - if (aligned > 0) - { - *size += (256 - aligned) ; - } + alloc_map *am = rmm_wrap_context[device_id]->size_map.get() ; + if (am == NULL) + { + // PANIC! + // std::cout<< "Uh oh, can't allocate before initializing RMM" + // << std::endl; + return (NULL) ; + } + + // ensure size is nonzero + if (*size == 0) *size = 256 ; + // round-up the allocation to a multiple of 256 + std::size_t aligned = (*size) % 256 ; + if (aligned > 0) + { + *size += (256 - aligned) ; + } + + rmm::mr::device_memory_resource *memoryresource = + rmm::mr::get_current_device_resource() ; + p = memoryresource->allocate( *size ) ; + if (p == NULL) + { + // out of memory + *size = 0 ; + return (NULL) ; + } + + // insert p into the hashmap + am->emplace ((std::size_t)p, (std::size_t)(*size)) ; + + // return the allocated block + return (p) ; - rmm::mr::device_memory_resource *memoryresource = - rmm::mr::get_current_device_resource() ; - void *p = memoryresource->allocate( *size ) ; - if (p == NULL) + } + catch (...) { - // out of memory - *size = 0 ; + // something failed; just return NULL return (NULL) ; } - - // insert p into the hashmap - am->emplace ((std::size_t)p, (std::size_t)(*size)) ; - - // return the allocated block - return (p) ; } //------------------------------------------------------------------------------ @@ -535,68 +590,78 @@ void *rmm_wrap_allocate( std::size_t *size) void rmm_wrap_deallocate( void *p, std::size_t size) { - if (rmm_wrap_context == NULL) + try { - return ; - } + if (rmm_wrap_context == NULL) + { + return ; + } - // Note: there are 3 PANIC cases below. The API of rmm_wrap_deallocate - // does not allow an error condition to be returned. These PANICs could be - // logged, or they could terminate the program if debug mode enabled, etc. - // In production, all we can do is ignore the PANIC. + // Note: there are 3 PANIC cases below. The API of rmm_wrap_deallocate + // does not allow an error condition to be returned. These PANICs + // could be logged, or they could terminate the program if debug mode + // enabled, etc. In production, all we can do is ignore the PANIC. - if (p == NULL) - { - // nothing to do; ignore a double-free - if (size > 0) + if (p == NULL) { - // PANIC! Why does a NULL pointer have a nonzero size?? + // nothing to do; ignore a double-free + if (size > 0) + { + // PANIC! Why does a NULL pointer have a nonzero size?? + } + return ; } - return ; - } - uint32_t device_id = get_current_device(); + uint32_t device_id = get_current_device(); - // check the size given. If the input size is zero, then the - // size is unknown (say rmm_wrap_free(p)). In that case, just trust the - // hashmap. Otherwise, double-check to make sure the size is correct. - alloc_map *am = rmm_wrap_context[device_id]->size_map.get() ; - size_t actual_size = 0 ; - if (am == NULL) - { - // PANIC! - // std::cout<< "Uh oh, can't deallocate before initializing RMM" - // << std::endl; - return ; - } - else - { - //actual_size = am->at( (std::size_t)(p) ) ; - auto iter = am->find( (std::size_t)(p) ) ; - if (iter != am->end() ) actual_size = iter->second; - // else std::cout<< " rmm_wrap:: tried to free unallocated pointer ! " << p ; - } + // check the size given. If the input size is zero, then the size is + // unknown (say rmm_wrap_free(p)). In that case, just trust the + // hashmap. Otherwise, double-check to make sure the size is correct. + alloc_map *am = rmm_wrap_context[device_id]->size_map.get() ; + size_t actual_size = 0 ; + if (am == NULL) + { + // PANIC! + // std::cout<< "Uh oh, can't deallocate before initializing RMM" + // << std::endl; + return ; + } + else + { + //actual_size = am->at( (std::size_t)(p) ) ; + auto iter = am->find( (std::size_t)(p) ) ; + if (iter != am->end() ) actual_size = iter->second; + // else std::cout << + // " rmm_wrap:: tried to free unallocated pointer !" << p ; + } - if (actual_size == 0) - { - // PANIC! oops, p is not in the hashmap. Ignore it. TODO: could add - // a printf here, write to a log file, etc. if debug mode, abort, etc. - return ; - } + if (actual_size == 0) + { + // PANIC! oops, p is not in the hashmap. Ignore it. TODO: could + // add a printf here, write to a log file, etc. if debug mode, + // abort, etc. + return ; + } - if (size > 0 && size != actual_size) - { - // PANIC! oops, invalid old size. Ignore the input size, and free p - // anyway. TODO: could add a printf here, write to a log file, etc. - // if debug mode, abort, etc. - } + if (size > 0 && size != actual_size) + { + // PANIC! oops, invalid old size. Ignore the input size, and free + // p anyway. TODO: could add a printf here, write to a log file, + // etc. if debug mode, abort, etc. + } - // remove p from the hashmap - am->erase ( (std::size_t)(p) ) ; + // remove p from the hashmap + am->erase ( (std::size_t)(p) ) ; - // deallocate the block of memory - rmm::mr::device_memory_resource *memoryresource = - rmm::mr::get_current_device_resource() ; - memoryresource->deallocate( p, actual_size ) ; + // deallocate the block of memory + rmm::mr::device_memory_resource *memoryresource = + rmm::mr::get_current_device_resource() ; + memoryresource->deallocate( p, actual_size ) ; + } + catch (...) + { + // something failed; just catch the error and return + return ; + } }