diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h index b824572ac2..29d7be7140 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -1013,6 +1013,13 @@ typedef struct hipExternalMemoryBufferDesc_st { unsigned int flags; unsigned int reserved[16]; } hipExternalMemoryBufferDesc; +typedef struct hipExternalMemoryMipmappedArrayDesc_st { + unsigned long long offset; + hipChannelFormatDesc formatDesc; + hipExtent extent; + unsigned int flags; + unsigned int numLevels; +} hipExternalMemoryMipmappedArrayDesc; typedef void* hipExternalMemory_t; typedef enum hipExternalSemaphoreHandleType_enum { hipExternalSemaphoreHandleTypeOpaqueFd = 1, @@ -2791,6 +2798,25 @@ hipError_t hipExternalMemoryGetMappedBuffer(void **devPtr, hipExternalMemory_t e * @see */ hipError_t hipDestroyExternalMemory(hipExternalMemory_t extMem); +/** + * @brief Maps a mipmapped array onto an external memory object. + * + * @param[out] mipmap mipmapped array to return + * @param[in] extMem external memory object handle + * @param[in] mipmapDesc external mipmapped array descriptor + * + * Returned mipmapped array must be freed using hipFreeMipmappedArray. + * + * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidResourceHandle + * + * @see hipImportExternalMemory, hipDestroyExternalMemory, hipExternalMemoryGetMappedBuffer, hipFreeMipmappedArray + */ +hipError_t hipExternalMemoryGetMappedMipmappedArray(hipMipmappedArray_t* mipmap, hipExternalMemory_t extMem, + const hipExternalMemoryMipmappedArrayDesc* mipmapDesc); + // end of external resource + /** + * @} + */ /** * @brief Allocate memory on the default accelerator * @@ -2804,10 +2830,6 @@ hipError_t hipDestroyExternalMemory(hipExternalMemory_t extMem); * @see hipMallocPitch, hipFree, hipMallocArray, hipFreeArray, hipMalloc3D, hipMalloc3DArray, * hipHostFree, hipHostMalloc */ - // end of external resource - /** - * @} - */ hipError_t hipMalloc(void** ptr, size_t size); /** * @brief Allocate memory on the default accelerator