def columns(self, a, identifier, size, charSize=0): if (a.dataType == Type.STRING): var1 = Variable(CType.STR_OFFS, identifier + "_offset", size) var2 = Variable(CType.CHAR, identifier + "_char", charSize) return [var1, var2] else: return Variable(self.codegen.langType(a.dataType), identifier, size)
def inputColumns(self, a, identifier, size, charSize=0): if (a.dataType == Type.STRING): var1 = Variable(CType.SIZE, identifier + "_offset", add(size, intConst(1))) var2 = Variable(CType.CHAR, identifier + "_char", charSize) return [var1, var2] else: return Variable(self.codegen.langType(a.dataType), identifier, size)
def mapTemptableOutputAttribute(self, a, table, sizeEstimate): tempIdent = "itm_" + table["name"] + "_" + a.name itmCol = self.columns(a, tempIdent, sizeEstimate) if a.dataType == Type.STRING: itmCol = Variable(CType.STR_TYPE, tempIdent, sizeEstimate) self.codegen.gpumem.declareAllocate(itmCol) self.codegen.currentKernel.addVar(itmCol) self.itmFile[a.id] = itmCol
def variable(self, a, identifier, size=0): return Variable(self.codegen.langType(a.dataType), identifier, size)