Merge pull request #4 from AMDComputeLibraries/memtracker

hipGetPointerAttrib behavioral changes

[ROCm/hip commit: ecadb1623c]
Dieser Commit ist enthalten in:
Aditya Avinash Atluri committed 2016-02-27 10:51:23 -06:00
2 Ursprung 66d6dbf686 ec7375ea3c
Commit f2dfb87abf
4 Dateien geändert
+74 -41

Keine Dateien entsprechen Ihrer Suche

@@ -275,6 +275,29 @@ inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t att
return hipCUDAErrorTohipError(cerror);
}
inline static hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, void* ptr){
cudaPointerAttributes cPA;
hipError_t err = hipCUDAErrorTohipError(cudaPointerGetAttributes(&cPA, ptr));
if(err == hipSuccess){
switch (cPA.memoryType){
case cudaMemoryTypeDevice:
attributes->memoryType = hipMemoryTypeDevice; break;
case cudaMemoryTypeHost:
attributes->memoryType = hipMemoryTypeHost; break;
default:
return hipErrorUnknownSymbol;
}
attributes->device = cPA.device;
attributes->devicePointer = cPA.devicePointer;
attributes->hostPointer = cPA.hostPointer;
attributes->isManaged = 0;
attributes->allocationFlags = 0;
}
return err;
}
inline static hipError_t hipMemGetInfo( size_t* free, size_t* total)
{
return hipCUDAErrorTohipError(cudaMemGetInfo(free,total));