Skip to content

What is the right way to create an empty Halide::Buffer? #8920

Closed

Description

@mhdadk

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)?

Activity

  1. changed the title [-]What is the right way to create a Halide::Buffer?[/-] [+]What is the right way to create an empty Halide::Buffer?[/+] on Jan 23, 2026
  2. locked and limited conversation to collaborators on Jan 23, 2026
  3. converted this issue into a discussion #8921 on Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions