diff --git a/commons/Makefile_common.mk b/commons/Makefile_common.mk index e9f641b..b7794aa 100644 --- a/commons/Makefile_common.mk +++ b/commons/Makefile_common.mk @@ -1,6 +1,6 @@ ######################################################## # MMC: Mesh-based Monte Carlo -# Copyright (C) 2009 Qianqian Fang +# Copyright (C) 2009-2024 Qianqian Fang # # # $Id$ @@ -176,14 +176,14 @@ ifeq ($(CC),clang) OPENMPLIB:= -lomp endif -ifneq (,$(filter mex,$(MAKECMDGOALS))) +ifneq (,$(filter $(MAKECMDGOALS),mex cudamex)) CCFLAGS+=-DMATLAB_MEX_FILE endif -ARFLAGS := +ARFLAGS := OBJSUFFIX := .o -BINSUFFIX := +BINSUFFIX := CLHEADER=.clh OBJS := $(addprefix $(OBJDIR)/, $(FILES)) @@ -231,8 +231,8 @@ debug: CUCCOPT+=-DMCX_DEBUG TARGETSUFFIX:=$(suffix $(BINARY)) ifeq ($(TARGETSUFFIX),.so) - CCFLAGS+= $(DLLFLAG) - ARFLAGS+= -shared -Wl,-soname,$(BINARY).1 + CCFLAGS+= $(DLLFLAG) + ARFLAGS+= -shared -Wl,-soname,$(BINARY).1 endif ifeq ($(TARGETSUFFIX),.a) diff --git a/examples/replay/plotjacobian.m b/examples/replay/plotjacobian.m index 5963687..2f4b7b1 100644 --- a/examples/replay/plotjacobian.m +++ b/examples/replay/plotjacobian.m @@ -15,8 +15,7 @@ data1 = data1(data1(:, 1) == 1, :); % the two sets of captured photons should be identical -if (all(ismember(round(data1 * 1e10) * 1e-10, round(data2 * 1e10) * 1e-10, 'rows')) && ... - all(ismember(round(data1 * 1e10) * 1e-10, round(data2 * 1e10) * 1e-10, 'rows'))) +if (all(ismember(round(data1 * 1e10) * 1e-10, round(data2 * 1e10) * 1e-10, 'rows'))) disp('replay is successful :-)'); else disp('replay failed :-('); diff --git a/examples/replay/run_test.sh b/examples/replay/run_test.sh index 17ad3da..a0a88f9 100755 --- a/examples/replay/run_test.sh +++ b/examples/replay/run_test.sh @@ -1,11 +1,11 @@ #!/bin/sh # first run to get the seeds for each detected photon (-q 1) -../../bin/mmc -f replaytest.inp -s step1 -n 3e6 -b 0 -q 1 -x 1 -d 1 -D TP +../../bin/mmc -f replaytest.inp -s step1 -n 3e6 -b 0 -q 1 -x 1 -d 1 -D TP $@ # replay the detected photons (-E *.mch) detected by detector#1 (-P 1) without normalization (-U 0) -../../bin/mmc -f replaytest.inp -E step1.mch -s step2 -P 1 -b 0 -q 1 -x 1 -d 1 -O L -D TP +../../bin/mmc -f replaytest.inp -E step1.mch -s step2 -P 1 -b 0 -q 1 -x 1 -d 1 -O L -D TP $@ # replay the detected photons (-E *.mch) detected by detector#1 (-P 1) without normalization (-U 0) -../../bin/mmc -f replaytest.inp -E step1.mch -s step3 -P 1 -b 0 -q 1 -x 1 -d 1 -O P -D TP +../../bin/mmc -f replaytest.inp -E step1.mch -s step3 -P 1 -b 0 -q 1 -x 1 -d 1 -O P -D TP $@ diff --git a/src/mmc_cu_host.cu b/src/mmc_cu_host.cu index d6290a9..03e7017 100644 --- a/src/mmc_cu_host.cu +++ b/src/mmc_cu_host.cu @@ -281,7 +281,7 @@ void mmc_run_simulation(mcconfig* cfg, tetmesh* mesh, raytracer* tracer, GPUInfo cfg->bary0, cfg->e0, cfg->isextdet, - (int)(meshlen / cfg->srcnum), + (uint)(meshlen / cfg->srcnum), (uint)(mesh->prop + 1 + cfg->isextdet) + cfg->detnum, (uint)(MIN((MAX_PROP - (mesh->prop + 1 + cfg->isextdet) - cfg->detnum), ((mesh->ne) << 2)) >> 2), /*max count of elem normal data in const mem*/ cfg->issaveseed,