Merge branch 'privatestaging' of https://github.com/AMDComputeLibraries/HIP-privatestaging into privatestaging

Conflicts:
	include/hcc_detail/trace_helper.h


[ROCm/clr commit: ba114a238f]
This commit is contained in:
Ben Sander
2016-03-29 05:56:03 -05:00
6 changed files with 49 additions and 27 deletions
+1 -1
View File
@@ -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 )
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
$HCC_HOME/bin/hcc -I$HCC_HOME/include -I$HSA_PATH/include -I$HIP_PATH/include -std=c11 -c hipC.c
+22
View File
@@ -0,0 +1,22 @@
#include"hip_runtime.h"
#include<stdio.h>
#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<ITER;i++){
Ad[tx] += 1;
}
}
}
int main(){
int A=0, *Ad;
hipMalloc((void**)&Ad, SIZE);
hipMemcpy(Ad, &A, SIZE, hipMemcpyHostToDevice);
hipLaunchKernel(HIP_KERNEL_NAME(Iter), dim3(1), dim3(1), 0, 0, Ad);
hipMemcpy(&A, Ad, SIZE, hipMemcpyDeviceToHost);
}