MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / GB_subref_phase2

Function GB_subref_phase2

deps/GraphBLAS/Source/GB_subref_phase2.c:17–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#include "GB_subref.h"
16
17GrB_Info GB_subref_phase2 // count nnz in each C(:,j)
18(
19 // computed by phase2:
20 int64_t **Cp_handle, // output of size Cnvec+1
21 size_t *Cp_size_handle,
22 int64_t *Cnvec_nonempty, // # of non-empty vectors in C
23 // tasks from phase1:
24 GB_task_struct *restrict TaskList, // array of structs
25 const int ntasks, // # of tasks
26 const int nthreads, // # of threads to use
27 const int64_t *Mark, // for I inverse buckets, size A->vlen
28 const int64_t *Inext, // for I inverse buckets, size nI
29 const int64_t nduplicates, // # of duplicates, if I inverted
30 // analysis from phase0:
31 const int64_t *restrict Ap_start,
32 const int64_t *restrict Ap_end,
33 const int64_t Cnvec,
34 const bool need_qsort,
35 const int Ikind,
36 const int64_t nI,
37 const int64_t Icolon [3],
38 // original input:
39 const GrB_Matrix A,
40 const GrB_Index *I, // index list for C = A(I,J), or GrB_ALL, etc.
41 const bool symbolic,
42 GB_Context Context
43)
44{
45
46 //--------------------------------------------------------------------------
47 // check inputs
48 //--------------------------------------------------------------------------
49
50 ASSERT (Cp_handle != NULL) ;
51 ASSERT (Cp_size_handle != NULL) ;
52 ASSERT_MATRIX_OK (A, "A for subref phase2", GB0) ;
53 ASSERT (!GB_IS_BITMAP (A)) ; // GB_bitmap_subref is used instead
54
55 //--------------------------------------------------------------------------
56 // allocate the result
57 //--------------------------------------------------------------------------
58
59 (*Cp_handle) = NULL ;
60 (*Cp_size_handle) = 0 ;
61 int64_t *restrict Cp = NULL ; size_t Cp_size = 0 ;
62 Cp = GB_CALLOC (GB_IMAX (2, Cnvec+1), int64_t, &Cp_size) ;
63 if (Cp == NULL)
64 {
65 // out of memory
66 return (GrB_OUT_OF_MEMORY) ;
67 }
68
69 //--------------------------------------------------------------------------
70 // count the entries in each vector of C
71 //--------------------------------------------------------------------------
72
73 #define GB_ANALYSIS_PHASE
74 if (symbolic)

Callers 1

GB_subrefFunction · 0.85

Calls 1

GB_task_cumsumFunction · 0.85

Tested by

no test coverage detected