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

Compilation issue with new clang/Intel #1656

Closed
rhornung67 opened this issue May 30, 2024 · 3 comments · Fixed by #1668
Closed

Compilation issue with new clang/Intel #1656

rhornung67 opened this issue May 30, 2024 · 3 comments · Fixed by #1668

Comments

@rhornung67
Copy link
Member

Issue reported by @homerdin

Intel ran into this issue in their nightly testing with the newest clang compiler. They created a smaller reproducer shown below (also https://godbolt.org/z/7evq6GT5v ). This is from https://github.com/LLNL/RAJA/blob/eaa93614a319b26aef63b1236e505f93a37c463a/include/RAJA/pattern/kernel/Tile.hpp#L106.

It looks like a bug that wasn’t being caught with older versions, but I’m not an expert on nested class member access.

Thanks,
Brian

#include

#define RAJA_INLINE inline attribute((always_inline))

template
struct IterableTiler {
using Index_type = std::ptrdiff_t;

class iterator
{
const Index_type block_id;

public:
RAJA_INLINE bool operator!=(const IterableTiler &rhs) const
{
return block_id != rhs.block_id;
}

RAJA_INLINE bool operator<(const IterableTiler &rhs) const
{
  return block_id < rhs.block_id;
}

};

};

bwhitney@exaperf-sdpcloud-pvc19:/jira/cmplrllvm-58711> g++ -c x.cpp
bwhitney@exaperf-sdpcloud-pvc19:
/jira/cmplrllvm-58711> icpx -c x.cpp
x.cpp:16:30: error: no member named 'block_id' in 'IterableTiler'
16 | return block_id != rhs.block_id;
| ~~~ ^
x.cpp:21:29: error: no member named 'block_id' in 'IterableTiler'
21 | return block_id < rhs.block_id;
| ~~~ ^
2 errors generated.

@rhornung67 rhornung67 added sycl support sycl backend support and removed sycl support sycl backend support labels Jun 10, 2024
@rhornung67
Copy link
Member Author

@homerdin I don't know which specific compiler and version that produced the error. If you have access to it, will you please try to build the code in the branch associated with this PR: #1668 or have someone at Intel(?) try that branch. The change I made resolves the issue in the Compiler Explorer example for every compiler I tried there.

Please let me know the build/test results, if you have questions, or if there are other issues. Thank you.

@homerdin
Copy link
Collaborator

@rhornung67 These changes have been tested with the Intel nightly compiler and everything is working. Thanks!

@rhornung67
Copy link
Member Author

Thanks @homerdin

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

Successfully merging a pull request may close this issue.

2 participants