feat: add CUDA benchmark CLI and shared search algorithms

This commit is contained in:
Yaossg 2026-10-11 12:27:26 +08:00
parent b4d677e83b
commit 12e4266950
12 changed files with 846 additions and 2 deletions

21
bench/Makefile Normal file
View file

@ -0,0 +1,21 @@
NVCC ?= nvcc
CUDA_ARCH ?= 86
NVCCFLAGS ?= -O3 -std=c++17
TARGET := bin/slime-bench
HEADERS := ../include/slime/solver_core.hpp ../include/slime/upper_interval.hpp
.PHONY: all clean test test-gpu
all: $(TARGET)
$(TARGET): slime_bench.cu $(HEADERS) Makefile
mkdir -p bin
$(NVCC) $(NVCCFLAGS) -Xcompiler -pthread -gencode arch=compute_$(CUDA_ARCH),code=sm_$(CUDA_ARCH) -gencode arch=compute_$(CUDA_ARCH),code=compute_$(CUDA_ARCH) slime_bench.cu -o $@
bin/test-math: test_math.cu slime_bench.cu $(HEADERS) Makefile
mkdir -p bin
$(NVCC) $(NVCCFLAGS) -Xcompiler -pthread test_math.cu -o $@
test: $(TARGET) bin/test-math
bin/test-math
python3 test_cli.py
test-gpu: $(TARGET)
python3 test_cli.py --gpu
clean:
rm -f $(TARGET) bin/test-math