From b4e4cc3ffa4c063533230cbb1864f08435d652ce Mon Sep 17 00:00:00 2001 From: Pietro Incardona <incardon@mpi-cbg.de> Date: Thu, 13 Dec 2018 02:46:56 +0100 Subject: [PATCH] Fixing reduce marked --- example/Vector/7_SPH_dlb_gpu_opt/Makefile | 4 ++-- src/Vector/cuda/vector_dist_cuda_funcs.cuh | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/example/Vector/7_SPH_dlb_gpu_opt/Makefile b/example/Vector/7_SPH_dlb_gpu_opt/Makefile index cca7077fd..ce1336a5d 100644 --- a/example/Vector/7_SPH_dlb_gpu_opt/Makefile +++ b/example/Vector/7_SPH_dlb_gpu_opt/Makefile @@ -12,10 +12,10 @@ sph_dlb_test: OPT += -DTEST_RUN sph_dlb_test: sph_dlb %.o: %.cu - nvcc -O0 -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC) + nvcc -O3 -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC) %.o: %.cpp - $(CC) -O0 $(OPT) -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH) + $(CC) -O3 $(OPT) -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH) sph_dlb: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) diff --git a/src/Vector/cuda/vector_dist_cuda_funcs.cuh b/src/Vector/cuda/vector_dist_cuda_funcs.cuh index 3e119645e..5a0874a8d 100644 --- a/src/Vector/cuda/vector_dist_cuda_funcs.cuh +++ b/src/Vector/cuda/vector_dist_cuda_funcs.cuh @@ -373,7 +373,13 @@ void remove_marked(vector_type & vd) // we have no particles to remove if (*(int *)mem.getPointer() != 1) - {return;} + { + if (*(int *)mem.getPointer() >= 2) + { + std::cout << __FILE__ << ":" << __LINE__ << " error: removing marked particle. Carefull particle must be marked with 1 or 0, no other numbers" << std::endl; + } + return; + } // Get the mark point mark.template deviceToHost<0>(); -- GitLab