1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
//------------------------------------------------------------------------------
// GB_subassign_22_template: C += y where C is full and y is a scalar
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//------------------------------------------------------------------------------
// Method 22: C += scalar, where C is dense
// M: NULL
// Mask_comp: false
// Mask_struct: ignored
// C_replace: false
// accum: present
// A: scalar
// S: none
// C += scalar where C is full.
{
//--------------------------------------------------------------------------
// determine the number of threads to use
//--------------------------------------------------------------------------
GB_C_NVALS (cnz) ;
const int nthreads = GB_nthreads (cnz, chunk, nthreads_max) ;
//--------------------------------------------------------------------------
// get C
//--------------------------------------------------------------------------
GB_C_TYPE *restrict Cx = (GB_C_TYPE *) C->x ;
ASSERT (!C->iso) ;
//--------------------------------------------------------------------------
// C += y where C is dense and y is a scalar
//--------------------------------------------------------------------------
int64_t pC ;
#pragma omp parallel for num_threads(nthreads) schedule(static)
for (pC = 0 ; pC < cnz ; pC++)
{
// Cx [pC] += ywork
GB_ACCUMULATE_scalar (Cx, pC, ywork, false) ;
}
}
|