Skip to content
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

compiler note about ABI being changed in GCC 4.6 #310

Open
RABijl opened this issue Oct 7, 2024 · 2 comments
Open

compiler note about ABI being changed in GCC 4.6 #310

RABijl opened this issue Oct 7, 2024 · 2 comments

Comments

@RABijl
Copy link

RABijl commented Oct 7, 2024

when using a cl_ulong4, the following compiler note shows up:

/home/rabijl/Projects/pocl-2/pocld/../include/hpp/CL/opencl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueFillBuffer(const cl::Buffer&, PatternType, cl::size_type, cl::size_type, cl::vector<cl::Event>*, cl::Event*) const [with PatternType = cl_ulong4]’:
/home/rabijl/Projects/pocl-2/pocld/../include/hpp/CL/opencl.hpp:7679:12: note: the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
 7679 |     cl_int enqueueFillBuffer(
      |            ^~~~~~~~~~~~~~~~~
@bashbaug
Copy link
Contributor

bashbaug commented Oct 8, 2024

Interesting, here's a shorter version of this issue: https://godbolt.org/z/67arzdq5a

We removed the alignment information from the scalar OpenCL types a very long time ago (see KhronosGroup/OpenCL-Headers#40), but we didn't remove the alignment information from the vector types. I wonder if that was a mistake. Removing __attribute__ ((aligned(_x))) will fix this warning.

@RABijl
Copy link
Author

RABijl commented Oct 9, 2024

I played around a bit with the short version and I notice that it does not complain if the alignment is set from 32 to 16 or if it is compiled with some form of -mavx. I don't know if the complexity added by checking for x86 (the arm and risc-v gcc compilers did not show any notes) and a whitelisted set of extension attributes (link) is worth the effort, but I could make make a pr like that and test it against godbolt.

edit: this does the trick: https://godbolt.org/z/714ofrPjh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants