Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
SWDEV-385161 - Remove env vars such as HIP_PATH, HSA_PATH etc
Browse files Browse the repository at this point in the history
  • Loading branch information
satyanveshd committed Mar 8, 2023
1 parent f90e791 commit 11372c9
Show file tree
Hide file tree
Showing 26 changed files with 33 additions and 241 deletions.
11 changes: 1 addition & 10 deletions HIP-Examples-Applications/BinomialOption/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = BinomialOption.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/BitonicSort/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = BitonicSort.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/FastWalshTransform/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = FastWalshTransform.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/FloydWarshall/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = FloydWarshall.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

9 changes: 1 addition & 8 deletions HIP-Examples-Applications/HelloWorld/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc
HIPCC=/opt/rocm/bin/hipcc

TARGET=hcc

Expand Down Expand Up @@ -32,5 +27,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/Histogram/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = Histogram.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/MatrixMultiplication/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = MatrixMultiplication.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/PrefixSum/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = PrefixSum.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/RecursiveGaussian/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = RecursiveGaussian.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/SimpleConvolution/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = SimpleConvolution.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/dct/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = dct.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

11 changes: 1 addition & 10 deletions HIP-Examples-Applications/dwtHaar1D/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

HIPCC=$(HIP_PATH)/bin/hipcc

TARGET=hcc
HIPCC=/opt/rocm/bin/hipcc

SOURCES = dwtHaar1D.cpp
OBJECTS = $(SOURCES:.cpp=.o)
Expand All @@ -32,5 +25,3 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

6 changes: 1 addition & 5 deletions add4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ all: gpu-stream-hip

common.o: common.cpp common.h Makefile

HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif
HIPCC=$(HIP_PATH)/bin/hipcc
HIPCC=/opt/rocm/bin/hipcc

hip-stream.o : hip-stream.cpp
$(HIPCC) $(CXXFLAGS) -c $< -o $@
Expand Down
4 changes: 2 additions & 2 deletions common/hip.all.make
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include $(HIP_PATH)/examples/common/hip.prologue.make
include $(HIP_PATH)/examples/common/hip.epilogue.make
include /opt/rocm/hip/examples/common/hip.prologue.make
include /opt/rocm/hip/examples/common/hip.epilogue.make
19 changes: 5 additions & 14 deletions common/hip.prologue.make
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# This file is designed to be included at beginning of Makefile, right after setting HIP_PATH.
# Note: define $HIP_PATH before including this file.
# HIP_PATH should be relevant to the parent makefile
# This file is designed to be included at beginning of Makefile.
#
# It should not include any concrete makefile steps, so "make" still runs the first step in the Makefile.
#

#------
##Provide default if not already set:
HIP_PATH?=../..
HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --compiler)
HIP_PLATFORM=$(shell /opt/rocm/bin/hipconfig --compiler)

# CUDA toolkit installation path
CUDA_DIR?=/usr/local/cuda-7.5
Expand All @@ -25,13 +22,11 @@ endif
# nvcc (7.5) can handle openmp though.
# use OMPCC and OMP_FLAGS

HIPCC=$(HIP_PATH)/bin/hipcc
HIPLD=$(HIP_PATH)/bin/hipcc
HIPCC=/opt/rocm/bin/hipcc
HIPLD=/opt/rocm/bin/hipcc

#--
# Set up automatic make of HIP cpp depenendencies
# TODO - this can be removed when HIP has a proper make structure.
#HIP_SOURCES = $(HIP_PATH)/src/hip_hcc.cpp

HIPCC_FLAGS += -I../../common
# 'make dbg=1' enables HIPCC debugging and no opt switch.
Expand All @@ -55,15 +50,11 @@ OMP_FLAGS = $(HIPCC_FLAGS)
HIP_DEPS =

else ifeq ($(HIP_PLATFORM), hcc)
#HIP_DEPS = $(HIP_SOURCES:.cpp=.o)
OMPCC = gcc
OMP_FLAGS += -fopenmp

