Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ CUDA app that uses various clever tricks to produce mushroom islands of adequate
- Change GPU target for PTX compilation
- `ARCH=native` is default for GPUs 30 series or older
- `ARCH=sm_89` is default for GPUs 40 series or newer
- CPU_ARCH
- Optional CPU architecture tuning for the GCC/Clang build path. The default
remains portable; use `CPU_ARCH=native` when the binary will run only on
the machine that builds it.
- Example usage
`make -B CPU_ARCH=native`
- PRINT_INTERVAL
- Change how often the program prints benchmarking info
- Default is 256, meaning every 256 iterations of the full GPU pipeline, it will print the table with stats.
Expand All @@ -60,3 +66,4 @@ CUDA app that uses various clever tricks to produce mushroom islands of adequate
- Example usage
`make -B LARGE_BIOMES=1` for large biomes
`make -B LARGE_BIOMES=0` for small biomes (default)

5 changes: 5 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ else
endif

PRINT_INTERVAL ?= 256
CPU_ARCH ?=
# Auto-detect GPU architecture:
# - RTX 40xx/50xx series: sm_89 is faster than native sm_120
# - Everything else: use native
Expand All @@ -31,6 +32,9 @@ endif

$(info Using ARCH = $(ARCH))
override CFLAGS += -O3
ifneq ($(strip $(CPU_ARCH)),)
override CFLAGS += -march=$(CPU_ARCH)
endif
override CXXFLAGS += -O3 -std=c++20 -I asio/asio/include -DOMISSION_LARGE_BIOMES=$(LARGE_BIOMES) -DOMISSION_UNBOUND=$(UNBOUND) -DPRINT_INTERVAL=$(PRINT_INTERVAL)
override NVCC_FLAGS += $(CXXFLAGS) --expt-relaxed-constexpr --default-stream per-thread -arch=$(ARCH) -use_fast_math

Expand Down Expand Up @@ -105,3 +109,4 @@ server.o: src/server.cpp src/server.h src/common.h
main: $(MAIN_DEP)
$(MAIN_CXX) $(MAIN_SRC) -o $@-$(BIN_SUFFIX) $(MAIN_CXXFLAGS)
endif

Loading