Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: reduce the alignment requirement for complex arrays on x86 #3816

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

Closed

Conversation

juliantaylor
Copy link
Contributor

x86 can deal with unaligned memory access so it does not need to align
complex types to 2 * sizeof(T) for the dtype transfers which work on the
full complex number.
closes #3768

Does not fix that new complex arrays are reported as aligned when
the allocator does not provide the required alignment.

@@ -4164,7 +4173,13 @@ set_typeinfo(PyObject *dict)
#endif
NPY_@name@,
NPY_BITSOF_@name@,
/* alignment, platforms without unaligned access need double
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, multiline comment like so:

/*
 * blah
 */

@charris
Copy link
Member

charris commented Sep 28, 2013

Is this safe to backport without the changes to npy_cpu.h?

@juliantaylor
Copy link
Contributor Author

it should be
but it also requires dropping the newely added asserts from the lowlevel loops, they will assert on linux32, or keeping the increased alignment in debug mode

@juliantaylor
Copy link
Contributor Author

oh no shold be fine, the asserts request the size of the types actually loaded, which are just doubles.

x86 can deal with unaligned memory access so it does not need to align
complex types to 2 * sizeof(T) for the dtype transfers which work on the
full complex number.
closes numpy#3768

Does not fix that new complex arrays are reported as aligned when
the allocator does not provide the required alignment.
@juliantaylor
Copy link
Contributor Author

fixed comments, and tested debug mode on linux32.

@juliantaylor
Copy link
Contributor Author

but it will fail with -maligndouble and win32, this is not worth the trouble, closing.

@charris
Copy link
Member

charris commented Sep 28, 2013

So it goes ;)

@juliantaylor juliantaylor deleted the avoid-unnecessary-align branch November 8, 2014 03:44
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.

Complex128 alignment leads to scipy test failures.
2 participants