mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
simpler
This commit is contained in:
parent
61c02ca634
commit
c3c85c64ee
3 changed files with 4 additions and 4 deletions
|
|
@ -87,7 +87,7 @@ if __name__ == "__main__":
|
|||
pass
|
||||
elif knum == 20:
|
||||
# 784x192 * 192x32 -> 784x32
|
||||
k.apply_opt(Opt(OptOps.UNROLL, 0, 8))
|
||||
k.apply_opt(Opt(OptOps.UNROLL, 0, 4))
|
||||
k.apply_opt(Opt(OptOps.UPCAST, 1, 32))
|
||||
k.apply_opt(Opt(OptOps.UPCAST, 0, 4))
|
||||
elif knum == 35:
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ def add_to_mul(c:UOp, x:UOp):
|
|||
|
||||
dsp_pm_late = PatternMatcher([
|
||||
# prefetch L1
|
||||
(UPat(Ops.LOAD, dtype=dtypes.uchar.vec(8), name="ld"),
|
||||
lambda ld: ld.replace(src=ld.src+(UOp(Ops.CUSTOM, dtypes.void, src=(ld.src[0].src[0].src[0].index(ld.src[0].src[0].src[1]+16),),
|
||||
(UPat(Ops.LOAD, dtype=(dtypes.uchar.vec(4), dtypes.uchar.vec(8)), name="ld"),
|
||||
lambda ld: ld.replace(src=ld.src+(UOp(Ops.CUSTOM, dtypes.void, src=(ld.src[0].src[0].index(UOp.const(dtypes.int, 16)),),
|
||||
arg="__builtin_HEXAGON_Y2_dcfetch({0});"),)) if ld.src[-1].op is not Ops.CUSTOM else None),
|
||||
|
||||
(UPat(Ops.CUSTOMI, dtype=dtypes.int.vec(32), name="c")+UPat.var("x"), add_to_mul),
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ spec = PatternMatcher([
|
|||
# **** new style load/store ****
|
||||
|
||||
# INDEX is used in new style load/store
|
||||
(UPat(Ops.INDEX, src=(UPat((Ops.DEFINE_GLOBAL, Ops.DEFINE_LOCAL)), UPat())), lambda: True),
|
||||
(UPat(Ops.INDEX, src=(UPat((Ops.DEFINE_GLOBAL, Ops.DEFINE_LOCAL, Ops.INDEX)), UPat())), lambda: True),
|
||||
|
||||
# LOAD takes a <bufidx, alt?, gate?, barrier?>
|
||||
(UPat(Ops.LOAD, src=(UPat((Ops.INDEX, Ops.CAST)),)), lambda: True),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue