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
SSE version of PresetOutputs::PerPixelMath #62
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d157822
SSE version of PresetOutputs::PerPixelMath()
labkey-matthewb 681b23d
unused member pcmBuffer
labkey-matthewb 59ee738
cleanup
labkey-matthewb 17942b7
alloc mesh as one memory block
labkey-matthewb a374bd9
some comments
labkey-matthewb 4307006
TARGET_OS_MAC
labkey-matthewb 6834d40
__APPLE__
541a22c
AC_CHECK_FUNCS_ONCE
labkey-matthewb 5f8a525
fix signature for _mm_sincosf(), thanks Mischa
labkey-matthewb File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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.
is aligned_alloc available on EVERY other platform that isn't apple? raspi? BSD? windows?
I know mac is special and needs ^2 alignment, that's fine. i'm concerned about the aligned_alloc being portable.
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 honestly don't know. It is C11 standard, and the only google references I found about lack of support seem related to OSX. I could remove the #ifdef and always use the hand-written version.
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.
Well do whatever you think is best
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.
MacOS seems to contain posix_memalign, would that not be sufficient? It seems to work (almost) exactly the same except takes an address to write the pointer to.
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'd rather use a library routine (posix_memalign and/or aligned_alloc), but I guess the real problem here is detecting which library routine is available in a general way. GCC is not my natural habitat so I'm definitely open to suggestions.
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.
There's this from stackoverflow
https://stackoverflow.com/questions/16376942/best-cross-platform-method-to-get-aligned-memory
If STDC_VERSION >= 201112L use aligned_alloc.
If _POSIX_VERSION >= 200112L use posix_memalign.
If _MSC_VER is defined, use the Windows stuff.
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.
autoconf should be able to detect and spit out a define in config.h
search http://download.redis.io/redis-stable/deps/jemalloc/configure.ac for aligned_alloc - maybe this is something like what we want?
again, do whatever you think is best. i just want to avoid breaking portability if it's not a huge pain.
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.
Super, I haven't peeked in a configure.ac file before, but this looks like just the thing.
AC_CHECK_FUNCS_ONCE([aligned_alloc posix_memalign])
BTW, please crank up the mesh size and FPS and try test, everyone. I seem to see different results on different machines from dramatic to not-so-much. I want to make sure I'm not seeing things.