Skip to content

Commit b8965f1

Browse files
authored
SWDEV-368819 - Update hipMemAdvise API description (#3293)
Change-Id: Ibc3a7a39fd2189974e2b07c3896defeef195076c
1 parent 3d5ab76 commit b8965f1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/hip/hip_runtime_api.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2863,7 +2863,7 @@ hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
28632863
/**
28642864
* @brief Allocates memory that will be automatically managed by HIP.
28652865
*
2866-
* This API is used for managed memory, allows data be shared and accessible to both the CPU and
2866+
* This API is used for managed memory, allows data be shared and accessible to both CPU and
28672867
* GPU using a single pointer.
28682868
*
28692869
* 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,
29022902
* @brief Advise about the usage of a given memory range to HIP.
29032903
*
29042904
* @param [in] dev_ptr pointer to memory to set the advice for
2905-
* @param [in] count size in bytes of the memory range, it should be 4KB alligned.
2905+
* @param [in] count size in bytes of the memory range, it should be CPU page size alligned.
29062906
* @param [in] advice advice to be applied for the specified memory range
29072907
* @param [in] device device to apply the advice for
29082908
*
29092909
* @returns #hipSuccess, #hipErrorInvalidValue
29102910
*
2911+
* This HIP advises about the usage to be applied on unified memory allocation in the
2912+
* range starting from the pointer address devPtr, with the size of count bytes.
2913+
* The memory range must refer to managed memory allocated via the API hipMallocManaged, and the
2914+
* range will be handled with proper round down and round up respectively in the driver to
2915+
* be aligned to CPU page size.
2916+
*
29112917
* @note This API is implemented on Linux, under development on Windows.
29122918
*/
29132919
hipError_t hipMemAdvise(const void* dev_ptr,

0 commit comments

Comments
 (0)