Create compute or hlib APIs to generate non-inlined HW modules
Closed this issue · 2 comments
hecmay commented
HCL compute or hlib APIs generate nested for-loops in the function body by default.
# input python code
A = hcl.compute((10,), lambda x: x, "A")
B = hlib.conv2d_nchw(input, weight, padding=[1,1], stride=[1,1])
// generated HLS code
allocate A;
for (i, 10)
A[i] = i;
for (n, N)
for (c, C)
for (h, H)
for(w, W)
for (r, R)
for (c, C)
v += weight[r, c] * input[y, x]
There should be a mode to create function calls for certain compute or hlib functions, like
A = hcl.compute((10,), lambda x: x, "A", module=True)
void k(int * A) {
for (i, 10)
A[i] = i;
}
allocate A;
k(A);