-
Notifications
You must be signed in to change notification settings - Fork 321
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
convert most of core to header only #2138
base: master
Are you sure you want to change the base?
Conversation
e5b005c
to
be8573d
Compare
@@ -20,6 +20,10 @@ | |||
namespace hwy { | |||
|
|||
namespace { | |||
|
|||
#ifdef HWY_HEADER_ONLY | |||
inline |
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 think for header files, we want static inline just to be sure/safe.
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.
Doesn't anonymous namespace take the place of static in this case ?
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.
hm. Now that you mention it, if we want to support header-only, then we should avoid anon namespace, even in .cc files, because those will also be included in the single header.
The reason is that multiple includes of the single header from different TUs would seem to violate the One Definition Rule.
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.
Probably a good idea, but I don't think that's issue with the compile error. Compile currently chokes on
mask_slide_test.cc
. so it is able to compile a number of other tests successfully. When you have a chance, take a look as I can't make head or tail of the error.
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.
Interesting. What's the error? I'm not seeing this in the build logs, currently they are failing at CMake already due to the CXX project setting.
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 think the problem is that this test happens to have the same name as another test. Will fix shortly.
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.
Unfortunately, error persists with this fix.
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.
hm, that's mystifying. Is that happening for all of the struct/class in this file?
TestStoreMaskBits is the only class, not that that should make a difference.
That class name is not repeated in other files. I'm not seeing anything different about this file compared to others.
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, indeed it is strange, there must be something else about this test that is different from all the others. Can you try on your system with the header only flag enabled ?
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've currently got lots going on. Would anyone else be interested in having a look?
PiperOrigin-RevId: 631451998
PiperOrigin-RevId: 631451998
PiperOrigin-RevId: 631451998
PiperOrigin-RevId: 631475295
if
per_target.cc
becomes header only, then library cannot be built as there are no longer any .cc filesHere is the error:
Even with current commit, we get errors in tests: