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

이 커밋은 다음에 포함됨:
Ben Sander가 2016-03-29 14:43:35 -05:00를 커밋했습니다
커밋 03c0fcbfec
9 파일이 변경됨
+43 -12

검색과 일치하는 파일 없음

+22
파일 보기
@@ -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);
}