mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-15 09:33:03 +08:00
ugh, that too
This commit is contained in:
@@ -6,11 +6,12 @@ import time
|
||||
import numpy as np
|
||||
from tinygrad.tensor import Tensor
|
||||
from tinygrad.nn import Conv2d
|
||||
from tinygrad.llops.ops_gpu import CL
|
||||
try:
|
||||
from termcolor import colored
|
||||
from tinygrad.llops.ops_gpu import CL
|
||||
except ImportError:
|
||||
colored = None
|
||||
CL = None
|
||||
|
||||
IN_CHANS = [int(x) for x in os.getenv("IN_CHANS", "4,16,64").split(",")]
|
||||
|
||||
@@ -34,7 +35,7 @@ def test_speed(f1, *args):
|
||||
del ret
|
||||
st = time.monotonic()
|
||||
ret = f1(*args)
|
||||
if ret.device in ["GPU", "OPENCL"]:
|
||||
if CL is not None and ret.device in ["GPU", "OPENCL"]:
|
||||
CL.cl_queue.finish()
|
||||
et = (time.monotonic() - st) * 1000
|
||||
ets.append(et)
|
||||
|
||||
Reference in New Issue
Block a user