-
Notifications
You must be signed in to change notification settings - Fork 143
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
Added support for Float16
#341
Open
andyferris
wants to merge
15
commits into
JuliaIO:master
Choose a base branch
from
FugroRoames:float16
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f1315af
Added support for `Float16`
b6eb8d1
Aesthetic fixes
andyferris 429bc75
work around macro with parens
musm e5e12ca
Merge branch 'master' into float16
musm e51c84e
Update plain.jl
musm 5c7b240
Put Float16 tests in temp directory and cleanup
33dfb18
rm both temporary files created during testing
musm be6645b
Fix typo tempdir() to tmpdir
musm bab0763
Update plain.jl
musm ef2d1a6
Update plain.jl
musm 78a260a
update open of nullterm_ascii file
musm 861cdf4
Update plain.jl
musm 9a7788e
Update plain.jl
musm 6ec1cd6
Merge branch 'master' into float16
musm ca674a8
Update plain.jl
musm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
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.
I guess I don't really understand why this has to be in
__init__
do you think you could please explain this to me?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 needed for the same reason that
H5open()
is called inside__init__
:make_float16()
is allocating new data structures inside the underlying hdf5 library and must be called each time the library is loaded.Actually it's interesting that the rest of the code assumes the value of globals like
H5T_NATIVE_FLOAT_g
will be consistent between different runs of the julia program. Looking at the C library, these globals are allocated insideH5open()
, so it seems this isn't really guaranteed.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.
Thanks. I'm wondering of a way to trigger a bug to show that.
In matlab.jl we have references https://github.com/JuliaInterop/MATLAB.jl/blob/master/src/init.jl
that are filled in with the pointers in inside
__init__
ref https://github.com/JuliaInterop/MATLAB.jl/blob/master/src/MATLAB.jl#L53we might have to do the same here?
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.
I have no idea if we can trigger a bug/make a test for this... would it happen if the HDF5 binary library was updated without this package being precompiled again? And yes, to me, filling references at run-time during
__init__
seems the safest possible thing to do.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.
To trigger this possible bug, it looks like you'd need to first load a library which creates a custom id dynamically (through a call to
H5Iregister()
I guess?), beforeH5open()
is called. I don't know whether the libhdf5 API contract prevents this from happening.After that, load HDF5.jl into the same process and the ids may be different from when HDF5.jl was loaded in build.jl.
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 seems quite possible. Another library (e.g. PETSc) could depend on HDF5_jll so that HDF5_jll is loaded and initialized before HDF5.jl is initialized. It would be quite difficult to trigger this in a test case though.