diff --git a/pystencils/data_types.py b/pystencils/data_types.py index 08c1da1c96f5ba63c1906cfddd6014f7d86f61fe..ed95e80fa67560c7fafa535e9362a6a26d69dd93 100644 --- a/pystencils/data_types.py +++ b/pystencils/data_types.py @@ -105,8 +105,8 @@ class TypedSymbol(sp.Symbol): obj = TypedSymbol.__xnew_cached_(cls, *args, **kwds) return obj - def __new_stage2__(cls, name, dtype): - obj = super(TypedSymbol, cls).__xnew__(cls, name) + def __new_stage2__(cls, name, dtype, *args, **kwargs): + obj = super(TypedSymbol, cls).__xnew__(cls, name, *args, **kwargs) try: obj._dtype = create_type(dtype) except (TypeError, ValueError): diff --git a/pystencils/kernelparameters.py b/pystencils/kernelparameters.py index 11d30e09c8e351cb67ed3f7c3020c9243fba7557..9284a1ee5d14dd97c63f44574e020f1bff24d4e5 100644 --- a/pystencils/kernelparameters.py +++ b/pystencils/kernelparameters.py @@ -30,7 +30,7 @@ class FieldStrideSymbol(TypedSymbol): def __new_stage2__(cls, field_name, coordinate): name = "_stride_{name}_{i}".format(name=field_name, i=coordinate) - obj = super(FieldStrideSymbol, cls).__xnew__(cls, name, STRIDE_DTYPE) + obj = super(FieldStrideSymbol, cls).__xnew__(cls, name, STRIDE_DTYPE, positive=True) obj.field_name = field_name obj.coordinate = coordinate return obj @@ -55,7 +55,7 @@ class FieldShapeSymbol(TypedSymbol): def __new_stage2__(cls, field_names, coordinate): names = "_".join([field_name for field_name in field_names]) name = "_size_{names}_{i}".format(names=names, i=coordinate) - obj = super(FieldShapeSymbol, cls).__xnew__(cls, name, SHAPE_DTYPE) + obj = super(FieldShapeSymbol, cls).__xnew__(cls, name, SHAPE_DTYPE, positive=True) obj.field_names = tuple(field_names) obj.coordinate = coordinate return obj