view example/many_task/Makefile.cuda @ 2048:6796d85f3d6b draft

remove error
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Thu, 28 Jan 2016 00:05:49 +0900
parents 7d1afa7aeccd
children
line wrap: on
line source

include ./Makefile.def

SRCS_TMP = $(wildcard *.cc)
SRCS_EXCLUDE = sort_test.cc  # 除外するファイルを書く
SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
OBJS = $(SRCS:.cc=.o)

TASK_DIR  = ppe
TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
TASK_SRCS_EXCLUDE = sort_test.cc
TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
TASK_OBJS = $(TASK_SRCS:.cc=.o)

CUDA_TASK_DIR  = cuda
CUDA_TASK_SRCS_TMP = $(wildcard $(CUDA_TASK_DIR)/*.cu)
CUDA_TASK_SRCS_EXCLUDE =
CUDA_TASK_SRCS = $(filter-out $(CUDA_TASK_DIR)/$(CUDA_TASK_SRCS_EXCLUDE),$(CUDA_TASK_SRCS_TMP))
CUDA_TASK_OBJS = $(CUDA_TASK_SRCS:.cu=.ptx)

CC += $(ABI)
CFLAGS  += -D__CERIUM_CUDA__

LIBS += -L${CERIUM}/TaskManager -DUSE_SIMPLE_TASK -lCudaManager -F/Library/Frameworks -framework CUDA `sdl-config --libs`

INCLUDE += -I/Developer/NVIDIA/CUDA-5.5/include

NVCC = nvcc
NVCCFLAGS = -ptx -arch=sm_20

.SUFFIXES: .cc .o .cu .ptx

.cc.o:
	$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@

.cu.ptx:
	$(NVCC) $(NVCCFLAGS) $< -o $@

all: $(TARGET)

$(TARGET): $(OBJS) $(TASK_OBJS) $(CUDA_TASK_OBJS)
	$(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)

link:
	$(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)

debug: $(TARGET)
	sudo lldb -- ./$(TARGET) -gpu -g

test : $(TARGET)
	./$(TARGET) -gpu -g

clean:
	rm -f $(TARGET) $(OBJS) $(TASK_OBJS) $(CUDA_TASK_OBJS)
	rm -f *~ \#*
	rm -f cuda/*~ cuda/\#*