-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
OpenCL Add a DECLSPEC or INLINE macro #5618
Comments
I guess the very least we should do about that is rename our @solardiz I'm not touching this until I hear your opinion, as I suspect you may have one. Except I'll investigate at some point in time whether static/inline/both/none (or the case of not using any functions) is affecting #5456. |
FWIW the "correct" way of writing it is either For NOT inlining, |
I think I'll just go with this: #define INLINE static inline
#define NOINLINE __attribute__((noinline)) |
I'm also considering dropping most uses of inline, relying on it mostly happening anyway, but using the INLINE macro for things like our LUT3 function and stuff like that. Then benchmark all formats before and after, comparing ptxas output and binary size and see if/what changes. Imported subdir code such as ed25519 should mostly be kept as-is. |
Tried this (with nvidia). Nothing changed, ptxas output identical. |
Next is to experiment with what affects #5456 and what doesn't. This has to wait a week or so, I'm stuck abroad with a laptop. |
Define NOINLINE as "__attribute__((noinline))" which is has been seen working. Replace all uses of the latter with the macro. Drop the questionable "inline" macro and instead define INLINE as 'static inline', which should be the right thing. Use this only for inlines that were replaced by the old inline macro. Closes openwall#5618
Define NOINLINE as "__attribute__((noinline))" which has been seen working. Replace all uses of the latter with the macro. Drop the questionable "inline" macro and instead define INLINE as 'static inline', which should be the right thing. Use this only for inlines that were replaced by the old inline macro. Closes openwall#5618
Define NOINLINE as "__attribute__((noinline))" which has been seen working. Replace all uses of the latter with the macro. Drop the questionable "inline" macro and instead define INLINE as 'static inline', which should be the right thing, for anything put POCL and MESA which we've seen problems with in the past. Then use this macro only for inlines that were replaced by the old inline macro (for now). Closes openwall#5618
Define NOINLINE as "__attribute__((noinline))" which has been seen working. Replace all uses of the latter with the macro. Drop the questionable "inline" macro and instead define INLINE as 'static inline', which should be the right thing, for anything put POCL and MESA which we've seen problems with in the past. Then use this macro only for inlines that were replaced by the old inline macro (for now). Closes openwall#5618
Just like you, I'm unhappy we were redefining As to the rest, I'm not sure. You experimented with it just recently and continue to do so. So I'll defer to you on it. |
We've had this in opencl_misc.h for ages:
This is suboptimal because 1) it's not obvious in affected functions that
inline
may be changed, and 2) it would changestatic inline
tostatic static inline
. Also, the whole thing might be a long gone problem - we do have code that use neither or juststatic
and there's no reports of it breaking anything. On the other hand, just maybe #5456 is affected by what syntax (or none) is used - I recall a few formats do not emit those warnings, while most do.FWIW hashcat has this:
...then all their functions start with
DECLSPEC
unless they're already ifdef'ed for a specific platform.The text was updated successfully, but these errors were encountered: