Skip to content

Commit

Permalink
Improved formatting of Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
kerrmudgeon committed Dec 5, 2017
1 parent d08ba8a commit 4276e46
Showing 1 changed file with 8 additions and 49 deletions.
57 changes: 8 additions & 49 deletions cutlass_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ else
TRANSPOSE := nn
endif

ifdef deepbench
BENCHMARK_DEEPBENCH := $(deepbench)
else
BENCHMARK_DEEPBENCH := 0
endif

# If defined, GEMMs only compiled with specified alignment restrictions on A and B
# matrices. Otherwise, kernels are compiled for all feasible alignment options, and
# the appropriate kernel is selected.
Expand All @@ -70,14 +64,12 @@ INC += -I$(BASE_DIR)

LIBS += -lcublas


#-------------------------------------------------------------------------------
# Preprocessor definitions
#-------------------------------------------------------------------------------

ifeq (nt, $(TRANSPOSE))
DEFINES += -DTRANSPOSE_B

else ifeq (tn, $(TRANSPOSE))
DEFINES += -DTRANSPOSE_A

Expand All @@ -93,17 +85,16 @@ NVCCFLAGS += -std=c++11
# Dependency Lists
#-------------------------------------------------------------------------------

DEPS := $(call rwildcard, $(BASE_DIR),*.h) \
$(call rwildcard, $(BASE_DIR)cgl,*.h) \
$(BASE_DIR)common.mk \
$(TEST_DIR)Makefile

DEPS := $(call rwildcard, $(BASE_DIR),*.h) \
$(call rwildcard, $(BASE_DIR)cgl,*.h) \
$(BASE_DIR)common.mk \
$(TEST_DIR)Makefile

ALL := sgemm \
dgemm \
hgemm \
igemm

ALL := sgemm \
dgemm \
hgemm \
igemm


#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -135,50 +126,30 @@ all : $(ALL)

sgemm: bin/sgemm_$(TRANSPOSE)_$(BIN_SUFFIX)

sgemm_testbench: bin/sgemm_testbench_$(BIN_SUFFIX)

bin/sgemm_$(TRANSPOSE)_$(BIN_SUFFIX) : gemm.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_SGEMM $(DEFINES) $(SM_TARGETS) -o $@ gemm.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)

bin/sgemm_testbench_$(BIN_SUFFIX) : gemm_testbench.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_SGEMM $(DEFINES) $(SM_TARGETS) -D BENCHMARK_DEEPBENCH=$(BENCHMARK_DEEPBENCH) -o $@ gemm_testbench.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)


#-------------------------------------------------------------------------------
# make dgemm
#-------------------------------------------------------------------------------

dgemm: bin/dgemm_$(TRANSPOSE)_$(BIN_SUFFIX)

dgemm_testbench: bin/dgemm_testbench_$(BIN_SUFFIX)

bin/dgemm_$(TRANSPOSE)_$(BIN_SUFFIX) : gemm.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_DGEMM $(DEFINES) $(SM_TARGETS) -o $@ gemm.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)

bin/dgemm_testbench_$(BIN_SUFFIX) : gemm_testbench.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_DGEMM $(DEFINES) $(SM_TARGETS) -D BENCHMARK_DEEPBENCH=$(BENCHMARK_DEEPBENCH) -o $@ gemm_testbench.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)


#-------------------------------------------------------------------------------
# make hgemm
#-------------------------------------------------------------------------------

hgemm: bin/hgemm_$(TRANSPOSE)_$(BIN_SUFFIX)

hgemm_testbench: bin/hgemm_testbench_$(BIN_SUFFIX)

bin/hgemm_$(TRANSPOSE)_$(BIN_SUFFIX) : gemm.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_HGEMM $(DEFINES) $(SM_TARGETS) -o $@ gemm.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)

bin/hgemm_testbench_$(BIN_SUFFIX) : gemm_testbench.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_HGEMM $(DEFINES) $(SM_TARGETS) -D BENCHMARK_DEEPBENCH=$(BENCHMARK_DEEPBENCH) -o $@ gemm_testbench.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)

#-------------------------------------------------------------------------------
# make igemm
#-------------------------------------------------------------------------------
Expand All @@ -189,25 +160,13 @@ bin/igemm_$(TRANSPOSE)_$(BIN_SUFFIX) : gemm.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_IGEMM $(DEFINES) $(SM_TARGETS) -o $@ gemm.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)

igemm_testbench: bin/igemm_testbench_$(BIN_SUFFIX)

bin/igemm_testbench_$(BIN_SUFFIX) : gemm_testbench.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_IGEMM $(DEFINES) $(SM_TARGETS) -D BENCHMARK_DEEPBENCH=$(BENCHMARK_DEEPBENCH) -o $@ gemm_testbench.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)


#-------------------------------------------------------------------------------
# make wgemm
#-------------------------------------------------------------------------------

wgemm: bin/wgemm_$(TRANSPOSE)_$(BIN_SUFFIX)

wgemm_testbench: bin/wgemm_testbench_$(BIN_SUFFIX)

bin/wgemm_$(TRANSPOSE)_$(BIN_SUFFIX) : gemm.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_WGEMM -DWMMA $(DEFINES) $(SM_TARGETS) -o $@ gemm.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)

bin/wgemm_testbench_$(BIN_SUFFIX) : gemm_testbench.cu $(DEPS)
mkdir -p bin
$(NVCC) -DTEST_WGEMM -DWMMA $(DEFINES) $(SM_TARGETS) -D BENCHMARK_DEEPBENCH=$(BENCHMARK_DEEPBENCH) -o $@ gemm_testbench.cu $(NVCCFLAGS) $(CPU_ARCH) $(INC) $(LIBINC) $(LIBS)

0 comments on commit 4276e46

Please sign in to comment.