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

feat: Lower array repeat and scan ops #1717

Merged
merged 8 commits into from
Dec 10, 2024
Merged

feat: Lower array repeat and scan ops #1717

merged 8 commits into from
Dec 10, 2024

Conversation

mark-koch
Copy link
Contributor

Closes #1681

@mark-koch mark-koch requested a review from a team as a code owner November 26, 2024 12:44
@mark-koch mark-koch requested review from croyzor and removed request for a team November 26, 2024 12:44
/// the array. I.e. it is of type `array.get_element_type().ptr_type()` not
/// `array.ptr_type()`
fn with_array_alloca<'c, T, E: From<BuilderError>>(
/// Returns two pointers: The first one
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment looks unfinished

@mark-koch mark-koch requested a review from croyzor December 9, 2024 09:28
#[case(5, 42, 2)]
#[case(5, 42, 3)]
#[case(5, 42, 4)]
fn exec_repeat(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a very satisfying test -- it'd be nicer to have something where the function inspects the inputs and puts a different value in each location

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not possible with repeat, all values in the array must have the same value

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, I was thinking repeat was haskell's Data.List.iterate

// We build a HUGR that:
// - Creates an array [1, 2, 3, ..., size]
// - Maps a function that increments each element by `inc`
// - Returns the sum of the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the what?? 😛

Base automatically changed from mk/array-exts to main December 9, 2024 11:01
croyzor
croyzor approved these changes Dec 10, 2024
@mark-koch mark-koch added this pull request to the merge queue Dec 10, 2024
Merged via the queue into main with commit 685adaf Dec 10, 2024
19 checks passed
@mark-koch mark-koch deleted the mk/array-emit branch December 10, 2024 10:47
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

Successfully merging this pull request may close these issues.

Lower array scan and repeat ops
2 participants