diff --git a/HIP-Examples-Applications/BinomialOption/Makefile b/HIP-Examples-Applications/BinomialOption/Makefile index 2f11d87..39097c5 100644 --- a/HIP-Examples-Applications/BinomialOption/Makefile +++ b/HIP-Examples-Applications/BinomialOption/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/BitonicSort/Makefile b/HIP-Examples-Applications/BitonicSort/Makefile index 6c62bad..3c73cca 100644 --- a/HIP-Examples-Applications/BitonicSort/Makefile +++ b/HIP-Examples-Applications/BitonicSort/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/FastWalshTransform/Makefile b/HIP-Examples-Applications/FastWalshTransform/Makefile index ee7c21a..2fa7613 100644 --- a/HIP-Examples-Applications/FastWalshTransform/Makefile +++ b/HIP-Examples-Applications/FastWalshTransform/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/FloydWarshall/Makefile b/HIP-Examples-Applications/FloydWarshall/Makefile index 30a5f98..e474103 100644 --- a/HIP-Examples-Applications/FloydWarshall/Makefile +++ b/HIP-Examples-Applications/FloydWarshall/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/HelloWorld/Makefile b/HIP-Examples-Applications/HelloWorld/Makefile index 216762a..860906c 100644 --- a/HIP-Examples-Applications/HelloWorld/Makefile +++ b/HIP-Examples-Applications/HelloWorld/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/Histogram/Makefile b/HIP-Examples-Applications/Histogram/Makefile index 836b6d0..9da8a88 100644 --- a/HIP-Examples-Applications/Histogram/Makefile +++ b/HIP-Examples-Applications/Histogram/Makefile @@ -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) @@ -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 diff --git a/HIP-Examples-Applications/MatrixMultiplication/Makefile b/HIP-Examples-Applications/MatrixMultiplication/Makefile index 8b89dd4..97001ce 100644 --- a/HIP-Examples-Applications/MatrixMultiplication/Makefile +++ b/HIP-Examples-Applications/MatrixMultiplication/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/PrefixSum/Makefile b/HIP-Examples-Applications/PrefixSum/Makefile index 2119cb5..52c0ead 100644 --- a/HIP-Examples-Applications/PrefixSum/Makefile +++ b/HIP-Examples-Applications/PrefixSum/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/RecursiveGaussian/Makefile b/HIP-Examples-Applications/RecursiveGaussian/Makefile index defa4c9..6513c7f 100644 --- a/HIP-Examples-Applications/RecursiveGaussian/Makefile +++ b/HIP-Examples-Applications/RecursiveGaussian/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/SimpleConvolution/Makefile b/HIP-Examples-Applications/SimpleConvolution/Makefile index b8099e7..a662187 100644 --- a/HIP-Examples-Applications/SimpleConvolution/Makefile +++ b/HIP-Examples-Applications/SimpleConvolution/Makefile @@ -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) @@ -33,4 +27,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/dct/Makefile b/HIP-Examples-Applications/dct/Makefile index 03a48a4..9375383 100644 --- a/HIP-Examples-Applications/dct/Makefile +++ b/HIP-Examples-Applications/dct/Makefile @@ -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) @@ -32,5 +25,3 @@ test: $(EXECUTABLE) clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) - rm -f $(HIP_PATH)/src/*.o - diff --git a/HIP-Examples-Applications/dwtHaar1D/Makefile b/HIP-Examples-Applications/dwtHaar1D/Makefile index b196ca3..c975a19 100644 --- a/HIP-Examples-Applications/dwtHaar1D/Makefile +++ b/HIP-Examples-Applications/dwtHaar1D/Makefile @@ -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) @@ -32,5 +25,3 @@ test: $(EXECUTABLE) clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) - rm -f $(HIP_PATH)/src/*.o - diff --git a/add4/Makefile b/add4/Makefile index a0c6826..c320316 100644 --- a/add4/Makefile +++ b/add4/Makefile @@ -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 diff --git a/common/hip.prologue.make b/common/hip.prologue.make index 2ce0db1..9718293 100644 --- a/common/hip.prologue.make +++ b/common/hip.prologue.make @@ -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. # @@ -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 @@ -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 $@ diff --git a/cuda-stream/Makefile b/cuda-stream/Makefile index fceec7d..dc8e0d7 100644 --- a/cuda-stream/Makefile +++ b/cuda-stream/Makefile @@ -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 diff --git a/gpu-burn/Makefile b/gpu-burn/Makefile index 1cdad3e..8f361eb 100644 --- a/gpu-burn/Makefile +++ b/gpu-burn/Makefile @@ -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 diff --git a/openmp-helloworld/Makefile b/openmp-helloworld/Makefile index f048d26..585fb00 100644 --- a/openmp-helloworld/Makefile +++ b/openmp-helloworld/Makefile @@ -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 diff --git a/reduction/Makefile b/reduction/Makefile index d040156..dad6ff1 100644 --- a/reduction/Makefile +++ b/reduction/Makefile @@ -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 @@ -17,4 +14,3 @@ endif clean: rm -f reduction *.o - diff --git a/rtm8/Makefile b/rtm8/Makefile index f0d89ab..a61fcba 100644 --- a/rtm8/Makefile +++ b/rtm8/Makefile @@ -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 @@ -17,4 +14,3 @@ endif clean: rm -f rtm8 *.o - diff --git a/rtm8/build_hip.sh b/rtm8/build_hip.sh index 4ccaa42..07b64ea 100755 --- a/rtm8/build_hip.sh +++ b/rtm8/build_hip.sh @@ -10,9 +10,7 @@ else HIP_PATH=/opt/rocm fi -fi - -echo "Using HIP_PATH=$HIP_PATH" +fi if [ -f "rtm8_hip" ] then diff --git a/strided-access/Makefile b/strided-access/Makefile index 46fe9b8..550e074 100644 --- a/strided-access/Makefile +++ b/strided-access/Makefile @@ -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 @@ -17,4 +14,3 @@ endif clean: rm -f strided-access *.o - diff --git a/vectorAdd/Makefile b/vectorAdd/Makefile index 9ec3970..a412c3d 100644 --- a/vectorAdd/Makefile +++ b/vectorAdd/Makefile @@ -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) @@ -34,5 +28,3 @@ clean: rm -f $(EXECUTABLE) rm -f $(OBJECTS) rm -f $(HIP_PATH)/src/*.o - -