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

[RTG] Add set type and operations #7848

Merged
merged 1 commit into from
Nov 20, 2024
Merged

[RTG] Add set type and operations #7848

merged 1 commit into from
Nov 20, 2024

Conversation

maerhart
Copy link
Member

No description provided.

@maerhart maerhart added the RTG Involving the `rtg` dialect label Nov 19, 2024
"set", "output",
"llvm::cast<rtg::SetType>($_self).getElementType()">
]> {
let summary = "selects an element uniformly at random from a set";
Copy link
Member

Choose a reason for hiding this comment

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

What does this return if the set is empty?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is currently undefined behavior. My plan is to add another operation to query the number of elements in the set. scf.if could then be used to skip random selections from empty sets. Alternatively, we could pass a default value to be chosen if the set is empty. Feel free to share your thoughts/opinion on how this should ideally be handled.

Base automatically changed from maerhart-rtgtest-dialect to main November 20, 2024 09:27
@maerhart maerhart merged commit 76b4da8 into main Nov 20, 2024
4 checks passed
@maerhart maerhart deleted the maerhart-rtg-sets branch November 20, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RTG Involving the `rtg` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants