Hi. I am trying to operate For ast node on Halide IR. But the Halide::Internal::StmtNode seem not have stride attribute. Is there any way to make a “For” node with specified stride? If extending existing IR struct to support stride, what parts of TVM may be influenced and re-implemented? I need some suggestions. Thanks.
We do not have For that have strides, but you can construct it by
for xx in range(size):
let i = xx * stride + base
// use i as loop variable
That’s a smart way. But if I want to generate Cuda, I have to translate these two HalideIR statements back to For-loop with stride. If there exists some optimizing passes that change or delete “let”, it possibly leads missing optimal target code.