Skip to content

Commit

Permalink
use memcpy not std::memcpy in hip
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Oct 25, 2024
1 parent 62a2f76 commit fac512f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hip/components/memory.hip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ __device__ __forceinline__ ValueType load_generic(const ValueType* ptr)
auto cast_value = HIP_ATOMIC_LOAD(reinterpret_cast<const atomic_type*>(ptr),
memorder, scope);
ValueType result{};
std::memcpy(&result, &cast_value, sizeof(ValueType));
memcpy(&result, &cast_value, sizeof(ValueType));
return result;
}

Expand All @@ -122,7 +122,7 @@ __device__ __forceinline__ void store_generic(ValueType* ptr, ValueType value)
static_assert(sizeof(atomic_type) == sizeof(ValueType), "invalid map");
static_assert(alignof(atomic_type) == alignof(ValueType), "invalid map");
atomic_type cast_value{};
std::memcpy(&cast_value, &value, sizeof(ValueType));
memcpy(&cast_value, &value, sizeof(ValueType));
HIP_ATOMIC_STORE(reinterpret_cast<atomic_type*>(ptr), cast_value, memorder,
scope);
}
Expand Down

0 comments on commit fac512f

Please sign in to comment.