From bcaefb81fc682b8d3e2b124aa574b62d77d39230 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Mon, 18 Apr 2016 10:15:35 +0530 Subject: [PATCH] Fix makefiles in samples --- samples/0_Intro/bit_extract/Makefile | 5 ++++- samples/0_Intro/hcc_dialects/Makefile | 5 ++++- samples/0_Intro/square/Makefile | 5 ++++- samples/1_Utils/hipBusBandwidth/Makefile | 5 ++++- samples/1_Utils/hipDispatchLatency/Makefile | 5 ++++- samples/1_Utils/hipInfo/Makefile | 5 ++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/samples/0_Intro/bit_extract/Makefile b/samples/0_Intro/bit_extract/Makefile index b71828f5fa..a01f60646e 100644 --- a/samples/0_Intro/bit_extract/Makefile +++ b/samples/0_Intro/bit_extract/Makefile @@ -1,6 +1,9 @@ #Dependencies : [MYHIP]/bin must be in user's path. -HIP_PATH?=../../.. +HIP_PATH?= $(wildcard /opt/rocm/hip) +ifeq (,$(HIP_PATH)) + HIP_PATH=../../.. +endif HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --platform) HIPCC=$(HIP_PATH)/bin/hipcc diff --git a/samples/0_Intro/hcc_dialects/Makefile b/samples/0_Intro/hcc_dialects/Makefile index b6e5c10afc..fb8fcc0c32 100644 --- a/samples/0_Intro/hcc_dialects/Makefile +++ b/samples/0_Intro/hcc_dialects/Makefile @@ -7,7 +7,10 @@ HCC_LDFLAGS= `$(HCC_HOME)/bin/hcc-config --ldflags` CPPAMP_CFLAGS= -std=c++amp -stdlib=libc++ -I$(HCC_HOME)/include CPPAMP_LDFLAGS= -std=c++amp -L$(HCC_HOME)/lib -Wl,--rpath=$(HCC_HOME)/lib -lc++ -lc++abi -ldl -lpthread -Wl,--whole-archive -lmcwamp -Wl,--no-whole-archive -HIP_PATH?=/opt/rocm/hip +HIP_PATH?= $(wildcard /opt/rocm/hip) +ifeq (,$(HIP_PATH)) + HIP_PATH=../../.. +endif HIPCC=$(HIP_PATH)/bin/hipcc HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --platform) diff --git a/samples/0_Intro/square/Makefile b/samples/0_Intro/square/Makefile index 817c556b26..89921c2072 100644 --- a/samples/0_Intro/square/Makefile +++ b/samples/0_Intro/square/Makefile @@ -1,4 +1,7 @@ -HIP_PATH?=../../.. +HIP_PATH?= $(wildcard /opt/rocm/hip) +ifeq (,$(HIP_PATH)) + HIP_PATH=../../.. +endif HIPCC=$(HIP_PATH)/bin/hipcc all: square.hip.out diff --git a/samples/1_Utils/hipBusBandwidth/Makefile b/samples/1_Utils/hipBusBandwidth/Makefile index 4599cacba2..418f25f8ed 100644 --- a/samples/1_Utils/hipBusBandwidth/Makefile +++ b/samples/1_Utils/hipBusBandwidth/Makefile @@ -1,4 +1,7 @@ -HIP_PATH?=../../.. +HIP_PATH?= $(wildcard /opt/rocm/hip) +ifeq (,$(HIP_PATH)) + HIP_PATH=../../.. +endif HIPCC=$(HIP_PATH)/bin/hipcc EXE=hipBusBandwidth diff --git a/samples/1_Utils/hipDispatchLatency/Makefile b/samples/1_Utils/hipDispatchLatency/Makefile index 87e707923d..387cb9aac6 100644 --- a/samples/1_Utils/hipDispatchLatency/Makefile +++ b/samples/1_Utils/hipDispatchLatency/Makefile @@ -1,4 +1,7 @@ -HIP_PATH?=../../.. +HIP_PATH?= $(wildcard /opt/rocm/hip) +ifeq (,$(HIP_PATH)) + HIP_PATH=../../.. +endif HIPCC=$(HIP_PATH)/bin/hipcc EXE=hipDispatchLatency diff --git a/samples/1_Utils/hipInfo/Makefile b/samples/1_Utils/hipInfo/Makefile index d69067388e..53bad55e45 100644 --- a/samples/1_Utils/hipInfo/Makefile +++ b/samples/1_Utils/hipInfo/Makefile @@ -1,4 +1,7 @@ -HIP_PATH?=../../.. +HIP_PATH?= $(wildcard /opt/rocm/hip) +ifeq (,$(HIP_PATH)) + HIP_PATH=../../.. +endif HIPCC=$(HIP_PATH)/bin/hipcc EXE=hipInfo