-
Notifications
You must be signed in to change notification settings - Fork 322
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
Question: header only version ? #2114
Comments
We're indeed close to this for ops in static-dispatch mode. There are a few source files (targets, print, abort, timer) which would be reasonably straightforward to bundle into a header. contrib also has image and vqsort*. I think a larger obstacle would be per_target.cc, which uses foreach_target. It seems difficult to reason about how that would compose with a header-only library, at the very least it would impose requirements on the ordering of highway.h vs any other Highway-using headers. Would anyone be interested in looking into this? |
Here is an example of a project that allows Google Highway to be used in a header-only manner if compiling for a single HWY_TARGET: The CMakeLists.txt file in simdhwyhash checks to see if Google Highway can be used in a header-only manner in simdhwyhash using check_cxx_source_compiles. Including the check to see if Google Highway can be used in a header-only manner in simdhwyhash also speeds up the build time in the case where the system-provided Google Highway library is not used and libhwy does not have to be built. |
Interesting, great that that works, thanks for sharing :) |
Perhaps all of the low hanging fruit can be converted into header only, while leaving |
Possibly; some users might not even require per_target. What did you have in mind with "converted into header only"? |
Just move implementations into header files, is what I had in mind. And delete the .cc files |
hm, another idea would be to add |
great idea |
:) Would you, or anyone else, like to experiment with that? |
presumably we would have a HWY_HEADER_ONLY flag and accompanying #define , and the .cc files would not be included in the CMake files if the flag was set. If you can set this up, I can experiment with including the .cc files as you suggested |
Sure, can do. Let's start with only the main library for now. |
PiperOrigin-RevId: 629984062
PiperOrigin-RevId: 629984062
PiperOrigin-RevId: 630041101
@jan-wassenberg I'm afraid I won't have time to look at this for a while - should we close ? |
No worries. I think we can leave this open for now in case anyone else is interested? |
Not sure if this is feasible, but as the ops are already inline header only,
would it be possible for the rest of the library to be header only as well ?
Pros are ease of integration into other projects, cons are time needed to refactor,
and code bloat, also perhaps maintainability.
The text was updated successfully, but these errors were encountered: