def __init__(self, alg_calls): if False: # pylint: disable=using-constant-test self._0_to_n = GOInvoke(None, None) # for pyreverse Invokes.__init__(self, alg_calls, GOInvoke) index_offsets = [] # Loop over all of the kernels in all of the invoke() calls # and check that they work on compatible grid-index offsets. # Strictly speaking this check should be done in the parsing # code since it is a check on the correctness of the meta-data. # However, that would require a fundamental change to the parsing # code since it requires information on all of the invokes and # kernels in an application. Therefore it is much simpler to # do it here where we have easy access to that information. for invoke in self.invoke_list: for kern_call in invoke.schedule.kern_calls(): # We only care if the index offset is not offset_any (since # that is compatible with any other offset) if kern_call.index_offset != "offset_any": # Loop over the offsets we've seen so far for offset in index_offsets: if offset != kern_call.index_offset: raise GenerationError( "Meta-data error in kernel {0}: " "INDEX_OFFSET of '{1}' does not match that " "({2}) of other kernels. This is not " "supported.".format(kern_call.name, kern_call.index_offset, offset)) # Append the index-offset of this kernel to the list of # those seen so far index_offsets.append(kern_call.index_offset)
def __init__(self, alg_calls): # pylint: disable=using-constant-test if False: self._0_to_n = GOInvoke(None, None) # for pyreverse Invokes.__init__(self, alg_calls, GOInvoke)
def __init__(self, alg_calls, psy): self._0_to_n = GOInvoke(None, None, None) # for pyreverse Invokes.__init__(self, alg_calls, GOInvoke, psy)
def __init__(self, alg_calls): if False: self._0_to_n = DynInvoke(None, None) # for pyreverse Invokes.__init__(self, alg_calls, DynInvoke)