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

[stdlib] Constrain simd.bool() to size == 1 #2502

Closed

Conversation

helehex
Copy link
Contributor

@helehex helehex commented May 4, 2024

Use explicit reduce_or()/reduce_and() instead
see #2412

@helehex helehex requested a review from a team as a code owner May 4, 2024 06:20
@soraros
Copy link
Contributor

soraros commented May 4, 2024

Actually, I wish they were called any and all.

@helehex
Copy link
Contributor Author

helehex commented May 4, 2024

i was thinking the same thing, but they can be separate to avoid bitwise ambiguity

@ematejska ematejska added the mojo-repo Tag all issues with this label label May 6, 2024
@JoeLoser
Copy link
Collaborator

JoeLoser commented May 9, 2024

Just a quick update here: this has been approved internally, but I need to go fix up more uses internally this breaks before we can land it.

@JoeLoser JoeLoser self-assigned this May 9, 2024
@JoeLoser JoeLoser added the imported-internally Signals that a given pull request has been imported internally. label May 9, 2024
@helehex
Copy link
Contributor Author

helehex commented May 9, 2024

I was about to try adding any/all functions, but my Internet connection just died, so if anyone wants something todo

edit: I did it anyway, but can't open the pr till I get online...

@helehex
Copy link
Contributor Author

helehex commented May 9, 2024

I thought there was something else that should get done before any/all, but I can't remember now

Signed-off-by: Max Brylski <helehex@gmail.com>
@helehex helehex force-pushed the stdlib/constrain-simd-bool branch from 4ceb858 to bb3de08 Compare May 15, 2024 20:05
modularbot pushed a commit that referenced this pull request May 16, 2024
[External] [stdlib] Add builtin `any()`/`all()` functions

Adds builtin functions for testing if there are truthy elements in
`List`, `Set`, `SIMD`.
Should change to check iterators eventually.

Also mentioned [here](#2502)

---------

Co-authored-by: Helehex <Helehex@gmail.com>
Closes #2600
MODULAR_ORIG_COMMIT_REV_ID: 894768635c30c41fa359a69e5110b60adce735f8
lsh pushed a commit to lsh/mojo that referenced this pull request May 17, 2024
[External] [stdlib] Add builtin `any()`/`all()` functions

Adds builtin functions for testing if there are truthy elements in
`List`, `Set`, `SIMD`.
Should change to check iterators eventually.

Also mentioned [here](modularml#2502)

---------

Co-authored-by: Helehex <Helehex@gmail.com>
Closes modularml#2600
MODULAR_ORIG_COMMIT_REV_ID: 894768635c30c41fa359a69e5110b60adce735f8

Signed-off-by: Lukas Hermann <lukashermann28@gmail.com>
@modularbot
Copy link
Collaborator

✅🟣 This contribution has been merged 🟣✅

Your pull request has been merged to the internal upstream Mojo sources. It will be reflected here in the Mojo repository on the nightly branch during the next Mojo nightly release, typically within the next 24-48 hours.

We use Copybara to merge external contributions, click here to learn more.

@modularbot modularbot added merged-internally Indicates that this pull request has been merged internally merged-externally Merged externally in public mojo repo labels May 18, 2024
@modularbot
Copy link
Collaborator

Landed in a31a0e6! Thank you for your contribution 🎉

modularbot pushed a commit that referenced this pull request May 18, 2024
[External] [stdlib] Constrain `simd.bool()` to `size == 1`

Use explicit `reduce_or()`/`reduce_and()` instead
See #2412.

Co-authored-by: Helehex <Helehex@gmail.com>
Closes #2502
MODULAR_ORIG_COMMIT_REV_ID: b0e954912430469a9a60fb73ea46a4e7edf96964
@modularbot modularbot closed this May 18, 2024
msaelices pushed a commit to msaelices/mojo that referenced this pull request May 18, 2024
[External] [stdlib] Add builtin `any()`/`all()` functions

Adds builtin functions for testing if there are truthy elements in
`List`, `Set`, `SIMD`.
Should change to check iterators eventually.

Also mentioned [here](modularml#2502)

---------

Co-authored-by: Helehex <Helehex@gmail.com>
Closes modularml#2600
MODULAR_ORIG_COMMIT_REV_ID: 894768635c30c41fa359a69e5110b60adce735f8
msaelices pushed a commit to msaelices/mojo that referenced this pull request May 18, 2024
[External] [stdlib] Constrain `simd.bool()` to `size == 1`

Use explicit `reduce_or()`/`reduce_and()` instead
See modularml#2412.

Co-authored-by: Helehex <Helehex@gmail.com>
Closes modularml#2502
MODULAR_ORIG_COMMIT_REV_ID: b0e954912430469a9a60fb73ea46a4e7edf96964
modularbot pushed a commit that referenced this pull request May 22, 2024
…bitwise operations (#40348)

[External] [stdlib] Change `SIMD.reduce_and()`/`SIMD.reduce_or()` to
bitwise operations

changes the behavior of simd `reduce_and()`/`reduce_or()` to be bitwise
operations.

Theres a few things that are related to this:
[builtin `any()`/`all()`
functions](#2600)
[constrain simd bool to
size=1](#2502)

Co-authored-by: Helehex <Helehex@gmail.com>
Closes #2671
MODULAR_ORIG_COMMIT_REV_ID: 1ab75b0817529420ea8dd4baf3014ea97dc162ad
martinvuyk pushed a commit to martinvuyk/mojo that referenced this pull request May 24, 2024
[External] [stdlib] Add builtin `any()`/`all()` functions

Adds builtin functions for testing if there are truthy elements in
`List`, `Set`, `SIMD`.
Should change to check iterators eventually.

Also mentioned [here](modularml#2502)

---------

Co-authored-by: Helehex <Helehex@gmail.com>
Closes modularml#2600
MODULAR_ORIG_COMMIT_REV_ID: 894768635c30c41fa359a69e5110b60adce735f8
martinvuyk pushed a commit to martinvuyk/mojo that referenced this pull request May 24, 2024
[External] [stdlib] Constrain `simd.bool()` to `size == 1`

Use explicit `reduce_or()`/`reduce_and()` instead
See modularml#2412.

Co-authored-by: Helehex <Helehex@gmail.com>
Closes modularml#2502
MODULAR_ORIG_COMMIT_REV_ID: b0e954912430469a9a60fb73ea46a4e7edf96964
martinvuyk pushed a commit to martinvuyk/mojo that referenced this pull request May 24, 2024
…bitwise operations (#40348)

[External] [stdlib] Change `SIMD.reduce_and()`/`SIMD.reduce_or()` to
bitwise operations

changes the behavior of simd `reduce_and()`/`reduce_or()` to be bitwise
operations.

Theres a few things that are related to this:
[builtin `any()`/`all()`
functions](modularml#2600)
[constrain simd bool to
size=1](modularml#2502)

Co-authored-by: Helehex <Helehex@gmail.com>
Closes modularml#2671
MODULAR_ORIG_COMMIT_REV_ID: 1ab75b0817529420ea8dd4baf3014ea97dc162ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported-internally Signals that a given pull request has been imported internally. merged-externally Merged externally in public mojo repo merged-internally Indicates that this pull request has been merged internally mojo-repo Tag all issues with this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants