diff --git a/hipamd/README.md b/hipamd/README.md index a60405053f..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 .. +cmake -DHSA_DIR=/path/to/hsa -DHCC_DIR=/path/to/hcc -DHIP_INSTALL_DIR=/where/to/install/hip -DCMAKE_BUILD_TYPE=Release .. make -sudo make install +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) diff --git a/hipamd/include/hcc_detail/hip_hcc.h b/hipamd/include/hcc_detail/hip_hcc.h index df287cf437..3c06295eaa 100644 --- a/hipamd/include/hcc_detail/hip_hcc.h +++ b/hipamd/include/hcc_detail/hip_hcc.h @@ -219,9 +219,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 13716371d7..544c16cd83 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/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 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