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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
//------------------------------------------------------------------------------
// GB_as: assign/subassign kernels with no accum
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//------------------------------------------------------------------------------
// C(I,J)<M> = A
#include "GB_control.h"
GB_type_enabled
#if GB_TYPE_ENABLED
#include "GB.h"
#include "FactoryKernels/GB_as__include.h"
// A and C matrices
GB_atype
GB_ctype
GB_declarec
GB_copy_aij_to_cwork
GB_copy_aij_to_c
GB_copy_cwork_to_c
GB_ax_mask
// disable this operator and use the generic case if these conditions hold
GB_disable
#include "assign/include/GB_assign_shared_definitions.h"
//------------------------------------------------------------------------------
// C<M> = 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, already typecasted
GB_Werk Werk
)
{
#if GB_DISABLE
return (GrB_NO_VALUE) ;
#else
GB_C_TYPE cwork = (*((GB_C_TYPE *) scalar)) ;
int nthreads_max = GB_Context_nthreads_max ( ) ;
double chunk = GB_Context_chunk ( ) ;
#include "assign/template/GB_subassign_05d_template.c"
return (GrB_SUCCESS) ;
#endif
}
//------------------------------------------------------------------------------
// C<A> = A, when C is dense
//------------------------------------------------------------------------------
#undef GB_SCALAR_ASSIGN
#define GB_SCALAR_ASSIGN 0
GrB_Info GB (_subassign_06d)
(
GrB_Matrix C,
const GrB_Matrix A,
const bool Mask_struct,
GB_Werk Werk
)
{
#if GB_DISABLE
return (GrB_NO_VALUE) ;
#else
ASSERT (C->type == A->type) ;
int nthreads_max = GB_Context_nthreads_max ( ) ;
double chunk = GB_Context_chunk ( ) ;
#include "assign/template/GB_subassign_06d_template.c"
return (GrB_SUCCESS) ;
#endif
}
//------------------------------------------------------------------------------
// C<M> = A, when C is empty and A is dense
//------------------------------------------------------------------------------
GrB_Info GB (_subassign_25)
(
GrB_Matrix C,
const GrB_Matrix M,
const GrB_Matrix A,
GB_Werk Werk
)
{
#if GB_DISABLE
return (GrB_NO_VALUE) ;
#else
ASSERT (C->type == A->type) ;
int nthreads_max = GB_Context_nthreads_max ( ) ;
double chunk = GB_Context_chunk ( ) ;
#include "assign/template/GB_subassign_25_template.c"
return (GrB_SUCCESS) ;
#endif
}
#else
GB_EMPTY_PLACEHOLDER
#endif
|