-
Notifications
You must be signed in to change notification settings - Fork 10
created SIMD version of line-rect intersection #42
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
Conversation
|
|
||
| extensions = [Extension("geometry", sources=["src_c/geometry.c"])] | ||
|
|
||
| compiler_options = {"unix": ["-mavx2"], "msvc": ["/arch:AVX2"]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary. Since you're using intrinsics, the compiler isn't emitting the symbols, you are. With these options, the project will not run at all on older systems, I believe.
src_c/collisions.c
Outdated
| double *T) | ||
| { | ||
| #ifdef __AVX2__ | ||
| return pgIntersection_LineRect_avx2(line, rect, X, Y, T); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a runtime check as well.
this version is about 3 times faster than the normal path