Skip to content

Instantly share code, notes, and snippets.

@ryanstout
Created January 3, 2020 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanstout/5a6d2ab8bbcf3191f476a1e35966ebc4 to your computer and use it in GitHub Desktop.
Save ryanstout/5a6d2ab8bbcf3191f476a1e35966ebc4 to your computer and use it in GitHub Desktop.
producer[x, y] = hl.sin(x * y)
consumer[x, y] = (producer[x, y] +
producer[x, y+1] +
producer[x+1, y] +
producer[x+1, y+1])/4
xo, yo, xi, yi = hl.Var("xo"), hl.Var("yo"), hl.Var("xi"), hl.Var("yi")
consumer.tile(x, y, xo, yo, xi, yi, 4, 4)
producer.compute_at(consumer, xo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment