Created
July 22, 2025 18:54
-
-
Save thataustin/24c9eb9bb8715bae082627e1260c7db6 to your computer and use it in GitHub Desktop.
Example CUDA Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name of your CUDA source file (without extension) | |
TARGET=my_cuda_program | |
SRC=$(TARGET).cu | |
# Output binary name | |
OUT=$(TARGET).out | |
# Supported GPU architectures | |
ARCHS=70 75 80 86 89 90 | |
# Build target | |
all: | |
nvcc -o $(OUT) $(SRC) $(foreach arch,$(ARCHS),-gencode arch=compute_$(arch),code=sm_$(arch)) | |
clean: | |
rm -f $(OUT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment