src/ fixed hipHostAllocDefault flags
This commit is contained in:
@@ -39,14 +39,14 @@ int device;
|
||||
HIPCHECK(hipGetDevice(&device));
|
||||
HIPCHECK(hipGetDeviceProperties(&prop, device));
|
||||
if(prop.canMapHostMemory != 1){
|
||||
std::cout<<"Exiting..."<<std::endl;
|
||||
//std::cout<<"Exiting..."<<std::endl;
|
||||
}
|
||||
|
||||
HIPCHECK(hipHostAlloc((void**)&A, SIZE, hipHostAllocWriteCombined | hipHostAllocMapped));
|
||||
HIPCHECK(hipHostAlloc((void**)&B, SIZE, hipHostAllocWriteCombined | hipHostAllocMapped));
|
||||
HIPCHECK(hipHostAlloc((void**)&B, SIZE, hipHostAllocDefault));
|
||||
HIPCHECK(hipHostAlloc((void**)&C, SIZE, hipHostAllocMapped));
|
||||
|
||||
HIPCHECK(hipHostGetDevicePointer((void**)&Ad, A, 0));
|
||||
HIPCHECK(hipHostGetDevicePointer((void**)&Bd, B, 0));
|
||||
HIPCHECK(hipHostGetDevicePointer((void**)&Cd, C, 0));
|
||||
|
||||
for(int i=0;i<LEN;i++){
|
||||
@@ -54,6 +54,9 @@ A[i] = 1.0f;
|
||||
B[i] = 2.0f;
|
||||
}
|
||||
|
||||
HIPCHECK(hipMalloc((void**)&Bd, SIZE));
|
||||
HIPCHECK(hipMemcpy(Bd, B, SIZE, hipMemcpyHostToDevice));
|
||||
|
||||
dim3 dimGrid(LEN/512,1,1);
|
||||
dim3 dimBlock(512,1,1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user