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

Prelu layer uses sse instruction _mm_load_ps but data can be misaligned so it must use _mm_loadu_ps #5149

Merged
merged 3 commits into from
Nov 15, 2023

Conversation

AlOa
Copy link
Contributor

@AlOa AlOa commented Nov 14, 2023

In the prelu_x86.cpp for loading the data for sse instructions it is used _mm_load_ps but data can be misaligned so it must be used _mm_loadu_ps

@github-actions github-actions bot added the x86 label Nov 14, 2023
@nihui
Copy link
Member

nihui commented Nov 15, 2023

Hi
This problem occurs when you load the model from memory, slope_data is not guaranteed to be aligned, which will lead to misalignment

However, I found that there is another place where _mm_load_ps is used incorrectly. Please fix it together.

__m128 _slope128 = _mm_load_ps(slope + i);

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (54e58bf) 94.70% compared to head (837bbbf) 94.70%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5149      +/-   ##
==========================================
- Coverage   94.70%   94.70%   -0.01%     
==========================================
  Files         777      777              
  Lines      241604   241653      +49     
==========================================
+ Hits       228809   228848      +39     
- Misses      12795    12805      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nihui nihui merged commit 9f26eeb into Tencent:master Nov 15, 2023
58 of 62 checks passed
@nihui
Copy link
Member

nihui commented Nov 15, 2023

Thanks for your contribution !

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

Successfully merging this pull request may close these issues.

3 participants