New array element accessor methods#228
Merged
Merged
Conversation
This currently fails mostly due to a couple very minor issues, but mainly due to the problem discussed in asdf-formatgh-227
This resolves the long-standing (but undocumented) bug that certain macros controlling code compiled with libasdf (specifically ASDF_LOG calls) did not get a value defined for ASDF_LOG_ENABLED, causing log calls to pass silently. This now provides another home for configure-time values that *should* be shipped in the public API. In particular this was needed to test for float16 support for some of the new ndarray APIs to be added on this branch. But it's an issue that needed resolution in the first place. asdf-formatgh-227
…ce macros) This provides a safer element-wise access to ndarrays; add documentation of its usage and why it should be used over direct pointer casts on the raw data. asdf-formatgh-227
asdf/config.h is generated at build time, but is needed for Hawkmoth to successfully read the headers. This generates a temporary copy of config.h for use just in the docbuild in case this condition is encountered (which it would be, e.g., on RTD) asdf-formatgh-227
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This resolves #227 by providing a suite of functions (and convenience macros) for accessing single elements of an ndarray safely regardless of word alignment, endianness, or source datatype. It complements the other
asdf_ndarray_read_*methods.Also takes care of UB surrounding word alignment on the general read conversions as well.
Adds support for builds with UBSan enabled (which raised this issue in the first place) and updates the docs accordingly.
Also takes care of the long-standing problem (but for which there was not a written issue) of not shipping certain configured defines in the installed headers (esp.
ASDF_LOG_ENABLED).AI Disclosure
No AI tools used.