SWDEV-338733 - Implement hipArrayGet* APIs (#2870)

- Add interfaces for hipArrayGetInfo, hipArrayGetDescriptor & hipArray3DGetDescriptor API implementations

Change-Id: I374c05e24a79960e7ee9a5b649b63115fdf2715e
This commit is contained in:
ROCm CI Service Account
2023-02-15 11:13:39 +05:30
committed by GitHub
parent 83ef5518e0
commit 91968beb57
3 changed files with 52 additions and 1 deletions
@@ -134,7 +134,7 @@
| **CUDA** | **HIP** |**CUDA version\***|
|-----------------------------------------------------------|-------------------------------|:----------------:|
| `cudaArrayGetInfo` | |
| `cudaArrayGetInfo` | `hipArrayGetInfo` |
| `cudaFree` | `hipFree` |
| `cudaFreeArray` | `hipFreeArray` |
| `cudaFreeHost` | `hipHostFree` |
+1
View File
@@ -90,6 +90,7 @@ typedef struct hipArray {
unsigned int NumChannels;
bool isDrv;
unsigned int textureType;
unsigned int flags;
}hipArray;
#if !defined(__HIPCC_RTC__)
typedef struct hip_Memcpy2D {
+50
View File
@@ -3999,6 +3999,56 @@ hipError_t hipGetMipmappedArrayLevel(
hipArray_t *levelArray,
hipMipmappedArray_const_t mipmappedArray,
unsigned int level);
/**
* @brief Gets info about the specified array
*
* @param[out] desc - Returned array type
* @param[out] extent - Returned array shape. 2D arrays will have depth of zero
* @param[out] flags - Returned array flags
* @param[in] array - The HIP array to get info for
*
* @return #hipSuccess, #hipErrorInvalidValue #hipErrorInvalidHandle
*
* @see hipArrayGetDescriptor, hipArray3DGetDescriptor
*/
hipError_t hipArrayGetInfo(hipChannelFormatDesc* desc, hipExtent* extent, unsigned int* flags,
hipArray* array);
/**
* @brief Gets a 1D or 2D array descriptor
*
* @param[out] pArrayDescriptor - Returned array descriptor
* @param[in] array - Array to get descriptor of
*
* @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext,
* #hipErrorInvalidValue #hipErrorInvalidHandle
*
* @see hipArray3DCreate, hipArray3DGetDescriptor, hipArrayCreate, hipArrayDestroy, hipMemAlloc,
* hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned,
* hipMemcpy3D, hipMemcpy3DAsync, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync,
* hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync,
* hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoD, hipMemcpyHtoDAsync, hipMemFree,
* hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc,
* hipMemHostGetDevicePointer, hipMemsetD8, hipMemsetD16, hipMemsetD32, hipArrayGetInfo
*/
hipError_t hipArrayGetDescriptor(HIP_ARRAY_DESCRIPTOR* pArrayDescriptor, hipArray* array);
/**
* @brief Gets a 3D array descriptor
*
* @param[out] pArrayDescriptor - Returned 3D array descriptor
* @param[in] array - 3D array to get descriptor of
*
* @return #hipSuccess, #hipErrorDeInitialized, #hipErrorNotInitialized, #hipErrorInvalidContext,
* #hipErrorInvalidValue #hipErrorInvalidHandle, #hipErrorContextIsDestroyed
*
* @see hipArray3DCreate, hipArrayCreate, hipArrayDestroy, hipArrayGetDescriptor, hipMemAlloc,
* hipMemAllocHost, hipMemAllocPitch, hipMemcpy2D, hipMemcpy2DAsync, hipMemcpy2DUnaligned,
* hipMemcpy3D, hipMemcpy3DAsync, hipMemcpyAtoA, hipMemcpyAtoD, hipMemcpyAtoH, hipMemcpyAtoHAsync,
* hipMemcpyDtoA, hipMemcpyDtoD, hipMemcpyDtoDAsync, hipMemcpyDtoH, hipMemcpyDtoHAsync,
* hipMemcpyHtoA, hipMemcpyHtoAAsync, hipMemcpyHtoD, hipMemcpyHtoDAsync, hipMemFree,
* hipMemFreeHost, hipMemGetAddressRange, hipMemGetInfo, hipMemHostAlloc,
* hipMemHostGetDevicePointer, hipMemsetD8, hipMemsetD16, hipMemsetD32, hipArrayGetInfo
*/
hipError_t hipArray3DGetDescriptor(HIP_ARRAY3D_DESCRIPTOR* pArrayDescriptor, hipArray* array);
/**
* @brief Copies data between host and device.
*