Skip to content

Conversation

@Emc2356
Copy link
Collaborator

@Emc2356 Emc2356 commented Aug 8, 2022

this version is about 3 times faster than the normal path

@itzpr3d4t0r itzpr3d4t0r added type:performance Related to speed or resource usage of the project submodule:line type:partial_rewrite Partially rewrites an existing feature submodule:collisions involves:SIMD labels Aug 8, 2022

extensions = [Extension("geometry", sources=["src_c/geometry.c"])]

compiler_options = {"unix": ["-mavx2"], "msvc": ["/arch:AVX2"]}
Copy link
Member

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.

double *T)
{
#ifdef __AVX2__
return pgIntersection_LineRect_avx2(line, rect, X, Y, T);
Copy link
Member

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.

@itzpr3d4t0r itzpr3d4t0r merged commit 3b2a8c0 into main Aug 19, 2022
@itzpr3d4t0r itzpr3d4t0r deleted the line-rect-intersection-SIMD-AVX2 branch August 19, 2022 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

involves:SIMD submodule:collisions submodule:line type:partial_rewrite Partially rewrites an existing feature type:performance Related to speed or resource usage of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants