mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
Use force_create to allocate return buffer (#491)
This commit is contained in:
@@ -165,7 +165,7 @@ class LLVMBuffer(ExplicitExecAST):
|
||||
ReduceOps.MAX: ir.Constant(ir.FloatType(), -math.inf)
|
||||
}
|
||||
|
||||
def __init__(self, shape:Union[ShapeTracker, Tuple[int, ...]], hostbuf=None):
|
||||
def __init__(self, shape:Union[ShapeTracker, Tuple[int, ...]], hostbuf=None, force_create=False):
|
||||
super().__init__(shape, hostbuf)
|
||||
# TODO: force alignment?
|
||||
self._buf = (ctypes.c_float * (prod(self.shape)))() if hostbuf is None else hostbuf._buf
|
||||
|
||||
Reference in New Issue
Block a user