From 8825bacec00f994b906d7d7d143c111ba76ec66e Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Thu, 27 Oct 2022 20:23:40 +0530 Subject: [PATCH] SWDEV-354898, SWDEV-355542 - Update HIP header for mis-spelling and doxygen Index (#3027) Change-Id: I19f883f9072c8cc7599a4b1002bf221d9fcde7cd [ROCm/hip commit: c74504290bf2a50e228769981e9102a643b51109] --- projects/hip/include/hip/hip_runtime_api.h | 225 ++++++++++----------- 1 file changed, 112 insertions(+), 113 deletions(-) diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h index 0685876aef..631ae31bf6 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -1215,6 +1215,102 @@ typedef enum hipGraphInstantiateFlags { 1, ///< Automatically free memory allocated in a graph before relaunching. } hipGraphInstantiateFlags; +/** + * Memory allocation properties + */ +typedef struct hipMemAllocationProp { + hipMemAllocationType type; ///< Memory allocation type + hipMemAllocationHandleType requestedHandleType; ///< Requested handle type + hipMemLocation location; ///< Memory location + void* win32HandleMetaData; ///< Metadata for Win32 handles + struct { + unsigned char compressionType; ///< Compression type + unsigned char gpuDirectRDMACapable; ///< RDMA capable + unsigned short usage; ///< Usage + } allocFlags; +} hipMemAllocationProp; + +/** + * Generic handle for memory allocation + */ +typedef struct ihipMemGenericAllocationHandle* hipMemGenericAllocationHandle_t; + +/** + * @brief Flags for granularity + * @enum + * @ingroup Enumerations + */ +typedef enum hipMemAllocationGranularity_flags { + hipMemAllocationGranularityMinimum = 0x0, ///< Minimum granularity + hipMemAllocationGranularityRecommended = 0x1 ///< Recommended granularity for performance +} hipMemAllocationGranularity_flags; + +/** + * @brief Memory handle type + * @enum + * @ingroup Enumerations + */ +typedef enum hipMemHandleType { + hipMemHandleTypeGeneric = 0x0 ///< Generic handle type +} hipMemHandleType; + +/** + * @brief Memory operation types + * @enum + * @ingroup Enumerations + */ +typedef enum hipMemOperationType { + hipMemOperationTypeMap = 0x1, ///< Map operation + hipMemOperationTypeUnmap = 0x2 ///< Unmap operation +} hipMemOperationType; + +/** + * @brief Subresource types for sparse arrays + * @enum + * @ingroup Enumerations + */ +typedef enum hipArraySparseSubresourceType { + hipArraySparseSubresourceTypeSparseLevel = 0x0, ///< Sparse level + hipArraySparseSubresourceTypeMiptail = 0x1 ///< Miptail +} hipArraySparseSubresourceType; + +/** + * Map info for arrays + */ +typedef struct hipArrayMapInfo { + hipResourceType resourceType; ///< Resource type + union { + hipMipmappedArray mipmap; + hipArray_t array; + } resource; + hipArraySparseSubresourceType subresourceType; ///< Sparse subresource type + union { + struct { + unsigned int level; ///< For mipmapped arrays must be a valid mipmap level. For arrays must be zero + unsigned int layer; ///< For layered arrays must be a valid layer index. Otherwise, must be zero + unsigned int offsetX; ///< X offset in elements + unsigned int offsetY; ///< Y offset in elements + unsigned int offsetZ; ///< Z offset in elements + unsigned int extentWidth; ///< Width in elements + unsigned int extentHeight; ///< Height in elements + unsigned int extentDepth; ///< Depth in elements + } sparseLevel; + struct { + unsigned int layer; ///< For layered arrays must be a valid layer index. Otherwise, must be zero + unsigned long long offset; ///< Offset within mip tail + unsigned long long size; ///< Extent in bytes + } miptail; + } subresource; + hipMemOperationType memOperationType; ///< Memory operation type + hipMemHandleType memHandleType; ///< Memory handle type + union { + hipMemGenericAllocationHandle_t memHandle; + } memHandle; + unsigned long long offset; ///< Offset within the memory + unsigned int deviceBitMask; ///< Device ordinal bit mask + unsigned int flags; ///< flags for future use, must be zero now. + unsigned int reserved[2]; ///< Reserved for future use, must be zero now. +} hipArrayMapInfo; // Doxygen end group GlobalDefs /** @} */ //------------------------------------------------------------------------------------------------- @@ -1253,7 +1349,7 @@ hipError_t hipInit(unsigned int flags); * * @param [out] driverVersion * - * @returns #hipSuccess, #hipErrorInavlidValue + * @returns #hipSuccess, #hipErrorInvalidValue * * @warning The HIP feature set does not correspond to an exact CUDA SDK driver revision. * This function always set *driverVersion to 4 as an approximation though HIP supports @@ -1269,7 +1365,7 @@ hipError_t hipDriverGetVersion(int* driverVersion); * * @param [out] runtimeVersion * - * @returns #hipSuccess, #hipErrorInavlidValue + * @returns #hipSuccess, #hipErrorInvalidValue * * @warning The version definition of HIP runtime is different from CUDA. * On AMD platform, the function returns HIP runtime version, @@ -1284,7 +1380,7 @@ hipError_t hipRuntimeGetVersion(int* runtimeVersion); * @param [out] device * @param [in] ordinal * - * @returns #hipSuccess, #hipErrorInavlidDevice + * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceGet(hipDevice_t* device, int ordinal); @@ -1294,7 +1390,7 @@ hipError_t hipDeviceGet(hipDevice_t* device, int ordinal); * @param [out] minor * @param [in] device * - * @returns #hipSuccess, #hipErrorInavlidDevice + * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device); /** @@ -1303,7 +1399,7 @@ hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device * @param [in] len * @param [in] device * - * @returns #hipSuccess, #hipErrorInavlidDevice + * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device); /** @@ -1315,7 +1411,7 @@ hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device); * it is still open to changes and may have outstanding issues. * * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue, #hipErrorNotInitialized, - * #hipErrorDeInitialized + * #hipErrorDeinitialized */ hipError_t hipDeviceGetUuid(hipUUID* uuid, hipDevice_t device); /** @@ -1325,7 +1421,7 @@ hipError_t hipDeviceGetUuid(hipUUID* uuid, hipDevice_t device); * @param [in] srcDevice * @param [in] dstDevice * - * @returns #hipSuccess, #hipErrorInavlidDevice + * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr, int srcDevice, int dstDevice); @@ -1335,7 +1431,7 @@ hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr, * @param [in] len * @param [in] device * - * @returns #hipSuccess, #hipErrorInavlidDevice + * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device); /** @@ -1343,7 +1439,7 @@ hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device); * @param [out] device handle * @param [in] PCI Bus ID * - * @returns #hipSuccess, #hipErrorInavlidDevice, #hipErrorInvalidValue + * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue */ hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId); /** @@ -1351,7 +1447,7 @@ hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId); * @param [out] bytes * @param [in] device * - * @returns #hipSuccess, #hipErrorInavlidDevice + * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device); // doxygen end initialization @@ -3334,7 +3430,7 @@ hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes, * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * @return #hipSuccess, #hipErrorDeinitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, * #hipErrorInvalidValue * * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, @@ -3352,7 +3448,7 @@ hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes); * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * @return #hipSuccess, #hipErrorDeinitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, * #hipErrorInvalidValue * * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, @@ -3370,7 +3466,7 @@ hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes); * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * @return #hipSuccess, #hipErrorDeinitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, * #hipErrorInvalidValue * * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, @@ -3388,7 +3484,7 @@ hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeByte * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * @return #hipSuccess, #hipErrorDeinitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, * #hipErrorInvalidValue * * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, @@ -3406,7 +3502,7 @@ hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, h * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * @return #hipSuccess, #hipErrorDeinitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, * #hipErrorInvalidValue * * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, @@ -3424,7 +3520,7 @@ hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, h * @param[in] src Data being copy from * @param[in] sizeBytes Data size in bytes * - * @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, + * @return #hipSuccess, #hipErrorDeinitialized, #hipErrorNotInitialized, #hipErrorInvalidContext, * #hipErrorInvalidValue * * @see hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc, hipMemAllocHost, @@ -6400,103 +6496,6 @@ hipError_t hipGraphReleaseUserObject(hipGraph_t graph, hipUserObject_t object, u */ -/** - * Memory allocation properties - */ -typedef struct hipMemAllocationProp { - hipMemAllocationType type; ///< Memory allocation type - hipMemAllocationHandleType requestedHandleType; ///< Requested handle type - hipMemLocation location; ///< Memory location - void* win32HandleMetaData; ///< Metadata for Win32 handles - struct { - unsigned char compressionType; ///< Compression type - unsigned char gpuDirectRDMACapable; ///< RDMA capable - unsigned short usage; ///< Usage - } allocFlags; -} hipMemAllocationProp; - -/** - * Generic handle for memory allocation - */ -typedef struct ihipMemGenericAllocationHandle* hipMemGenericAllocationHandle_t; - -/** - * @brief Flags for granularity - * @enum - * @ingroup Enumerations - */ -typedef enum hipMemAllocationGranularity_flags { - hipMemAllocationGranularityMinimum = 0x0, ///< Minimum granularity - hipMemAllocationGranularityRecommended = 0x1 ///< Recommended granularity for performance -} hipMemAllocationGranularity_flags; - -/** - * @brief Memory handle type - * @enum - * @ingroup Enumerations - */ -typedef enum hipMemHandleType { - hipMemHandleTypeGeneric = 0x0 ///< Generic handle type -} hipMemHandleType; - -/** - * @brief Memory operation types - * @enum - * @ingroup Enumerations - */ -typedef enum hipMemOperationType { - hipMemOperationTypeMap = 0x1, ///< Map operation - hipMemOperationTypeUnmap = 0x2 ///< Unmap operation -} hipMemOperationType; - -/** - * @brief Subresource types for sparse arrays - * @enum - * @ingroup Enumerations - */ -typedef enum hipArraySparseSubresourceType { - hipArraySparseSubresourceTypeSparseLevel = 0x0, ///< Sparse level - hipArraySparseSubresourceTypeMiptail = 0x1 ///< Miptail -} hipArraySparseSubresourceType; - -/** - * Map info for arrays - */ -typedef struct hipArrayMapInfo { - hipResourceType resourceType; ///< Resource type - union { - hipMipmappedArray mipmap; - hipArray_t array; - } resource; - hipArraySparseSubresourceType subresourceType; ///< Sparse subresource type - union { - struct { - unsigned int level; ///< For mipmapped arrays must be a valid mipmap level. For arrays must be zero - unsigned int layer; ///< For layered arrays must be a valid layer index. Otherwise, must be zero - unsigned int offsetX; ///< X offset in elements - unsigned int offsetY; ///< Y offset in elements - unsigned int offsetZ; ///< Z offset in elements - unsigned int extentWidth; ///< Width in elements - unsigned int extentHeight; ///< Height in elements - unsigned int extentDepth; ///< Depth in elements - } sparseLevel; - struct { - unsigned int layer; ///< For layered arrays must be a valid layer index. Otherwise, must be zero - unsigned long long offset; ///< Offset within mip tail - unsigned long long size; ///< Extent in bytes - } miptail; - } subresource; - hipMemOperationType memOperationType; ///< Memory operation type - hipMemHandleType memHandleType; ///< Memory handle type - union { - hipMemGenericAllocationHandle_t memHandle; - } memHandle; - unsigned long long offset; ///< Offset within the memory - unsigned int deviceBitMask; ///< Device ordinal bit mask - unsigned int flags; ///< flags for future use, must be zero now. - unsigned int reserved[2]; ///< Reserved for future use, must be zero now. -} hipArrayMapInfo; - /** *------------------------------------------------------------------------------------------------- *-------------------------------------------------------------------------------------------------