From bb4a5968abbaa60d2d9eca5649f2d01fd3779887 Mon Sep 17 00:00:00 2001 From: Jeronim Morina Date: Tue, 17 Mar 2015 17:32:59 +0100 Subject: [PATCH] FIX use correct sizes in memcpy --- hscgv_uebung_4/lbm.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hscgv_uebung_4/lbm.cu b/hscgv_uebung_4/lbm.cu index 664ed6b..6f999e4 100644 --- a/hscgv_uebung_4/lbm.cu +++ b/hscgv_uebung_4/lbm.cu @@ -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