added feature for hipHostGetFlags for CUDA and HIP

[ROCm/clr commit: 45408db5dc]
This commit is contained in:
Aditya Atluri
2016-03-06 12:17:30 -06:00
parent b07ad6cc93
commit d7d689cf32
5 changed files with 103 additions and 7 deletions
@@ -687,6 +687,15 @@ hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags) ;
*/
hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, size_t size) ;
/**
* @brief Get flags associated with host pointer
*
* @param[out] flagsPtr Memory location to store flags
* @param[in] hostPtr Host Pointer allocated through hipHostAlloc
* @return Error code
*/
hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr) ;
/**
* @brief Free memory allocated by the hcc hip memory allocation API.
* This API performs an implicit hipDeviceSynchronize() call.
@@ -128,6 +128,10 @@ inline static hipError_t hipHostGetDevicePointer(void** devPtr, void* hostPtr, u
return hipCUDAErrorTohipError(cudaHostGetDevicePointer(devPtr, hostPtr, flags));
}
inline static hipError_ hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr){
return hipCUDAErrorTohipError(cudaHostGetFlags(flagsPtr, hostPtr));
}
inline static hipError_t hipFreeHost(void* ptr) {
return hipCUDAErrorTohipError(cudaFreeHost(ptr));
}