change specific string 'CLANG' to DEVICE variable in abstractions2.py (#3488)

This commit is contained in:
Caleb Bunch
2024-02-24 07:51:39 -05:00
committed by GitHub
parent c032df520b
commit b41761488d

View File

@@ -76,10 +76,10 @@ from tinygrad.lazy import LazyBuffer, LoadOps
from tinygrad.realize import run_schedule, create_schedule
# allocate some values + load in values
a = LazyBuffer.loadop(LoadOps.EMPTY, (1,), dtypes.int32, "CLANG")
b = LazyBuffer.loadop(LoadOps.EMPTY, (1,), dtypes.int32, "CLANG")
a.realized = Buffer("CLANG", 1, dtypes.int32).copyin(memoryview(bytearray(struct.pack("I", 2))))
b.realized = Buffer("CLANG", 1, dtypes.int32).copyin(memoryview(bytearray(struct.pack("I", 3))))
a = LazyBuffer.loadop(LoadOps.EMPTY, (1,), dtypes.int32, DEVICE)
b = LazyBuffer.loadop(LoadOps.EMPTY, (1,), dtypes.int32, DEVICE)
a.realized = Buffer(DEVICE, 1, dtypes.int32).copyin(memoryview(bytearray(struct.pack("I", 2))))
b.realized = Buffer(DEVICE, 1, dtypes.int32).copyin(memoryview(bytearray(struct.pack("I", 3))))
# describe the computation
out = a.e(BinaryOps.ADD, b)