Skip to content

Commit d426f1a

Browse files
authored
don't open devices in lowering (tinygrad#9008)
1 parent cfd3db7 commit d426f1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tinygrad/codegen/rewriter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from typing import Optional, Any, Callable
22
import functools, itertools, operator
33
from collections import defaultdict
4-
from tinygrad.device import Device
54
from tinygrad.dtype import dtypes, ImageDType, PtrDType
65
from tinygrad.ops import UOp, Ops, UPat, PatternMatcher, symbolic_flat, symbolic_simple, resolve
76
from tinygrad.ops import graph_rewrite, split_uop, uop_given_valid, parse_valid, is_increasing, simplify_valid, GroupOp
@@ -17,7 +16,8 @@ def fold_expanded(ex, buf):
1716
is_load, is_image = new_srcs[0].op is Ops.LOAD, isinstance(buf.dtype, ImageDType)
1817

1918
# TODO: get the device from the buffer somehow
20-
if Device.DEFAULT == "DSP":
19+
# NOTE: this can't be Device.DEFAULT because it opens devices
20+
if getenv("DSP"):
2121
if buf.dtype.base == dtypes.bool: return None
2222
lengths = [128,4]
2323
else:

0 commit comments

Comments
 (0)