diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py index f84feca880cac553ee9e6ad6471cd964de0bf48c..ac42438d43b0e1bd576efa5a56fc27ed5e124c08 100644 --- a/loopy/kernel/__init__.py +++ b/loopy/kernel/__init__.py @@ -791,6 +791,10 @@ class LoopKernel(Record): sep = 75*"-" lines.append(sep) + lines.append("ARGUMENTS:") + for arg_name in sorted(self.arg_dict): + lines.append(str(self.arg_dict[arg_name])) + lines.append(sep) lines.append("INAME-TO-TAG MAP:") for iname in sorted(self.all_inames()): line = "%s: %s" % (iname, self.iname_to_tag.get(iname)) diff --git a/loopy/kernel/data.py b/loopy/kernel/data.py index 3ee3002b0cacf22cd2c9081cb5d8b3903c7c2dd5..e4cadc98df5eeb6cddc63f02ed095ad77cfa3bdf 100644 --- a/loopy/kernel/data.py +++ b/loopy/kernel/data.py @@ -221,14 +221,27 @@ class ShapedArg(Record): def dimensions(self): return len(self.strides) - def __repr__(self): + def __str__(self): if self.shape is None: shape = "unknown" + elif self.shape is auto_shape: + shape = "auto" else: shape = ",".join(str(i) for i in self.shape) - return "<%s '%s' of type %s and shape (%s)>" % ( - type(self).__name__, self.name, self.dtype, shape) + if self.strides is None: + strides = "unknown" + elif self.strides is auto_strides: + strides = "auto" + else: + strides = ",".join(str(i) for i in self.strides) + + return "%s: %s, type: %s, shape: (%s), strides: (%s)" % ( + self.name, type(self).__name__, self.dtype, shape, + strides) + + def __repr__(self): + return "<%s>" % self.__str__() class GlobalArg(ShapedArg): pass @@ -261,9 +274,11 @@ class ImageArg(Record): dtype=dtype, name=name) + def __str__(self): + return "%s: ImageArg, type %s" % (self.name, self.dtype) def __repr__(self): - return "<ImageArg '%s' of type %s>" % (self.name, self.dtype) + return "<%s>" % self.__str__() class ValueArg(Record): def __init__(self, name, dtype=None, approximately=1000): @@ -273,8 +288,11 @@ class ValueArg(Record): Record.__init__(self, name=name, dtype=dtype, approximately=approximately) + def __str__(self): + return "%s: ValueArg, type %s" % (self.name, self.dtype) + def __repr__(self): - return "<ValueArg '%s' of type %s>" % (self.name, self.dtype) + return "<%s>" % self.__str__() class ScalarArg(ValueArg): def __init__(self, name, dtype=None, approximately=1000):