Skip to content

Commit

Permalink
Merge pull request #37 from satyanveshd/satyanveshd/HIP_PATH
Browse files Browse the repository at this point in the history
SWDEV-385161 - Remove env vars such as HIP_PATH, HSA_PATH etc.
  • Loading branch information
satyanveshd committed Jul 7, 2023
2 parents 1144662 + 38d5365 commit ff81239
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 150 deletions.
9 changes: 1 addition & 8 deletions HIP-Examples-Applications/BinomialOption/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

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

TARGET=hcc

SOURCES = BinomialOption.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

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

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

TARGET=hcc

SOURCES = BitonicSort.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

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

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

TARGET=hcc

SOURCES = FastWalshTransform.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

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

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

TARGET=hcc

SOURCES = FloydWarshall.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ 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,12 +1,6 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

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

TARGET=hcc

SOURCES = HelloWorld.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

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

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

TARGET=hcc

SOURCES = Histogram.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -32,5 +26,4 @@ test: $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

rm -f $(HIP_PATH)src/*.o
9 changes: 1 addition & 8 deletions HIP-Examples-Applications/MatrixMultiplication/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif

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

TARGET=hcc

SOURCES = MatrixMultiplication.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

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

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

TARGET=hcc

SOURCES = PrefixSum.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

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

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

TARGET=hcc

SOURCES = RecursiveGaussian.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ clean:
rm -f $(EXECUTABLE)
rm -f $(OBJECTS)
rm -f $(HIP_PATH)/src/*.o

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

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

TARGET=hcc

SOURCES = SimpleConvolution.cpp
OBJECTS = $(SOURCES:.cpp=.o)

Expand All @@ -33,4 +27,3 @@ 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: 2 additions & 4 deletions add4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ 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
HIP_PATH?= $(wildcard /opt/rocm)

HIPCC=$(HIP_PATH)/bin/hipcc

hip-stream.o : hip-stream.cpp
Expand Down
6 changes: 3 additions & 3 deletions common/hip.prologue.make
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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
# HIP_PATH should be relevant to the parent makefile
#
# It should not include any concrete makefile steps, so "make" still runs the first step in the Makefile.
#
Expand Down Expand Up @@ -61,7 +61,7 @@ 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_SOURCES = $(HIP_PATH)/src/hip_hcc.cpp
#HIP_DEPS = $(HIP_SOURCES:.cpp=.o)
#$(HIP_DEPS): HIPCC_FLAGS += -I$(HSA_PATH)/include
%.o:: %.cpp
Expand All @@ -85,7 +85,7 @@ endif
# $(HIPIFY) $< > $@


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

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

HIPCC=$(HIP_PATH)/bin/hipcc

CXXFLAGS += -std=c++11 -O3
Expand Down
10 changes: 4 additions & 6 deletions gpu-burn/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif

HIP_PATH?= $(wildcard /opt/rocm)

HIP_PLATFORM = $(shell $(HIP_PATH)/bin/hipconfig --platform)

HIP_INCLUDE = -I${HIP_PATH}/../include

BUILD_DIR ?= build

HIPCC = ${HIP_PATH}/bin/hipcc
HIPCC = $(HIP_PATH)/bin/hipcc
CPPFLAGS = -O3
LDFLAGS = -lm -lpthread

Expand Down
7 changes: 2 additions & 5 deletions openmp-helloworld/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif

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

CXX=$(HIPCC)
CXXFLAGS =-fopenmp

Expand Down
6 changes: 1 addition & 5 deletions reduction/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif
HIP_PATH?= $(wildcard /opt/rocm)
HIPCC=$(HIP_PATH)/bin/hipcc

CXXFLAGS += -std=c++11 -O3
Expand All @@ -17,4 +14,3 @@ endif

clean:
rm -f reduction *.o

6 changes: 1 addition & 5 deletions rtm8/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif
HIP_PATH?= $(wildcard /opt/rocm)
HIPCC=$(HIP_PATH)/bin/hipcc

CXXFLAGS += -std=c++11 -O3
Expand All @@ -17,4 +14,3 @@ endif

clean:
rm -f rtm8 *.o

4 changes: 1 addition & 3 deletions rtm8/build_hip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ else
HIP_PATH=/opt/rocm
fi

fi

echo "Using HIP_PATH=$HIP_PATH"
fi

if [ -f "rtm8_hip" ]
then
Expand Down
6 changes: 1 addition & 5 deletions strided-access/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif
HIP_PATH?= $(wildcard /opt/rocm)
HIPCC=$(HIP_PATH)/bin/hipcc

CXXFLAGS += -std=c++11 -O3
Expand All @@ -17,4 +14,3 @@ endif

clean:
rm -f strided-access *.o

10 changes: 1 addition & 9 deletions vectorAdd/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=/opt/rocm
endif

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

TARGET=hcc

SOURCES = vectoradd_hip.cpp
OBJECTS = $(SOURCES:.cpp=.o)

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


0 comments on commit ff81239

Please sign in to comment.