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.
Этот коммит содержится в:
Ben Sander
2016-03-22 02:30:10 -05:00
родитель 8087bc0401
Коммит ab910efb96
17 изменённых файлов: 95 добавлений и 70 удалений
+4 -4
Просмотреть файл
@@ -33,7 +33,7 @@ void simpleNegTest()
size_t Nbytes = N*sizeof(float);
A_malloc = (float*)malloc(Nbytes);
HIPCHECK(hipHostAlloc((void**)&A_pinned, Nbytes, hipHostAllocDefault));
HIPCHECK(hipHostMalloc((void**)&A_pinned, Nbytes, hipHostMallocDefault));
HIPCHECK(hipMalloc(&A_d, Nbytes));
@@ -61,7 +61,7 @@ struct HostTraits<Pinned>
static void *Alloc(size_t sizeBytes) {
void *p;
HIPCHECK(hipHostAlloc((void**)&p, sizeBytes, hipHostAllocDefault));
HIPCHECK(hipHostMalloc((void**)&p, sizeBytes, hipHostMallocDefault));
return p;
};
};
@@ -181,8 +181,8 @@ void test_manyInflightCopies(hipStream_t stream, int numElements, int numCopies,
T *A_d;
T *A_h1, *A_h2;
HIPCHECK(hipHostAlloc((void**)&A_h1, Nbytes, hipHostAllocDefault));
HIPCHECK(hipHostAlloc((void**)&A_h2, Nbytes, hipHostAllocDefault));
HIPCHECK(hipHostMalloc((void**)&A_h1, Nbytes, hipHostMallocDefault));
HIPCHECK(hipHostMalloc((void**)&A_h2, Nbytes, hipHostMallocDefault));
HIPCHECK(hipMalloc(&A_d, Nbytes));
for (int i=0; i<numElements; i++) {