From 5afa5d23fc871f6797b76e93d547004cdb9cfec9 Mon Sep 17 00:00:00 2001 From: scchan Date: Mon, 28 Mar 2016 09:18:38 -0500 Subject: [PATCH 1/4] add inline keyword to all the template functions --- hipamd/include/hcc_detail/trace_helper.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hipamd/include/hcc_detail/trace_helper.h b/hipamd/include/hcc_detail/trace_helper.h index 1275016188..35a8b80c0c 100644 --- a/hipamd/include/hcc_detail/trace_helper.h +++ b/hipamd/include/hcc_detail/trace_helper.h @@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - +#pragma once #include #include @@ -35,7 +35,7 @@ THE SOFTWARE. // Building block functions: template -std::string ToHexString(T v) +inline std::string ToHexString(T v) { std::ostringstream ss; ss << "0x" << std::hex << v; @@ -47,7 +47,7 @@ std::string ToHexString(T v) // Template overloads for ToString to handle various types: // Note these use C++11 variadic templates template -std::string ToString(T v) { +inline std::string ToString(T v) { std::ostringstream ss; ss << v; return ss.str(); @@ -55,7 +55,7 @@ std::string ToString(T v) { template <> -std::string ToString(hipMemcpyKind v) { +inline std::string ToString(hipMemcpyKind v) { switch(v) { CASE_STR(hipMemcpyHostToHost); CASE_STR(hipMemcpyHostToDevice); @@ -68,13 +68,13 @@ std::string ToString(hipMemcpyKind v) { template <> -std::string ToString(hipError_t v) { +inline std::string ToString(hipError_t v) { return ihipErrorString(v); }; // Catch empty arguments case -std::string ToString() { +inline std::string ToString() { return (""); } @@ -83,6 +83,6 @@ std::string ToString() { // C++11 variadic template - peels off first argument, converts to string, and calls itself again to peel the next arg. // Strings are automatically separated by comma+space. template -std::string ToString(T first, Args... args) { +inline std::string ToString(T first, Args... args) { return ToString(first) + ", " + ToString(args...) ; } From 3aa542e21bd5123608d7d599d2315668fd1b9fbe Mon Sep 17 00:00:00 2001 From: scchan Date: Mon, 28 Mar 2016 12:56:15 -0500 Subject: [PATCH 2/4] turn off ONE_OBJECT_FILE since we are building a static library --- hipamd/include/hcc_detail/hip_hcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hipamd/include/hcc_detail/hip_hcc.h b/hipamd/include/hcc_detail/hip_hcc.h index 9000602ff1..1784acc67f 100644 --- a/hipamd/include/hcc_detail/hip_hcc.h +++ b/hipamd/include/hcc_detail/hip_hcc.h @@ -117,7 +117,7 @@ struct ihipDevice_t; // #include CPP files to produce one object file -#define ONE_OBJECT_FILE 1 +#define ONE_OBJECT_FILE 0 // Compile support for trace markers that are displayed on CodeXL GUI at start/stop of each function boundary. From 5e76b13cecb15826bc8979d2cb40d3149fc5681a Mon Sep 17 00:00:00 2001 From: scchan Date: Mon, 28 Mar 2016 13:56:23 -0500 Subject: [PATCH 3/4] remove the --hipcc_explicit_lib --- hipamd/tests/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hipamd/tests/src/CMakeLists.txt b/hipamd/tests/src/CMakeLists.txt index acd2060647..5cc280cec7 100644 --- a/hipamd/tests/src/CMakeLists.txt +++ b/hipamd/tests/src/CMakeLists.txt @@ -62,7 +62,7 @@ endif() set (HIPCC ${HIP_PATH}/bin/hipcc) set (CMAKE_CXX_COMPILER ${HIPCC}) -set (CMAKE_CXX_FLAGS --hipcc_explicit_lib) +#set (CMAKE_CXX_FLAGS --hipcc_explicit_lib) add_library(test_common OBJECT test_common.cpp ) From a629d4975ffe3f038a47375797dad0c190aec027 Mon Sep 17 00:00:00 2001 From: streamhsa Date: Tue, 29 Mar 2016 16:02:09 +0800 Subject: [PATCH 4/4] change makefile for samples --- hipamd/samples/0_Intro/bit_extract/Makefile | 2 +- hipamd/samples/0_Intro/square/Makefile | 2 +- hipamd/samples/1_Utils/hipBusBandwidth/Makefile | 2 +- hipamd/samples/1_Utils/hipDispatchLatency/Makefile | 2 +- hipamd/samples/1_Utils/hipInfo/Makefile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hipamd/samples/0_Intro/bit_extract/Makefile b/hipamd/samples/0_Intro/bit_extract/Makefile index d0a2d4bc75..39fb5cf8c6 100644 --- a/hipamd/samples/0_Intro/bit_extract/Makefile +++ b/hipamd/samples/0_Intro/bit_extract/Makefile @@ -1,6 +1,6 @@ #Dependencies : [MYHIP]/bin must be in user's path. -HIP_PATH?=$(shell hipconfig --path) +HIP_PATH=../../.. HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --platform) HIPCC=$(HIP_PATH)/bin/hipcc diff --git a/hipamd/samples/0_Intro/square/Makefile b/hipamd/samples/0_Intro/square/Makefile index 9fb03d867e..98ee0be4f6 100644 --- a/hipamd/samples/0_Intro/square/Makefile +++ b/hipamd/samples/0_Intro/square/Makefile @@ -1,4 +1,4 @@ -HIP_PATH?=$(shell hipconfig --path) +HIP_PATH=../../.. HIPCC=$(HIP_PATH)/bin/hipcc all: square.hip.out diff --git a/hipamd/samples/1_Utils/hipBusBandwidth/Makefile b/hipamd/samples/1_Utils/hipBusBandwidth/Makefile index 77a92fb1a6..a713379d8d 100644 --- a/hipamd/samples/1_Utils/hipBusBandwidth/Makefile +++ b/hipamd/samples/1_Utils/hipBusBandwidth/Makefile @@ -1,4 +1,4 @@ -HIP_PATH?=$(shell hipconfig -p) +HIP_PATH=../../.. HIPCC=$(HIP_PATH)/bin/hipcc EXE=hipBusBandwidth diff --git a/hipamd/samples/1_Utils/hipDispatchLatency/Makefile b/hipamd/samples/1_Utils/hipDispatchLatency/Makefile index 4b33a0ff6d..9b2d558114 100644 --- a/hipamd/samples/1_Utils/hipDispatchLatency/Makefile +++ b/hipamd/samples/1_Utils/hipDispatchLatency/Makefile @@ -1,4 +1,4 @@ -HIP_PATH?=$(shell hipconfig -p) +HIP_PATH=../../.. HIPCC=$(HIP_PATH)/bin/hipcc EXE=hipDispatchLatency diff --git a/hipamd/samples/1_Utils/hipInfo/Makefile b/hipamd/samples/1_Utils/hipInfo/Makefile index a36b16be50..f38f157bcb 100644 --- a/hipamd/samples/1_Utils/hipInfo/Makefile +++ b/hipamd/samples/1_Utils/hipInfo/Makefile @@ -1,4 +1,4 @@ -HIP_PATH?=$(shell hipconfig -p) +HIP_PATH=../../.. HIPCC=$(HIP_PATH)/bin/hipcc EXE=hipInfo