def update_idg(self,mapir): #Add the ERG call node to the IDG erg_call_node=mapir.idg.get_node(IDGCall,calc_erg_call(self.name,self.erg_func_name,self.inputs,self.outputs)) #Add the input ERSpecs to the IDG for input_er_spec in self.inputs: #Get a node for the ERSpec input_er_spec_node=mapir.idg.get_node(IDGERSpec,input_er_spec) #Get a gen node for the ERSpec gen_input_er_spec_node=mapir.idg.get_node(IDGGenERSpec,input_er_spec) #Add dependence of the GenERSpec node to ERSpec node input_er_spec_node.add_dep(gen_input_er_spec_node) #Add dependence of the call to the input erg_call_node.add_dep(input_er_spec_node) #Add the output ERSpecs to the IDG for output_er_spec in self.outputs: #Get a node for the ERSpec output_er_spec_node=mapir.idg.get_node(IDGOutputERSpec,output_er_spec) #Add dependence of the output on the call output_er_spec_node.add_dep(erg_call_node)
def update_idg(self,mapir): #Add the ERG call node to the IDG erg_call_node=mapir.idg.get_node(IDGCall,calc_erg_call(self.name,self.erg_func_name,self.inputs,self.outputs)) #Collection of reorder call nodes reorder_call_nodes=[] #Add the input ERSpecs to the IDG for input_er_spec in self.inputs: #Get a node for the ERSpec input_er_spec_node=mapir.idg.get_node(IDGERSpec,input_er_spec) #Get a gen node for the ERSpec gen_input_er_spec_node=mapir.idg.get_node(IDGGenERSpec,input_er_spec) #Add dependence of the GenERSpec node to ERSpec node input_er_spec_node.add_dep(gen_input_er_spec_node) #Add dependence of the call to the input erg_call_node.add_dep(input_er_spec_node) #Add reorder call nodes for each data array to be reordered for data_array in self.data_arrays: #Build the list of arguments to the function call #Add the reorder call node for this data array to the IDG reorder_call_node=mapir.idg.get_node(IDGCall,calc_reorder_call(self.name,data_array,self.reordering_name,mapir)) #Add the reorder call node to the collection of reorder call nodes reorder_call_nodes.append(reorder_call_node) #Get the data array node before the reordering before_data_array_node=mapir.idg.get_node(IDGDataArray,VersionedDataArray(data_array)) #Add the dependence of the reorder call on the before data array reorder_call_node.add_dep(before_data_array_node) #Get the data array node after the reordering after_data_array_node=mapir.idg.get_node(IDGDataArray,VersionedDataArray(data_array)) #Add the dependence of the after data array node on the reorder call after_data_array_node.add_dep(reorder_call_node) #Add the output ERSpecs to the IDG for output_er_spec in self.outputs: #Get a node for the ERSpec output_er_spec_node=mapir.idg.get_node(IDGOutputERSpec,output_er_spec) #Add dependence of the output on the call output_er_spec_node.add_dep(erg_call_node) #Add dependences of the reorder calls on the output for reorder_call_node in reorder_call_nodes: reorder_call_node.add_dep(output_er_spec_node)
def update_idg(self, mapir): # Add the ERG call node to the IDG # This is the node that represents the call to the cache blocking routine erg_call_node = mapir.idg.get_node( IDGCall, calc_erg_call(self.name, self.erg_func_name, self.inputs, self.outputs) ) # Add the input col ER node to the IDG col_er_spec_node = mapir.idg.get_node(IDGERSpec, self.inputs[0]) # Add a dependence of the call to the input col ER erg_call_node.add_dep(col_er_spec_node) # Add the number of cache blocks symbolic node to the IDG num_tile_node = mapir.idg.get_node(IDGSymbolic, mapir.symbolics[self.num_cb_name]) # Add a dependence of the ERG call on the symbolic erg_call_node.add_dep(num_tile_node) # Add the output node to the IDG output_node = mapir.idg.get_node(IDGOutputERSpec, self.outputs[0]) # Add a dependence of the output on the ERG call node output_node.add_dep(erg_call_node)
def update_idg(self,mapir): #Add the to/from data dependence nodes to the IDG to_data_dep_node=mapir.idg.get_node(IDGDataDep,self.to_deps) from_data_dep_node=mapir.idg.get_node(IDGDataDep,self.from_deps) #Add the data dependence generation nodes to the IDG gen_to_data_dep_node=mapir.idg.get_node(IDGGenDataDep,self.to_deps) gen_from_data_dep_node=mapir.idg.get_node(IDGGenDataDep,self.from_deps) #Add the dependence of the data dependence nodes on the generation ndoes to_data_dep_node.add_dep(gen_to_data_dep_node) from_data_dep_node.add_dep(gen_from_data_dep_node) #Add the ERG call node to the IDG #This is the node that represents the call to the sparse tiling routine erg_call_node=mapir.idg.get_node(IDGCall,calc_erg_call(self.name,self.erg_func_name,self.inputs,self.outputs)) #Add the symbolic node to the IDG num_tile_node=mapir.idg.get_node(IDGSymbolic,mapir.symbolics[self.num_tile_name]) #Add a dependence of the ERG call on the symbolic erg_call_node.add_dep(num_tile_node) #Add dependences of the ERG call on the data dependence nodes erg_call_node.add_dep(to_data_dep_node) erg_call_node.add_dep(from_data_dep_node) #Add the output node to the IDG output_node=mapir.idg.get_node(IDGOutputERSpec,self.outputs[0]) #Add a dependence of the output on the ERG call node output_node.add_dep(erg_call_node) #Setup dependences for the data dependence nodes calc_data_dep_deps(self.to_deps,mapir) calc_data_dep_deps(self.from_deps,mapir)