import numpy as np
from vgpu_cache import VGPUCache
from vgpu_tiled import install_patched_matmul
from tiled_matmul_fix import (_tiled_matmul_src, _compile_tiled_matmul,
                        _BinaryKernel_unused_remove_in_real_module)
install_patched_matmul(VGPUCache)
c = VGPUCache()
c.benchmark_matmul(M=512, K=512, N=512, iters=2000)
"""
W = c.stack(np.random.rand(1000,1000))
X = c.stack(np.random.rand(1000,1000))
yt = c.stack(np.random.rand(1000,1000))

while True:
    err = yt - c.matmul(X,W)
    W += 0.00001 * err
    print(c.sum(err**2))
"""