# Add dependencies to make hip_cc.o and other support files.
HSA_PATH ?= /opt/hsa
#HIP_SOURCES = $(HIP_PATH)/src/hip_hcc.cpp
#HIP_DEPS = $(HIP_SOURCES:.cpp=.o)
#$(HIP_DEPS): HIPCC_FLAGS += -I$(HSA_PATH)/include
%.o:: %.cpp
$(HIPCC) $(HIPCC_FLAGS) $< -c -o $@
endif
Expand All @@ -85,7 +76,7 @@ endif
# $(HIPIFY) $< > $@


KCFLAGS += $(OPT) -I$(HSA_PATH)/include -I$(HIP_PATH)/include -I$(GRID_LAUNCH_PATH) -I$(AM_PATH)/include
KCFLAGS += $(OPT) -I/opt/rocm/include -I/opt/rocm/hip/include -I$(GRID_LAUNCH_PATH) -I$(AM_PATH)/include

%.o:: %.cpp
$(HIPCC) $(HIPCC_FLAGS) $< -c -o $@
Expand Down
6 changes: 1 addition & 5 deletions cuda-stream/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif
HIPCC=$(HIP_PATH)/bin/hipcc
HIPCC=/opt/rocm/bin/hipcc

CXXFLAGS += -std=c++11 -O3

Expand Down
13 changes: 3 additions & 10 deletions gpu-burn/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif


HCC_PATH ?= /opt/rocm/hcc
HIP_PLATFORM = $(shell $(HIP_PATH)/bin/hipconfig --platform)
HIP_INCLUDE = -I${HIP_PATH}/include -I${HCC_PATH}/include
HIP_PLATFORM = $(shell /opt/rocm/bin/hipconfig --platform)
HIP_INCLUDE = -I/opt/rocm/include
BUILD_DIR ?= build

HIPCC = ${HIP_PATH}/bin/hipcc
HIPCC = /opt/rocm/bin/hipcc
CPPFLAGS = -O3
LDFLAGS = -lm -lpthread

Expand Down
15 changes: 1 addition & 14 deletions mini-nbody/hip/HIP-nbody-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,8 @@ then
rm nbody-block
fi

if [ -z "$HIP_PATH" ]
then

if [ -d /opt/rocm/hip ]
then
HIP_PATH=/opt/rocm/hip
else
HIP_PATH=/opt/rocm
fi

fi

echo hipcc -I../ -DSHMOO nbody-block.cpp -o nbody-block
$HIP_PATH/bin/hipcc -I../ -DSHMOO nbody-block.cpp -o nbody-block
/opt/rocm/bin/hipcc -I../ -DSHMOO nbody-block.cpp -o nbody-block

#To print our more details, remove DSHMOO flag
#hipcc -I../ nbody-block.cpp -o nbody-block
Expand All @@ -37,4 +25,3 @@ do
./$EXE $K
K=$(($K*2))
done

15 changes: 1 addition & 14 deletions mini-nbody/hip/HIP-nbody-orig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,8 @@ then
rm nbody-orig
fi

if [ -z "$HIP_PATH" ]
then

if [ -d /opt/rocm/hip ]
then
HIP_PATH=/opt/rocm/hip
else
HIP_PATH=/opt/rocm
fi

fi

echo hipcc -I../ -DSHMOO nbody-orig.cpp -o nbody-orig
$HIP_PATH/bin/hipcc -I../ -DSHMOO nbody-orig.cpp -o nbody-orig
/opt/rocm/bin/hipcc -I../ -DSHMOO nbody-orig.cpp -o nbody-orig

#To print our more details, remove flag
#hipcc -I../ nbody-orig.cpp -o nbody-orig
Expand All @@ -35,4 +23,3 @@ do
./$EXE $K
K=$(($K*2))
done

Loading

0 comments on commit 11372c9

Please sign in to comment.