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

Function GB_split_bitmap

deps/GraphBLAS/Source/GB_split_bitmap.c:15–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "GB_split.h"
14
15GrB_Info GB_split_bitmap // split a bitmap matrix
16(
17 GrB_Matrix *Tiles, // 2D row-major array of size m-by-n
18 const GrB_Index m,
19 const GrB_Index n,
20 const int64_t *restrict Tile_rows, // size m+1
21 const int64_t *restrict Tile_cols, // size n+1
22 const GrB_Matrix A, // input matrix
23 GB_Context Context
24)
25{
26
27 //--------------------------------------------------------------------------
28 // get inputs
29 //--------------------------------------------------------------------------
30
31 GrB_Info info ;
32 ASSERT (GB_IS_BITMAP (A)) ;
33 GrB_Matrix C = NULL ;
34
35 int sparsity_control = A->sparsity_control ;
36 float hyper_switch = A->hyper_switch ;
37 bool csc = A->is_csc ;
38 GrB_Type atype = A->type ;
39 int64_t avlen = A->vlen ;
40// int64_t avdim = A->vdim ;
41 size_t asize = atype->size ;
42 const int8_t *restrict Ab = A->b ;
43 const bool A_iso = A->iso ;
44// int64_t anz = GB_nnz (A) ;
45
46 GB_GET_NTHREADS_MAX (nthreads_max, chunk, Context) ;
47
48 int64_t nouter = csc ? n : m ;
49 int64_t ninner = csc ? m : n ;
50
51 const int64_t *Tile_vdim = csc ? Tile_cols : Tile_rows ;
52 const int64_t *Tile_vlen = csc ? Tile_rows : Tile_cols ;
53
54 //--------------------------------------------------------------------------
55 // split A into tiles
56 //--------------------------------------------------------------------------
57
58 for (int64_t outer = 0 ; outer < nouter ; outer++)
59 {
60
61 const int64_t avstart = Tile_vdim [outer] ;
62 const int64_t avend = Tile_vdim [outer+1] ;
63
64 for (int64_t inner = 0 ; inner < ninner ; inner++)
65 {
66
67 //------------------------------------------------------------------
68 // allocate the tile C
69 //------------------------------------------------------------------
70
71 // The tile appears in vectors avstart:avend-1 of A, and indices
72 // aistart:aiend-1.

Callers 1

GB_splitFunction · 0.85

Calls 3

GB_new_bixFunction · 0.85
GB_nthreadsFunction · 0.85
GB_conformFunction · 0.85

Tested by

no test coverage detected