Skip to content

Commit

Permalink
SWDEV-299127 - Support External Mipmap
Browse files Browse the repository at this point in the history
Support hipExternalMemoryGetMappedMipmappedArray

Change-Id: I7e3524cdde53e4df9f728794bcebf4bd3f58d4d8
  • Loading branch information
tomsang authored and gargrahul committed Aug 31, 2023
1 parent 9cb358b commit 0e1645e
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions include/hip/hip_runtime_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,13 @@ typedef struct hipExternalMemoryBufferDesc_st {
unsigned long long size;
unsigned int flags;
} 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,
Expand Down Expand Up @@ -2754,6 +2761,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
*
Expand All @@ -2767,10 +2793,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
Expand Down

0 comments on commit 0e1645e

Please sign in to comment.