Skip to content

Added first() function for SSE/AVX/AVX512F#1134

Merged
serge-sans-paille merged 4 commits intoxtensor-stack:masterfrom
emrys53:feature/first
Jul 3, 2025
Merged

Added first() function for SSE/AVX/AVX512F#1134
serge-sans-paille merged 4 commits intoxtensor-stack:masterfrom
emrys53:feature/first

Conversation

@emrys53
Copy link
Contributor

@emrys53 emrys53 commented Jul 2, 2025

This pr implements new first() function for batch types. It is an improvement from the currently used self.get(0) as first() uses intrinsics to extract the first element. Addresses inefficiencies mentioned in issue #1133.
I have only implemented for SSE/AVX/AVX512F architectures @serge-sans-paille will implement for other architectures.
I also haven't replace any .get(0) functions with first(). That needs to be done as well

@serge-sans-paille
Copy link
Contributor

Looks good, but there is some formatting and windows - specific issue to handle, can you have a look?

@emrys53
Copy link
Contributor Author

emrys53 commented Jul 2, 2025

These last 2 commits should be able to fix the previous issues

@emrys53
Copy link
Contributor Author

emrys53 commented Jul 2, 2025

oh nice it passed all the tests. Now we need to implement it for other architectures and replace all .get(0) with first()

@serge-sans-paille
Copy link
Contributor

oh nice it passed all the tests. Now we need to implement it for other architectures and replace all .get(0) with first()

I'll handle that. thanks!

@serge-sans-paille serge-sans-paille merged commit ff1dc67 into xtensor-stack:master Jul 3, 2025
63 checks passed
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.

2 participants