This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

External Resource Interoperability

External Resource Interoperability#

HIP Runtime API Reference: External Resource Interoperability
External Resource Interoperability
Collaboration diagram for External Resource Interoperability:

Functions

hipError_t hipImportExternalSemaphore (hipExternalSemaphore_t *extSem_out, const hipExternalSemaphoreHandleDesc *semHandleDesc)
 Imports an external semaphore. More...
 
hipError_t hipSignalExternalSemaphoresAsync (const hipExternalSemaphore_t *extSemArray, const hipExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, hipStream_t stream)
 Signals a set of external semaphore objects. More...
 
hipError_t hipWaitExternalSemaphoresAsync (const hipExternalSemaphore_t *extSemArray, const hipExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, hipStream_t stream)
 Waits on a set of external semaphore objects. More...
 
hipError_t hipDestroyExternalSemaphore (hipExternalSemaphore_t extSem)
 Destroys an external semaphore object and releases any references to the underlying resource. Any outstanding signals or waits must have completed before the semaphore is destroyed. More...
 
hipError_t hipImportExternalMemory (hipExternalMemory_t *extMem_out, const hipExternalMemoryHandleDesc *memHandleDesc)
 Imports an external memory object. More...
 
hipError_t hipExternalMemoryGetMappedBuffer (void **devPtr, hipExternalMemory_t extMem, const hipExternalMemoryBufferDesc *bufferDesc)
 Maps a buffer onto an imported memory object. More...
 
hipError_t hipDestroyExternalMemory (hipExternalMemory_t extMem)
 Destroys an external memory object. More...
 
hipError_t hipExternalMemoryGetMappedMipmappedArray (hipMipmappedArray_t *mipmap, hipExternalMemory_t extMem, const hipExternalMemoryMipmappedArrayDesc *mipmapDesc)
 Maps a mipmapped array onto an external memory object. More...
 

Detailed Description



This section describes the external resource interoperability functions of HIP runtime API.

Function Documentation

◆ hipDestroyExternalMemory()

hipError_t hipDestroyExternalMemory ( hipExternalMemory_t  extMem)

Destroys an external memory object.

Parameters
[in]extMemExternal memory object to be destroyed
Returns
hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue
See also

◆ hipDestroyExternalSemaphore()

hipError_t hipDestroyExternalSemaphore ( hipExternalSemaphore_t  extSem)

Destroys an external semaphore object and releases any references to the underlying resource. Any outstanding signals or waits must have completed before the semaphore is destroyed.

Parameters
[in]extSemhandle to an external memory object
Returns
hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue
See also

◆ hipExternalMemoryGetMappedBuffer()

hipError_t hipExternalMemoryGetMappedBuffer ( void **  devPtr,
hipExternalMemory_t  extMem,
const hipExternalMemoryBufferDesc bufferDesc 
)

Maps a buffer onto an imported memory object.

Parameters
[out]devPtrReturned device pointer to buffer
[in]extMemHandle to external memory object
[in]bufferDescBuffer descriptor
Returns
hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue
See also

◆ hipExternalMemoryGetMappedMipmappedArray()

hipError_t hipExternalMemoryGetMappedMipmappedArray ( hipMipmappedArray_t *  mipmap,
hipExternalMemory_t  extMem,
const hipExternalMemoryMipmappedArrayDesc mipmapDesc 
)

Maps a mipmapped array onto an external memory object.

Parameters
[out]mipmapmipmapped array to return
[in]extMemexternal memory object handle
[in]mipmapDescexternal mipmapped array descriptor

Returned mipmapped array must be freed using hipFreeMipmappedArray.

Returns
hipSuccess, hipErrorInvalidValue, hipErrorInvalidResourceHandle
See also
hipImportExternalMemory, hipDestroyExternalMemory, hipExternalMemoryGetMappedBuffer, hipFreeMipmappedArray

◆ hipImportExternalMemory()

hipError_t hipImportExternalMemory ( hipExternalMemory_t extMem_out,
const hipExternalMemoryHandleDesc memHandleDesc 
)

Imports an external memory object.

Parameters
[out]extMem_outReturned handle to an external memory object
[in]memHandleDescMemory import handle descriptor
Returns
hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue
See also

◆ hipImportExternalSemaphore()

hipError_t hipImportExternalSemaphore ( hipExternalSemaphore_t extSem_out,
const hipExternalSemaphoreHandleDesc semHandleDesc 
)

Imports an external semaphore.

Parameters
[out]extSem_outExternal semaphores to be waited on
[in]semHandleDescSemaphore import handle descriptor
Returns
hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue
See also

◆ hipSignalExternalSemaphoresAsync()

hipError_t hipSignalExternalSemaphoresAsync ( const hipExternalSemaphore_t extSemArray,
const hipExternalSemaphoreSignalParams paramsArray,
unsigned int  numExtSems,
hipStream_t  stream 
)

Signals a set of external semaphore objects.

Parameters
[in]extSemArrayExternal semaphores to be waited on
[in]paramsArrayArray of semaphore parameters
[in]numExtSemsNumber of semaphores to wait on
[in]streamStream to enqueue the wait operations in
Returns
hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue
See also

◆ hipWaitExternalSemaphoresAsync()

hipError_t hipWaitExternalSemaphoresAsync ( const hipExternalSemaphore_t extSemArray,
const hipExternalSemaphoreWaitParams paramsArray,
unsigned int  numExtSems,
hipStream_t  stream 
)

Waits on a set of external semaphore objects.

Parameters
[in]extSemArrayExternal semaphores to be waited on
[in]paramsArrayArray of semaphore parameters
[in]numExtSemsNumber of semaphores to wait on
[in]streamStream to enqueue the wait operations in
Returns
hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue
See also