Closed hecmay closed 3 years ago
The SODAC codegen works with the test cases, where SODA module is called inside the default_function
. But if I put the Stencil node into a HCL module, then the error above occurs. This is kind of weird -- I checked the input SODA DSL, they are actually exactly the same.
Here is the IR of the problematic program.
def test(float32(input[480*640*3]), int32(output[480*640])) {
// io attr: "input" mem(0) port(0) io_type(0) fifo_depth(1) direction(0)
// io attr: "output" mem(0) port(0) io_type(1) fifo_depth(1) direction(1)
// attr [gray] storage_scope = "global"
allocate gray[int32 * 480 * 640]
produce gray {
// attr [0] extern_scope = 0
// attr [gray.pipe.1] storage_scope = "global"
allocate gray.pipe.1[int32 * 480 * 640]
// attr gray.pipe.1 as FIFO (depth=10)
for "stage_name"="gray" (y, 0, 480) {
for "stage_name"="gray" (x, 0, 640) {
// attr [gray.temp] storage_scope = "global"
allocate gray.temp[int32 * 1]
gray.temp[0] = int32((((input[((x + (y*640))*3)]*0.300000f) + (input[(((x + (y*640))*3) + 1)]*0.590000f)) + (input[(((x + (y*640))*3) + 2)]*0.110000f)))
gray.pipe.1[0].write(gray.temp[0]);
}
}
}
produce output {
// attr [0] extern_scope = 0
stencil burst_width=512 unroll_factor=8 num_iteration=1 is_axis=1
inputs=[gray]
outputs=[output] {
for "stage_name"="output" (y, 0, 480) {
for "stage_name"="output" (x, 0, 640) {
output[(x + (y*640))] = int32(((int36((int35((int34((int33(gray[((x + (y*640)) + 639)]) + int33(gray[(x + (y*640))]))) + int34(gray[((x + (y*640)) + 640)]))) + int35(gray[((x + (y*640)) + 641)]))) + int36(gray[((x + (y*640)) + 1280)]))/(int36)5))
}
}
}
}
}
Here is the test cases I used: https://github.com/Hecmay/heterocl/blob/autosa-integration/tests/test_schedule_systolic.py#L181-L214
I suddenly found that this should be
output int32:
but not
local int32:
Nvm. I found the issue. The VarExprs inside Stencil op are not updated in the mutation and thus they are mis-classified as local output. It is fixed now.
The test cases were fixed already. Issue closed.
@Blaok Is
border
andcluster
required for the input SODA DSL now? I am using versionsodac 0.0.20200829.dev2