forked from tinygrad/tinygrad
cache is_int [run_process_replay] (#6131)
* cache is_int [run_process_replay] * functools.cached_property is pretty slow
This commit is contained in:
@@ -286,7 +286,7 @@ constant_folder = PatternMatcher([
|
||||
(NOp.var('x') * 0, lambda x: x.const(float('nan') if isinstance(x.arg, float) and (math.isnan(x.arg) or math.isinf(x.arg)) else 0)),
|
||||
# x-x -> 0
|
||||
(NOp.var('x') - NOp.var('x'), lambda x: x.const(0)),
|
||||
# min==max -> CONST
|
||||
# min==max -> CONST (slow!)
|
||||
(UPat({UOps.ALU, UOps.DEFINE_VAR}, name='x'), lambda x: x.const(x.vmin.arg) if x.vmin.arg == x.vmax.arg else None),
|
||||
# ** load/store folding **
|
||||
(NOp.store(NOp.var("buf"), NOp.var("idx"), NOp.load(NOp.var("buf"), NOp.var("idx"))), lambda buf,idx:UOp(UOps.NOOP)),
|
||||
|
||||
Reference in New Issue
Block a user