@@ -56,35 +56,56 @@ def to_label_decomposed_graph(graph):
5656 alloc_r << alloc .T
5757 print ("Boolean matrix for alloc_r nvals: " , alloc_r .nvals )
5858
59+ mask_v = Vector (BOOL , graph .ncols , name = "mask_vector" )
60+ mask_v (op .lor ) << alloc .reduce_columnwise ("lor" )
61+ mask_v (op .lor ) << alloc .reduce_rowwise ("lor" )
62+
63+ entrypoints = Vector (bool ,graph .nrows , name = "entrypoints" )
64+ entrypoints << graph .reduce_columnwise (op .lor )
65+ mask_v (op .lor ) << Vector .from_coo (list (set (range (0 ,graph .nrows )).difference (entrypoints .to_coo (values = False )[0 ])), values = True , dtype = BOOL )
66+
5967 load_i = Matrix (UINT64 , graph .ncols , graph .nrows , name = "load_i_after_intersection" )
6068 load_i << graph .select (graphblas .select .select_load ).apply (graphblas .unary .decode_load )
61-
62- load_r_i = Matrix (UINT64 , graph .ncols , graph .nrows , name = "load_r_i_after_intersection" )
63- load_r_i << load_i .T
69+ print ("Matrix for load_i nvals: " , load_i .nvals )
6470
6571 store_i = Matrix (UINT64 , graph .ncols , graph .nrows , name = "store_i_after_intersection" )
6672 store_i << graph .select (graphblas .select .select_store ).apply (graphblas .unary .decode_store )
73+ print ("Matrix for store_i nvals: " , store_i .nvals )
6774
68- store_r_i = Matrix (UINT64 , graph .ncols , graph .nrows , name = "store_r_i_after_intersection" )
69- store_r_i << store_i .T
70-
71- mask_v = Vector (BOOL , graph .ncols , name = "mask_vector" )
72- mask_v (op .lor ) << alloc .reduce_columnwise ("lor" )
73- mask_v (op .lor ) << alloc .reduce_rowwise ("lor" )
74-
7575 mask_v (op .lor ) << load_i .reduce_columnwise ("lor" )
7676 mask_v (op .lor ) << load_i .reduce_rowwise ("lor" )
7777
7878 mask_v (op .lor ) << store_i .reduce_columnwise ("lor" )
7979 mask_v (op .lor ) << store_i .reduce_rowwise ("lor" )
8080
81- entrypoints = Vector ( bool , graph . nrows , name = "entrypoints" )
82- entrypoints << graph . reduce_columnwise ( op . lor )
83- mask_v ( op . lor ) << Vector . from_coo ( list ( set ( range ( 0 , graph . nrows )). difference ( entrypoints . to_coo ( values = False )[ 0 ])), values = True , dtype = BOOL )
81+ store_block_count = store_i . reduce_scalar ( "max" ). get ( 0 ) + 1
82+ load_block_count = load_i . reduce_scalar ( "max" ). get ( 0 ) + 1
83+ block_count = max ( store_block_count , load_block_count )
8484
85+ boolean_decompose_load = indexed_to_boolean_decomposition (load_i , block_count )
86+ print ("Boolean matrix for load nvals: " , boolean_decompose_load .nvals )
87+
88+ boolean_decompose_store = indexed_to_boolean_decomposition (store_i , block_count )
89+ print ("Boolean matrix for store nvals: " , boolean_decompose_store .nvals )
90+
91+ load_r_i = Matrix (UINT64 , graph .ncols , graph .nrows , name = "load_r_i_after_intersection" )
92+ load_r_i << load_i .T
93+ print ("Matrix for load_r_i nvals: " , load_r_i .nvals )
94+
95+ boolean_decompose_load_r = indexed_to_boolean_decomposition (load_r_i , block_count )
96+ print ("Boolean matrix for load_r nvals: " , boolean_decompose_load_r .nvals )
97+
98+ store_r_i = Matrix (UINT64 , graph .ncols , graph .nrows , name = "store_r_i_after_intersection" )
99+ store_r_i << store_i .T
100+ print ("Matrix for store_r_i nvals: " , store_r_i .nvals )
101+
102+ boolean_decompose_store_r = indexed_to_boolean_decomposition (store_r_i , block_count )
103+ print ("Boolean matrix for store_r nvals: " , boolean_decompose_store_r .nvals )
104+
105+
106+
85107 assign_mask = mask_v .diag (name = "assign_mask" )
86108
87-
88109 assign = Matrix (BOOL , graph .ncols , graph .nrows , name = "assign_after_intersection" )
89110 assign << graph .select (graphblas .select .select_assign )
90111 print ("Boolean matrix for assign nvals: " , assign .nvals )
@@ -103,30 +124,22 @@ def to_label_decomposed_graph(graph):
103124 # assign_i_use = Matrix.mxm(assign_mask, assign_i, "land_lor")
104125 # assign_res("lor") << assign_i_use
105126
106-
107127 assign_r = Matrix (BOOL , graph .ncols , graph .nrows , name = "assign_r_after_intersection" )
108128 assign_r << assign .T
109129 print ("Boolean matrix for assign_r nvals: " , assign_r .nvals )
130+
110131
111132 #print_matrix_to_dot(assign_r,"assign_r.dot")
112133
113134
114135
115- store_block_count = store_i .reduce_scalar ("max" ).get (0 ) + 1
116- load_block_count = load_i .reduce_scalar ("max" ).get (0 ) + 1
117- block_count = max (store_block_count , load_block_count )
118-
119- boolean_decompose_load = indexed_to_boolean_decomposition (load_i , block_count )
120- print ("Boolean matrix for load nvals: " , boolean_decompose_load .nvals )
136+
121137
122- boolean_decompose_load_r = indexed_to_boolean_decomposition (load_r_i , block_count )
123- print ("Boolean matrix for load_r nvals: " , boolean_decompose_load_r .nvals )
138+
124139
125- boolean_decompose_store = indexed_to_boolean_decomposition (store_i , block_count )
126- print ("Boolean matrix for store nvals: " , boolean_decompose_store .nvals )
140+
127141
128- boolean_decompose_store_r = indexed_to_boolean_decomposition (store_r_i , block_count )
129- print ("Boolean matrix for store_r nvals: " , boolean_decompose_store_r .nvals )
142+
130143
131144
132145 matrices : Dict [Symbol , Matrix ] = {}
0 commit comments