From cfce3890102a0f94306cab763fd48bebd03830ff Mon Sep 17 00:00:00 2001 From: Ethan Stewart Date: Mon, 14 Oct 2024 14:51:41 -0500 Subject: [PATCH] Use common makefile for openmpapps INSTALLED_GPU and AOMP are now calculated in the base Makefile.defs. Removed usage of deprecated mygpu. --- MI-Teams/src/Makefile | 20 +++----------------- MI-Teams/src/Makefile-Team2par | 20 +++----------------- MI-Teams/src/Makefile-Team2par-lock | 20 +++----------------- MI-Teams/src/Makefile-exp1 | 20 +++----------------- MI-Teams/src/Makefile-exp2 | 20 +++----------------- bigloopC/src/Makefile | 20 +++----------------- comd-mp4/src-omp/Makefile | 20 +++----------------- hpgmg-mp4/Makefile | 20 +++----------------- lulesh-mp4/Makefile | 20 +++----------------- matmul-weights/src/Makefile | 20 +++----------------- matmul/src/Makefile | 20 +++----------------- matmul_Mthreads/src/Makefile | 20 +++----------------- matmul_devices/src/Makefile | 20 +++----------------- matmul_usm/src/Makefile | 20 +++----------------- snap-mp4/src/Makefile | 20 +++----------------- xsbench-mp4/src/Makefile | 20 +++----------------- 16 files changed, 48 insertions(+), 272 deletions(-) diff --git a/MI-Teams/src/Makefile b/MI-Teams/src/Makefile index 08b624a..95ce814 100644 --- a/MI-Teams/src/Makefile +++ b/MI-Teams/src/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/MI-Teams/src/Makefile-Team2par b/MI-Teams/src/Makefile-Team2par index bd335f3..d0e706e 100644 --- a/MI-Teams/src/Makefile-Team2par +++ b/MI-Teams/src/Makefile-Team2par @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/MI-Teams/src/Makefile-Team2par-lock b/MI-Teams/src/Makefile-Team2par-lock index 5c4bda4..4ea6515 100644 --- a/MI-Teams/src/Makefile-Team2par-lock +++ b/MI-Teams/src/Makefile-Team2par-lock @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/MI-Teams/src/Makefile-exp1 b/MI-Teams/src/Makefile-exp1 index f84f179..15b3392 100644 --- a/MI-Teams/src/Makefile-exp1 +++ b/MI-Teams/src/Makefile-exp1 @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/MI-Teams/src/Makefile-exp2 b/MI-Teams/src/Makefile-exp2 index 8fa5a44..1c161a4 100644 --- a/MI-Teams/src/Makefile-exp2 +++ b/MI-Teams/src/Makefile-exp2 @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/bigloopC/src/Makefile b/bigloopC/src/Makefile index 7838a64..72813ff 100644 --- a/bigloopC/src/Makefile +++ b/bigloopC/src/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/comd-mp4/src-omp/Makefile b/comd-mp4/src-omp/Makefile index 64ca896..b651c59 100644 --- a/comd-mp4/src-omp/Makefile +++ b/comd-mp4/src-omp/Makefile @@ -1,5 +1,8 @@ # Makefile for src-openmp +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + SHELL = /bin/bash host_debug_flag ?= @@ -11,23 +14,6 @@ DOUBLE_PRECISION = ON # MPI for parallel (ON/OFF) DO_MPI = OFF -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/hpgmg-mp4/Makefile b/hpgmg-mp4/Makefile index d26882a..d657835 100644 --- a/hpgmg-mp4/Makefile +++ b/hpgmg-mp4/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../Makefile.defs + HPGMG_ARCH := $(if $(PETSC_ARCH),$(PETSC_ARCH),build) host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa ifeq (sm_,$(findstring sm_,$(AOMP_GPU))) diff --git a/lulesh-mp4/Makefile b/lulesh-mp4/Makefile index 64536e3..754865b 100644 --- a/lulesh-mp4/Makefile +++ b/lulesh-mp4/Makefile @@ -1,28 +1,14 @@ # Default build suggestion of MPI + OPENMP with Clang on IBM (Power 8) + NVIDIA GPU machines. # You might have to change the compiler name and flags. +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../Makefile.defs + SHELL = /bin/sh .SUFFIXES: .cc .o host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/matmul-weights/src/Makefile b/matmul-weights/src/Makefile index 38a7617..c48eddd 100644 --- a/matmul-weights/src/Makefile +++ b/matmul-weights/src/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/matmul/src/Makefile b/matmul/src/Makefile index 38a7617..c48eddd 100644 --- a/matmul/src/Makefile +++ b/matmul/src/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/matmul_Mthreads/src/Makefile b/matmul_Mthreads/src/Makefile index e6e0c7e..be980dc 100644 --- a/matmul_Mthreads/src/Makefile +++ b/matmul_Mthreads/src/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/matmul_devices/src/Makefile b/matmul_devices/src/Makefile index 86c99a5..59a7cf0 100644 --- a/matmul_devices/src/Makefile +++ b/matmul_devices/src/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/matmul_usm/src/Makefile b/matmul_usm/src/Makefile index f681093..5036137 100644 --- a/matmul_usm/src/Makefile +++ b/matmul_usm/src/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/snap-mp4/src/Makefile b/snap-mp4/src/Makefile index 93fa8d9..ff3dcb7 100644 --- a/snap-mp4/src/Makefile +++ b/snap-mp4/src/Makefile @@ -1,24 +1,10 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + MP4BUILD = 1 #host_debug_flag = -g host_debug_flag ?= -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- -INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" diff --git a/xsbench-mp4/src/Makefile b/xsbench-mp4/src/Makefile index d2f8d72..7ef963f 100644 --- a/xsbench-mp4/src/Makefile +++ b/xsbench-mp4/src/Makefile @@ -1,3 +1,6 @@ +mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(mkfile_dir)../../Makefile.defs + #=============================================================================== # User Options #=============================================================================== @@ -54,23 +57,6 @@ endif # Default is Radeon vega/gfx900, for nvidia "export AOMP_GPU=sm_35" ifeq ($(COMPILER),aomp) -# --- Standard Makefile check for AOMP installation --- -ifeq ("$(wildcard $(AOMP))","") - ifneq ($(AOMP),) - $(warning AOMP not found at $(AOMP)) - endif - AOMP = $(HOME)/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - AOMP = /opt/rocm/aomp - ifeq ("$(wildcard $(AOMP))","") - $(warning AOMP not found at $(AOMP)) - $(error Please install AOMP or correctly set env-var AOMP) - endif - endif -endif -# --- End Standard Makefile check for AOMP installation --- - INSTALLED_GPU = $(shell $(AOMP)/bin/mygpu -d gfx900) AOMP_GPU ?= $(INSTALLED_GPU) AOMP_GPUTARGET = amdgcn-amd-amdhsa ifeq (sm_,$(findstring sm_,$(AOMP_GPU)))