Not using classes inside headers

This commit is contained in:
Aditya Atluri
2016-03-29 02:27:51 -05:00
والد f59b9e0aaf
کامیت 8e437d0565
3فایلهای تغییر یافته به همراه32 افزوده شده و 4 حذف شده
+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);
}