From 8717d015883afbae26c53cd13f4954fbbc522ace Mon Sep 17 00:00:00 2001 From: Julia Jiang Date: Thu, 2 Nov 2023 16:13:04 -0400 Subject: [PATCH] SWDEV-368819 - Adding more info for hip memory APIs Change-Id: Ia1ab540580cd8a2967263adcb23c888007a22ac6 [ROCm/hip commit: d1d95ca0dbb02c6e7b00b9c28ac16ee0168e9044] --- projects/hip/include/hip/hip_runtime_api.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h index 9278bc6b76..4571c7b47f 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -2925,7 +2925,12 @@ hipError_t hipMalloc(void** ptr, size_t size); * @param[in] size Requested memory size * @param[in] flags Type of memory allocation * - * If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned. + * If requested memory size is 0, no memory is allocated, *ptr returns nullptr, and #hipSuccess + * is returned. + * + * The memory allocation flag should be either #hipDeviceMallocDefault, + * #hipDeviceMallocFinegrained, #hipDeviceMallocUncached, or #hipMallocSignalMemory. + * If the flag is any other value, the API returns #hipErrorInvalidValue. * * @return #hipSuccess, #hipErrorOutOfMemory, #hipErrorInvalidValue (bad context, null *ptr) * @@ -3058,7 +3063,8 @@ hipError_t hipMemPrefetchAsync(const void* dev_ptr, * range starting from the pointer address devPtr, with the size of count bytes. * The memory range must refer to managed memory allocated via the API hipMallocManaged, and the * range will be handled with proper round down and round up respectively in the driver to - * be aligned to CPU page size. + * be aligned to CPU page size, the same way as corresponding CUDA API behaves in CUDA version 8.0 + * and afterwards. * * @note This API is implemented on Linux and is under development on Windows. */