Merge pull request #4 from AMDComputeLibraries/memtracker

hipGetPointerAttrib behavioral changes
이 커밋은 다음에 포함됨:
Aditya Avinash Atluri가 2016-02-27 10:51:23 -06:00를 커밋했습니다
커밋 ecadb1623c
4 파일이 변경됨
+74 -41

검색과 일치하는 파일 없음

+23
파일 보기
@@ -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));