Skip to content

Commit

Permalink
Merge pull request #187 from jeffhammond/ada-hopper-native
Browse files Browse the repository at this point in the history
Fortran: add Ada and Hopper, plus ccnative, to build system
  • Loading branch information
tomdeakin committed May 13, 2024
2 parents 85fe83a + 5f77650 commit 200f453
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/fortran/make.inc.nvhpc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ FC := nvfortran
#FCFLAGS := -O3 -Minform=inform -Minfo=all
FCFLAGS := -O3 -Minform=warn

#TARGET=gpu
TARGET=multicore
TARGET=gpu
#TARGET=multicore

NVARCH=$(shell which nvidia-smi > /dev/null && nvidia-smi -q | grep "Product Architecture")
ifeq ($(findstring Hopper,$(NVARCH)),Hopper)
$(info Hopper detected)
GPU = cc90
endif
ifeq ($(findstring Ada,$(NVARCH)),Ada)
$(info Ada detected)
GPU = cc89
endif
ifeq ($(findstring Ampere,$(NVARCH)),Ampere)
$(info Ampere detected)
GPU = cc80
Expand All @@ -29,7 +37,8 @@ ifeq ($(shell which jetson_clocks > /dev/null && echo 1),1)
#GPU = cc72
endif
ifeq ($(GPU),)
$(error Your GPU architecture could not be detected. Set it manually.)
$(info Your GPU architecture could not be detected.)
GPU = ccnative
endif
GPUFLAG = -gpu=$(GPU)

Expand Down

0 comments on commit 200f453

Please sign in to comment.