Skip to content
Snippets Groups Projects

Add hello --> world example

Merged Andreas Herten requested to merge ah-gpu-hello-world into main
11 files
+ 142
0
Compare changes
  • Side-by-side
  • Inline
Files
11
+ 28
0
CUCOMP = nvcc
CUFLAGS = -arch=sm_80
ifdef EBROOTOPENMPI
MPI_HOME+=$(EBROOTOPENMPI)
endif
ifdef EBROOTPSMPI
MPI_HOME+=$(EBROOTPSMPI)
endif
INCLUDES = -I$(MPI_HOME)/include
LIBRARIES = -L$(MPI_HOME)/lib -lmpi
all: hello.cpu.out hello.gpu.out
hello.cpu.out: hello-world.c
mpicc $< -o $@
hello.gpu.out: hello.gpu.o
$(CUCOMP) $(CUFLAGS) $(LIBRARIES) $< -o $@
hello.gpu.o: hello-world.cu
$(CUCOMP) $(CUFLAGS) $(INCLUDES) -c $< -o $@
.PHONY: clean
clean:
rm -f hello.cpu.out hello.gpu.out *.o
\ No newline at end of file
Loading