Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a class to model Circular Buffers #18

Open
jakedves opened this issue Dec 30, 2024 · 0 comments
Open

Create a class to model Circular Buffers #18

jakedves opened this issue Dec 30, 2024 · 0 comments

Comments

@jakedves
Copy link
Collaborator

Create a class to model Circular Buffers.

Some things that may be useful:

  • reading from it (return type? Grid)
  • writing to it
  • storing an index to use (1..16)

We never run the code so index must be determined at compile-time, so PythonToMLIR object should be the one tracking instantiations rather than the circular buffer itself.

def func(a: CircularBuffer, b: CircularBuffer):
    a.read()  # read default size from circular buffer index 1? 
    a = b
    a.read()  # read .. index 2? 

Valid code above? Can choose. Could make it a rule (=> error) that circular buffers must only be referenced by their parameter name, or could allow dynamism but then can't just use a var_name -> CBIndex map in PythonToMLIR. First case is simpler and should cover most, if not all, programs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant