Skip to content

Commit

Permalink
modify Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
subarutaro committed Dec 9, 2020
1 parent 2e8d8a9 commit fbbd8c5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sample/c++/Nbody/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -34,15 +37,19 @@ 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 $<
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:
Expand Down

0 comments on commit fbbd8c5

Please sign in to comment.