Use force_create to allocate return buffer (#491)

This commit is contained in:
Martin Loretz
2023-01-30 02:13:10 +01:00
committed by GitHub
parent bb0cdc2442
commit 43abbd3d00
2 changed files with 2 additions and 3 deletions

View File

@@ -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