Skip to content

Commit

Permalink
add cudamex and cudaoct makefile targets
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Nov 2, 2022
1 parent f455d1e commit 9809be0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions commons/Makefile_common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ ifeq ($(TARGETSUFFIX),.a)
endif

cuda: sse
cudamex: mex
cudaoct: oct

all release sse ssemath prof omp mex oct mexomp octomp pnacl web debug cuda: $(SUBDIRS) $(BINDIR)/$(BINARY)

Expand Down
5 changes: 3 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ USERCCFLAGS=-DUSE_OS_TIMER -DUSE_OPENCL -DMMC_XORSHIFT

DUMMY:=$(shell mkdir -p built/cjson)

ifeq ($(MAKECMDGOALS),cuda)
ifeq ($(MAKECMDGOALS),$(filter $(MAKECMDGOALS),cuda cudamex cudaoct))
FILES+=mmc_cu_host
USERCCFLAGS+=-DUSE_CUDA
CUCCOPT= -DUSE_ATOMIC -DMCX_SAVE_DETECTORS -DMCX_DO_REFLECTION -DUSE_DMMC -DUSE_BLBADOUEL
CUCCOPT= -DUSE_ATOMIC -DMCX_SAVE_DETECTORS -DMCX_DO_REFLECTION -DUSE_DMMC -DUSE_BLBADOUEL -Xcompiler -fPIC
EXTRALIB+=-lcudart
MEXLINKOPT+=-lcudart
endif

include $(ROOTDIR)/commons/Makefile_common.mk
7 changes: 6 additions & 1 deletion src/mmclab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@
#include "mex.h"
#include "mmc_mesh.h"
#include "mmc_host.h"
#include "mmc_cl_host.h"
#ifdef USE_OPENCL
#include "mmc_cl_host.h"
#endif
#ifdef USE_CUDA
#include "mmc_cu_host.h"
#endif
#include "mmc_tictoc.h"
#include "mmc_raytrace.h"
#include "waitmex/waitmex.c"
Expand Down

0 comments on commit 9809be0

Please sign in to comment.