hipHostRegister and hipHostMalloc refactor.

Note hipHostMalloc (not hipHostAlloc or hipMallocHost).
 -  the hipHost* is used for all HIP APIs dealing with Host memory.
    (including hipHostMalloc, hipHostFree, hipHostRegister,
hipHostUnregister, hipHostGetFlags, hipHostGetDevicePointer).
  - hipMallocHost is consistent with "hipMalloc" for allocating device
    memory.  Enumerations hipHostMalloc* also used as optional
    flags parm to hipHostMalloc.


[ROCm/hip commit: ab910efb96]
Этот коммит содержится в:
Ben Sander
2016-03-22 02:30:10 -05:00
родитель f392d143ff
Коммит b319209299
17 изменённых файлов: 95 добавлений и 70 удалений
+9 -9
Просмотреть файл
@@ -34,11 +34,11 @@ Array[tx] = Array[tx] + T(1);
void run1(size_t size, hipStream_t stream){
float *Ah, *Bh, *Cd, *Dd, *Eh;
HIPCHECK(hipHostAlloc((void**)&Ah, size, hipHostAllocDefault));
HIPCHECK(hipHostAlloc((void**)&Bh, size, hipHostAllocDefault));
HIPCHECK(hipHostMalloc((void**)&Ah, size, hipHostMallocDefault));
HIPCHECK(hipHostMalloc((void**)&Bh, size, hipHostMallocDefault));
HIPCHECK(hipMalloc(&Cd, size));
HIPCHECK(hipMalloc(&Dd, size));
HIPCHECK(hipHostAlloc((void**)&Eh, size, hipHostAllocDefault));
HIPCHECK(hipHostMalloc((void**)&Eh, size, hipHostMallocDefault));
for(int i=0;i<N;i++){
Ah[i] = 1.0f;
@@ -58,16 +58,16 @@ void run(size_t size, hipStream_t stream1, hipStream_t stream2){
float *Ah, *Bh, *Cd, *Dd, *Eh;
float *Ahh, *Bhh, *Cdd, *Ddd, *Ehh;
HIPCHECK(hipHostAlloc((void**)&Ah, size, hipHostAllocDefault));
HIPCHECK(hipHostAlloc((void**)&Bh, size, hipHostAllocDefault));
HIPCHECK(hipHostMalloc((void**)&Ah, size, hipHostMallocDefault));
HIPCHECK(hipHostMalloc((void**)&Bh, size, hipHostMallocDefault));
HIPCHECK(hipMalloc(&Cd, size));
HIPCHECK(hipMalloc(&Dd, size));
HIPCHECK(hipHostAlloc((void**)&Eh, size, hipHostAllocDefault));
HIPCHECK(hipHostAlloc((void**)&Ahh, size, hipHostAllocDefault));
HIPCHECK(hipHostAlloc((void**)&Bhh, size, hipHostAllocDefault));
HIPCHECK(hipHostMalloc((void**)&Eh, size, hipHostMallocDefault));
HIPCHECK(hipHostMalloc((void**)&Ahh, size, hipHostMallocDefault));
HIPCHECK(hipHostMalloc((void**)&Bhh, size, hipHostMallocDefault));
HIPCHECK(hipMalloc(&Cdd, size));
HIPCHECK(hipMalloc(&Ddd, size));
HIPCHECK(hipHostAlloc((void**)&Ehh, size, hipHostAllocDefault));
HIPCHECK(hipHostMalloc((void**)&Ehh, size, hipHostMallocDefault));
HIPCHECK(hipMemcpyAsync(Bh, Ah, size, hipMemcpyHostToHost, stream1));
HIPCHECK(hipMemcpyAsync(Bhh, Ahh, size, hipMemcpyHostToHost, stream2));