summaryrefslogtreecommitdiff
path: root/benchmarks/CUDA/CP/common/mk/cuda_rules.mk
blob: ce2f5da05e172e2266454ae07723149192c173fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# (c) 2007 The Board of Trustees of the University of Illinois.

# Cuda-related rules common to all benchmarks

########################################
# Derived variables
########################################

CUDAOBJS = $(call INBUILDDIR,$(SRCDIR_CUDAOBJS))

########################################
# Rules
########################################

ifeq ("$(LINK_MODE)", "CUDA")
$(BIN) : $(OBJS) $(CUDAOBJS)
	$(CUDACC) $(CUDALDFLAGS) $^ -o $@ $(CUDALIBS)
endif

$(BUILDDIR)/%.o : $(SRCDIR)/%.cu
	mkdir -p $(BUILDDIR)
	$(CUDACC) $(CUDACFLAGS) -c $< -o $@

$(BUILDDIR)/%.ptx : $(SRCDIR)/%.cu
	mkdir -p $(BUILDDIR)
	$(CUDACC) $(CUDACFLAGS) -ptx $< -o $@

$(BUILDDIR)/%.cubin : $(SRCDIR)/%.cu
	mkdir -p $(BUILDDIR)
	$(CUDACC) $(CUDACFLAGS) -cubin $< -o $@