Skip to content

Commit

Permalink
Fix warning in some user code when using std::memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Rombur committed Mar 24, 2023
1 parent 65aa95e commit 904fb32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/HIP/Kokkos_HIP_KernelLaunch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ struct HIPParallelLaunchKernelInvoker<DriverType, LaunchBounds,

// Copy functor (synchronously) to staging buffer in pinned host memory
unsigned long *staging = hip_instance->constantMemHostStaging;
std::memcpy(staging, &driver, sizeof(DriverType));
std::memcpy(static_cast<void *>(staging),
static_cast<const void *>(&driver), sizeof(DriverType));

// Copy functor asynchronously from there to constant memory on the device
KOKKOS_IMPL_HIP_SAFE_CALL(hipMemcpyToSymbolAsync(
Expand Down

0 comments on commit 904fb32

Please sign in to comment.