From beccdec2806b3111ab5e83a4cfb5b65ffdb1dd2d Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Sat, 11 Feb 2023 00:02:01 +0530 Subject: [PATCH] SWDEV-368819 - Add information on HIP APIs (#3135) Change-Id: I0677280d14c3b813b4288682360824a20995eaf1 [ROCm/hip commit: 644456d4388e14ce0f8b54fcf1862019201972d2] --- projects/hip/include/hip/hip_runtime_api.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h index f8fccdae35..0d961c24d0 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -2594,12 +2594,16 @@ hipError_t hipEventQuery(hipEvent_t event); hipError_t hipPointerSetAttribute(const void* value, hipPointer_attribute attribute, hipDeviceptr_t ptr); + /** * @brief Return attributes for the specified pointer * * @param [out] attributes attributes for the specified pointer * @param [in] ptr pointer to get attributes for * + * Note: To get pointer's memory type, the parameter attributes has 'type' as member variable. + * The 'type' indicates input pointer is allocated on device or host. + * * @return #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue * * @see hipPointerGetAttribute @@ -2786,10 +2790,11 @@ hipError_t hipMemAllocHost(void** ptr, size_t size); * @brief Allocate device accessible page locked host memory * * @param[out] ptr Pointer to the allocated host pinned memory - * @param[in] size Requested memory size + * @param[in] size Requested memory size in bytes * @param[in] flags Type of host memory allocation * * If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned. + * If no input for flags, it will be the default pinned memory allocation on the host. * * @return #hipSuccess, #hipErrorOutOfMemory * @@ -3304,7 +3309,7 @@ hipError_t hipMemPoolImportPointer( * @brief Allocate device accessible page locked host memory [Deprecated] * * @param[out] ptr Pointer to the allocated host pinned memory - * @param[in] size Requested memory size + * @param[in] size Requested memory size in bytes * @param[in] flags Type of host memory allocation * * If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned.