@@ -109,11 +109,11 @@ class CireTransformer:
109109 def __init__ (self , sregistry , options , platform ):
110110 self .sregistry = sregistry
111111 self .platform = platform
112-
113112 self .opt_minstorage = options ['min-storage' ]
114113 self .opt_rotate = options ['cire-rotate' ]
115114 self .opt_ftemps = options ['cire-ftemps' ]
116115 self .opt_mingain = options ['cire-mingain' ]
116+ self .opt_mindtype = options ['scalar-min-type' ]
117117 self .opt_multisubdomain = True
118118
119119 def _aliases_from_clusters (self , clusters , exclude , meta ):
@@ -143,7 +143,7 @@ def _aliases_from_clusters(self, clusters, exclude, meta):
143143
144144 # Schedule -> [Clusters]_k
145145 processed , subs = lower_schedule (schedule , meta , self .sregistry ,
146- self .opt_ftemps )
146+ self .opt_ftemps , self . opt_mindtype )
147147
148148 # [Clusters]_k -> [Clusters]_k (optimization)
149149 if self .opt_multisubdomain :
@@ -831,7 +831,7 @@ def optimize_schedule_rotations(schedule, sregistry):
831831 return schedule .rebuild (* processed , rmapper = rmapper )
832832
833833
834- def lower_schedule (schedule , meta , sregistry , ftemps ):
834+ def lower_schedule (schedule , meta , sregistry , ftemps , mindtype ):
835835 """
836836 Turn a Schedule into a sequence of Clusters.
837837 """
@@ -849,7 +849,8 @@ def lower_schedule(schedule, meta, sregistry, ftemps):
849849 # This prevents cases such as `floor(a*b)` with `a` and `b` floats
850850 # that would creat a temporary `int r = b` leading to erronous
851851 # numerical results
852- dtype = sympy_dtype (pivot , base = meta .dtype )
852+ mindtype = None if writeto else mindtype
853+ dtype = sympy_dtype (pivot , base = meta .dtype , smin = mindtype )
853854
854855 if writeto :
855856 # The Dimensions defining the shape of Array
0 commit comments