Suppose that I wanted to create an empty M x N Halide float buffer called arr that consists of M rows and N columns. Also, suppose that I want to index this arr as arr(row, col), where row and col are the row and column indices respectively.
Do I write Halide::Buffer<float> arr(M, N) or Halide::Buffer<float> arr(N, M)? I believe the former is correct because it matches how I want to index arr.
More generally, would how the buffer be defined be affected by how it is indexed? For example, if I instead wanted to index arr as arr(col, row), would I then write Halide::Buffer<float> arr(N, M)?
Suppose that I wanted to create an empty
M x NHalide float buffer calledarrthat consists ofMrows andNcolumns. Also, suppose that I want to index thisarrasarr(row, col), whererowandcolare the row and column indices respectively.Do I write
Halide::Buffer<float> arr(M, N)orHalide::Buffer<float> arr(N, M)? I believe the former is correct because it matches how I want to indexarr.More generally, would how the buffer be defined be affected by how it is indexed? For example, if I instead wanted to index
arrasarr(col, row), would I then writeHalide::Buffer<float> arr(N, M)?