Skip to content

Commit

Permalink
Fix #4 robustly.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVlx committed Jan 6, 2021
1 parent ec747b1 commit 72cd96d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/include/hip/detail/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
T r;
#if defined(__has_builtin)
#if __has_builtin(__builtin_memcpy) || defined(__GNUC__)
__builtin_memcpy(&r, &v, sizeof(T));
__builtin_memcpy(
reinterpret_cast<void*>(&r),
reinterpret_cast<const void*>(&v),
sizeof(T));
#else
std::memcpy(&r, &v, sizeof(T));
#endif
Expand Down

0 comments on commit 72cd96d

Please sign in to comment.