Commit 559d96a3 authored by incardon's avatar incardon

Adding examples files

parent f3ea76d9
include ../../example.mk
CC=mpic++
LDIR =
OBJ = main.o
%.o: %.cpp
$(CC) -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
gray_scott_sparse_cs: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
all: gray_scott_sparse_cs
run: all
mpirun -np 4 ./gray_scott_sparse_cs
.PHONY: clean all run
clean:
rm -f *.o *~ core gray_scott_sparse_cs
This diff is collapsed.
include ../../example.mk
### internally the example disable with the preprocessor its code if not compiled with nvcc
CUDA_CC=
CUDA_CC_LINK=
ifeq (, $(shell which nvcc))
CUDA_CC=mpic++ -x c++ $(INCLUDE_PATH)
INCLUDE_PATH_NVCC=
CUDA_CC_LINK=mpic++
else
CUDA_CC=nvcc -ccbin=mpic++
CUDA_CC_LINK=nvcc -ccbin=mpic++
endif
CC=mpic++
LDIR =
OBJ = main.o
%.o: %.cu
$(CUDA_CC) -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
gray_scott_sparse_gpu: $(OBJ)
$(CUDA_CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
all: gray_scott_sparse_gpu
run: all
mpirun -np 4 ./gray_scott_sparse_gpu
.PHONY: clean all run
clean:
rm -f *.o *~ core gray_scott_sparse_gpu
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment