No title Revision 626233623161 (Fri Sep 09 2011 at 20:03) - Diff Link to this snippet: https://friendpaste.com/4Y1TNkU4VMDOm8kjAk7js5 Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108# Rules for generating all the kernels of these types..PHONY: counts.PHONY: hists.PHONY: sorts# Rules for detecting changes in .cu files effecting these kernels..PHONY: count.PHONY: hist.PHONY: sort# Relative paths# Note that the caller must define BITSifeq ($(BITS), 32) CUBIN = ../cubin ISA = ../isaendififeq ($(BITS), 64) CUBIN = ../cubin64 ISA = ../isa64endif# Compiler optionsNVCCFLAGS = --cubin -Xptxas=-v -arch=compute_20 -code=sm_20 -m=$(BITS)T128 = -D NUM_THREADS=128T256 = -D NUM_THREADS=256INDEX = -D VALUE_TYPE_INDEXKEY = -D VALUE_TYPE_NONESINGLE = -D VALUE_TYPE_SINGLEMULTI = -D VALUE_TYPE_MULTILIST = -D SCATTER_TRANSACTION_LISTSIMPLE = -D SCATTER_SIMPLESORTFLAGS = $(NVCCFLAGS) -D VALUES_PER_THREAD=8# Generate all kernels.all : \ sorts hists counts# Generate all .isa filescounts : \ $(ISA)/count.isahists : \ $(ISA)/hist_simple.isa sorts : \ $(ISA)/sort_128_8_index_simple.isa \ $(ISA)/sort_128_8_key_simple.isa \ $(ISA)/sort_128_8_single_simple.isa \ $(ISA)/sort_128_8_multi_simple.isa \ $(ISA)/sort_256_8_index_simple.isa \ $(ISA)/sort_256_8_key_simple.isa \ $(ISA)/sort_256_8_single_simple.isa \ $(ISA)/sort_256_8_multi_simple.isa # Generate all .isa files from a pattern with cuobjdump.$(ISA)/%.isa : $(CUBIN)/%.cubin cuobjdump -sass $< > $@ # Define dependencies for count, hist, and sortcount : count.cu countgen.cu common.cuhist : histgen.cu histogram.cu common.cu params.cu \ hist1.cu hist2.cu hist3.cu hist3_64.cusort : common.cu params.cu sort.cu sortcommon.cu sortgen.cu \ sortgeneric.cu sortscan1.cu sortscan2.cu sortscan3.cu sortstore.cu # Build count cubins$(CUBIN)/count.cubin : count nvcc $(NVCCFLAGS) -o $@ countgen.cu # Build hist cubins$(CUBIN)/hist_simple.cubin : hist nvcc $(NVCCFLAGS) -o $@ histgen.cu# Build sort cubins$(CUBIN)/sort_128_8_index_simple.cubin : sort nvcc $(SORTFLAGS) $(T128) $(INDEX) $(SIMPLE) -o $@ sortgen.cu $(CUBIN)/sort_128_8_key_simple.cubin : sort nvcc $(SORTFLAGS) $(T128) $(KEY) $(SIMPLE) -o $@ sortgen.cu $(CUBIN)/sort_128_8_single_simple.cubin : sort nvcc $(SORTFLAGS) $(T128) $(SINGLE) $(SIMPLE) -o $@ sortgen.cu $(CUBIN)/sort_128_8_multi_simple.cubin : sort nvcc $(SORTFLAGS) $(T128) $(MULTI) $(SIMPLE) -o $@ sortgen.cu $(CUBIN)/sort_256_8_index_simple.cubin : sort nvcc $(SORTFLAGS) $(T256) $(INDEX) $(SIMPLE) -o $@ sortgen.cu $(CUBIN)/sort_256_8_key_simple.cubin : sort nvcc $(SORTFLAGS) $(T256) $(KEY) $(SIMPLE) -o $@ sortgen.cu $(CUBIN)/sort_256_8_single_simple.cubin : sort nvcc $(SORTFLAGS) $(T256) $(SINGLE) $(SIMPLE) -o $@ sortgen.cu $(CUBIN)/sort_256_8_multi_simple.cubin : sort nvcc $(SORTFLAGS) $(T256) $(MULTI) $(SIMPLE) -o $@ sortgen.cu