diff --git a/sample/c++/Nbody/Makefile b/sample/c++/Nbody/Makefile index e48c738..c8ee750 100644 --- a/sample/c++/Nbody/Makefile +++ b/sample/c++/Nbody/Makefile @@ -13,16 +13,19 @@ SRC=nbody.cpp ifeq ($(use_avx2),yes) CONVERSION_TYPE=AVX2 CCFLAGS += -mavx2 -mfma -ffast-math +HED = kernel.hpp endif ifeq ($(use_avx512),yes) CONVERSION_TYPE=AVX-512 CCFLAGS += -mavx512f -mavx512dq -ffast-math +HED = kernel.hpp endif ifeq ($(use_arm_sve),yes) CONVERSION_TYPE=A64FX CCFLAGS += -Kfast +HED = kernel.hpp endif ifeq ($(use_cuda),yes) @@ -34,6 +37,10 @@ CCFLAGS+= -DUSE_CUDA_KERNEL NVCCFLAGS= $(CCFLAGS) endif +ifeq ($(CONVERSION_TYPE),reference) +HED = kernel.hpp +endif + all: nbody.out kernel.cu: kernel.pikg $(PIKG) $(PIKG_OPTION) --output $@ -i $< @@ -41,8 +48,8 @@ kernel.o: kernel.cu $(NVCC) $(NVCCFLAGS) $< -c -o $@ kernel.hpp: kernel.pikg $(PIKG) $(PIKG_OPTION) --output $@ -i $< -nbody.out: $(SRC) - $(CC) $(CCFLAGS) $^ -o $@ +nbody.out: $(SRC) $(HED) + $(CC) $(CCFLAGS) $(SRC) -o $@ test: nbody.out ./nbody.out clean: