Skip to content

[SYCL] workaround for memaccess warning from older hostcompiler #18435

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/include/sycl/detail/memcpy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inline void memcpy_no_adl(T1 *Dst, const T2 *Src, size_t Size) {
#ifdef __SYCL_DEVICE_ONLY__
__builtin_memcpy(Dst, Src, Size);
#else
std::memcpy(Dst, Src, Size);
std::memcpy(static_cast<void *>(Dst), static_cast<const void *>(Src), Size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this should be done on bit_cast->memcpy_no_adl call, not in memcpy_no_adl->memcpy call.

Also, per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104855 the warning is correct, so I'm not sure why recent GCCs don't emit it.

#endif
}
} // namespace detail
Expand Down
Loading