Closed chhzh123 closed 2 years ago
In the original implementation, the alloc B operation will be moved from device to host, causing UNKNOWN_VALUE in the xcel program.
alloc B
UNKNOWN_VALUE
def test_move_outputs(): hcl.init() A = hcl.placeholder((10, 32), "A") def kernel(A): B = hcl.compute(A.shape, lambda i, j: A[i, j] * 2, "B") hcl.update(B, lambda i, j: B[i, j] + 1, "update1") hcl.update(B, lambda i, j: B[i, j] * 2, "update2") return B target = hcl.Platform.aws_f1 target.config(compiler="vivado_hls", mode="csim", project="test.prj") s = hcl.create_schedule([A], kernel) s.to(A, target.xcel) s.to(kernel.update1.B, target.host) mod = hcl.build(s, target)
This is because hcl.update forces B to be used on both CPU and FPGA.
hcl.update
B
In the original implementation, the
alloc B
operation will be moved from device to host, causingUNKNOWN_VALUE
in the xcel program.