Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWDEV-299127 - Support External Mipmap #3306

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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