From f67a2a7a7d5fba9835c9c48cb2953c6caf8a577c Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Mon, 14 Aug 2023 21:35:47 +0530 Subject: [PATCH] SWDEV-368819 - Update hipMemAdvise API description (#3293) Change-Id: Ibc3a7a39fd2189974e2b07c3896defeef195076c [ROCm/hip commit: b8965f1f3d58d7adf7d702c09e75ebf3dd718f8c] --- 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 dc2edb0273..1803b16bbb 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -2863,7 +2863,7 @@ hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags); /** * @brief Allocates memory that will be automatically managed by HIP. * - * This API is used for managed memory, allows data be shared and accessible to both the CPU and + * This API is used for managed memory, allows data be shared and accessible to both CPU and * GPU using a single pointer. * * The API returns the allocation pointer, managed by HMM, can be used further to execute kernels @@ -2902,12 +2902,18 @@ hipError_t hipMemPrefetchAsync(const void* dev_ptr, * @brief Advise about the usage of a given memory range to HIP. * * @param [in] dev_ptr pointer to memory to set the advice for - * @param [in] count size in bytes of the memory range, it should be 4KB alligned. + * @param [in] count size in bytes of the memory range, it should be CPU page size alligned. * @param [in] advice advice to be applied for the specified memory range * @param [in] device device to apply the advice for * * @returns #hipSuccess, #hipErrorInvalidValue * + * This HIP advises about the usage to be applied on unified memory allocation in the + * 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. + * * @note This API is implemented on Linux, under development on Windows. */ hipError_t hipMemAdvise(const void* dev_ptr,