Skip to content

Commit

Permalink
FIX use correct sizes in memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
plattenschieber committed Mar 17, 2015
1 parent 324a78f commit bb4a596
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hscgv_uebung_4/lbm.cu
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ void LBMD3Q19::freeCuda() {
//! this needs to be done, each time we switch our settings
void LBMD3Q19::applyCuda() {
//! copy data from host to device, the rest are constants which stay the same
gpuErrchk (cudaMemcpy(d_flags, m_flags, m_width * m_height * m_depth, cudaMemcpyHostToDevice));
gpuErrchk (cudaMemcpy(d_velocity, m_velocity, sizeof(float3) * m_width * m_height * m_depth, cudaMemcpyHostToDevice));
gpuErrchk (cudaMemcpy(d_flags, m_flags, sizeof(char) * m_width * m_height * m_depth, cudaMemcpyHostToDevice));
gpuErrchk (cudaMemcpy(d_velocity, m_velocity, sizeof(float) * m_width * m_height * m_depth * D, cudaMemcpyHostToDevice));
gpuErrchk (cudaMemcpy(d_cells[m_current], m_cells[m_current], sizeof(float) * m_width * m_height * m_depth * Q, cudaMemcpyHostToDevice));
gpuErrchk (cudaMemcpy(d_cells[!m_current], m_cells[!m_current], sizeof(float) * m_width * m_height * m_depth * Q, cudaMemcpyHostToDevice));
//! omega can be changed, too
Expand Down

0 comments on commit bb4a596

Please sign in to comment.