Sources: siboehm/SGEMM_CUDA → upstream_ref/sgemm_siboehm/ (25 files) wangzyon/NVIDIA_SGEMM_PRACTICE → upstream_ref/nvidia_sgemm_practice/ (23 files, filled gaps) edtallison/sgemm-cuda → upstream_ref/sgemm_edtallison/ (41 files) All files cat'd one by one from git clone (no --depth). These are the 3 public SGEMM repos that can compile on CUDA 10.2 + CoreX ivcore10. Key files for BI-V100 porting: kernel 10 (warp tiling) — already proven on device with WARPSIZE=64 kernel 11/12 (double buffering) — next optimization target sgemm.cu + runner.cu — complete build+benchmark harness CMakeLists.txt — build system reference
35 lines
933 B
Makefile
35 lines
933 B
Makefile
.PHONY: all build debug clean profile bench cuobjdump
|
|
|
|
CMAKE := cmake
|
|
|
|
BUILD_DIR := build
|
|
BENCHMARK_DIR := benchmark_results
|
|
|
|
all: build
|
|
|
|
build:
|
|
@mkdir -p $(BUILD_DIR)
|
|
@cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=Release ..
|
|
@$(MAKE) -C $(BUILD_DIR)
|
|
|
|
debug:
|
|
@mkdir -p $(BUILD_DIR)
|
|
@cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=Debug ..
|
|
@$(MAKE) -C $(BUILD_DIR)
|
|
|
|
clean:
|
|
@rm -rf $(BUILD_DIR)
|
|
|
|
FUNCTION := $$(cuobjdump -symbols build/sgemm | grep -i Warptiling | awk '{print $$NF}')
|
|
|
|
cuobjdump: build
|
|
@cuobjdump -arch sm_86 -sass -fun $(FUNCTION) build/sgemm | c++filt > build/cuobjdump.sass
|
|
@cuobjdump -arch sm_86 -ptx -fun $(FUNCTION) build/sgemm | c++filt > build/cuobjdump.ptx
|
|
|
|
# Usage: make profile KERNEL=<integer> PREFIX=<optional string>
|
|
profile: build
|
|
@ncu --set full --export $(BENCHMARK_DIR)/$(PREFIX)kernel_$(KERNEL) --force-overwrite $(BUILD_DIR)/sgemm $(KERNEL)
|
|
|
|
bench: build
|
|
@bash gen_benchmark_results.sh
|