diff --git a/RELEASE.md b/RELEASE.md index 055dd0a60d..04102ed0c1 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -13,6 +13,11 @@ We have attempted to document known bugs and limitations - in particular the [HI Stay tuned - the work for many of these features is already in-flight. +Next: +- Deprecate hipDeviceGetProp, replace with hipGetDeviceProp +- Deprecate hipMallocHost (Replace with hipHostAlloc with hipHostAllocDefault as last parameter). +- Deprecate hipFreeHost (Replace with hipHostFree). + ## Revision History: diff --git a/include/hcc_detail/hip_runtime_api.h b/include/hcc_detail/hip_runtime_api.h index 2421358661..d1d447256f 100644 --- a/include/hcc_detail/hip_runtime_api.h +++ b/include/hcc_detail/hip_runtime_api.h @@ -670,7 +670,7 @@ hipError_t hipMalloc(void** ptr, size_t size) ; * @param[in] size Requested memory size * @return Error code */ -hipError_t hipMallocHost(void** ptr, size_t size) ; +hipError_t hipMallocHost(void** ptr, size_t size) __attribute__((deprecated("use hipHostAlloc instead"))) ; /** * @brief Allocate device accessible page locked host memory @@ -737,7 +737,7 @@ hipError_t hipFree(void* ptr); * @param[in] ptr Pointer to memory to be freed * @return #hipSuccess, #hipErrorMemoryFree */ -hipError_t hipFreeHost(void* ptr); +hipError_t hipFreeHost(void* ptr) __attribute__((deprecated("use hipHostFree instead"))) ; diff --git a/include/hip_runtime_api.h b/include/hip_runtime_api.h index 9e191e138a..9d6aa6d3ca 100644 --- a/include/hip_runtime_api.h +++ b/include/hip_runtime_api.h @@ -218,9 +218,10 @@ static inline hipError_t hipMalloc ( T** devPtr, size_t size) return hipMalloc((void**)devPtr, size); } +// Provide an override to automatically typecast the pointer type from void**, and also provide a default for the flags. template -static inline hipError_t hipMallocHost ( T** ptr, size_t size) +static inline hipError_t hipHostAlloc( T** ptr, size_t size, unsigned int flags = hipHostAllocDefault) { - return hipMallocHost((void**)ptr, size); + return hipHostAlloc((void**)ptr, size, flags); } #endif diff --git a/include/nvcc_detail/hip_runtime_api.h b/include/nvcc_detail/hip_runtime_api.h index 3722c74c12..f0dee89808 100644 --- a/include/nvcc_detail/hip_runtime_api.h +++ b/include/nvcc_detail/hip_runtime_api.h @@ -119,7 +119,7 @@ inline static hipError_t hipFree(void* ptr) { return hipCUDAErrorTohipError(cudaFree(ptr)); } -inline static hipError_t hipMallocHost(void** ptr, size_t size) { +inline static hipError_t hipMallocHost(void** ptr, size_t size) __attribute__((deprecated("use hipHostAlloc instead"))) { return hipCUDAErrorTohipError(cudaMallocHost(ptr, size)); } @@ -143,9 +143,14 @@ inline static hipError_t hipHostUnregister(void* ptr){ return hipCUDAErrorTohipError(cudaHostUnregister(ptr)); } -inline static hipError_t hipFreeHost(void* ptr) { +inline static hipError_t hipFreeHost(void* ptr) __attribute__((deprecated("use hipHostFree instead"))) { return hipCUDAErrorTohipError(cudaFreeHost(ptr)); } + +inline static hipError_t hipHostFree(void* ptr) { + return hipCUDAErrorTohipError(cudaFreeHost(ptr)); +} + inline static hipError_t hipSetDevice(int device) { return hipCUDAErrorTohipError(cudaSetDevice(device)); }