Skip to content
hellopatrick  /   cuda-samples  /  
Clear Command Palette
Tip: Type # to search pull requests
Type ? for help and tips
Tip: Type # to search issues
Type ? for help and tips
Tip: Type # to search discussions
Type ? for help and tips
Tip: Type ! to search projects
Type ? for help and tips
Tip: Type @ to search teams
Type ? for help and tips
Tip: Type @ to search people and organizations
Type ? for help and tips
Tip: Type > to activate command mode
Type ? for help and tips
Tip: Go to your accessibility settings to change your keyboard shortcuts
Type ? for help and tips
Tip: Type author:@me to search your content
Type ? for help and tips
Tip: Type is:pr to filter to pull requests
Type ? for help and tips
Tip: Type is:issue to filter to issues
Type ? for help and tips
Tip: Type is:project to filter to projects
Type ? for help and tips
Tip: Type is:open to filter to open content
Type ? for help and tips
We’ve encountered an error and some results aren't available at this time. Type a new search or try again later.
No results matched your search
Search for issues and pull requests # Search for issues, pull requests, discussions, and projects # Search for organizations, repositories, and users @ Search for projects ! Search for files / Activate command mode > Search your issues, pull requests, and discussions # author:@me Search your issues, pull requests, and discussions # author:@me Filter to pull requests # is:pr Filter to issues # is:issue Filter to discussions # is:discussion Filter to projects # is:project Filter to open issues, pull requests, and discussions # is:open
This repository has been archived by the owner. It is now read-only.
/ cuda-samples Public archive
  • Watch 1

    Notifications

Open in github.dev Open in a new github.dev tab
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
39 lines (26 sloc) 891 Bytes
PROJECT_NAME = game_of_life
# NVCC is path to nvcc. Here it is assumed /usr/local/cuda is on one's PATH.
# CC is the compiler for C++ host code.
NVCC = nvcc
CC = clang
CUDAPATH = /usr/local/cuda
BUILD_DIR = build
# note that nvcc defaults to 32-bit architecture. thus, force C/LFLAGS to comply.
# you could also force nvcc to compile 64-bit with -m64 flag. (and remove -m32 instances)
CFLAGS = -c -m32 -I$(CUDAPATH)/include
NVCCFLAGS = -c -I$(CUDAPATH)/include
# this is mac only. only linux system, remove -Xlinker and add in -lGL -lGLUT?
LFLAGS = -m32 -L$(CUDAPATH)/lib -lcuda -lcudart -lm -Xlinker -framework,OpenGL,-framework,GLUT
all: build clean
build: build_dir gpu cpu
$(NVCC) $(LFLAGS) -o $(BUILD_DIR)/$(PROJECT_NAME) *.o
build_dir:
mkdir -p $(BUILD_DIR)
gpu:
$(NVCC) $(NVCCFLAGS) *.cu
cpu:
$(CC) $(CFLAGS) *.c
clean:
rm *.o
run:
./$(BUILD_DIR)/$(PROJECT_NAME)