
* fix.. speed_limit error... * draw tpms settings. * fix.. traffic light stopping only.. * fix.. waze cam * fix.. waze... * add setting (Enable comma connect ) * auto detect LFA2 * fix.. cruisespeed1 * vff2 driving model. * fix.. * agnos 12.3 * fix.. * ff * ff * test * ff * fix.. drawTurnInfo.. * Update drive_helpers.py * fix.. support eng voice eng sounds fix settings... english fix.. mph.. fix.. roadlimit speed bug.. * new vff model.. 250608 * fix soundd.. * fix safe exit speed.. * fix.. sounds. * fix.. radar timeStep.. * KerryGold model * Update drive_helpers.py * fix.. model. * fix.. * fix.. * Revert "fix.." This reverts commit b09ec459afb855c533d47fd7e8a1a6b1a09466e7. * Revert "fix.." This reverts commit 290bec6b83a4554ca232d531a911edccf94a2156. * fix esim * add more acc table. 10kph * kg update.. * fix cruisebutton mode3 * test atc..cond. * fix.. canfd * fix.. angle control limit
29 lines
936 B
Python
29 lines
936 B
Python
import unittest
|
|
from tinygrad import Tensor, Context, Device
|
|
from tinygrad.codegen.kernel import Kernel, Opt, OptOps
|
|
|
|
class TestLinearizerRewrite(unittest.TestCase):
|
|
def test_reduction(self):
|
|
t = Tensor.ones((64,64), device="NULL").contiguous().realize()
|
|
out = (t*2).sum(axis=1)
|
|
with Context(SPLIT_REDUCEOP=0, DEVECTORIZE=0):
|
|
si = out.schedule()[-1]
|
|
k = Kernel(si.ast, Device["CPU"].renderer)
|
|
k.apply_opt(Opt(OptOps.UPCAST, 0, 4))
|
|
k.apply_opt(Opt(OptOps.UNROLL, 0, 4))
|
|
prg = k.to_program()
|
|
print(prg.src)
|
|
|
|
def test_arange(self):
|
|
out = Tensor.arange(32, device="NULL")
|
|
with Context(SPLIT_REDUCEOP=0, DEVECTORIZE=0):
|
|
si = out.schedule()[-1]
|
|
k = Kernel(si.ast, Device["CPU"].renderer)
|
|
k.apply_opt(Opt(OptOps.UPCAST, 0, 4))
|
|
k.apply_opt(Opt(OptOps.UNROLL, 0, 4))
|
|
prg = k.to_program()
|
|
print(prg.src)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|