-
Notifications
You must be signed in to change notification settings - Fork 797
[ESIMD] Add 'inline' to function decls to fix ODR problems. #3085
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
Conversation
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
@@ -466,7 +466,7 @@ __esimd_raw_send_store(uint8_t modifier, uint8_t execSize, | |||
|
|||
template <typename Ty, int N, int NumBlk, sycl::INTEL::gpu::CacheHint L1H, | |||
sycl::INTEL::gpu::CacheHint L3H> | |||
SYCL_EXTERNAL sycl::INTEL::gpu::vector_type_t< | |||
inline sycl::INTEL::gpu::vector_type_t< |
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.
With this change, for non-sycl-device build, compiler FE will see one SYCL_EXTERNAL declaration and one inline definition for the same API, while the existing code made it consistent. What is the exact FE rule here, or compiler doesn't have diagnostic for this? Should similar change be made in other files such as esimd_math_intrin.hpp?
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.
inline
will be seen only by the host compiler, which is really the intent.
Device compiler will continue to see SYCL_EXTERNAL w/o definition
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.
Should similar change be made in other files such as esimd_math_intrin.hpp?
Yes. This is achieved by including inline
into ESIMD_INLINE
used in other files.
Also, SYCL_EXTERNAL is defined to empty string for the host compiler, so void foo
followed by inline void foo
should be OK.
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.
Had a sync with @kychendev - esimd_math_intrin.hpp should be really fixed, my omission. Will do.
It turns out all the intrinsic functions in
So there is no need to fix |
actually, some clean-up still would be good - |
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
@kbobrovs, looks good but there is test error related to unsupported sycl target. Please double check. |
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
@kychendev, all checks now pass |
@bader, please take a look. |
Co-authored-by: Alexey Bader <[email protected]>
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
I suggest adding one more person as a code owner for ESIMD, who is familiar with the code and can do code review for your changes. |
right, good idea. I created #3114 |
@DenisBakhvalov - could you please review/approve? @kychendev already approved (approval lost due to test re-formatting) |
Fixes "multiple definition" linker errors when multiple sources using ESIMD are linked together.
Signed-off-by: Konstantin S Bobrovsky [email protected]