From 8e437d0565950ea43e76577cabf1808469b06526 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Tue, 29 Mar 2016 02:27:51 -0500 Subject: [PATCH 1/4] Not using classes inside headers --- hipamd/include/hcc_detail/hip_hcc.h | 6 +++--- hipamd/include/hcc_detail/hip_runtime_api.h | 8 +++++++- hipamd/tests/src/hipC.cpp | 22 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 hipamd/tests/src/hipC.cpp diff --git a/hipamd/include/hcc_detail/hip_hcc.h b/hipamd/include/hcc_detail/hip_hcc.h index 9000602ff1..07c2d5109c 100644 --- a/hipamd/include/hcc_detail/hip_hcc.h +++ b/hipamd/include/hcc_detail/hip_hcc.h @@ -215,9 +215,9 @@ extern "C" { #endif typedef class ihipStream_t* hipStream_t; -typedef struct hipEvent_t { - struct ihipEvent_t *_handle; -} hipEvent_t; +//typedef struct hipEvent_t { +// struct ihipEvent_t *_handle; +//} hipEvent_t; #ifdef __cplusplus } diff --git a/hipamd/include/hcc_detail/hip_runtime_api.h b/hipamd/include/hcc_detail/hip_runtime_api.h index 22247af4b5..38fbe4fc29 100644 --- a/hipamd/include/hcc_detail/hip_runtime_api.h +++ b/hipamd/include/hcc_detail/hip_runtime_api.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include #include -#include "hip_hcc.h" +//#include "hip_hcc.h" #if defined (__HCC__) && (__hcc_workweek__ < 16074) #error("This version of HIP requires a newer version of HCC."); @@ -42,6 +42,12 @@ THE SOFTWARE. extern "C" { #endif +typedef struct ihipStream_t *hipStream_t; +typedef struct hipEvent_t { + struct ihipEvent_t *_handle; +} hipEvent_t; + + /** * @addtogroup GlobalDefs More * @{ diff --git a/hipamd/tests/src/hipC.cpp b/hipamd/tests/src/hipC.cpp new file mode 100644 index 0000000000..73526ecfe0 --- /dev/null +++ b/hipamd/tests/src/hipC.cpp @@ -0,0 +1,22 @@ +#include"hip_runtime.h" +#include + +#define ITER 1<<20 +#define SIZE 1024*1024*sizeof(int) + +__global__ void Iter(hipLaunchParm lp, int *Ad){ + int tx = hipThreadIdx_x + hipBlockIdx_x * hipBlockDim_x; + if(tx == 0){ + for(int i=0;i Date: Tue, 29 Mar 2016 16:02:09 +0800 Subject: [PATCH 2/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 From 573d331ab8b27d22c5e75fc40234216855710454 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Tue, 29 Mar 2016 14:11:10 -0500 Subject: [PATCH 3/4] Update README.md --- hipamd/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hipamd/README.md b/hipamd/README.md index a60405053f..31c286636a 100644 --- a/hipamd/README.md +++ b/hipamd/README.md @@ -15,9 +15,9 @@ New projects can be developed directly in the portable HIP C++ language and can cd HIP-privatestaging mkdir build cd build -cmake .. +cmake -DHSA_DIR=/path/to/hsa -DHCC_DIR=/path/to/hcc -DHIP_INSTALL_DIR=/where/to/install/hip .. make -sudo make install +make install ``` Make sure HIP_PATH is pointed to `/opt/hip` and PATH includes `$HIP_PATH/bin` From ae2b136bfe9a23257679922a1c51531abca88594 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Tue, 29 Mar 2016 14:23:41 -0500 Subject: [PATCH 4/4] Update README.md --- hipamd/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hipamd/README.md b/hipamd/README.md index 31c286636a..10d0e31288 100644 --- a/hipamd/README.md +++ b/hipamd/README.md @@ -15,11 +15,14 @@ New projects can be developed directly in the portable HIP C++ language and can cd HIP-privatestaging mkdir build cd build -cmake -DHSA_DIR=/path/to/hsa -DHCC_DIR=/path/to/hcc -DHIP_INSTALL_DIR=/where/to/install/hip .. +cmake -DHSA_DIR=/path/to/hsa -DHCC_DIR=/path/to/hcc -DHIP_INSTALL_DIR=/where/to/install/hip -DCMAKE_BUILD_TYPE=Release .. make make install ``` -Make sure HIP_PATH is pointed to `/opt/hip` and PATH includes `$HIP_PATH/bin` +Make sure HIP_PATH is pointed to `/where/to/install/hip` and PATH includes `$HIP_PATH/bin`. This requirement is optional, but required to run any HIP test infrastructure. + +The Release build installs HIP inside `/where/to/install/hip`. The Debug build will install inside HIP repo directory by adding a `./lib` directory containing `libhip_hcc.a` + ## More Info: - [HIP FAQ](docs/markdown/hip_faq.md)