From 811d6d52eaa9d730fcea45dde29eaf0903a83bc2 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Tue, 29 Mar 2016 02:27:51 -0500 Subject: [PATCH] Not using classes inside headers [ROCm/hip commit: f01810183b8b36e68a40f7d12cde2cc316392b62] --- projects/hip/include/hcc_detail/hip_hcc.h | 6 ++--- .../hip/include/hcc_detail/hip_runtime_api.h | 8 ++++++- projects/hip/tests/src/hipC.cpp | 22 +++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 projects/hip/tests/src/hipC.cpp diff --git a/projects/hip/include/hcc_detail/hip_hcc.h b/projects/hip/include/hcc_detail/hip_hcc.h index 9000602ff1..07c2d5109c 100644 --- a/projects/hip/include/hcc_detail/hip_hcc.h +++ b/projects/hip/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/projects/hip/include/hcc_detail/hip_runtime_api.h b/projects/hip/include/hcc_detail/hip_runtime_api.h index 22247af4b5..38fbe4fc29 100644 --- a/projects/hip/include/hcc_detail/hip_runtime_api.h +++ b/projects/hip/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/projects/hip/tests/src/hipC.cpp b/projects/hip/tests/src/hipC.cpp new file mode 100644 index 0000000000..73526ecfe0 --- /dev/null +++ b/projects/hip/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