cornell-zhang/hcl-dialect

hcl.print printing random number

Closed this issue · 2 comments

With the following code:

            z1 = hcl.compute((2,3,4), lambda x,y,z: 0, dtype=hcl.Int(32))
            def do(i,j,k):
                z1[0,0,0] = 53
            hcl.mutate(z1.shape, do)
            hcl.print((z1[0,0,0]), "here %d\n")

The main branch correctly prints "here 53" while hcl-mlir prints "here <random number>".

Related to #37

Expression printing hasn't been supported, I'm working on printing support this week

Printing has been fully supported, features include:

  • Tensor printing with numpy-like format
  • Expression printing with format string
  • Tuple printing, e.g. hcl.print((a, b), "%d, %d\n")

This particular test case has been added here.