a | b | |
---|
| 0 | + | |
---|
| 0 | + | # Rules for generating all the kernels of these types. |
---|
| 0 | + | .PHONY: counts |
---|
| 0 | + | .PHONY: hists |
---|
| 0 | + | .PHONY: sorts |
---|
| 0 | + | .PHONY: counts64 |
---|
| 0 | + | .PHONY: hists64 |
---|
| 0 | + | .PHONY: sorts64 |
---|
| 0 | + | |
---|
| 0 | + | # Rules for detecting changes in .cu files effecting these kernels. |
---|
| 0 | + | .PHONY: count |
---|
| 0 | + | .PHONY: hist |
---|
| 0 | + | .PHONY: sort |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | # Relative paths |
---|
| 0 | + | # Note that the caller must define BITS |
---|
| 0 | + | ifeq ($(BITS), 64) |
---|
| 0 | + | CUBIN = ../cubin |
---|
| 0 | + | ISA = ../isa |
---|
| 0 | + | endif |
---|
| 0 | + | |
---|
| 0 | + | ifeq ($(BITS), 64) |
---|
| 0 | + | CUBIN ../cubin64 |
---|
| 0 | + | ISA = ../isa64 |
---|
| 0 | + | endif |
---|
| 0 | + | |
---|
| 0 | + | # Compiler options |
---|
| 0 | + | NVCCFLAGS = --cubin -Xptxas=-v -arch=compute_20 -code=sm_20 -m=$(BITS) |
---|
| 0 | + | |
---|
| 0 | + | T128 = -D NUM_THREADS=128 |
---|
| 0 | + | T256 = -D NUM_THREADS=256 |
---|
| 0 | + | |
---|
| 0 | + | INDEX = -D VALUE_TYPE_INDEX |
---|
| 0 | + | KEY = -D VALUE_TYPE_NONE |
---|
| 0 | + | SINGLE = -D VALUE_TYPE_SINGLE |
---|
| 0 | + | MULTI = -D VALUE_TYPE_MULTI |
---|
| 0 | + | |
---|
| 0 | + | LIST = -D SCATTER_TRANSACTION_LIST |
---|
| 0 | + | SIMPLE = -D SCATTER_SIMPLE |
---|
| 0 | + | |
---|
| 0 | + | SORTFLAGS = $(NVCCFLAGS) -D VALUES_PER_THREAD=8 |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | # Generate all kernels. |
---|
| 0 | + | all : \ |
---|
| 0 | + | sorts hists counts |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | # Generate all .isa files |
---|
| 0 | + | counts : \ |
---|
| 0 | + | $(ISA)/count.isa |
---|
| 0 | + | |
---|
| 0 | + | hists : \ |
---|
| 0 | + | $(ISA)/hist_simple.isa |
---|
| 0 | + | |
---|
| 0 | + | sorts : \ |
---|
| 0 | + | $(ISA)/sort_128_8_index_simple.isa \ |
---|
| 0 | + | $(ISA)/sort_128_8_key_simple.isa \ |
---|
| 0 | + | $(ISA)/sort_128_8_single_simple.isa \ |
---|
| 0 | + | $(ISA)/sort_128_8_multi_simple.isa \ |
---|
| 0 | + | $(ISA)/sort_256_8_index_simple.isa \ |
---|
| 0 | + | $(ISA)/sort_256_8_key_simple.isa \ |
---|
| 0 | + | $(ISA)/sort_256_8_single_simple.isa \ |
---|
| 0 | + | $(ISA)/sort_256_8_multi_simple.isa |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | # Generate all .isa files from a pattern with cuobjdump. |
---|
| 0 | + | $(ISA)/%.isa : $(CUBIN)/%.cubin |
---|
| 0 | + | cuobjdump -sass $< > $@ |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | # Define dependencies for count, hist, and sort |
---|
| 0 | + | count : count.cu countgen.cu common.cu |
---|
| 0 | + | hist : histgen.cu histogram.cu common.cu params.cu \ |
---|
| 0 | + | hist1.cu hist2.cu hist3.cu hist3_64.cu |
---|
| 0 | + | sort : common.cu params.cu sort.cu sortcommon.cu sortgen.cu \ |
---|
| 0 | + | sortgeneric.cu sortscan1.cu sortscan2.cu sortscan3.cu sortstore.cu |
---|
| 0 | + | |
---|
| 0 | + | |
---|
| 0 | + | # Build count cubins |
---|
| 0 | + | $(CUBIN)/count.cubin : count |
---|
| 0 | + | nvcc $(NVCCFLAGS) -o $@ countgen.cu |
---|
| 0 | + | |
---|
| 0 | + | # Build hist cubins |
---|
| 0 | + | $(CUBIN)/hist_simple.cubin : hist |
---|
| 0 | + | nvcc $(NVCCFLAGS) -o $@ histgen.cu |
---|
| 0 | + | |
---|
| 0 | + | # Build sort cubins |
---|
| 0 | + | $(CUBIN)/sort_128_8_index_simple.cubin : sort |
---|
| 0 | + | nvcc $(SORTFLAGS) $(T128) $(INDEX) $(SIMPLE) -o $@ sortgen.cu |
---|
| 0 | + | |
---|
| 0 | + | $(CUBIN)/sort_128_8_key_simple.cubin : sort |
---|
| 0 | + | nvcc $(SORTFLAGS) $(T128) $(KEY) $(SIMPLE) -o $@ sortgen.cu |
---|
| 0 | + | |
---|
| 0 | + | $(CUBIN)/sort_128_8_single_simple.cubin : sort |
---|
| 0 | + | nvcc $(SORTFLAGS) $(T128) $(SINGLE) $(SIMPLE) -o $@ sortgen.cu |
---|
| 0 | + | |
---|
| 0 | + | $(CUBIN)/sort_128_8_multi_simple.cubin : sort |
---|
| 0 | + | nvcc $(SORTFLAGS) $(T128) $(MULTI) $(SIMPLE) -o $@ sortgen.cu |
---|
| 0 | + | |
---|
| 0 | + | $(CUBIN)/sort_256_8_index_simple.cubin : sort |
---|
| 0 | + | nvcc $(SORTFLAGS) $(T256) $(INDEX) $(SIMPLE) -o $@ sortgen.cu |
---|
| 0 | + | |
---|
| 0 | + | $(CUBIN)/sort_256_8_key_simple.cubin : sort |
---|
| 0 | + | nvcc $(SORTFLAGS) $(T256) $(KEY) $(SIMPLE) -o $@ sortgen.cu |
---|
| 0 | + | |
---|
| 0 | + | $(CUBIN)/sort_256_8_single_simple.cubin : sort |
---|
| 0 | + | nvcc $(SORTFLAGS) $(T256) $(SINGLE) $(SIMPLE) -o $@ sortgen.cu |
---|
| 0 | + | |
---|
| 0 | + | $(CUBIN)/sort_256_8_multi_simple.cubin : sort |
---|
| 0 | + | nvcc $(SORTFLAGS) $(T256) $(MULTI) $(SIMPLE) -o $@ sortgen.cu |
---|
| 0 | + | |
---|
... | |
---|